nvpro-samples / vk_video_samples

Vulkan video samples
Apache License 2.0
252 stars 41 forks source link

AV1 decode: fix reference frame order hint array #74

Closed fhvwy closed 1 week ago

fhvwy commented 6 months ago

The code here is intended to implement this logic from the AV1 specification section 5.9.2:

for ( i = 0; i < REFS_PER_FRAME; i++ ) {
    refFrame = LAST_FRAME + i
    hint = RefOrderHint[ ref_frame_idx[ i ] ]
    OrderHints[ refFrame ] = hint
}

Fix the indexing so that the OrderHints array is set exactly as the specification states rather than offset by one element. (The offset was propagating into incorrect values for the SavedOrderHints element for reference frames.)

zlatinski commented 5 months ago

Thank you, Mark! We agree with your findings and will be working on fixing this in the CTS and the drivers before fixing the sample app.