1.66k likes | 1.88k Views
H.264 decoder. 張正儒. Agenda. H.264 decoder overview Design statistic Performance analysis Future work. Comparison of Standards. Performance comparison. H.264 Profiles. Main profile. B slices. Weighted prediction. Interlace. Extended profile. CABAC. SP and SI slices. I slices.
E N D
H.264 decoder 張正儒
Agenda • H.264 decoder overview • Design statistic • Performance analysis • Future work
H.264 Profiles Main profile B slices Weighted prediction Interlace Extended profile CABAC SP and SI slices I slices P slices Data partitioning CAVLC Slice Group and ASO Redundant Slices Baseline profile
H.264 decoder block diagram H.264 stream decframe mem MV mem Para mem VLC Ref idx mem bitstream mem reconstruct mem MC DF CABAC MBinfo mem Pred mem Pic Rec unfilter mem Intra pred raw stream Coeff mem IDCT/IQ Residual mem picnum mem Software Hardware Memory
133MHz 11195 cycles/MB 100MHz 8417 cycles/MB 70MHz 5893 cycles/MB 54MHz 4545 cycles/MB 45MHz 3788 cycles/MB 40MHz 3366 cycles/MB 27MHz 2272 cycles/MB 25 MHz 2105 cycles/MB Performance requirement • CIF 30fps • 352/16 * 288/16 * 30 =11880 MB/sec
Test sequence • mobile.cif • 10 Frame, IPPPPPPPPP • One ref frame • 396 intra 16x16 MB • 1147 inter 16x16 MB • 298 inter 16x8 MB • 280 inter 8x16 MB • 1839 inter 8x8 MB • iPROVE FPGA prototyping
Future work • AMBA wrapper • Software driver • ARM-integrator platform demonstration
F’n-1 Entropy encode F’n Fn NTHU H.264 Encoder + DCT Q - ME NAL MC P Intra prediction + Filter IDCT IQ +
Profile of H.264 Encoder Others 60% 40% Motion Estimation
The Purpose of Motion Estimation • Exploit the temporal redundancy of a video sequence to reduce data needed to be encoded. frame t-1 frame t
Block-based Motion Estimation • Video frames are divided into macroblocks (MBs)
I/O of Motion Estimation RF SR ME MV for 16x16 block CF SAD for 16x16 block 16x16 CB
Difference in ME between MPEG4 & H.264 • Variable block sizes • Multiple reference frames
Variable Block Sizes ME in H.264 MPEG4 H.264
Variable Block Sizes ME in H.264 MPEG4 H.264
Multiple Reference Frames in H.264 t t-1 MPEG4 H.264 t-5 t-4 t-3 t-2 t t-1
I/O of Motion Estimation in H.264 41 MVs & SADs RF MV for 16x16 block SR Multiple-RF Variable -block size ME MV for 4 x 4 CF SAD for 16x16 block 16x16 SAD for 4 x 4 CB
Advantage & Disadvantage of ME • Need much more computations. • Provide better compression ratio.
H.264 decoder block diagram H.264 stream decframe mem MV mem Para mem VLC Ref idx mem bitstream mem reconstruct mem MC DF CABAC MBinfo mem Pred mem Pic Rec unfilter mem Intra pred raw stream Coeff mem IDCT/IQ Residual mem picnum mem Software Hardware Memory
Variable block size (1/2) 16 8 16 8 8 8 16 16 8 4 8 4 4 4 8 8
Variable block size (2/2) O O O O x x x
Multiple reference frames in H.264 t t-1 MPEG4 H.264 t-5 t-4 t-3 t-2 t t-1
I/O of motion estimation in H.264 41 MVs & SADs RF MV for 16x16 block SR Multiple-RF Variable -block size ME MV for 4 x 4 CF SAD for 16x16 block 16x16 SAD for 4 x 4 CB
Motion compensation overview bitstream RF CABAC Mb_skip_flag MB_type Sub_mb_type RefIdx mvd . . . CF MC VLC Slice_type . . . . . .
Motion vector • Encoder • mvd = mv – mvp • Decoder • mv = mvp + mvd • How to generate mvp ?
Neighboring block (1/2) B C D A
Neighboring block (2/2) B D C A
Motion vector prediction (1/3) • mvp[0] = Median(mvA[0],mvB[0],mvC[0]) • mvp[1] = Median(mvA[1],mvB[1],mvC[1]) C B D current block A
Motion vector prediction(2/3) • Block size = 16 x 8
Motion vector prediction(3/3) • Block size = 8 x 16
Example of compensation (1/3) motion vector (1, 1)
Example of compensation (2/3) Use these gray points to interpolation
Filter • Luma filter • 6-tap filter for half pixels • 2-tap filter for quarter pixels • Chroma filter • Use neighboring 4 pixels to interpolation