Newer
Older
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
{
bool found = false;
for (int j = 0; j<numRefs; j++)
{
if (refList[j] == absPOC)
{
found = true;
for (int k = 0; k<m_iGOPSize; k++)
{
if (absPOC % (m_iGOPSize * multipleFactor) == m_RPLList0[k].m_POC % (m_iGOPSize * multipleFactor))
{
if (m_RPLList0[k].m_temporalId == m_RPLList0[curGOP].m_temporalId)
{
m_RPLList0[k].m_refPic = true;
}
}
}
}
}
if (!found)
{
msg(WARNING, "\nError: ref pic %d is not available for GOP frame %d\n", m_RPLList0[curGOP].m_deltaRefPics[i], curGOP + 1);
errorGOP = true;
}
}
}
if (!beforeI && !errorGOP)
{
//all ref frames were present
if (!isOK[curGOP])
{
numOK++;
isOK[curGOP] = true;
if (numOK == m_iGOPSize)
{
verifiedGOP = true;
}
}
}
else
{
//create a new RPLEntry for this frame containing all the reference pictures that were available (POC > 0)
m_RPLList0[m_iGOPSize + extraRPLs] = m_RPLList0[curGOP];
m_RPLList1[m_iGOPSize + extraRPLs] = m_RPLList1[curGOP];
int newRefs0 = 0;
for (int i = 0; i< m_RPLList0[curGOP].m_numRefPics; i++)
{
int absPOC = curPOC - m_RPLList0[curGOP].m_deltaRefPics[i];
if (absPOC >= 0)
{
m_RPLList0[m_iGOPSize + extraRPLs].m_deltaRefPics[newRefs0] = m_RPLList0[curGOP].m_deltaRefPics[i];
newRefs0++;
}
}
int numPrefRefs0 = m_RPLList0[curGOP].m_numRefPicsActive;
int newRefs1 = 0;
for (int i = 0; i< m_RPLList1[curGOP].m_numRefPics; i++)
{
int absPOC = curPOC - m_RPLList1[curGOP].m_deltaRefPics[i];
if (absPOC >= 0)
{
m_RPLList1[m_iGOPSize + extraRPLs].m_deltaRefPics[newRefs1] = m_RPLList1[curGOP].m_deltaRefPics[i];
newRefs1++;
}
}
int numPrefRefs1 = m_RPLList1[curGOP].m_numRefPicsActive;
for (int offset = -1; offset>-checkGOP; offset--)
{
//step backwards in coding order and include any extra available pictures we might find useful to replace the ones with POC < 0.
int offGOP = (checkGOP - 1 + offset) % m_iGOPSize;
int offPOC = ((checkGOP - 1 + offset) / m_iGOPSize)*(m_iGOPSize * multipleFactor) + m_RPLList0[offGOP].m_POC;
if (offPOC >= 0 && m_RPLList0[offGOP].m_temporalId <= m_RPLList0[curGOP].m_temporalId)
{
bool newRef = false;
for (int i = 0; i<(newRefs0 + newRefs1); i++)
{
if (refList[i] == offPOC)
{
newRef = true;
}
}
for (int i = 0; i<newRefs0; i++)
{
if (m_RPLList0[m_iGOPSize + extraRPLs].m_deltaRefPics[i] == curPOC - offPOC)
{
newRef = false;
}
}
if (newRef)
{
int insertPoint = newRefs0;
//this picture can be added, find appropriate place in list and insert it.
if (m_RPLList0[offGOP].m_temporalId == m_RPLList0[curGOP].m_temporalId)
{
m_RPLList0[offGOP].m_refPic = true;
}
for (int j = 0; j<newRefs0; j++)
{
if (m_RPLList0[m_iGOPSize + extraRPLs].m_deltaRefPics[j] > curPOC - offPOC && curPOC - offPOC > 0)
{
insertPoint = j;
break;
}
}
int prev = curPOC - offPOC;
for (int j = insertPoint; j<newRefs0 + 1; j++)
{
int newPrev = m_RPLList0[m_iGOPSize + extraRPLs].m_deltaRefPics[j];
m_RPLList0[m_iGOPSize + extraRPLs].m_deltaRefPics[j] = prev;
prev = newPrev;
}
newRefs0++;
}
}
if (newRefs0 >= numPrefRefs0)
{
break;
}
}
for (int offset = -1; offset>-checkGOP; offset--)
{
//step backwards in coding order and include any extra available pictures we might find useful to replace the ones with POC < 0.
int offGOP = (checkGOP - 1 + offset) % m_iGOPSize;
int offPOC = ((checkGOP - 1 + offset) / m_iGOPSize)*(m_iGOPSize * multipleFactor) + m_RPLList1[offGOP].m_POC;
if (offPOC >= 0 && m_RPLList1[offGOP].m_temporalId <= m_RPLList1[curGOP].m_temporalId)
{
bool newRef = false;
for (int i = 0; i<(newRefs0 + newRefs1); i++)
{
if (refList[i] == offPOC)
{
newRef = true;
}
}
for (int i = 0; i<newRefs1; i++)
{
if (m_RPLList1[m_iGOPSize + extraRPLs].m_deltaRefPics[i] == curPOC - offPOC)
{
newRef = false;
}
}
if (newRef)
{
int insertPoint = newRefs1;
//this picture can be added, find appropriate place in list and insert it.
if (m_RPLList1[offGOP].m_temporalId == m_RPLList1[curGOP].m_temporalId)
{
m_RPLList1[offGOP].m_refPic = true;
}
for (int j = 0; j<newRefs1; j++)
{
if (m_RPLList1[m_iGOPSize + extraRPLs].m_deltaRefPics[j] > curPOC - offPOC && curPOC - offPOC > 0)
{
insertPoint = j;
break;
}
}
int prev = curPOC - offPOC;
for (int j = insertPoint; j<newRefs1 + 1; j++)
{
int newPrev = m_RPLList1[m_iGOPSize + extraRPLs].m_deltaRefPics[j];
m_RPLList1[m_iGOPSize + extraRPLs].m_deltaRefPics[j] = prev;
prev = newPrev;
}
newRefs1++;
}
}
if (newRefs1 >= numPrefRefs1)
{
break;
}
}
m_RPLList0[m_iGOPSize + extraRPLs].m_numRefPics = newRefs0;
m_RPLList0[m_iGOPSize + extraRPLs].m_numRefPicsActive = min(m_RPLList0[m_iGOPSize + extraRPLs].m_numRefPics, m_RPLList0[m_iGOPSize + extraRPLs].m_numRefPicsActive);
m_RPLList1[m_iGOPSize + extraRPLs].m_numRefPics = newRefs1;
m_RPLList1[m_iGOPSize + extraRPLs].m_numRefPicsActive = min(m_RPLList1[m_iGOPSize + extraRPLs].m_numRefPics, m_RPLList1[m_iGOPSize + extraRPLs].m_numRefPicsActive);
curGOP = m_iGOPSize + extraRPLs;
extraRPLs++;
}
numRefs = 0;
for (int i = 0; i< m_RPLList0[curGOP].m_numRefPics; i++)
{
int absPOC = curPOC - m_RPLList0[curGOP].m_deltaRefPics[i];
if (absPOC >= 0)
{
refList[numRefs] = absPOC;
numRefs++;
}
}
for (int i = 0; i< m_RPLList1[curGOP].m_numRefPics; i++)
{
int absPOC = curPOC - m_RPLList1[curGOP].m_deltaRefPics[i];
if (absPOC >= 0)
{
bool alreadyExist = false;
for (int j = 0; !alreadyExist && j < numRefs; j++)
{
if (refList[j] == absPOC)
{
alreadyExist = true;
}
}
if (!alreadyExist)
{
refList[numRefs] = absPOC;
numRefs++;
}
}
}
refList[numRefs] = curPOC;
numRefs++;
}
checkGOP++;
}
xConfirmPara(errorGOP, "Invalid GOP structure given");

