The process will output 1 16x16 luma sample array and 2 8x8 chroma sample array(for mainprofile with chroma_format_idc = 1).
Notice, the inter prediction is executed partition by partition, for main profile all partition will be involved except for 8x8
(1) The derivation of Partwidth&partHeight
For Luma:
ü Not 8x8 partition: = MbpartWidth()
(Such as 8x16,16x8,)
ü 8x8 with subpartition: = SubMbPartWidth
(P_8x8, P_8x8ref0, B_8x8 without B_Direct_8x8)
ü 8x8 without subpartition: = 4, since the smallest partition is 8x8
(B_Skip or B_Direct_16x16, even B_8x8 with B_Direct_8x8 )
For Chroma:
When chroma_format_idc is not equal to 0 (monochrome)
partWidthC = partWidth / SubWidthC
partHeightC = partHeight / SubHeightC
(2) The Inter Prediction for each partition
Ø Step1 (important): get MV and REF list information, refer to (3)
In:
mbpartIdx, subMbpartIdx
out:
mvL0,mvL1, subMvCnt
refIdxL0,refIdxL1 with predFlagL0,predFlagL1
Ø Step2:
MVcnt += subMcCnt
Ø Step3: (important) refer to (5)
(mbpartIdx, subMbpartIdx, partWidth, partHeight
mvL0,mvL1, subMvCnt,
refIdxL0,refIdxL1 with predFlagL0,predFlagL1 )
->Inter prediction samples (partWidth x partHeight)
Ø Step4: (store result for next decoding process)
MvL0[ mbPartIdx ][ subMbPartIdx ] = mvL0
MvL1[ mbPartIdx ][ subMbPartIdx ] = mvL1
RefIdxL0[ mbPartIdx ] = refIdxL0
RefIdxL1[ mbPartIdx ] = refIdxL1
PredFlagL0[ mbPartIdx ] = predFlagL0
PredFlagL1[ mbPartIdx ] = predFlagL1
Ø Step5:
Derivation of partition location: (xP,yP) relative to macroblock
Derivation of subpartition location: (xS,yS) relative to macroblock partition
Pred[xP+xS+x,yP+yS+y] = predPart[x,y]
(3) process of derivation of motion vector an reference indices
P_skip: refer to 8.4.1.1for refIdxL0 of mvL0 and set predflagL0 ‘1’
B_skip, B_Direct_16x16,B_direct_8x8: refer to 8.4.1.2
Other B,P:
ü step1:
get refIdxLX from parsed semantics , and set predFlagLX
ü step2:
subMvCnt = predFlagL0+predFlagL1
MvCnt += subMvCnt
(4) derivation of motion vector prediction mvpLX[] (main algoritm)
The process is related with neighbor MB
( Note: reference to below function:
prepare_direct_params(dec_picture, img, mb_nr, pmvl0, pmvl1, &l0_rFrame, &l1_rFrame) in JM )
(5) Derivation of MvLX[], RefIdxLX[], PredFlagLX[] for partition or subpartition
Horizon:
MvLX[mbPartIdx ][subMbPartIdx ][0]=
mvpLX[0] + mvd_IX[mbpartIdx][subMbpartIdx][0]
Vertical:
MvLX[mbPartIdx ][subMbPartIdx ] [1] =
mvpLX[1] + mvd_IX[mbpartIdx][subMbpartIdx][1]
(p: prediction, d: delta or data)
RefIdxL0[ mbPartIdx ] = refIdxL0
RefIdxL1[ mbPartIdx ] = refIdxL1
PredFlagL0[ mbPartIdx ] = predFlagL0
PredFlagL1[ mbPartIdx ] = predFlagL1
(6) Decoding of PredPartl and Predpartc (inter prediction samples )
( predPart(x,y) = predPartl(x,y) or predPartc(x,y) )
The predL[ xP + xS + x, yP + yS + y ] = predPartL[ x, y ]
predC[ xP / SubWidthC + xS / SubWidthC + x, yP / SubHeightC + yS / SubHeightC + y ] = predPartC[ x, y ]
24/02/08 Created by Shuguang
03/06/08 Modified by Shuguang
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/moonsinger/archive/2008/03/11/2168948.aspx