Commit 3ef4fd1
committed
decoder: Fix AV1 encoder crash with B-frames (show existing frame handling)
When encoding AV1 with B-frames (consecutiveBFrameCount > 0), the
encoder creates "show existing frame" P-frames that display previously
encoded frames. These frames have bShowExistingFrame=true.
The issue was in ProcessDpb():
- frameEncodeEncodeOrderNum is only assigned in StartOfVideoCodingEncodeOrder
when bShowExistingFrame=false
- ProcessDpb called InvalidateStaleReferenceFrames() with the uninitialized
frameEncodeEncodeOrderNum (UINT64_MAX) before checking bShowExistingFrame
- This triggered the assertion: frameEncodeEncodeOrderNum <= UINT32_MAX
Fix: Move the bShowExistingFrame early return check before the assertion
and InvalidateStaleReferenceFrames() call. Show existing frames don't need
stale reference invalidation since they don't encode a new frame.
Command line that triggered this crash:
vk-video-enc-test -i input.yuv -c av1 --inputWidth 352 --inputHeight 288 \
--inputChromaSubsampling 420 --numFrames 30 -o output.ivf \
--gopFrameCount 16 --consecutiveBFrameCount 3
This fixes the AV1_gop_16_b3 encoder test.
Signed-off-by: Tony Zlatinski <tzlatinski@nvidia.com>1 parent 5d0059e commit 3ef4fd1
1 file changed
+8
-3
lines changedLines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
234 | 234 | | |
| 235 | + | |
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| |||
240 | 241 | | |
241 | 242 | | |
242 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
243 | 248 | | |
244 | 249 | | |
245 | 250 | | |
| |||
0 commit comments