GPU-Based Sample-Parallel Context Modeling for EBCOT in JPEG2000 Jiří Matela Vít Rusňák

Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
GPU-Based Sample-Parallel Context Modeling for
EBCOT in JPEG2000
Jiří Matela
[email protected]
Vít Rusňák
[email protected]
Petr Holub
[email protected]
Faculty of Informatics MU Brno
Institute of Computer Science MU Brno
CESNET Prague
MEMICS’10
1/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
The Advanced Network Technologies Laboratory at FI
• High-res low-latency video transmission
2/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Example of Applications of High-Res Video and
Visualization Transmission
Remote lecturing
3/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Example of Applications of High-Res Video and
Visualization Transmission
Remote collaborative environments
4/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Example of Applications of High-Res Video and
Visualization Transmission
Film postproduction
5/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
High Resolution Visual Communication is Bandwidth
Demanding
• Uncompressed HD video ∼ 1.5 Gbps
• Uncompressed 4K video ∼ 6.4 Gbps
• Several streams might be transmitted
• Network connections may not have enough of bandwidth
• Need for compression
6/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
High Resolution Visual Communication is Bandwidth
Demanding
• Uncompressed HD video ∼ 1.5 Gbps
• Uncompressed 4K video ∼ 6.4 Gbps
• Several streams might be transmitted
• Network connections may not have enough of bandwidth
• Need for compression
7/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
High Resolution Visual Communication is Bandwidth
Demanding
• Uncompressed HD video ∼ 1.5 Gbps
• Uncompressed 4K video ∼ 6.4 Gbps
• Several streams might be transmitted
• Network connections may not have enough of bandwidth
• Need for compression
8/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
High Resolution Visual Communication is Bandwidth
Demanding
• Uncompressed HD video ∼ 1.5 Gbps
• Uncompressed 4K video ∼ 6.4 Gbps
• Several streams might be transmitted
• Network connections may not have enough of bandwidth
• Need for compression
9/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
High Resolution Visual Communication is Bandwidth
Demanding
• Uncompressed HD video ∼ 1.5 Gbps
• Uncompressed 4K video ∼ 6.4 Gbps
• Several streams might be transmitted
• Network connections may not have enough of bandwidth
• Need for compression
10/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
JPEG2000 characteristics
• Successor to the popular JPEG
• Superior compression performance
• Lossy and lossless compression
• Error resilience
11/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Multiple resolution representation
12/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Progressive transmission by pixel and resolution accuracy
13/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
JPEG2000 compression process
Data compression
DWT
Context
Modeling
Arithmetic
Encoding
14/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Discrete Wavelet Transform (DWT)
• Digital signal processing technique
• Application in diverse areas
• digital speech recognition
• multi-resolution video processing
• data compression
15/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
DWT – Speedup
Our GPU implementation shows 68× speedup
16/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Context Modeling (CM) in JPEG2000
• Analyzes and describes image to the Arithmetic Encoder
• Described in form of CX,D pairs
17/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: Bit-Plane by Bit-Plane
Source: wikipedia.org
18/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: Bit-Plane Scanned According to Scan Pattern
19/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: Bit-Plane Scanned According to Scan Pattern
20/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: Bit-Plane Scanned According to Scan Pattern
21/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: Bit-Plane Scanned According to Scan Pattern
22/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: Bit-Plane Scanned in 3 Passes
23/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: Bit-Plane Scanned in 3 Passes
24/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: Bit-Plane Scanned in 3 Passes
25/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: Coding Operations In a Pass
• Zero Coding (ZC)
• Run-Length Coding (RLC)
• Magnitude Refinement Coding (MRC)
• Sign Coding (SC)
Coding operations produces CX,D pairs
26/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: Coding Operations In a Pass
• Zero Coding (ZC)
• Run-Length Coding (RLC)
• Magnitude Refinement Coding (MRC)
• Sign Coding (SC)
Coding operations produces CX,D pairs
27/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: Coding Operations In a Pass
• Zero Coding (ZC)
• Run-Length Coding (RLC)
• Magnitude Refinement Coding (MRC)
• Sign Coding (SC)
Coding operations produces CX,D pairs
28/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: Coding Operations In a Pass
• Zero Coding (ZC)
• Run-Length Coding (RLC)
• Magnitude Refinement Coding (MRC)
• Sign Coding (SC)
Coding operations produces CX,D pairs
29/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: Coding Pass Decision
Based on value, state, and states of neighbours
30/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: State variables
Used:
• for Coding Pass decision
31/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: State variables
Used:
• for Coding Pass decision
• for Coding Operation decision
32/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: State variables
Used:
• for Coding Pass decision
• for Coding Operation decision
• by Coding Operations (to compute CX,D)
33/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: State variables
Computed Step-by-Step (as bits are coded)
34/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: State variables
Limits parallel processing
35/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
CM: State variables
Limits parallel processing
Limits utilization of GPU
36/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Parallel Context Modeling Design
• Replace the original states with 2 new states
• Precomputed in parallel (before bit-plane is coded)
• Bypass the defined coding passes
• In-place coding operation decision
• Bits coded in parallel
37/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Parallel Context Modeling Design
• Replace the original states with 2 new states
• Precomputed in parallel (before bit-plane is coded)
• Bypass the defined coding passes
• In-place coding operation decision
• Bits coded in parallel
38/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Parallel Context Modeling Design
• Replace the original states with 2 new states
• Precomputed in parallel (before bit-plane is coded)
• Bypass the defined coding passes
• In-place coding operation decision
• Bits coded in parallel
39/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Parallel Context Modeling Design
• Replace the original states with 2 new states
• Precomputed in parallel (before bit-plane is coded)
• Bypass the defined coding passes
• In-place coding operation decision
• Bits coded in parallel
40/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Parallel Context Modeling Design
• Replace the original states with 2 new states
• Precomputed in parallel (before bit-plane is coded)
• Bypass the defined coding passes
• In-place coding operation decision
• Bits coded in parallel
41/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Original State Variables
• σ first non-zero bit of a pixel has been coded (pixel become
significant)
• σ 0 MRC has been applied
• η a bit has been coded in SPP
42/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
New State Variables
• ρ pixel is already significant (become significant on previous
bit-planes)
• τ pixel going to be significant on current bitplane
• Replaces the σ state
43/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Direct selection of coding operations
Combination of τ and ρ replaces the original states
44/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Use of new variables for coding
• MRC uses ρp+1 and τ p of all the neighbors instead of σ; the
σ 0 is substituted by looking for the position of the first
non-zero bit on previous p + 1 bit-planes. τ p of four preceding
neighbors for bits belonging to SPP. ρp+1 and τ p all neighbors
and bit value of the four preceding neighbors are used for bits
belonging to CUP.
• instead of σ, SC uses ρp+1 of two vertical and two horizontal
neighbors and τ p of the upper and the left side neighbor for
bits belonging to SPP. ρp+1 and τ p of two vertical and two
horizontal neighbors and bit value of of the upper and the left
side neighbor for bits belonging to CUP.
• RLC uses no state information at all, both prior and after the
transformation.
45/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Coding Speed Compared
• OpenJPEG (cpu)
• JasPer (cpu)
• Kakadu (cpu)
• CUJ2K (gpu)
46/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Speedup
Speedup of the data compression part (Tier-1)
Speedup
OpenJPEG
5,3×
JasPer
2,7×
Kakadu
2,3×
CUJ2K
1,9×
47/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Speedup
Speedup of the Context Modeling
Speedup
OpenJPEG
26×
JasPer
12×
Kakadu
N/A
CUJ2K
N/A
48/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Conclusion
• Original algorithm reformulated
• Approach to Context Modeling in JPEG2000
• Enables effective parallel implementation on GPU platforms
• Preliminary results show 12× speedup
• Acceleration of arithmetic encoding for JPEG2000
49/50
Motivation
JPEG2000
Context Modeling
Parallel Context Modeling
Results
Thank you for your attention!
Q?/A!
[email protected]
50/50