[VDPAU] [PATCH 1/2] Add tracing for VP9 picture info

ManojGuptaBonda mbonda at nvidia.com
Tue Jul 28 06:26:33 UTC 2020


---
 trace/vdpau_trace.cpp | 154 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 154 insertions(+)

diff --git a/trace/vdpau_trace.cpp b/trace/vdpau_trace.cpp
index 11e227c..3479e05 100644
--- a/trace/vdpau_trace.cpp
+++ b/trace/vdpau_trace.cpp
@@ -722,6 +722,160 @@ static void _vdp_cap_dump_picture_info(
             fputs("}}", _vdp_cap_data.fp);
         }
         break;
+    case VDP_DECODER_PROFILE_VP9_PROFILE_0:
+    case VDP_DECODER_PROFILE_VP9_PROFILE_1:
+    case VDP_DECODER_PROFILE_VP9_PROFILE_2:
+    case VDP_DECODER_PROFILE_VP9_PROFILE_3:
+        {
+            VdpPictureInfoVP9 const * picture_info_vp9 =
+                (VdpPictureInfoVP9 const *)picture_info;
+
+            fprintf(
+                _vdp_cap_data.fp,
+                "{%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u {",
+                (uint32_t)picture_info_vp9->width,
+                (uint32_t)picture_info_vp9->height,
+                picture_info_vp9->lastReference,
+                picture_info_vp9->goldenReference,
+                picture_info_vp9->altReference,
+                (uint32_t)picture_info_vp9->colorSpace,
+                (uint32_t)picture_info_vp9->profile,
+                (uint32_t)picture_info_vp9->frameContextIdx,
+                (uint32_t)picture_info_vp9->keyFrame,
+                (uint32_t)picture_info_vp9->showFrame,
+                (uint32_t)picture_info_vp9->errorResilient,
+                (uint32_t)picture_info_vp9->frameParallelDecoding,
+                (uint32_t)picture_info_vp9->subSamplingX,
+                (uint32_t)picture_info_vp9->subSamplingY,
+                (uint32_t)picture_info_vp9->intraOnly,
+                (uint32_t)picture_info_vp9->allowHighPrecisionMv,
+                (uint32_t)picture_info_vp9->refreshEntropyProbs
+            );
+            for (uint32_t i = 0; i < _VDP_TRACE_ARSIZE(picture_info_vp9->refFrameSignBias); ++i) {
+                fprintf(
+                    _vdp_cap_data.fp,
+                    "%s%u",
+                    (i == 0) ? "" : ", ",
+                    (uint32_t)picture_info_vp9->refFrameSignBias[i]
+                );
+            }
+            fputs("}, ", _vdp_cap_data.fp);
+            fprintf(
+                _vdp_cap_data.fp,
+                "%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, {",
+                (uint32_t)picture_info_vp9->bitDepthMinus8Luma,
+                (uint32_t)picture_info_vp9->bitDepthMinus8Chroma,
+                (uint32_t)picture_info_vp9->loopFilterLevel,
+                (uint32_t)picture_info_vp9->loopFilterSharpness,
+                (uint32_t)picture_info_vp9->modeRefLfEnabled,
+                (uint32_t)picture_info_vp9->log2TileColumns,
+                (uint32_t)picture_info_vp9->log2TileRows,
+                (uint32_t)picture_info_vp9->segmentEnabled,
+                (uint32_t)picture_info_vp9->segmentMapUpdate,
+                (uint32_t)picture_info_vp9->segmentMapTemporalUpdate,
+                (uint32_t)picture_info_vp9->segmentFeatureMode
+            );
+           for (uint32_t i = 0; i < _VDP_TRACE_ARSIZE(picture_info_vp9->segmentFeatureEnable); ++i) {
+                fputs((i == 0) ? "{" : "}, {", _vdp_cap_data.fp);
+                for (uint32_t j = 0; j < _VDP_TRACE_ARSIZE(picture_info_vp9->segmentFeatureEnable[0]); ++j) {
+                    fprintf(
+                        _vdp_cap_data.fp,
+                        "%s%u",
+                        (j == 0) ? "" : ", ",
+                        (uint32_t)picture_info_vp9->segmentFeatureEnable[i][j]
+                    );
+                }
+            }
+            fputs("}}, {", _vdp_cap_data.fp);
+            for (uint32_t i = 0; i < _VDP_TRACE_ARSIZE(picture_info_vp9->segmentFeatureData); ++i) {
+                fputs((i == 0) ? "{" : "}, {", _vdp_cap_data.fp);
+                for (uint32_t j = 0; j < _VDP_TRACE_ARSIZE(picture_info_vp9->segmentFeatureData[0]); ++j) {
+                    fprintf(
+                        _vdp_cap_data.fp,
+                        "%s%d",
+                        (j == 0) ? "" : ", ",
+                        (int32_t)picture_info_vp9->segmentFeatureData[i][j]
+                    );
+                }
+            }
+            fputs("}}, {", _vdp_cap_data.fp);
+            for (uint32_t i = 0; i < _VDP_TRACE_ARSIZE(picture_info_vp9->mbSegmentTreeProbs); ++i) {
+                fprintf(
+                    _vdp_cap_data.fp,
+                    "%s%u",
+                    (i == 0) ? "" : ", ",
+                    (uint32_t)picture_info_vp9->mbSegmentTreeProbs[i]
+                );
+            }
+            fputs("}, {", _vdp_cap_data.fp);
+            for (uint32_t i = 0; i < _VDP_TRACE_ARSIZE(picture_info_vp9->segmentPredProbs); ++i) {
+                fprintf(
+                    _vdp_cap_data.fp,
+                    "%s%u",
+                    (i == 0) ? "" : ", ",
+                    (uint32_t)picture_info_vp9->segmentPredProbs[i]
+                );
+            }
+            fputs("}, {", _vdp_cap_data.fp);
+            for (uint32_t i = 0; i < _VDP_TRACE_ARSIZE(picture_info_vp9->reservedSegment16Bits); ++i) {
+                fprintf(
+                    _vdp_cap_data.fp,
+                    "%s%u",
+                    (i == 0) ? "" : ", ",
+                    (uint32_t)picture_info_vp9->reservedSegment16Bits[i]
+                );
+            }
+            fputs("}, ", _vdp_cap_data.fp);
+            fprintf(
+                _vdp_cap_data.fp,
+                "%d, %d, %d, %d, {",
+                (int32_t)picture_info_vp9->qpYAc,
+                (int32_t)picture_info_vp9->qpYDc,
+                (int32_t)picture_info_vp9->qpChDc,
+                (int32_t)picture_info_vp9->qpChAc
+            );
+            for (uint32_t i = 0; i < _VDP_TRACE_ARSIZE(picture_info_vp9->activeRefIdx); ++i) {
+                fprintf(
+                    _vdp_cap_data.fp,
+                    "%s%u",
+                    (i == 0) ? "" : ", ",
+                    (uint32_t)picture_info_vp9->activeRefIdx[i]
+                );
+            }
+            fputs("}, ", _vdp_cap_data.fp);
+            fprintf(
+                _vdp_cap_data.fp,
+                "%u, %u, {",
+                (uint32_t)picture_info_vp9->resetFrameContext,
+                (uint32_t)picture_info_vp9->mcompFilterType
+            );
+            for (uint32_t i = 0; i < _VDP_TRACE_ARSIZE(picture_info_vp9->mbRefLfDelta); ++i) {
+                fprintf(
+                    _vdp_cap_data.fp,
+                    "%s%u",
+                    (i == 0) ? "" : ", ",
+                    (uint32_t)picture_info_vp9->mbRefLfDelta[i]
+                );
+            }
+            fputs("}, {", _vdp_cap_data.fp);
+            for (uint32_t i = 0; i < _VDP_TRACE_ARSIZE(picture_info_vp9->mbModeLfDelta); ++i) {
+                fprintf(
+                    _vdp_cap_data.fp,
+                    "%s%d",
+                    (i == 0) ? "" : ", ",
+                    (int32_t)picture_info_vp9->mbModeLfDelta[i]
+                );
+            }
+            fputs("}, ", _vdp_cap_data.fp);
+            fprintf(
+                _vdp_cap_data.fp,
+                "%u, %u, {",
+                (uint32_t)picture_info_vp9->uncompressedHeaderSize,
+                (uint32_t)picture_info_vp9->compressedHeaderSize
+            );
+            fputs("}", _vdp_cap_data.fp);
+        }
+        break;
     default:
         fputs("{...}", _vdp_cap_data.fp);
         break;
-- 
2.17.1



More information about the VDPAU mailing list