Karsten Suehring
committed
m_maxTempLayer = 1;

Karsten Suehring
committed
for(int i=0; i<m_iGOPSize; i++)
{
if(m_GOPList[i].m_temporalId >= m_maxTempLayer)
{
m_maxTempLayer = m_GOPList[i].m_temporalId+1;
}
xConfirmPara(m_GOPList[i].m_sliceType!='B' && m_GOPList[i].m_sliceType!='P' && m_GOPList[i].m_sliceType!='I', "Slice type must be equal to B or P or I");
}
for(int i=0; i<MAX_TLAYER; i++)
{
m_numReorderPics[i] = 0;
m_maxDecPicBuffering[i] = 1;
}
for(int i=0; i<m_iGOPSize; i++)
{
int numRefPic = m_RPLList0[i].m_numRefPics;
for (int tmp = 0; tmp < m_RPLList1[i].m_numRefPics; tmp++)
{
bool notSame = true;
for (int jj = 0; notSame && jj < m_RPLList0[i].m_numRefPics; jj++)
{
if (m_RPLList1[i].m_deltaRefPics[tmp] == m_RPLList0[i].m_deltaRefPics[jj]) notSame = false;
}
if (notSame) numRefPic++;
}
if (numRefPic + 1 > m_maxDecPicBuffering[m_GOPList[i].m_temporalId])
{
m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = numRefPic + 1;
}

Karsten Suehring
committed
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
int highestDecodingNumberWithLowerPOC = 0;
for(int j=0; j<m_iGOPSize; j++)
{
if(m_GOPList[j].m_POC <= m_GOPList[i].m_POC)
{
highestDecodingNumberWithLowerPOC = j;
}
}
int numReorder = 0;
for(int j=0; j<highestDecodingNumberWithLowerPOC; j++)
{
if(m_GOPList[j].m_temporalId <= m_GOPList[i].m_temporalId &&
m_GOPList[j].m_POC > m_GOPList[i].m_POC)
{
numReorder++;
}
}
if(numReorder > m_numReorderPics[m_GOPList[i].m_temporalId])
{
m_numReorderPics[m_GOPList[i].m_temporalId] = numReorder;
}
}

