* rocDecode/Perf: Improved the accuracy of decode performance measurement for the performance sample. We need to wait for the decode completion of the last picture before sampling the end time. (#425)

Bu işleme şunda yer alıyor:
jeffqjiangNew
2024-09-25 21:27:49 -04:00
işlemeyi yapan: GitHub
ebeveyn 0ba9992247
işleme 7ef4e29262
3 değiştirilmiş dosya ile 21 ekleme ve 3 silme
+9
Dosyayı Görüntüle
@@ -643,6 +643,7 @@ int RocVideoDecoder::HandlePictureDecode(RocdecPicParams *pPicParams) {
}
pic_num_in_dec_order_[pPicParams->curr_pic_idx] = decode_poc_++;
ROCDEC_API_CALL(rocDecDecodeFrame(roc_decoder_, pPicParams));
last_decode_surf_idx_ = pPicParams->curr_pic_idx;
decoded_pic_cnt_++;
if (b_force_zero_latency_ && ((!pPicParams->field_pic_flag) || (pPicParams->second_field))) {
RocdecParserDispInfo disp_info;
@@ -1189,3 +1190,11 @@ bool RocVideoDecoder::CodecSupported(int device_id, rocDecVideoCodec codec_id, u
}
return true;
}
void RocVideoDecoder::WaitForDecodeCompletion() {
RocdecDecodeStatus dec_status;
memset(&dec_status, 0, sizeof(dec_status));
do {
rocDecStatus result = rocDecGetDecodeStatus(roc_decoder_, last_decode_surf_idx_, &dec_status);
} while (dec_status.decode_status == rocDecodeStatus_InProgress);
}