Professional Documents
Culture Documents
Table of Contents
Figure 1: H.264 intra prediction block diagram 8................................................................... 6
Figure 2: Block diagram of controller 9................................................................................... 6
Figure 3: Block diagram of I4M_top 10...................................................................................
10
II.4.1.1) Abstract..............................................................................................................
10
10
11
II.4.2. I4M_top.................................................................................................................................... 11
II.4.2.1) Abstract..............................................................................................................
11
11
11
II.4.3. I4M_controller.........................................................................................................................
12
II.4.3.1) Abstract..............................................................................................................
12
13
13
15
16
16
17
II.4.5.1) Abstract..............................................................................................................
17
18
18
II.4.6. I4M_pred_mem.....................................................................................................................
19
II.4.6.1) Abstract..............................................................................................................
19
19
19
II.4.7. I4M_res_mem.........................................................................................................................
19
II.4.7.1) Abstract..............................................................................................................
19
20
20
II.4.8. I4M_res_cal.............................................................................................................................
20
II.4.8.1) Abstract..............................................................................................................
20
21
21
II.4.9. I16M_top................................................................................................................................
22
II.4.9.1) Abstract..............................................................................................................
22
22
22
II.4.10. I16M_controller.....................................................................................................................
23
II.4.10.1) Abstract.............................................................................................................. 23
II.4.10.2) Block diagram.................................................................................................... 23
II.4.10.3) I/O description.................................................................................................... 23
II.4.11. I16M_PE................................................................................................................................ 24
II.4.11.1) Abstract.............................................................................................................. 24
II.4.11.2) Block diagram....................................................................................................
25
28
II.4.14.1) Abstract.............................................................................................................. 28
II.4.14.2) Block diagram.................................................................................................... 28
II.4.14.3) I/O description.................................................................................................... 28
II.4.15. I16M_res_cal.........................................................................................................................
28
II.4.15.1) Abstract.............................................................................................................. 28
II.4.15.2) Block diagram.................................................................................................... 29
II.4.15.3) I/O description.................................................................................................... 29
List of Figures
Figure 1: H.264 intra prediction block diagram.......................................................................... 9
Figure 2: Block diagram of controller...................................................................................
10
11
19
20
25
List of Tables
Table 1: I/O description of the Intra Prediction...................................................................... 10
Table 2: I/O description of controller....................................................................................... 11
Table 3: I/O description of I4M_top.......................................................................................... 12
Table 4: I/O description of I4M_controller.............................................................................
14
18
20
23
28
I. Introduction
Intra prediction l mt hm c chc nng to ra khi d on PU (Prediction Unit) da trn
kch thc v mu tn hiu ca cc khi bn cnh (neighboring spartially). Kch thc ca khi PU
c th thay i t 4x4 ti kch thc ti a c quy nh trong file .cfg (thng th tt c u m
phng vi kch thc u vo max l 64x64). Kch thc PU thay i ty thuc vo c im, tnh
cht ca nh. Khi mt khi PU c kch thc ln, nhng kt qu d on khng tt( SAD ln) th
n s c chia thnh 4 khi PU c kch thc nh hn. Qu trnh c in ra quy nh vy, cho
n khi khng th chia c na ( kch thc PU l 4x4) th dng li. Sau n s chn khi c
kch thc sao cho c SAD nh nht.Trong H264 c tng cng 9 mode tm kim khc nhau cho
mi PU c xy dng theo hnh vung (4x4 hoc 16x16).Cn H265 HEVC h tr 35 mode trong
gm DC,Planner v 33 mode khc.(tinh toan theo cong thuc cua nguoi viet ra)
II.
Intra prediction block
II.1.
Abstract
II.2.
Top-block Diagram
II.3.
I/O Description
Name
clk
rst
I_seq_start
next_frame
I4M_done
I4M_frame_done
I4M_ready
Dir
I
I
I
I
O
O
I
Description
Clock (sn ln)
Reset ( mc cao)
Bt u khung hnh
Bo chuyn tip khung hnh
Tm kim block 4x4 xong
D on khung hnh 4x4 xong
nh gc sn sng
I4M_rden
I4M_addr
c a ch ca Luma ti org_mem
I4M_org_data
I16M_rden
I16M_addr
c a ch ca chm ti org_mem
I16M_org_data
rem_intra4x4_predmode
prev_intra4x4_pred_flag
I4M_mode_vld
chroma_pred_mode
I4M_T_req
Yu cu tn hiu t TQ_if
I4M_res_rden
I4M_res_data
I16M_T_req
Yu cu tn hiu t TQ_if
I16M_res_rden
I16M_res_data
I4M_pred_rden
I16M_pred_rden
reconY_in_vld
Gi tr Reconstruct Y
reconC_in_vld
Gi tr Reconstruct C
recon_data_in
D liu t reconstruct
I4M_pred_data
Gi tr d on ti reconstruct
I16M_pred_data
Gi tr d on ti reconstruct
Table 1
II.4.
Sub-block Specifications
II.4.1.
Controller
II.4.1.1)
Abstract
II.4.1.2)
Block Diagram
10
II.4.1.3)
I/O Description
Name
Dir
Description
clk
rst
I_seq_start
Bt u frame
Intra4x4_done
d on 4x4 xong
chroma_done
d on Chroma xong
mbAddr_x
mbAddr_y
mbA_avail
mbB_avail
mbC_avail
frame_done
d on 1 frame xong
Intra4x4_enable
Chroma_enable
II.4.2.
I4M_top
II.4.2.1)
Abstract
D on cho block P c thc hin theo 5 cch khc nhau : horizontal, vertical, DC, diagonal down left,
diagonal down right .Mode no c SAD nh nht s c chn lm mode d on.
II.4.2.2)
Block Diagram
II.4.2.3)
I/O Description
11
Name
Dir
Description
clk
rst
I4M_enable
mbA_avail
mbB_avail
Up neighbor mb availability
mbC_avail
mbAddr_x
Current X mb
mbAddr_y
Current Y mb
orgY_ready
orgY_rd_en
orgY_addr
orgY_data_in
reconY_data_in
reconY_in_vld
Y_T_req
I4M_pred_rden
I4M_pred_data
I4M_res_rden
I4M_res_data
rem_intra4x4_predmode
changed
prev_intra4x4_pred_flag
I4M_mode_vld
I4M_done
Predict completed
II.4.3.
I4M_controller
II.4.3.1)
Abstract
This module controls operation of intra prediction for luma components. It gives control signals such as
enable, disable, mode selection,
12
II.4.3.2)
Block Diagram
II.4.3.3)
Name
I/O Description
Dir
Description
clk
Clock signal
rst
in_vld
mbA_avail
mbB_avail
mbC_avail
mbAddr_x
Current mb X
mbAddr_y
Current mb Y
block_rst
better_mode
Intra4x4 enable
mode
compare_vld
I4M_T_req
I4M_T_done
blkA_avail
blkB_avail
ver_mode
hor_mode
dc_mode
predicting DC mode
ddleft_mode
ddright_mode
Start predicting
cnt4x4blk
orgY_ready
orgY_rden
orgY_addr
neighY_rden
neighY_addr
reconY_in_vld
rem_intra4x4_predmode
prev_intra4x4_pred_flag
I4M_done
Prediction completed
I4M_mode_vld
run_pred
Neigbour availability
II.4.3.4)
Algorithm description
I4M_controller controls all operation of I4M_top. It sets prediction modes by a FSM described in figure 5
14
II.4.4.
I4M_PE
II.4.4.1)
Abstract
15
II.4.4.2)
Block diagram
Figure 6 : I4M_PE
II.4.4.3)
Name
I/O description
Dir
Description
clk
Clock signal
neigh_in_vld
neigh
Data bus
d_reg
mbA_avail
mbB_avail
ver_mode
hor_mode
dc_mode
DC mode selection
ddleft_mode
ddright_mode
run_pred
Run prediction
I4M_pred0
Predict value
I4M_pred1
Predict value
I4M_pred2
Predict value
I4M_pred3
Predict value
out_vld
Output valid
Table 5 : I/O description of I4M_PE
16
II.4.4.4)
Algorithm description
II.4.5.
I4M_neigh_mem
II.4.5.1)
Abstract
This module is a buffer of neighbouring samples of current block 4x4. It contains 1 row of
sample above current macroblock and samples of a column of macroblock at left side of
current macroblock. The I4M_PE block reads samples from this module to calculate
prediction value of current block.
17
II.4.5.2)
Block diagram
II.4.5.3)
Name
I/O description
Dir
Description
clk
Clock signal
mbC_avail
cnt4x4blk
ver_mode
ddleft_mode
reconY_in_vld
neighY_rden
neighY_addr
data_in
data_out
neigh_out_vld
d_out
Sample [-1,-1]
18
II.4.6.
I4M_pred_mem
II.4.6.1)
Abstract
II.4.6.2)
Block diagram
II.4.6.3)
Name
I/O description
Dir
Description
clk
Clock signal
mb_rst
Macroblock reset
better_mode
rd_en
wr_en
data_in
Data in port
data_out
II.4.7.
I4M_res_mem
II.4.7.1)
Abstract
19
II.4.7.2)
Block diagram
II.4.7.3)
Name
I/O description
Dir
Description
clk
Clock signal
mb_rst
Macroblock reset
better_mode
rd_en
wr_en
data_in
Data in port
data_out
I4M_T_done
Read 1 mb done
II.4.8.
I4M_res_cal
II.4.8.1)
Abstract
This module calcutes the differences between the original block 4x4 and the predicted
bock. It also compare the SAD (sum of absolute differences) of all prediction modes. The
mode which has minimum SAD is chosen and sent to next block. Residual values are
temporarily stored at I4M_res_mem before sent to TQ block.
20
II.4.8.2)
Block diagram
II.4.8.3)
Name
I/O description
Dir
Description
clk
Clock signal
mb_rst
Macroblock reset
mp_mode_vld
Mode valid
org
Orginal samples
pred_vld
pred0
Predicted value
pred1
Predicted value
pred2
Predicted value
pred3
Predicted value
res0
Residual value
res1
Residual value
res2
Residual value
res3
Residual value
res_out_vld
Residual valid
compare_vld
better_mode
21
II.4.9.
I16M_top
II.4.9.1)
Abstract
I16M_top is the top level of intra prediction for chroma component. There are 4 modes: DC, vertical,
horizontal and Plane for each 8x8 block Cb and Cr. The prediction mode of Cb component and Cr
component are always the same.
II.4.9.2)
Block Diagram
II.4.9.3)
Name
I/O Description
Dir
Description
Clk
Rst
I16M_enable
mbA_avail
mbB_avail
mbAddr_x
mbAddr_y
orgC_rd_en
orgC_addr
orgC_data_in
reconC_data_in
reconC_in_vld
Cbr_T_req
Request signal to TQ
I16M_pred_rden
I16M_pred_data
I16M_res_rden
I16M_res_data
Cbr_bestmode
I16M_done
II.4.10.
I16M_controller
II.4.10.1)
Abstract
I16M_controller controls operation of intra prediction for chroma block. It gives set of
control signals such as enable, disable, valid signal, It also gives addresses and read
enable, write enable for reading/writing memory.
II.4.10.2)
Block diagram
Figure 13 : I16M_controller
II.4.10.3)
Name
I/O description
Dir
Description
clk
Clock signal
rst
in_vld
Enable signal
23
mbA_avail
mbB_avail
Up neigbour mb availability
mbAddr_x
Current mb (X coordinate)
mbAddr_y
Current mb (Y coordinate)
Cb_vld
Cb component valid
Cr_vld
Cr component valid
sel_dc
Predicting DC mode
sel_ver
sel_hor
sel_plane
run_pred
Run predict
cnt4x4blk
neighC_addr
neighC_rden
reconC_in_vld
better_mode
compare_vld
cmp_rst
Cbr_T_req
Cbr_T_done
orgC_rd_en
orgC_addr
Cbr_bestmode
I16M_done
Predict completed
II.4.11.
I16M_PE
II.4.11.1)
Abstract
This module performs calculating prediction value of a block 8x8 Cb and a block 8x8 Cr.
There are 4 modes: DC, vertical, horizontal and plane for each block 8x8 of chroma
component. The control signals is given from I16M_controller. The neigbour samples are
read from I16M_neigh_mem.
24
II.4.11.2)
Block diagram
Figure 14 : I16M_PE
II.4.11.3)
Name
I/O description
Dir
Description
clk
Clock signal
rst
neigh_in_vld
neigh
Neigbour data
d_reg
cnt4x4blk
mbA_avail
mbB_avail
Cb_vld
Cb component in valid
Cr_vld
Cr component in valid
sel_chrom_ver
sel_chrom_hor
sel_chrom_dc
Current mode is DC
sel_chrom_plane
run_pred
Start predict
I16M_pred0
Predict result
I16M_pred1
Predict result
I16M_pred2
Predict result
I16M_pred3
Predict result
out_vld
Output valid
II.4.12.
I16M_neigh_mem
II.4.12.1)
Abstract
II.4.12.2)
Block diagram
II.4.12.3)
Name
I/O description
Dir
Description
clk
Clock signal
wr_en
rd_en
Cb_vld
Cb valid
26
sel_plane
Plane mode
sel_dc
DC mode
mbA_avail
mbB_avail
Up neighbour mb avail
addr
Read address
data_in
data_out
neigh_out_vld
d_reg
Sample [-1,-1]
II.4.13.
I16M_pred_mem
II.4.13.1)
Abstract
II.4.13.2)
Block diagram
II.4.13.3)
Name
I/O description
Dir
Description
clk
Clock signal
mb_rst
Macroblock reset
better_mode
rd_en
wr_en
data_in
Data in port
27
data_out
II.4.14.
I16M_res_mem
II.4.14.1)
Abstract
This module stores residual values (differences between original macroblock and
predicted macroblock). Residual values are calculated by I16M_res_mem.
II.4.14.2)
Block diagram
II.4.14.3)
Name
I/O description
Dir
Description
clk
Clock signal
mb_rst
Macroblock reset
better_mode
rd_en
wr_en
data_in
Data in port
data_out
Cbr_T_done
Read 1 mb done
II.4.15.
I16M_res_cal
II.4.15.1)
Abstract
This module calcutes the differences between the original block 8x8 of chroma component
28
Cb and Cr and the predicted bock. It also compare the SAD (sum of absolute differences)
of all prediction modes. The mode which has minimum SAD is chosen and sent to next
block. Residual values are temporarily stored at I4M_res_mem before sent to TQ block.
II.4.15.2)
Block diagram
II.4.15.3)
Name
I/O description
Dir
Description
clk
Clock signal
mb_rst
Reset macroblock
in_vld
Data in valid
sel_chrom_dc
DC mode
sel_chrom_hor
Horizontal mode
pred0
Predicted value
pred1
Predicted value
pred2
Predicted value
pred3
Predicted value
org0
Original value
org1
Original value
org2
Original value
org3
Original value
res
Residual value
cmp_vld
better_mode
30