Karsten Suehring
committed
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
for(int i=0; i<MAX_TLAYER-1; i++)
{
// a lower layer can not have higher value of m_numReorderPics than a higher layer
if(m_numReorderPics[i+1] < m_numReorderPics[i])
{
m_numReorderPics[i+1] = m_numReorderPics[i];
}
// the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive
if(m_numReorderPics[i] > m_maxDecPicBuffering[i] - 1)
{
m_maxDecPicBuffering[i] = m_numReorderPics[i] + 1;
}
// a lower layer can not have higher value of m_uiMaxDecPicBuffering than a higher layer
if(m_maxDecPicBuffering[i+1] < m_maxDecPicBuffering[i])
{
m_maxDecPicBuffering[i+1] = m_maxDecPicBuffering[i];
}
}
// the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive
if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1)
{
m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1;
}
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
if( m_picPartitionFlag )
{
PPS pps;
uint32_t colIdx, rowIdx;
uint32_t remSize;
pps.setPicWidthInLumaSamples( m_iSourceWidth );
pps.setPicHeightInLumaSamples( m_iSourceHeight );
pps.setLog2CtuSize( floorLog2(m_uiCTUSize) );
// set default tile column if not provided
if( m_tileColumnWidth.size() == 0 )
{
m_tileColumnWidth.push_back( pps.getPicWidthInCtu() );
}
// set default tile row if not provided
if( m_tileRowHeight.size() == 0 )
{
m_tileRowHeight.push_back( pps.getPicHeightInCtu() );
}
// remove any tile columns that can be specified implicitly
while( m_tileColumnWidth.size() > 1 && m_tileColumnWidth.end()[-1] == m_tileColumnWidth.end()[-2] )
{
m_tileColumnWidth.pop_back();
}
// remove any tile rows that can be specified implicitly
while( m_tileRowHeight.size() > 1 && m_tileRowHeight.end()[-1] == m_tileRowHeight.end()[-2] )
{
m_tileRowHeight.pop_back();
}
// setup tiles in temporary PPS structure
remSize = pps.getPicWidthInCtu();
for( colIdx=0; remSize > 0 && colIdx<m_tileColumnWidth.size(); colIdx++ )
{
xConfirmPara(m_tileColumnWidth[ colIdx ] == 0, "Tile column widths cannot be equal to 0");
m_tileColumnWidth[ colIdx ] = std::min( remSize, m_tileColumnWidth[ colIdx ]);
pps.addTileColumnWidth( m_tileColumnWidth[ colIdx ] );
remSize -= m_tileColumnWidth[ colIdx ];
}
m_tileColumnWidth.resize( colIdx );
pps.setNumExpTileColumns( (uint32_t)m_tileColumnWidth.size() );
remSize = pps.getPicHeightInCtu();
for( rowIdx=0; remSize > 0 && rowIdx<m_tileRowHeight.size(); rowIdx++ )
{
xConfirmPara(m_tileRowHeight[ rowIdx ] == 0, "Tile row heights cannot be equal to 0");
m_tileRowHeight[ rowIdx ] = std::min( remSize, m_tileRowHeight[ rowIdx ]);
pps.addTileRowHeight( m_tileRowHeight[ rowIdx ] );
remSize -= m_tileRowHeight[ rowIdx ];
}
m_tileRowHeight.resize( rowIdx );
pps.setNumExpTileRows( (uint32_t)m_tileRowHeight.size() );
pps.initTiles();
xConfirmPara(pps.getNumTileColumns() > getMaxTileColsByLevel( m_level ), "Number of tile columns exceeds maximum number allowed according to specified level");
xConfirmPara(pps.getNumTileRows() > getMaxTileRowsByLevel( m_level ), "Number of tile rows exceeds maximum number allowed according to specified level");
m_numTileCols = pps.getNumTileColumns();
m_numTileRows = pps.getNumTileRows();
// rectangular slices
if( !m_rasterSliceFlag )
{
uint32_t sliceIdx;
bool needTileIdxDelta = false;
// generate slice list for the simplified fixed-rectangular-slice-size config option
if( m_rectSliceFixedWidth > 0 && m_rectSliceFixedHeight > 0 )
{
int tileIdx = 0;
m_rectSlicePos.clear();
while( tileIdx < pps.getNumTiles() )
{
uint32_t startTileX = tileIdx % pps.getNumTileColumns();
uint32_t startTileY = tileIdx / pps.getNumTileColumns();
uint32_t startCtuX = pps.getTileColumnBd( startTileX );
uint32_t startCtuY = pps.getTileRowBd( startTileY );
uint32_t stopCtuX = (startTileX + m_rectSliceFixedWidth) >= pps.getNumTileColumns() ? pps.getPicWidthInCtu() - 1 : pps.getTileColumnBd( startTileX + m_rectSliceFixedWidth ) - 1;
uint32_t stopCtuY = (startTileY + m_rectSliceFixedHeight) >= pps.getNumTileRows() ? pps.getPicHeightInCtu() - 1 : pps.getTileRowBd( startTileY + m_rectSliceFixedHeight ) - 1;
uint32_t stopTileX = pps.ctuToTileCol( stopCtuX );
uint32_t stopTileY = pps.ctuToTileRow( stopCtuY );
// add rectangular slice to list
m_rectSlicePos.push_back( startCtuY * pps.getPicWidthInCtu() + startCtuX );
m_rectSlicePos.push_back( stopCtuY * pps.getPicWidthInCtu() + stopCtuX );
// get slice size in tiles
uint32_t sliceWidth = stopTileX - startTileX + 1;
uint32_t sliceHeight = stopTileY - startTileY + 1;
// move to next tile in raster scan order
tileIdx += sliceWidth;
if( tileIdx % pps.getNumTileColumns() == 0 )
{
tileIdx += (sliceHeight - 1) * pps.getNumTileColumns();
}
}
}
xConfirmPara( m_rectSlicePos.size() & 1, "Odd number of rectangular slice positions provided. Rectangular slice positions must be specified in pairs of (top-left / bottom-right) raster-scan CTU addresses.");
// set default slice size if not provided
if( m_rectSlicePos.size() == 0 )
{
m_rectSlicePos.push_back( 0 );
m_rectSlicePos.push_back( pps.getPicWidthInCtu() * pps.getPicHeightInCtu() - 1 );
}
pps.setNumSlicesInPic( (uint32_t)(m_rectSlicePos.size() >> 1) );
xConfirmPara(pps.getNumSlicesInPic() > getMaxSlicesByLevel( m_level ), "Number of rectangular slices exceeds maximum number allowed according to specified level");
pps.initRectSlices();
// set slice parameters from CTU addresses
for( sliceIdx = 0; sliceIdx < pps.getNumSlicesInPic(); sliceIdx++ )
{
xConfirmPara( m_rectSlicePos[2*sliceIdx] >= pps.getPicWidthInCtu() * pps.getPicHeightInCtu(), "Rectangular slice position exceeds total number of CTU in picture.");
xConfirmPara( m_rectSlicePos[2*sliceIdx + 1] >= pps.getPicWidthInCtu() * pps.getPicHeightInCtu(), "Rectangular slice position exceeds total number of CTU in picture.");
// map raster scan CTU address to X/Y position
uint32_t startCtuX = m_rectSlicePos[2*sliceIdx] % pps.getPicWidthInCtu();
uint32_t startCtuY = m_rectSlicePos[2*sliceIdx] / pps.getPicWidthInCtu();
uint32_t stopCtuX = m_rectSlicePos[2*sliceIdx + 1] % pps.getPicWidthInCtu();
uint32_t stopCtuY = m_rectSlicePos[2*sliceIdx + 1] / pps.getPicWidthInCtu();
// get corresponding tile index
uint32_t startTileX = pps.ctuToTileCol( startCtuX );
uint32_t startTileY = pps.ctuToTileRow( startCtuY );
uint32_t stopTileX = pps.ctuToTileCol( stopCtuX );
uint32_t stopTileY = pps.ctuToTileRow( stopCtuY );
uint32_t tileIdx = startTileY * pps.getNumTileColumns() + startTileX;
// get slice size in tiles
uint32_t sliceWidth = stopTileX - startTileX + 1;
uint32_t sliceHeight = stopTileY - startTileY + 1;
// check for slice / tile alignment
xConfirmPara( startCtuX != pps.getTileColumnBd( startTileX ), "Rectangular slice position does not align with a left tile edge.");
xConfirmPara( stopCtuX != (pps.getTileColumnBd( stopTileX + 1 ) - 1), "Rectangular slice position does not align with a right tile edge.");
if( sliceWidth > 1 || sliceHeight > 1 )
{
xConfirmPara( startCtuY != pps.getTileRowBd( startTileY ), "Rectangular slice position does not align with a top tile edge.");
xConfirmPara( stopCtuY != (pps.getTileRowBd( stopTileY + 1 ) - 1), "Rectangular slice position does not align with a bottom tile edge.");
}
// set slice size and tile index
pps.setSliceWidthInTiles( sliceIdx, sliceWidth );
pps.setSliceHeightInTiles( sliceIdx, sliceHeight );
pps.setSliceTileIdx( sliceIdx, tileIdx );
if( sliceIdx > 0 && !needTileIdxDelta )
{
uint32_t lastTileIdx = pps.getSliceTileIdx( sliceIdx-1 );
lastTileIdx += pps.getSliceWidthInTiles( sliceIdx-1 );
if( lastTileIdx % pps.getNumTileColumns() == 0)
{
lastTileIdx += (pps.getSliceHeightInTiles( sliceIdx-1 ) - 1) * pps.getNumTileColumns();
}
if( lastTileIdx != tileIdx )
{
needTileIdxDelta = true;
}
}
// special case for multiple slices within a single tile
if( sliceWidth == 1 && sliceHeight == 1 )
{
uint32_t firstSliceIdx = sliceIdx;
uint32_t numSlicesInTile = 1;
pps.setSliceHeightInCtu( sliceIdx, stopCtuY - startCtuY + 1 );
while( sliceIdx < pps.getNumSlicesInPic()-1 )
{
uint32_t nextTileIdx;
startCtuX = m_rectSlicePos[2*(sliceIdx+1)] % pps.getPicWidthInCtu();
startCtuY = m_rectSlicePos[2*(sliceIdx+1)] / pps.getPicWidthInCtu();
stopCtuX = m_rectSlicePos[2*(sliceIdx+1) + 1] % pps.getPicWidthInCtu();
stopCtuY = m_rectSlicePos[2*(sliceIdx+1) + 1] / pps.getPicWidthInCtu();
startTileX = pps.ctuToTileCol( startCtuX );
startTileY = pps.ctuToTileRow( startCtuY );
stopTileX = pps.ctuToTileCol( stopCtuX );
stopTileY = pps.ctuToTileRow( stopCtuY );
nextTileIdx = startTileY * pps.getNumTileColumns() + startTileX;
sliceWidth = stopTileX - startTileX + 1;
sliceHeight = stopTileY - startTileY + 1;
if(nextTileIdx != tileIdx || sliceWidth != 1 || sliceHeight != 1)
{
break;
}
numSlicesInTile++;
sliceIdx++;
pps.setSliceWidthInTiles( sliceIdx, 1 );
pps.setSliceHeightInTiles( sliceIdx, 1 );
pps.setSliceTileIdx( sliceIdx, tileIdx );
pps.setSliceHeightInCtu( sliceIdx, stopCtuY - startCtuY + 1 );
}
pps.setNumSlicesInTile( firstSliceIdx, numSlicesInTile );
}
}
pps.setTileIdxDeltaPresentFlag( needTileIdxDelta );
m_tileIdxDeltaPresentFlag = needTileIdxDelta;
// check rectangular slice mapping and full picture CTU coverage
pps.initRectSliceMap();
// store rectangular slice parameters from temporary PPS structure
m_numSlicesInPic = pps.getNumSlicesInPic();
m_rectSlices.resize( pps.getNumSlicesInPic() );
for( sliceIdx = 0; sliceIdx < pps.getNumSlicesInPic(); sliceIdx++ )
{
m_rectSlices[sliceIdx].setSliceWidthInTiles( pps.getSliceWidthInTiles(sliceIdx) );
m_rectSlices[sliceIdx].setSliceHeightInTiles( pps.getSliceHeightInTiles(sliceIdx) );
m_rectSlices[sliceIdx].setNumSlicesInTile( pps.getNumSlicesInTile(sliceIdx) );
m_rectSlices[sliceIdx].setSliceHeightInCtu( pps.getSliceHeightInCtu(sliceIdx) );
m_rectSlices[sliceIdx].setTileIdx( pps.getSliceTileIdx(sliceIdx) );
}
}
// raster-scan slices
else
{
uint32_t listIdx = 0;
uint32_t remTiles = pps.getNumTiles();
// set default slice size if not provided
if( m_rasterSliceSize.size() == 0 )
{
m_rasterSliceSize.push_back( remTiles );
}
// set raster slice sizes
while( remTiles > 0 )
{
// truncate if size exceeds number of remaining tiles
if( listIdx < m_rasterSliceSize.size() )
{
m_rasterSliceSize[listIdx] = std::min( remTiles, m_rasterSliceSize[listIdx] );
remTiles -= m_rasterSliceSize[listIdx];
}
// replicate last size uniformly as needed to cover the remainder of the picture
else
{
m_rasterSliceSize.push_back( std::min( remTiles, m_rasterSliceSize.back() ) );
remTiles -= m_rasterSliceSize.back();
}
listIdx++;
}
// shrink list if too many sizes were provided
m_rasterSliceSize.resize( listIdx );
m_numSlicesInPic = (uint32_t)m_rasterSliceSize.size();
xConfirmPara(m_rasterSliceSize.size() > getMaxSlicesByLevel( m_level ), "Number of raster-scan slices exceeds maximum number allowed according to specified level");
}
}
else
{
m_numTileCols = 1;
m_numTileRows = 1;
m_numSlicesInPic = 1;
}

