ä¸è¼ - å æºå¤§å¸è³è¨å·¥ç¨å¸ç³»
ä¸è¼ - å æºå¤§å¸è³è¨å·¥ç¨å¸ç³»
ä¸è¼ - å æºå¤§å¸è³è¨å·¥ç¨å¸ç³»
- No tags were found...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
2009 元 智 大 學 資 工 系 演 講無 失 真 視 訊 壓 縮 簡 介Lossless Video Compression-- An IntroductionRay-I Chang張 瑞 益台 大 工 科 系 資 訊 組
從 計 畫 講 起 …• 網 路 & 內 嵌 式 系 統• 無 線 感 測 器 網 路 • 多 媒 體 網 路• 資 料 探 勘 & 資 料 庫• 網 路 攻 擊 偵 測• 電 力 網 路 節 能 策 略 • 影 像 & 視 訊• 視 訊 監 控 影 像 辨 識• 無 失 真 視 訊 壓 縮
中 視 E-SNG 計 畫 的 應 用 需 求videolossycachescheduler衛 星微 波回 電 視 台 , 直 接 store電 視公 司Storage(video database)live在 不 變 動 電 視 台 原 作 業 流 程 下 ,提 供 無 失 真 的 videovideolossy伺 機 而 用Real-timescheduler衛 星微 波???電 視公 司Storage(video database)live(near)losslessresiduecache傳 送 遺 漏回 電 視 台 , 加 上 patchingOn-demand
應 用 需 求 : 無 失 真 視 訊 壓 縮Outline• Compression• Lossless / Lossy• Image Compression• Lossy / Lossless• Video Compression• Lossy / Lossless• More?
基 本 壓 縮 原 理‧ 資 料 的 重 複 性‧ 統 計 不 均 勻 度‧ 資 料 可 預 測 性‧ 人 類 感 知 範 圍
資 料 的 重 複 性• 重 複 字 元 壓 縮 法 (suppression of repeated character)• Run Length Coding• 將 "ABBCCCDDDDEEEEE“ 壓 縮 成• "A1B2C3D4E5” or "ABBCCC$4D$5E“• codebook 法• 將 資 料 以 字 典 的 排 列 方 式 依 序 編 排 成 codebook 使 用• 前 置 壓 縮 法 (front-compression)• codebook 可 進 一 步 壓 縮 成 以 下 使 用compost compound compresscompost 5-und 4-ress
統 計 不 均 勻 度• 符 號 壓 擠 法 (compact notation)• 如 日 期 "Wednesday, August 31”可 壓 縮 成 "3 08 31“ (3 integers? 5 characters?)• 用 binary 表 示 ? 011 1000 11111• 字 典 替 代 法 (dictionary substitution)• 每 一 個 單 字 均 編 以 一 個 新 的 位 元 串 , 再 利 用 新 的字 元 串 取 代 該 單 字• Huffman CodingFrequently occurring symbols with shorter codes
資 料 可 預 測 性• Predictive coding• Define a predictor to generate prediction value• Prediction error’s dynamic range is smaller than truevalue’s• Ex. “differential pulse-coded modulation” (DPCM)• Prediction error= true value - prediction value• Only predictor and prediction error are coded• It is difficult to random accessing• It is sensitive to data loss3 2 41 x
人 類 感 知 範 圍• 以 " 聽 " 覺 為 例• 藉 由 耳 蝸 內 數 以 千 計 的 毛 細 胞 將 聲 波 振 動 變為 電 能 , 刺 激 聽 覺 神 經 並 將 聲 音 傳 至 大 腦 。• “ 視 "&” 聽 “ 之 敏 感 度 需 以 FrequencyDomain 來 看 !• 聽 覺 對 高 頻 部 份 較 不 敏 感•Frequency: ~ 20 KHz•Amplitude: ~ 120 db• 此 範 圍 每 個 人 稍 有 不 同• 視 覺 對 高 頻 部 份 較 不 敏 感•…
AD 過 程 的 失 真量 化QuantizationAmplitude1.510.50-0.5-1-1.5聽 覺 Sampling rate:CD: 44.10 KHzFM Radio: 22.05 KHzTelephone: 8.00 KHz數 位 化 品 質 決 定 於 『 取 樣 率 』 與 『 量 化 度 』。類 比 資 料 轉 數 位 化 的 AD 過 程 , 就 存 在 失 真 的 問 題 。我 們 在 此 所 討 論 的 並 不 包 含 AD 過 程 的 失 真 。TimeSampling取 樣Pulse codemodulation( PCM)Time量 度 N-bit Quantization= 2 N levels視 覺 Sampling rate:視 覺 暫 留 Frame rate: 24~30 fpsCIF 畫 面 解 析 度 (352×288)(VHS 規 格 )24 位 元 色 彩 ? 量 化
『 量 化 』 的 例 子『 量 化 度 』 在 實 用 上 可 接 受 範 圍小 數 點 以 下 原 3 位 改 取 2 位 (π: 3.141 -> 3.14)『 量 化 度 』 在 人 眼 可 接 受 範 圍只 取 偶 數 01010101 -> 01010100
Color Models因 特 質 不 同 而 採 不 同 模 式• RGB [ 螢 幕 ]• Red, Green, Blue• CMYK [ 印 刷 ]• Cyan 藍 綠 , Magenta 紫 紅 , Yellow, K 黑• YUV [ 人 眼 ]• Y: luminance 亮 度 , U, V: chrominance 色 度• Y = 0.299R + 0.587G + 0.114B, U = B – Y, V = R - Y在 Y 加 浮 水 印在 V 隱 藏 資 訊
Steps of Color JPEG ImageEncoding造 成失 真RGB to YUV失 真UV失 真失 真DPCM 差 值 壓 縮 有 利 漸 層RLE 同 值 壓 縮 有 利 色 塊
lossy → lossless ?
Lossless JPEG2000 標 準(LS-JPEG2000)• 直 接 去 改 進 JPEG 會 造 成 損 失 的 部 份• Color Transform, DCT, Quantization• JPEG 2000 lossless 標 準 , 就 是• Reversible Color Transform (RCT)• a modified YUV color space• Reversible Integer Wavelet Transform• the biorthogonal 5/3 wavelet transform• no quantization is performed國 史 館 採 用 無 失 真 壓 縮 實 作 經 驗 談 (2003) 用 Lossless JPEG 2000 標 準
Lossless JPEG 標 準(LS-JPEG, 1992)• 注 意 : 跟 JPEG 很 不 一 樣 , 沒 有 DCT!因 為 發 現 DCT 處 理 後 的 餘 值 影 像 不 利 entropy coding。SourceImage DataLoseless JPEG EncoderPredictorEntropyEncoderCompressedImage DataC BA XContext structureType Prediction X=?0 no prediction1 A2 B3 C4 A+B-C5 A+(B-C)/26 B+(A-C)/27 (A+B)/2
M. Weinberger, G. Seroussi, G. Sapiro, "The LOCO-I Lossless Image Compression Algorithm: Principles andStandardization into JPEG-LS", IEEE Trans. Image Processing, Vol. 9, August 2000, pp.1309-1324.JPEG-LS (2000)• JPEG-LS, LS-JPEG, LS-JPEG2000 都 是 ISO 標 準 。• JPEG-LS is generally much faster than LS-JPEG2000and much better than the original LS-JPEG standard.• LS-JPEG2000 fares better than JPEG-LS on digitalcamera pictures, but not on artificial images.
(Lossy) VideoCompression• Video is a sequence of picture frames• Motion JPEG• Pro: no error propagation, random access, complexity• Con: low compression ratio• Motion estimation and compensation• 資 料 的 重 複 性
Motion Estimation• Predict current frame from neighboringframes• Motion Estimation Algorithm• Block based• Object based• Factors• Matching criteria• Searching range(x,y)CurrentMacroblockMotionVector(x,y)(4)(1)(2)Search positionDefined SearchWindowPredictedPictureReferencePicture(3)Best matchedmacroblock withinthe search window
Motion compensationI 畫 面 (IntraCoded Pictures)P 畫 面 (PredictiveCoded Pictures)B 畫 面 (BidirectionallyPredicted Pictures)
MPEG• Spatial redundancy (Intra-frame): DCT• Temporal redundancy (Inter-frame)• block based motion compensationForward Prediction1I2B3B4B5P6B7B8B9P10B11B12B13IBidirectional Prediction
現 用 的lossless video codec• FFV1, x.264• intra-frame-only video compressor (JPEG-LS)• the difference between a current pixel and itsestimated values, judging by neighboringprocessed pixels, is sent to the entropy-codingprocess.
速 度 每 秒 可 以 處 理 多 少 畫 面
現 用 的lossless video codec(2005)
商 業 獨 特 封 閉 格 式 ,結 果 似 乎 沒 好 多 少 …• MSU, YULS ( 關 係 密 切 …)• YULS comes from YULsoft, a softwarecompany• inter-frame video codec• Its performance is comparable to resultsthat use either fixed spatial-temporalpredictor or motion compensation.• Due to its proprietary nature, the details oftheir video codec is not known.
Lossless Image/VideoCompression1940 19922000YearLosslesscompressionLS-JPEGJPEGJPEG-LS現 有 的Lossless video標 準研 究 中 的Losslessimage/videocompressionLS-JPEG2000
Hierarchical interpolating prediction• NEC 發 表 比 JPEG-LS 快 10 倍 的 技 術 (2007)“A fast progressive lossless image compression method forspace and satellite images,” Geoscience and RemoteSensing Symposium, 2007.餘 值 影 像 !原 影 像subsamplinginterpolationsubs
MRP (2007)Minimum-Rate PredictorsCoding rates (bits/byte)• 從 前 :the linear prediction coefficients aredetermined so as to minimize the mean squaredprediction errors.• 缺 失 :the goal of lossless image coding is to reducethe coding rate, minimizing the mean squaredprediction errors does not yield the best results.• 解 法 :to formulate the amount of information on theprediction errors and design the predictors so as tominimize that value.Ichiro Matsuda, Hirofumi Mori, Joji Maeda, Susumu Itoh: "Design and Evaluation of Minimum-Rate Predictors forLossless Image Coding", Systems and Computers in Japan, Vol.38, No.5, pp.90-98, (May 2007).
"Performance Improvement of the Lossless Video CodingScheme by Adapting the Number of 3D Predictors Frameby Frame", Proceedings of 2008 International Workshopon Advanced Image Technology (IWAIT 2008), 6 pages,(Jan. 2008).由Image到Video,2.3b/B!
dynamic coding由 條 件 判 斷 擇 一error• IWT: integer wavelet transformation• MED: median edge detector
Lossless Video CompressionI-frame 用JPEG-LSP/B-frame 用pixel-basedpredictionError 再 用pixel-basedpredictionDigitalsourcedataI-frame 用IWTP/B-frame 用MotioncompensationLosslessEncodingI-frame 用MRPP/B-frame 用3DMRP特 殊 格 式 的LosslessVideo file
不 能 同 時 兼 顧 原 live 需 求 ,跟 中 視 原 有 系 統 不 能 配 合 ,不 算 是 可 行 的 辦 法 !videolossyReal-timescheduler衛 星微 波???電 視公 司live(near)losslessresidue伺 機 而 用cache傳 送 遺 漏Storage(video database)On-demand回 電 視 台 , 加 上 patching
H.264 encoder diagram
audioH.264 encoder.YUV( 無 失 真 )Picture buffer.264( 失 真 ).YUV( 無 失 真 ).YUV( 失 真 )?H.264 decoder算 出 residue,並 對 其 進 行 無 失 真 壓 縮.LSR( 無 失 真 )audio
學 術 研 究• 針 對 『 高 頻 residue』 的 無 失 真 壓 縮 ?• 更 高 的 壓 縮 比• 更 快 的 執 行 速 度• 前 人 的 研 究 , 給 了 我 們 很 多 靈 感 …• ?
結 論-- 商 機 與 挑 戰 --• video standard only specify• Bit stream syntax and Decoding scheme• 如 何 得 到 好 的 壓 縮 結 果 則 各 憑 本 事• 好 的 encoder 有 很 大 的 商 機 ( 聯 發 科 ?)• 雖 然 有 標 準 的 decoder 規 則 , 還 是 可 以 設 計 有特 殊 功 能 的 撥 放 軟 硬 體• 高 容 錯 ? 自 我 修 正 ?• 更 有 創 意 的 多 媒 體 應 用 系 統• ipod? iphone?
謝 謝 聆 聽( 宣 傳 : 博 士 班 錄 取 名 額 15 名 , 錄 取 率 ?)
研 究 中 的 Losslessimage/video compression?• 目 前 lossless video 壓 縮 率 約 2.3b/B,lossless image 壓 縮 率 約 3.9b/B,lossless text 壓 縮 率 約 1.4b/BH.264 = MPEG-4AVCMPEG-2 壓 縮 率 約 是 25:1H.264 壓 縮 率 約 是 100:1,
目 前 lossless video 壓 縮 率 約 2.3b/B,lossless image 壓 縮 率 約 3.9b/B,lossless text 壓 縮 率 約 1.4b/BThe Hutter Prize for Compression ofHuman Knowledge• 2006-2009 Winner : PAQ8• 100,000,000bytes 的 維 基 百 科 文 檔 壓 縮 到16,481,655bytes (1.4b/B)• 離 極 限 (1Bytes->0.6~1.3bits) 只 差 了 1%• 數 據 壓 縮 技 術 的 極 限 是 由 信 息 論 創 始 人 Shannon預 測 的 ,Cover 和 King 在 1978 年 證 明 。• 開 源 GPL 程 序