Skip to content

Commit

Permalink
Fix AV1 temporal layers in SMT (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreymcallister authored and tletnes committed Jul 22, 2022
1 parent 80b808f commit b20b786
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ struct __sInputParams {
mfxU16 nBaseLayerPID;
mfxU16 nAvcTemporalLayers[8];
#if defined(_WIN32) || defined(_WIN64)
mfxU16 nTemp;
mfxU16 nTemporalLayers[8];
mfxU16 bTemporalLayers;
mfxTemporalLayer temporalLayers[8];
#endif
mfxU16 nSPSId;
mfxU16 nPPSId;
Expand Down
11 changes: 2 additions & 9 deletions tools/legacy/sample_multi_transcode/src/pipeline_transcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2755,19 +2755,12 @@ mfxStatus CTranscodingPipeline::InitEncMfxParams(sInputParams* pInParams) {
}
}
#if defined(_WIN32) || defined(_WIN64)
if (pInParams->nTemp) {
if (pInParams->bTemporalLayers) {
if (pInParams->EncodeId == MFX_CODEC_AV1) {
auto tl = m_mfxEncParams.AddExtBuffer<mfxExtTemporalLayers>();
tl->BaseLayerPID = pInParams->nBaseLayerPID;
tl->NumLayers = 8;
std::vector<mfxTemporalLayer> tmplayers;
tmplayers.reserve(8);
tl->Layers = &tmplayers[0];

for (int i = 0; i < 8; i++) {
tl->Layers[i] = {};
tl->Layers[i].FrameRateScale = pInParams->nTemporalLayers[i];
}
tl->Layers = pInParams->temporalLayers;
}
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions tools/legacy/sample_multi_transcode/src/transcode_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ mfxStatus ParseAdditionalParams(msdk_char* argv[],
}
#if defined(_WIN32) || defined(_WIN64)
else if (0 == msdk_strcmp(argv[i], MSDK_STRING("-TemporalLayers"))) {
InputParams.nTemp = 1;
InputParams.bTemporalLayers = true;
VAL_CHECK(i + 1 >= argc, i, argv[i]);
mfxU16 arr[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
int j, k;
Expand All @@ -1387,7 +1387,7 @@ mfxStatus ParseAdditionalParams(msdk_char* argv[],
}

for (j = 0; j < 8; j++) {
InputParams.nTemporalLayers[j] = arr[j];
InputParams.temporalLayers[j].FrameRateScale = arr[j];
}
i += 1;
}
Expand Down

0 comments on commit b20b786

Please sign in to comment.