Karsten Suehring
committed
if ((m_MCTSEncConstraint) && (!m_disableLFCrossTileBoundaryFlag))
{
printf("Warning: Constrained Encoding for Motion Constrained Tile Sets (MCTS) is enabled. Disabling filtering across tile boundaries!\n");
}
if ((m_MCTSEncConstraint) && (m_TMVPModeId))
{
printf("Warning: Constrained Encoding for Motion Constrained Tile Sets (MCTS) is enabled. Disabling TMVP!\n");
m_TMVPModeId = 0;
}
if ((m_MCTSEncConstraint) && ( m_alf ))
{
printf("Warning: Constrained Encoding for Motion Constrained Tile Sets (MCTS) is enabled. Disabling ALF!\n");
m_alf = false;
}
if( ( m_MCTSEncConstraint ) && ( m_BIO ) )
{
printf( "Warning: Constrained Encoding for Motion Constrained Tile Sets (MCTS) is enabled. Disabling BIO!\n" );
m_BIO = false;
}

Karsten Suehring
committed
#if !JVET_Q0482_REMOVE_CONSTANT_PARAMS
// If m_PPSorSliceFlag is equal to 1, for each PPS parameter below,
// 0: value is signaled in slice header
// >0: value is derived from PPS parameter as value - 1
switch (m_PPSorSliceMode)
{
case 0: // All parameter values are signaled in slice header
m_constantSliceHeaderParamsEnabledFlag = 0;
m_PPSDepQuantEnabledIdc = 0;
m_PPSRefPicListSPSIdc0 = 0;
m_PPSRefPicListSPSIdc1 = 0;
m_PPSMvdL1ZeroIdc = 0;
m_PPSCollocatedFromL0Idc = 0;
m_PPSSixMinusMaxNumMergeCandPlus1 = 0;
#if !JVET_Q0806
m_PPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1 = 0;
#else
m_PPSMaxNumMergeCandMinusMaxNumGeoCandPlus1 = 0;
#endif
break;
case 1: // RA setting
m_constantSliceHeaderParamsEnabledFlag = 1;
m_PPSDepQuantEnabledIdc = (m_depQuantEnabledFlag ? 1 : 0) + 1;
m_PPSRefPicListSPSIdc0 = 0;
m_PPSRefPicListSPSIdc1 = 0;
Martin Pettersson
committed
m_PPSMvdL1ZeroIdc = 0;
m_PPSCollocatedFromL0Idc = 0;
m_PPSSixMinusMaxNumMergeCandPlus1 = 6 - m_maxNumMergeCand + 1;
#if !JVET_Q0806
m_PPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1 = m_maxNumMergeCand - m_maxNumTriangleCand + 1;
#else
m_PPSMaxNumMergeCandMinusMaxNumGeoCandPlus1 = m_maxNumMergeCand - m_maxNumGeoCand + 1;
#endif
break;
case 2: // LDB setting
m_constantSliceHeaderParamsEnabledFlag = 1;
m_PPSDepQuantEnabledIdc = (m_depQuantEnabledFlag ? 1 : 0) + 1;
m_PPSRefPicListSPSIdc0 = 2;
m_PPSRefPicListSPSIdc1 = 2;
m_PPSMvdL1ZeroIdc = 2;
m_PPSCollocatedFromL0Idc = 1;
m_PPSSixMinusMaxNumMergeCandPlus1 = 6 - m_maxNumMergeCand + 1;
#if !JVET_Q0806
m_PPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1 = m_maxNumMergeCand - m_maxNumTriangleCand + 1;
#else
m_PPSMaxNumMergeCandMinusMaxNumGeoCandPlus1 = m_maxNumMergeCand - m_maxNumGeoCand + 1;
#endif
break;
case 3: // LDP setting
m_constantSliceHeaderParamsEnabledFlag = 1;
m_PPSDepQuantEnabledIdc = (m_depQuantEnabledFlag ? 1 : 0) + 1;
m_PPSRefPicListSPSIdc0 = 2;
m_PPSRefPicListSPSIdc1 = 2;
m_PPSMvdL1ZeroIdc = 0;
m_PPSCollocatedFromL0Idc = 0;
m_PPSSixMinusMaxNumMergeCandPlus1 = 6 - m_maxNumMergeCand + 1;
#if !JVET_Q0806
m_PPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1 = 0;
#else
m_PPSMaxNumMergeCandMinusMaxNumGeoCandPlus1 = 0;
#endif
break;
default:
THROW("Invalid value for PPSorSliceMode");
}
xConfirmPara(m_drapPeriod > 0 && m_PPSRefPicListSPSIdc0 > 0, "PPSRefPicListSPSIdc0 shall be 0 when DRAP is used. This can be fixed by setting PPSorSliceMode=0.");
xConfirmPara(m_drapPeriod > 0 && m_PPSRefPicListSPSIdc1 > 0, "PPSRefPicListSPSIdc1 shall be 0 when DRAP is used. This can be fixed by setting PPSorSliceMode=0.");
#endif
xConfirmPara( m_sariAspectRatioIdc < 0 || m_sariAspectRatioIdc > 255, "SEISARISampleAspectRatioIdc must be in the range of 0 to 255");

