Changeset 108358 in vbox
- Timestamp:
- Feb 24, 2025 4:36:40 PM (8 weeks ago)
- svn:sync-xref-src-repo-rev:
- 167718
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/dxvk-2.3.1/src/dxvk/dxvk_video_decoder.cpp
r108315 r108358 769 769 770 770 /* Reference pictures and the destination slot to be bound for video decoding. */ 771 std::vector<VkVideoDecodeH264DpbSlotInfoKHR> h264DpbSlotInfo(maxRefSlotsCount + 1); 771 772 std::vector<VkVideoPictureResourceInfoKHR> pictureResourceInfo(maxRefSlotsCount + 1); 772 773 std::vector<VkVideoReferenceSlotInfoKHR> referenceSlotsInfo(maxRefSlotsCount + 1); … … 787 788 continue; 788 789 } 790 791 h264DpbSlotInfo[refSlotsCount] = 792 { VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_KHR }; 793 h264DpbSlotInfo[refSlotsCount].pStdReferenceInfo = &m_DPB.slots[dpbSlotIndex].stdRefInfo; 789 794 790 795 pictureResourceInfo[refSlotsCount] = … … 796 801 797 802 referenceSlotsInfo[refSlotsCount] = 798 { VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR };803 { VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, &h264DpbSlotInfo[refSlotsCount] }; 799 804 referenceSlotsInfo[refSlotsCount].slotIndex = dpbSlotIndex; 800 805 referenceSlotsInfo[refSlotsCount].pPictureResource = &pictureResourceInfo[refSlotsCount]; … … 804 809 805 810 /* Destination picture. */ 811 h264DpbSlotInfo[refSlotsCount] = 812 { VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_KHR }; 813 h264DpbSlotInfo[refSlotsCount].pStdReferenceInfo = &dstDPBSlot.stdRefInfo; 814 806 815 pictureResourceInfo[refSlotsCount] = 807 816 { VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR }; … … 809 818 pictureResourceInfo[refSlotsCount].codedExtent = { m_sampleWidth, m_sampleHeight }; 810 819 pictureResourceInfo[refSlotsCount].baseArrayLayer = 0; /* "relative to the image subresource range" of the view */ 811 pictureResourceInfo[refSlotsCount].imageViewBinding = m_DPB.slots[dstSlotIndex].imageView->handle();820 pictureResourceInfo[refSlotsCount].imageViewBinding = dstDPBSlot.imageView->handle(); 812 821 813 822 referenceSlotsInfo[refSlotsCount] = 814 { VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR };823 { VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, &h264DpbSlotInfo[refSlotsCount] }; 815 824 referenceSlotsInfo[refSlotsCount].slotIndex = -1; 816 825 referenceSlotsInfo[refSlotsCount].pPictureResource = &pictureResourceInfo[refSlotsCount]; … … 851 860 852 861 /* 853 * Setup "active reference pictures."854 */855 /* Reuse first refFramesCount elements in pictureResourceInfo and referenceSlotsInfo.856 * Add h264DpbSlotInfo to referenceSlotsInfo.857 */858 /* VkVideoReferenceSlotInfoKHR refSlotInfo[idxRefSlot].pNext */859 std::vector<VkVideoDecodeH264DpbSlotInfoKHR> h264DpbSlotInfo(refSlotsCount);860 861 for (uint32_t i = 0; i < refSlotsCount; ++i) {862 const DxvkRefFrameInfo& r = parms.refFrames[i];863 864 StdVideoDecodeH264ReferenceInfo& stdRefInfo = m_DPB.slots[referenceSlotsInfo[i].slotIndex].stdRefInfo;865 866 h264DpbSlotInfo[i] =867 { VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_KHR };868 h264DpbSlotInfo[i].pStdReferenceInfo = &stdRefInfo;869 870 referenceSlotsInfo[i].pNext = &h264DpbSlotInfo[i];871 }872 873 /*874 862 * Setup video decoding parameters 'decodeInfo' (VkVideoDecodeInfoKHR). 875 */ 863 * 864 * Reuse first refFramesCount elements in referenceSlotsInfo as pReferenceSlots for decodeVideo. 865 * The last element is the destination picture for pSetupReferenceSlot. 866 */ 867 868 /* Update the destination DPB slot index. It was set to -1 for beginVideoCoding above. */ 869 referenceSlotsInfo[refSlotsCount].slotIndex = dstSlotIndex; 870 876 871 /* VkVideoDecodeInfoKHR decodeInfo.pNext */ 877 872 VkVideoDecodeH264PictureInfoKHR h264PictureInfo = … … 880 875 h264PictureInfo.sliceCount = parms.sliceOffsets.size(); 881 876 h264PictureInfo.pSliceOffsets = parms.sliceOffsets.data(); 882 883 /* VkVideoReferenceSlotInfoKHR dstSlotInfo.pNext */884 VkVideoDecodeH264DpbSlotInfoKHR dstH264DpbSlotInfo =885 { VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_KHR };886 dstH264DpbSlotInfo.pStdReferenceInfo = &dstDPBSlot.stdRefInfo;887 888 /* VkVideoReferenceSlotInfoKHR dstSlotInfo.pPictureResource */889 VkVideoPictureResourceInfoKHR dstPictureResourceInfo =890 { VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR };891 dstPictureResourceInfo.codedOffset = { 0, 0 };892 dstPictureResourceInfo.codedExtent = { m_sampleWidth, m_sampleHeight };893 dstPictureResourceInfo.baseArrayLayer = 0; /* "relative to the image subresource range" of the view */894 dstPictureResourceInfo.imageViewBinding = dstDPBSlot.imageView->handle();895 896 /* VkVideoDecodeInfoKHR decodeInfo.pSetupReferenceSlot */897 VkVideoReferenceSlotInfoKHR dstSlotInfo =898 { VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, &dstH264DpbSlotInfo };899 dstSlotInfo.slotIndex = dstSlotIndex;900 dstSlotInfo.pPictureResource = &dstPictureResourceInfo;901 877 902 878 VkVideoDecodeInfoKHR decodeInfo = … … 920 896 decodeInfo.dstPictureResource.imageViewBinding = dstDPBSlot.imageView->handle(); 921 897 } 922 decodeInfo.pSetupReferenceSlot = & dstSlotInfo;898 decodeInfo.pSetupReferenceSlot = &referenceSlotsInfo[refSlotsCount]; 923 899 decodeInfo.referenceSlotCount = refSlotsCount; 924 900 decodeInfo.pReferenceSlots = referenceSlotsInfo.data(); … … 932 908 ", view=", s.pPictureResource->imageViewBinding)); 933 909 } 934 Logger::info(str::format("VREF: dst: slotIndex=", dstSlotIn fo.slotIndex,935 ", FrameNum=", dst H264DpbSlotInfo.pStdReferenceInfo->FrameNum,910 Logger::info(str::format("VREF: dst: slotIndex=", dstSlotIndex, 911 ", FrameNum=", dstDPBSlot.stdRefInfo.FrameNum, 936 912 ", is_ref=", parms.stdH264PictureInfo.flags.is_reference, 937 ", view=", dst SlotInfo.pPictureResource->imageViewBinding));913 ", view=", dstDPBSlot.imageView->handle())); 938 914 #endif 939 915
Note:
See TracChangeset
for help on using the changeset viewer.