04 翻译任务.docx
《04 翻译任务.docx》由会员分享,可在线阅读,更多相关《04 翻译任务.docx(19页珍藏版)》请在冰豆网上搜索。
04翻译任务
9Parsingprocess
InputstothisprocessarebitsfromtheRBSP.
Outputsofthisprocessaresyntaxelementvalues.
Thisprocessisinvokedwhenthedescriptorofasyntaxelementinthesyntaxtablesinsubclause7.3isequalto ue(v),me(v),se(v),te(v)(seesubclause9.1),ce(v)(seesubclause9.2),orae(v)(seesubclause9.3).
9.1ParsingprocessforExp-Golombcodes
Thisprocessisinvokedwhenthedescriptorofasyntaxelementinthesyntaxtablesinsubclause7.3isequalto ue(v),me(v),se(v),orte(v).Forsyntaxelementsinsubclauses7.3.4and7.3.5,thisprocessisinvokedonlywhenentropy_coding_mode_flagisequalto 0.
InputstothisprocessarebitsfromtheRBSP.
Outputsofthisprocessaresyntaxelementvalues.
Syntaxelementscodedasue(v),me(v),orse(v)areExp-Golomb-coded.Syntaxelementscodedaste(v)aretruncatedExp-Golomb-coded.Theparsingprocessforthesesyntaxelementsbeginswithreadingthebitsstartingatthecurrentlocationinthebitstreamuptoandincludingthefirstnon-zerobit,andcountingthenumberofleadingbitsthatareequalto 0.Thisprocessshallbeequivalenttothefollowing:
leadingZeroBits=-1;
for(b=0;!
b;leadingZeroBits++)
b=read_bits
(1)
ThevariablecodeNumisthenassignedasfollows:
codeNum=2leadingZeroBits–1+read_bits(leadingZeroBits)
wherethevaluereturnedfromread_bits(leadingZeroBits)isinterpretedasabinaryrepresentationofanunsignedintegerwithmostsignificantbitwrittenfirst.
Table 91illustratesthestructureoftheExp-Golombcodebyseparatingthebitstringinto“prefix”and“suffix”bits.The“prefix”bitsarethosebitsthatareparsedintheabovepseudo-codeforthecomputationofleadingZeroBits,andareshownaseither0or1inthebitstringcolumnofTable 91.The“suffix”bitsarethosebitsthatareparsedinthecomputationofcodeNumandareshownasxiinTable 91,withibeingintherange0toleadingZeroBits - 1,inclusive.Eachxicantakeonvalues0or1.
Table 91–Bitstringswith“prefix”and“suffix”bitsandassignmenttocodeNumranges(informative)
Bitstringform
RangeofcodeNum
1
0
01x0
1-2
001x1x0
3-6
0001x2x1x0
7-14
00001x3x2x1x0
15-30
000001x4x3x2x1x0
31-62
…
…
Table 92illustratesexplicitlytheassignmentofbitstringstocodeNumvalues.
Table 92–Exp-GolombbitstringsandcodeNuminexplicitformandusedasue(v)(informative)
Bitstring
codeNum
1
0
010
1
011
2
00100
3
00101
4
00110
5
00111
6
0001000
7
0001001
8
0001010
9
…
…
Dependingonthedescriptor,thevalueofasyntaxelementisderivedasfollows.
-Ifthesyntaxelementiscodedasue(v),thevalueofthesyntaxelementisequaltocodeNum.
-Otherwise,ifthesyntaxelementiscodedasse(v),thevalueofthesyntaxelementisderivedbyinvokingthemappingprocessforsignedExp-Golombcodesasspecifiedinsubclause9.1.1withcodeNumastheinput.
-Otherwise,ifthesyntaxelementiscodedasme(v),thevalueofthesyntaxelementisderivedbyinvokingthemappingprocessforcodedblockpatternasspecifiedinsubclause9.1.2withcodeNumastheinput.
-Otherwise(thesyntaxelementiscodedaste(v)),therangeofthesyntaxelementshallbedeterminedfirst.Therangeofthissyntaxelementmaybebetween0andx,withxbeinggreaterthanorequalto 1andisusedinthederivationofthevalueofasyntaxelementasfollows
-Ifxisgreaterthan 1,codeNumandthevalueofthesyntaxelementshallbederivedinthesamewayasforsyntaxelementscodedasue(v)
-Otherwise(xisequalto 1),theparsingprocessforcodeNumwhichisequaltothevalueofthesyntaxelementisgivenbyaprocessequivalentto:
b=read_bits
(1)
codeNum=!
b
9.1.1MappingprocessforsignedExp-Golombcodes
InputtothisprocessiscodeNumasspecifiedinsubclause9.1.
Outputofthisprocessisavalueofasyntaxelementcodedasse(v).
ThesyntaxelementisassignedtothecodeNumbyorderingthesyntaxelementbyitsabsolutevalueinincreasingorderandrepresentingthepositivevalueforagivenabsolutevaluewiththelowercodeNum.Table 93providestheassignmentrule.
Table 93–AssignmentofsyntaxelementtocodeNumforsignedExp-Golombcodedsyntaxelementsse(v)
codeNum
syntaxelementvalue
0
0
1
1
2
–1
3
2
4
–2
5
3
6
–3
k
(–1)k+1Ceil(k÷2)
9.1.2Mappingprocessforcodedblockpattern
InputtothisprocessiscodeNumasspecifiedinsubclause9.1.
Outputofthisprocessisavalueofthesyntaxelementcoded_block_patterncodedasme(v).
Table 94showstheassignmentofcoded_block_patterntocodeNumdependingonwhetherthemacroblockpredictionmodeisequaltoIntra_4x4orInter.
Table 94–AssignmentofcodeNumtovaluesofcoded_block_patternformacroblockpredictionmodes
codeNum
coded_block_pattern
Intra_4x4
Inter
0
47
0
1
31
16
2
15
1
3
0
2
4
23
4
5
27
8
6
29
32
7
30
3
8
7
5
9
11
10
10
13
12
11
14
15
12
39
47
13
43
7
14
45
11
15
46
13
16
16
14
17
3
6
18
5
9
19
10
31
20
12
35
21
19
37
22
21
42
23
26
44
24
28
33
25
35
34
26
37
36
27
42
40
28
44
39
29
1
43
30
2
45
31
4
46
32
8
17
33
17
18
34
18
20
35
20
24
36
24
19
37
6
21
38
9
26
39
22
28
40
25
23
41
32
27
42
33
29
43
34
30
44
36
22
45
40
25
46
38
38
47
41
41
9.2CAVLCparsingprocessfortransformcoefficientlevels
Thisprocessisinvokedwhenparsingsyntaxelementswithdescriptorequalto ce(v)insubclause7.3.5.3.1andwhenentropy_coding_mode_flagisequalto 0.
Inputstothisprocessarebitsfromslicedata,amaximumnumberofnon-zerotransformcoefficientlevelsmaxNumCoeff,thelumablockindexluma4x4BlkIdxorthechromablockindexchroma4x4BlkIdxofthecurrentblockoftransformcoefficientlevels.
OutputofthisprocessisthelistcoeffLevelcontainingtransformcoefficientlevelsofthelumablockwithblockindexluma4x4BlkIdxorthechromablockwithblockindexchroma4x4BlkIdx.
Theprocessisspecifiedinthefollowingorderedsteps:
1.Alltransformcoefficientlevels,withindicesfrom0tomaxNumCoeff-1,inthelistcoeffLevelaresetequalto 0.
2.Thetotalnumberofnon-zerotransformcoefficientlevelsTotalCoeff( coeff_token )andthenumberoftrailingonetransformcoefficientlevelsTrailingOnes( coeff_token )arederivedbyparsingcoeff_token(seesubclause9.2.1)asfollows.
-Ifthenumberofnon-zerotransformcoefficientlevelsTotalCoeff( coeff_token )isequalto 0,thelistcoeffLevelcontaining0valuesisreturnedandnofurtherstepiscarriedout.
-Otherwise,thefollowingstepsarecarriedout.
a.Thenon-zerotransformcoefficientlevelsarederivedbyparsingtrailing_ones_sign_flag,level_prefix,andlevel_suffix(seesubclause9.2.2).
b.Therunsofzerotransformcoefficientlevelsbeforeeachnon-zerotransformcoefficientlevelarederivedbyparsingtotal_zerosandrun_before(seesubclause9.2.3).
c.ThelevelandruninformationarecombinedintothelistcoeffLevel(seesubclause9.2.4).
9.2.1Parsingprocessfortotalnumberoftransformcoefficientlevelsandtrailingones
Inputstothisprocessarebitsfromslicedata,amaximumnumberofnon-zerotransformcoefficientlevelsmaxNumCoeff,thelumablockindexluma4x4BlkIdxorthechromablockindexchroma4x4BlkIdxofthecurrentblockoftransform.
OutputsofthisprocessareTotalCoeff( coeff_token )andTrailingOnes( coeff_token ).
Thesyntaxelementcoeff_tokenisdecodedusingoneofthefiveVLCsspecifiedinfiveright-mostcolumnsofTable 95.EachVLCspecifiesbothTotalCoeff( coeff_token )andTrailingOnes( coeff_token )foragivencodewordcoeff_token.VLCselectionisdependentuponavariablenCthatisderivedasfollows.
-IftheCAVLCparsingprocessisinvokedforChromaDCLevel,nCissetequalto –1,
-Otherwise,thefollowingapplies.
-WhentheCAVLCparsingprocessisinvokedforIntra16x16DCLevel,luma4x4BlkIdxissetequalto 0.
-ThevariablesblkAandblkBarederivedasfollows.
-IftheCAVLCparsingprocessisinvokedforIntra16x16DCLevel,Intra16x16ACLevel,orLumaLevel,theprocessspecifiedinsubclause6.4.7.3isinvokedwithluma4x4BlkIdxastheinput,andtheoutputisassignedtombAddrA,mbAddrB,luma4x4BlkIdxA,andluma4x4BlkIdxB.The4x4lumablockspecifiedbymbAddrA\luma4x4BlkIdxAisassignedto blkA,andthe4x4lumablockspecifiedbymbAddrB\luma4x4BlkIdxBisassignedto blkB.
-Otherwise(theCAVLCparsingprocessisinvokedforChromaACLevel),theprocessspecifiedinsubclause6.4.7.4isinvokedwithchroma4x4BlkIdxasinput,andtheoutputisassignedtombAddrA,mbAddrB,chroma4x4BlkIdxA,andchroma4x4BlkIdxB.The4x4chromablockspecifiedbymbAddrA\iCbCr\chroma4x4BlkIdxAisassignedto blkA,andthe4x4chromablockspecifiedbymbAddrB\iCbCr\luma4x4BlkIdxBisassignedto blkB.
-LetnAandnBbethenumberofnon-zerotransformcoefficientlevels(givenbyTotalCoeff( coeff_token ))intheblockoftransformcoefficientlevelsblkAlocatedtotheleftofthecurrentblockandtheblockoftransformcoefficientlevelsblkBlocatedabovethecurrentblock,respectively.
-WithNreplacedbyAandB,inmbAddrN,blkN,andnNthefollowingapplies.
-Ifanyofthefollowingconditionsistrue,nNissetequalto 0.
-mbAddrNisnotavailable
-ThecurrentmacroblockiscodedusinganIntrapredictionmode,constrained_intra_pred_flagisequalto 1andmbAddrNiscodedusingInterpredictionandslicedatapartitioningisinuse(nal_unit_typeisintherangeof2to 4,inclusive).
-