Karsten Suehring
committed
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
if ( m_RCEnableRateControl )
{
if ( m_RCForceIntraQP )
{
if ( m_RCInitialQP == 0 )
{
msg( WARNING, "\nInitial QP for rate control is not specified. Reset not to use force intra QP!" );
m_RCForceIntraQP = false;
}
}
xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" );
#if U0132_TARGET_BITS_SATURATION
if ((m_RCCpbSaturationEnabled) && (m_level!=Level::NONE) && (m_profile!=Profile::NONE))
{
uint32_t uiLevelIdx = (m_level / 10) + (uint32_t)((m_level % 10) / 3); // (m_level / 30)*3 + ((m_level % 10) / 3);
xConfirmPara(m_RCCpbSize > g_uiMaxCpbSize[m_levelTier][uiLevelIdx], "RCCpbSize should be smaller than or equal to Max CPB size according to tier and level");
xConfirmPara(m_RCInitialCpbFullness > 1, "RCInitialCpbFullness should be smaller than or equal to 1");
}
#endif
}
#if U0132_TARGET_BITS_SATURATION
else
{
xConfirmPara( m_RCCpbSaturationEnabled != 0, "Target bits saturation cannot be processed without Rate control" );
}
#endif
if (m_framePackingSEIEnabled)
{
xConfirmPara(m_framePackingSEIType < 3 || m_framePackingSEIType > 5 , "SEIFramePackingType must be in rage 3 to 5");
}
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
if( m_erpSEIEnabled && !m_erpSEICancelFlag )
{
xConfirmPara( m_erpSEIGuardBandType < 0 || m_erpSEIGuardBandType > 8, "SEIEquirectangularprojectionGuardBandType must be in the range of 0 to 7");
xConfirmPara( (m_chromaFormatIDC == CHROMA_420 || m_chromaFormatIDC == CHROMA_422) && (m_erpSEILeftGuardBandWidth%2 == 1), "SEIEquirectangularprojectionLeftGuardBandWidth must be an even number for 4:2:0 or 4:2:2 chroma format");
xConfirmPara( (m_chromaFormatIDC == CHROMA_420 || m_chromaFormatIDC == CHROMA_422) && (m_erpSEIRightGuardBandWidth%2 == 1), "SEIEquirectangularprojectionRightGuardBandWidth must be an even number for 4:2:0 or 4:2:2 chroma format");
}
if( m_sphereRotationSEIEnabled && !m_sphereRotationSEICancelFlag )
{
xConfirmPara( m_sphereRotationSEIYaw < -(180<<16) || m_sphereRotationSEIYaw > (180<<16)-1, "SEISphereRotationYaw must be in the range of -11 796 480 to 11 796 479");
xConfirmPara( m_sphereRotationSEIPitch < -(90<<16) || m_sphereRotationSEIYaw > (90<<16), "SEISphereRotationPitch must be in the range of -5 898 240 to 5 898 240");
xConfirmPara( m_sphereRotationSEIRoll < -(180<<16) || m_sphereRotationSEIYaw > (180<<16)-1, "SEISphereRotationRoll must be in the range of -11 796 480 to 11 796 479");
}
if ( m_omniViewportSEIEnabled && !m_omniViewportSEICancelFlag )
{
xConfirmPara( m_omniViewportSEIId < 0 || m_omniViewportSEIId > 1023, "SEIomniViewportId must be in the range of 0 to 1023");
xConfirmPara( m_omniViewportSEICntMinus1 < 0 || m_omniViewportSEICntMinus1 > 15, "SEIomniViewportCntMinus1 must be in the range of 0 to 15");
for ( uint32_t i=0; i<=m_omniViewportSEICntMinus1; i++ )
{
xConfirmPara( m_omniViewportSEIAzimuthCentre[i] < -(180<<16) || m_omniViewportSEIAzimuthCentre[i] > (180<<16)-1, "SEIOmniViewportAzimuthCentre must be in the range of -11 796 480 to 11 796 479");
xConfirmPara( m_omniViewportSEIElevationCentre[i] < -(90<<16) || m_omniViewportSEIElevationCentre[i] > (90<<16), "SEIOmniViewportSEIElevationCentre must be in the range of -5 898 240 to 5 898 240");
xConfirmPara( m_omniViewportSEITiltCentre[i] < -(180<<16) || m_omniViewportSEITiltCentre[i] > (180<<16)-1, "SEIOmniViewportTiltCentre must be in the range of -11 796 480 to 11 796 479");
xConfirmPara( m_omniViewportSEIHorRange[i] < 1 || m_omniViewportSEIHorRange[i] > (360<<16), "SEIOmniViewportHorRange must be in the range of 1 to 360*2^16");
xConfirmPara( m_omniViewportSEIVerRange[i] < 1 || m_omniViewportSEIVerRange[i] > (180<<16), "SEIOmniViewportVerRange must be in the range of 1 to 180*2^16");
}
}
if (m_gcmpSEIEnabled && !m_gcmpSEICancelFlag)
{
xConfirmPara( m_gcmpSEIMappingFunctionType < 0 || m_gcmpSEIMappingFunctionType > 2, "SEIGcmpMappingFunctionType must be in the range of 0 to 2");
int numFace = m_gcmpSEIPackingType == 4 || m_gcmpSEIPackingType == 5 ? 5 : 6;
for ( int i = 0; i < numFace; i++ )
{
xConfirmPara( m_gcmpSEIFaceIndex[i] < 0 || m_gcmpSEIFaceIndex[i] > 5, "SEIGcmpFaceIndex must be in the range of 0 to 5");
xConfirmPara( m_gcmpSEIFaceRotation[i] < 0 || m_gcmpSEIFaceRotation[i] > 3, "SEIGcmpFaceRotation must be in the range of 0 to 3");
if (m_gcmpSEIMappingFunctionType == 2)
{
xConfirmPara( m_gcmpSEIFunctionCoeffU[i] <= 0.0 || m_gcmpSEIFunctionCoeffU[i] > 1.0, "SEIGcmpFunctionCoeffU must be in the range (0, 1]");
xConfirmPara( m_gcmpSEIFunctionCoeffV[i] <= 0.0 || m_gcmpSEIFunctionCoeffV[i] > 1.0, "SEIGcmpFunctionCoeffV must be in the range (0, 1]");
}
}
if (m_gcmpSEIGuardBandFlag)
{
xConfirmPara( m_gcmpSEIGuardBandSamplesMinus1 < 0 || m_gcmpSEIGuardBandSamplesMinus1 > 15, "SEIGcmpGuardBandSamplesMinus1 must be in the range of 0 to 15");
}
}
#if JVET_Q0297_MER
xConfirmPara(m_log2ParallelMergeLevel < 2, "Log2ParallelMergeLevel should be larger than or equal to 2");
#endif

