Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

**視訊壓縮期末專案**

組員: 周哲瑋 (Wayne),陳冠霖,許詠約

高效能 JPEG 解碼器實現,核心使用 C++ 開發並透過 pybind11 提供 Python API。專案包含 C++ 和 NumPy 兩種實現,用於比較不同實現方式的性能差異。


## 專案特點

- **⚡ 高效能**: C++ 核心實現,比 NumPy 版本快 **約 4.4 倍**
Expand All @@ -32,7 +35,7 @@
- NumPy Decoder: **35.15 dB** ✅ (良好)
- 兩者均達到視覺無失真標準(> 30 dB)

詳細的 benchmark 結果請參考 [BENCHMARK_RESULTS.md](BENCHMARK_RESULTS.md)
詳細的 benchmark 結果請參考 [BENCHMARK_RESULTS.md](doc/BENCHMARK_RESULTS.md)

## 快速開始

Expand All @@ -49,7 +52,7 @@

```bash
# 1. Clone 專案
git clone https://github.com/yourusername/Fast-Jpeg-Decoder.git
git clone https://github.com/5000user5000/Fast-Jpeg-Decoder.git
cd Fast-Jpeg-Decoder

# 2. 安裝 Python 依賴
Expand Down Expand Up @@ -163,10 +166,9 @@ Fast-Jpeg-Decoder/
├── benchmarks/
│ └── run_benchmark.py # 性能測試與品質驗證
├── doc/
│ └── report.md # 詳細技術報告
│ └── BENCHMARK_RESULTS.md # Benchmark 結果文檔
├── output/ # 解碼輸出結果(benchmark 生成)
├── example.py # 使用範例
├── BENCHMARK_RESULTS.md # Benchmark 結果文檔
├── Makefile # 建構腳本
├── setup.py # Python 安裝腳本
└── README.md # 本文件
Expand Down Expand Up @@ -252,8 +254,6 @@ JPEG 檔案
解碼完成的圖片
```

詳細的技術實現請參考 [doc/report.md](doc/report.md)

## 技術亮點

### C++ 實現
Expand Down Expand Up @@ -302,8 +302,6 @@ JPEG 檔案
- 多執行緒(OpenMP): 預期提升接近 CPU 核心數
- 查表法(LUT): 預期提升 1.5-2×

詳細分析請參考 [BENCHMARK_RESULTS.md](BENCHMARK_RESULTS.md)

## 使用建議

### ✅ 推薦使用場景
Expand All @@ -317,13 +315,12 @@ JPEG 檔案

- **生產環境**: 請使用成熟的庫(libjpeg-turbo, PIL/Pillow)
- **完整 JPEG 支援**: 本專案僅支援 Baseline DCT
- **關鍵應用**: NumPy 實現存在已知的正確性問題
- **關鍵應用**: NumPy 實現性能較低(比 C++ 慢 4.4 倍)

## 文檔

- **[README.md](README.md)**: 專案概述和快速開始(本文件)
- **[BENCHMARK_RESULTS.md](BENCHMARK_RESULTS.md)**: 詳細的性能測試結果和正確性驗證
- **[doc/report.md](doc/report.md)**: 完整的技術報告(包含原理、實現、分析)
- **[BENCHMARK_RESULTS.md](doc/BENCHMARK_RESULTS.md)**: 詳細的性能測試結果和正確性驗證

### 開發指南

Expand All @@ -341,7 +338,6 @@ JPEG 檔案

### 技術文章

- [JPEG Decoding Tutorial](https://www.impulseadventure.com/photo/jpeg-decoder.html)
- [Fast DCT Algorithms](https://www.nayuki.io/page/fast-discrete-cosine-transform-algorithms)
- [Understanding JPEG](https://parametric.press/issue-01/unraveling-the-jpeg/)

Expand Down
43 changes: 0 additions & 43 deletions BENCHMARK_RESULTS.md → doc/BENCHMARK_RESULTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,49 +211,6 @@ YCbCr → RGB 轉換 12.3% 數學運算
- 當前 C++ 實現:67.50ms (lena.jpg)
- **還有約 13× 的優化空間**

## 結論與建議

### 使用建議

#### ✅ 推薦使用 C++ 實現
- **場景**: 性能敏感應用、大規模圖片處理
- **優勢**: 4.4× 性能提升 + 高品質還原(35+ dB)
- **適用**: 視訊處理、嵌入式系統、即時應用

#### ✅ NumPy 實現適用場景
- **場景**: 學習、原型開發、理解 JPEG 原理
- **優勢**: 代碼清晰、易於修改、與 C++ 品質相當
- **限制**: 性能較低,不適合生產環境

#### 🚫 生產環境請使用成熟的庫
- **推薦**:
- `libjpeg-turbo` (C/C++) - 工業標準
- `PIL/Pillow` (Python) - 功能完整
- `opencv-python` (Python) - 整合豐富
- **原因**:
- 完整的 JPEG 格式支援(Progressive, Lossless 等)
- 經過大量測試和優化
- 持續維護和更新

### 專案價值

本專案的主要價值在於:

1. **教學示範**
- 完整實現 JPEG Baseline DCT 解碼流程
- 修復了多個常見的實現錯誤
- 提供詳細的技術文檔

2. **性能比較研究**
- 實證 C++ vs Python 的性能差異(4.4×)
- 分析瓶頸來源和優化方向
- 展示 pybind11 的整合實踐

3. **品質驗證**
- 使用 PSNR 量化評估解碼品質
- 證明兩種實現的正確性(35+ dB)
- 提供可靠的參考實現

## 已知限制

### 支援的 JPEG 格式
Expand Down
169 changes: 0 additions & 169 deletions doc/report.md

This file was deleted.