Skip to content

Commit b20b786

Browse files
jeffreymcallisterThaddeus Letnes
authored andcommitted
Fix AV1 temporal layers in SMT (#479)
1 parent 80b808f commit b20b786

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

tools/legacy/sample_multi_transcode/include/pipeline_transcode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ struct __sInputParams {
337337
mfxU16 nBaseLayerPID;
338338
mfxU16 nAvcTemporalLayers[8];
339339
#if defined(_WIN32) || defined(_WIN64)
340-
mfxU16 nTemp;
341-
mfxU16 nTemporalLayers[8];
340+
mfxU16 bTemporalLayers;
341+
mfxTemporalLayer temporalLayers[8];
342342
#endif
343343
mfxU16 nSPSId;
344344
mfxU16 nPPSId;

tools/legacy/sample_multi_transcode/src/pipeline_transcode.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2755,19 +2755,12 @@ mfxStatus CTranscodingPipeline::InitEncMfxParams(sInputParams* pInParams) {
27552755
}
27562756
}
27572757
#if defined(_WIN32) || defined(_WIN64)
2758-
if (pInParams->nTemp) {
2758+
if (pInParams->bTemporalLayers) {
27592759
if (pInParams->EncodeId == MFX_CODEC_AV1) {
27602760
auto tl = m_mfxEncParams.AddExtBuffer<mfxExtTemporalLayers>();
27612761
tl->BaseLayerPID = pInParams->nBaseLayerPID;
27622762
tl->NumLayers = 8;
2763-
std::vector<mfxTemporalLayer> tmplayers;
2764-
tmplayers.reserve(8);
2765-
tl->Layers = &tmplayers[0];
2766-
2767-
for (int i = 0; i < 8; i++) {
2768-
tl->Layers[i] = {};
2769-
tl->Layers[i].FrameRateScale = pInParams->nTemporalLayers[i];
2770-
}
2763+
tl->Layers = pInParams->temporalLayers;
27712764
}
27722765
}
27732766
#endif

tools/legacy/sample_multi_transcode/src/transcode_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@ mfxStatus ParseAdditionalParams(msdk_char* argv[],
13671367
}
13681368
#if defined(_WIN32) || defined(_WIN64)
13691369
else if (0 == msdk_strcmp(argv[i], MSDK_STRING("-TemporalLayers"))) {
1370-
InputParams.nTemp = 1;
1370+
InputParams.bTemporalLayers = true;
13711371
VAL_CHECK(i + 1 >= argc, i, argv[i]);
13721372
mfxU16 arr[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
13731373
int j, k;
@@ -1387,7 +1387,7 @@ mfxStatus ParseAdditionalParams(msdk_char* argv[],
13871387
}
13881388

13891389
for (j = 0; j < 8; j++) {
1390-
InputParams.nTemporalLayers[j] = arr[j];
1390+
InputParams.temporalLayers[j].FrameRateScale = arr[j];
13911391
}
13921392
i += 1;
13931393
}

0 commit comments

Comments
 (0)