Karsten Suehring
committed
#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
xConfirmPara(m_preferredTransferCharacteristics > 255, "transfer_characteristics_idc should not be greater than 255.");
#endif
xConfirmPara( unsigned(m_ImvMode) > 1, "ImvMode exceeds range (0 to 1)" );
#if JVET_Q0444_AMVR_SIGNALLING
if (m_AffineAmvr)
{
xConfirmPara(!m_ImvMode, "AffineAmvr cannot be used when IMV is disabled.");
}
#endif

Karsten Suehring
committed
xConfirmPara( m_decodeBitstreams[0] == m_bitstreamFileName, "Debug bitstream and the output bitstream cannot be equal.\n" );
xConfirmPara( m_decodeBitstreams[1] == m_bitstreamFileName, "Decode2 bitstream and the output bitstream cannot be equal.\n" );
xConfirmPara(unsigned(m_LMChroma) > 1, "LMMode exceeds range (0 to 1)");
Rickard Sjöberg
committed
if (m_gopBasedTemporalFilterEnabled)
{
xConfirmPara(m_temporalSubsampleRatio != 1, "GOP Based Temporal Filter only support Temporal sub-sample ratio 1");
}

Karsten Suehring
committed
#if EXTENSION_360_VIDEO
check_failed |= m_ext360.verifyParameters();
#endif
Alican Nalci
committed
#if !JVET_Q0089_SLICE_LOSSLESS_CODING_CHROMA_BDPCM
xConfirmPara(m_useBDPCM < 0 || m_useBDPCM > 2, "BDPCM must be in range 0..2");
Alican Nalci
committed
#endif
#if JVET_Q0820_ACT
xConfirmPara(m_useColorTrans && (m_log2MaxTbSize == 6), "Log2MaxTbSize must be less than 6 when ACT is enabled, otherwise ACT needs to be disabled");
#endif

Karsten Suehring
committed
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
#undef xConfirmPara
return check_failed;
}
const char *profileToString(const Profile::Name profile)
{
static const uint32_t numberOfProfiles = sizeof(strToProfile)/sizeof(*strToProfile);
for (uint32_t profileIndex = 0; profileIndex < numberOfProfiles; profileIndex++)
{
if (strToProfile[profileIndex].value == profile)
{
return strToProfile[profileIndex].str;
}
}
//if we get here, we didn't find this profile in the list - so there is an error
EXIT( "ERROR: Unknown profile \"" << profile << "\" in profileToString" );
return "";
}
void EncAppCfg::xPrintParameter()
{
//msg( DETAILS, "\n" );
msg( DETAILS, "Input File : %s\n", m_inputFileName.c_str() );
msg( DETAILS, "Bitstream File : %s\n", m_bitstreamFileName.c_str() );
msg( DETAILS, "Reconstruction File : %s\n", m_reconFileName.c_str() );
msg( DETAILS, "Real Format : %dx%d %gHz\n", m_iSourceWidth - m_confWinLeft - m_confWinRight, m_iSourceHeight - m_confWinTop - m_confWinBottom, (double)m_iFrameRate / m_temporalSubsampleRatio );
msg( DETAILS, "Internal Format : %dx%d %gHz\n", m_iSourceWidth, m_iSourceHeight, (double)m_iFrameRate / m_temporalSubsampleRatio );
msg( DETAILS, "Sequence PSNR output : %s\n", ( m_printMSEBasedSequencePSNR ? "Linear average, MSE-based" : "Linear average only" ) );
msg( DETAILS, "Hexadecimal PSNR output : %s\n", ( m_printHexPsnr ? "Enabled" : "Disabled" ) );

Karsten Suehring
committed
msg( DETAILS, "Sequence MSE output : %s\n", ( m_printSequenceMSE ? "Enabled" : "Disabled" ) );
msg( DETAILS, "Frame MSE output : %s\n", ( m_printFrameMSE ? "Enabled" : "Disabled" ) );
msg( DETAILS, "Cabac-zero-word-padding : %s\n", ( m_cabacZeroWordPaddingEnabled ? "Enabled" : "Disabled" ) );
if (m_isField)
{
msg( DETAILS, "Frame/Field : Field based coding\n" );
msg( DETAILS, "Field index : %u - %d (%d fields)\n", m_FrameSkip, m_FrameSkip + m_framesToBeEncoded - 1, m_framesToBeEncoded );
msg( DETAILS, "Field Order : %s field first\n", m_isTopFieldFirst ? "Top" : "Bottom" );
}
else
{
msg( DETAILS, "Frame/Field : Frame based coding\n" );
msg( DETAILS, "Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip + m_framesToBeEncoded - 1, m_framesToBeEncoded );
}
{
msg( DETAILS, "Profile : %s\n", profileToString(m_profile) );
}
#if JVET_Q0468_Q0469_MIN_LUMA_CB_AND_MIN_QT_FIX
msg(DETAILS, "CTU size / min CU size : %d / %d \n", m_uiMaxCUWidth, 1 << m_log2MinCuSize);
#else

Karsten Suehring
committed
msg( DETAILS, "CU size / depth / total-depth : %d / %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth, m_uiMaxCodingDepth );
#endif
Kui Fan
committed
#if JVET_Q0119_CLEANUPS
msg(DETAILS, "subpicture info present flag : %d\n", m_subPicInfoPresentFlag);
if (m_subPicInfoPresentFlag)
#else
msg(DETAILS, "subpicture present flag : %d\n", m_subPicPresentFlag);
LI JINGYA
committed
if (m_subPicPresentFlag)
Kui Fan
committed
#endif
LI JINGYA
committed
{
msg(DETAILS, "number of subpictures : %d\n", m_numSubPics);
LI JINGYA
committed
for (int i = 0; i < m_numSubPics; i++)
{
msg(DETAILS, "[%d]th subpictures location :[%d %d]\n", i, m_subPicCtuTopLeftX[i], m_subPicCtuTopLeftY[i]);
msg(DETAILS, "[%d]th subpictures size :[%d %d]\n", i, m_subPicWidth[i], m_subPicHeight[i]);
msg(DETAILS, "[%d]th subpictures treated as picture flag :%d\n", i, m_subPicTreatedAsPicFlag[i]);
msg(DETAILS, "loop filter cross [%d]th subpictures enabled flag :%d\n", i, m_loopFilterAcrossSubpicEnabledFlag[i]);
Kui Fan
committed
#if JVET_Q0119_CLEANUPS
msg(DETAILS, "subpicture ID present flag : %d\n", m_subPicIdMappingExplicitlySignalledFlag);
if (m_subPicIdMappingExplicitlySignalledFlag)
Kui Fan
committed
{
msg(DETAILS, "subpicture ID signalling present flag : %d\n", m_subPicIdMappingInSpsFlag);
#else
msg(DETAILS, "subpicture ID present flag : %d\n", m_subPicIdPresentFlag);
LI JINGYA
committed
if (m_subPicIdPresentFlag)
{
msg(DETAILS, "subpicture ID signalling present flag : %d\n", m_subPicIdSignallingPresentFlag);
Kui Fan
committed
#endif
LI JINGYA
committed
for (int i = 0; i < m_numSubPics; i++)
{
msg(DETAILS, "[%d]th subpictures ID length :%d\n", i, m_subPicIdLen);
msg(DETAILS, "[%d]th subpictures ID :%d\n", i, m_subPicId[i]);
msg( DETAILS, "Max TB size : %d \n", 1 << m_log2MaxTbSize );

Karsten Suehring
committed
msg( DETAILS, "Motion search range : %d\n", m_iSearchRange );
msg( DETAILS, "Intra period : %d\n", m_iIntraPeriod );
msg( DETAILS, "Decoding refresh type : %d\n", m_iDecodingRefreshType );
msg( DETAILS, "DRAP period : %d\n", m_drapPeriod );

Karsten Suehring
committed
#if QP_SWITCHING_FOR_PARALLEL
if (m_qpIncrementAtSourceFrame.bPresent)
{
msg( DETAILS, "QP : %d (incrementing internal QP at source frame %d)\n", m_iQP, m_qpIncrementAtSourceFrame.value);
}
else
{
msg( DETAILS, "QP : %d\n", m_iQP);
}
#else
msg( DETAILS, "QP : %5.2f\n", m_fQP );
#endif
msg( DETAILS, "Max dQP signaling subdiv : %d\n", m_cuQpDeltaSubdiv);

Karsten Suehring
committed
msg( DETAILS, "Cb QP Offset (dual tree) : %d (%d)\n", m_cbQpOffset, m_cbQpOffsetDualTree);
msg( DETAILS, "Cr QP Offset (dual tree) : %d (%d)\n", m_crQpOffset, m_crQpOffsetDualTree);
msg( DETAILS, "QP adaptation : %d (range=%d)\n", m_bUseAdaptiveQP, (m_bUseAdaptiveQP ? m_iQPAdaptationRange : 0) );
msg( DETAILS, "GOP size : %d\n", m_iGOPSize );
msg( DETAILS, "Input bit depth : (Y:%d, C:%d)\n", m_inputBitDepth[CHANNEL_TYPE_LUMA], m_inputBitDepth[CHANNEL_TYPE_CHROMA] );
msg( DETAILS, "MSB-extended bit depth : (Y:%d, C:%d)\n", m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] );
msg( DETAILS, "Internal bit depth : (Y:%d, C:%d)\n", m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA] );
msg( DETAILS, "Intra reference smoothing : %s\n", (m_enableIntraReferenceSmoothing ? "Enabled" : "Disabled") );
msg( DETAILS, "cu_chroma_qp_offset_subdiv : %d\n", m_cuChromaQpOffsetSubdiv);

Karsten Suehring
committed
msg( DETAILS, "extended_precision_processing_flag : %s\n", (m_extendedPrecisionProcessingFlag ? "Enabled" : "Disabled") );
msg( DETAILS, "implicit_rdpcm_enabled_flag : %s\n", (m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT] ? "Enabled" : "Disabled") );
msg( DETAILS, "explicit_rdpcm_enabled_flag : %s\n", (m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT] ? "Enabled" : "Disabled") );
msg( DETAILS, "transform_skip_rotation_enabled_flag : %s\n", (m_transformSkipRotationEnabledFlag ? "Enabled" : "Disabled") );
msg( DETAILS, "transform_skip_context_enabled_flag : %s\n", (m_transformSkipContextEnabledFlag ? "Enabled" : "Disabled") );

Karsten Suehring
committed
#if !REMOVE_PPS_REXT

Karsten Suehring
committed
msg( DETAILS, "cross_component_prediction_enabled_flag: %s\n", (m_crossComponentPredictionEnabledFlag ? (m_reconBasedCrossCPredictionEstimate ? "Enabled (reconstructed-residual-based estimate)" : "Enabled (encoder-side-residual-based estimate)") : "Disabled") );

Karsten Suehring
committed
#endif

Karsten Suehring
committed
msg( DETAILS, "high_precision_offsets_enabled_flag : %s\n", (m_highPrecisionOffsetsEnabledFlag ? "Enabled" : "Disabled") );
msg( DETAILS, "persistent_rice_adaptation_enabled_flag: %s\n", (m_persistentRiceAdaptationEnabledFlag ? "Enabled" : "Disabled") );
msg( DETAILS, "cabac_bypass_alignment_enabled_flag : %s\n", (m_cabacBypassAlignmentEnabledFlag ? "Enabled" : "Disabled") );

Karsten Suehring
committed
if (m_bUseSAO)
{
msg( DETAILS, "log2_sao_offset_scale_luma : %d\n", m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA] );
msg( DETAILS, "log2_sao_offset_scale_chroma : %d\n", m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA] );
}

Karsten Suehring
committed
switch (m_costMode)
{
case COST_STANDARD_LOSSY: msg( DETAILS, "Cost function: : Lossy coding (default)\n"); break;
case COST_SEQUENCE_LEVEL_LOSSLESS: msg( DETAILS, "Cost function: : Sequence_level_lossless coding\n"); break;
case COST_LOSSLESS_CODING: msg( DETAILS, "Cost function: : Lossless coding with fixed QP of %d\n", LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP); break;
case COST_MIXED_LOSSLESS_LOSSY_CODING: msg( DETAILS, "Cost function: : Mixed_lossless_lossy coding with QP'=%d for lossless evaluation\n", LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME); break;
default: msg( DETAILS, "Cost function: : Unknown\n"); break;
}
msg( DETAILS, "RateControl : %d\n", m_RCEnableRateControl );
msg( DETAILS, "WeightedPredMethod : %d\n", int(m_weightedPredictionMethod));

Karsten Suehring
committed
if(m_RCEnableRateControl)
{
msg( DETAILS, "TargetBitrate : %d\n", m_RCTargetBitrate );
msg( DETAILS, "KeepHierarchicalBit : %d\n", m_RCKeepHierarchicalBit );
msg( DETAILS, "LCULevelRC : %d\n", m_RCLCULevelRC );
msg( DETAILS, "UseLCUSeparateModel : %d\n", m_RCUseLCUSeparateModel );
msg( DETAILS, "InitialQP : %d\n", m_RCInitialQP );
msg( DETAILS, "ForceIntraQP : %d\n", m_RCForceIntraQP );
#if U0132_TARGET_BITS_SATURATION
msg( DETAILS, "CpbSaturation : %d\n", m_RCCpbSaturationEnabled );
if (m_RCCpbSaturationEnabled)
{
msg( DETAILS, "CpbSize : %d\n", m_RCCpbSize);
msg( DETAILS, "InitalCpbFullness : %.2f\n", m_RCInitialCpbFullness);
}
#endif
}
msg( DETAILS, "Max Num Merge Candidates : %d\n", m_maxNumMergeCand );
msg( DETAILS, "Max Num Affine Merge Candidates : %d\n", m_maxNumAffineMergeCand );
#if !JVET_Q0806
#if JVET_Q0798_SPS_NUMBER_MERGE_CANDIDATE
msg(DETAILS, "Max Num Triangle Merge Candidates : %d\n", m_maxNumGeoCand);
#else
msg( DETAILS, "Max Num Triangle Merge Candidates : %d\n", m_maxNumTriangleCand );
#else
msg( DETAILS, "Max Num Geo Merge Candidates : %d\n", m_maxNumGeoCand );
#endif
msg( DETAILS, "Max Num IBC Merge Candidates : %d\n", m_maxNumIBCMergeCand );

Karsten Suehring
committed
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
msg( DETAILS, "\n");
msg( VERBOSE, "TOOL CFG: ");
msg( VERBOSE, "IBD:%d ", ((m_internalBitDepth[CHANNEL_TYPE_LUMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA]) || (m_internalBitDepth[CHANNEL_TYPE_CHROMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA])));
msg( VERBOSE, "HAD:%d ", m_bUseHADME );
msg( VERBOSE, "RDQ:%d ", m_useRDOQ );
msg( VERBOSE, "RDQTS:%d ", m_useRDOQTS );
msg( VERBOSE, "RDpenalty:%d ", m_rdPenalty );
#if SHARP_LUMA_DELTA_QP
msg( VERBOSE, "LQP:%d ", m_lumaLevelToDeltaQPMapping.mode );
#endif
msg( VERBOSE, "SQP:%d ", m_uiDeltaQpRD );
msg( VERBOSE, "ASR:%d ", m_bUseASR );
msg( VERBOSE, "MinSearchWindow:%d ", m_minSearchWindow );
msg( VERBOSE, "RestrictMESampling:%d ", m_bRestrictMESampling );
msg( VERBOSE, "FEN:%d ", int(m_fastInterSearchMode) );
msg( VERBOSE, "ECU:%d ", m_bUseEarlyCU );
msg( VERBOSE, "FDM:%d ", m_useFastDecisionForMerge );
msg( VERBOSE, "CFM:%d ", m_bUseCbfFastMode );
msg( VERBOSE, "ESD:%d ", m_useEarlySkipDetection );
msg( VERBOSE, "TransformSkip:%d ", m_useTransformSkip );
msg( VERBOSE, "TransformSkipFast:%d ", m_useTransformSkipFast );
msg( VERBOSE, "TransformSkipLog2MaxSize:%d ", m_log2MaxTransformSkipBlockSize);
msg(VERBOSE, "ChromaTS:%d ", m_useChromaTS);
msg( VERBOSE, "BDPCM:%d ", m_useBDPCM );
msg( VERBOSE, "Tiles: %dx%d ", m_numTileCols, m_numTileRows );
msg( VERBOSE, "Slices: %d ", m_numSlicesInPic);
msg( VERBOSE, "MCTS:%d ", m_MCTSEncConstraint );

Karsten Suehring
committed
msg( VERBOSE, "SAO:%d ", (m_bUseSAO)?(1):(0));
msg( VERBOSE, "ALF:%d ", m_alf ? 1 : 0 );
#if JVET_Q0795_CCALF
msg( VERBOSE, "CCALF:%d ", m_ccalf ? 1 : 0 );
#endif

Karsten Suehring
committed
msg( VERBOSE, "WPP:%d ", (int)m_useWeightedPred);
msg( VERBOSE, "WPB:%d ", (int)m_useWeightedBiPred);
#if JVET_Q0297_MER
msg( VERBOSE, "PME:%d ", m_log2ParallelMergeLevel);
#endif

Karsten Suehring
committed
const int iWaveFrontSubstreams = m_entropyCodingSyncEnabledFlag ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1;
msg( VERBOSE, " WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_entropyCodingSyncEnabledFlag?1:0, iWaveFrontSubstreams);
msg( VERBOSE, " ScalingList:%d ", m_useScalingListId );
Martin Pettersson
committed
msg( VERBOSE, "TMVPMode:%d ", m_TMVPModeId );

Karsten Suehring
committed
msg( VERBOSE, " DQ:%d ", m_depQuantEnabledFlag);
msg( VERBOSE, " SignBitHidingFlag:%d ", m_signDataHidingEnabledFlag);
msg( VERBOSE, "RecalQP:%d ", m_recalculateQPAccordingToLambda ? 1 : 0 );
{
msg( VERBOSE, "\nTOOL CFG: " );
msg( VERBOSE, "LFNST:%d ", m_LFNST );

Karsten Suehring
committed
msg( VERBOSE, "Affine:%d ", m_Affine );
if ( m_Affine )
{
msg( VERBOSE, "AffineType:%d ", m_AffineType );
}
msg(VERBOSE, "PROF:%d ", m_PROF);

Karsten Suehring
committed
msg(VERBOSE, "SubPuMvp:%d+%d ", m_SubPuMvpMode & 1, (m_SubPuMvpMode & 2) == 2);

Karsten Suehring
committed
msg( VERBOSE, "IMV:%d ", m_ImvMode );