[BUG] Encoder: a stream that needs a level above the device's maxLevelIdc fails with a generic error instead of "not supported"

Aperta Adatta ai principianti
#276 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
73/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
backend

Direzione di ricerca

Inizia da InitEncoder() nell’esempio Encoder ed esamina il percorso di errore di DetermineLevelTier() e il controllo dell’estensione codificata; l’issue dice che attualmente viene eseguito prima il controllo del livello. Confronta i risultati del rifiuto con quelli di altri controlli delle capacità hardware e verifica che i casi ad alta risoluzione vengano segnalati come non supportati quando si supera il limite del dispositivo. Il lavoro è completato quando il runner segnala N/S per queste configurazioni non supportate invece di FAIL.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Describe the bug

The large resolution tests are failing:

  • For RADV: h264_resolution_too_large
  • For ANV: h264_resolution_too_large and h265_resolution_too_large

When the encoding parameters require a codec level higher than the device's maxLevelIdc (H.264/H.265), the encoder should report the configuration as not supported. It currently reports a generic error.

Every other hardware-capability rejection in InitEncoder() returns a VkResult that IsVideoUnsupportedResult() recognizes. The encoder then exits with VVS_EXIT_UNSUPPORTED (69), and the test runner reports N/S.

The level check does not follow this pattern. When DetermineLevelTier() fails, InitEncoder() returns VK_ERROR_INITIALIZATION_FAILED. The encoder then exits with EXIT_FAILURE (1), and the runner reports FAIL. That treats a hardware limit as if it were an encoder bug.

maxLevelIdc is a hardware capability, just like maxCodedExtent. If a standard level exists for the stream but the device cannot reach it, the device does not support the stream.

A second problem makes this visible. The level check runs before the coded-extent check. When an input exceeds both limits, the generic level error hides the more specific "exceeds hardware maximum" rejection.

Setup

  • OS: Ubuntu 24.04.4 LTS
  • GPU: AMD Radeon RX 7600 (RADV NAVI33)
  • Driver Version: radv Mesa 27.0.0-devel (git-bb7494e71c)
  • Sample Application: Encoder
  • Sample Application Version: 0.5.2

Expected Behavior

  • If the stream needs a level above the device's maxLevelIdc, the encoder rejects it as not supported. It exits with 69, and the runner reports N/S.

Observed Behavior

RADV, H.264, 7680x4320:

H.264 Encoder Capabilities
  maxLevelIdc                                     : 15
...
Failed to determine a suitable level for the given encoding parameters

ERROR: InitEncoder() failed with ret(-3)
Can't create the video encoder!

Steps to Reproduce

$VVS_DIR/build/vk_video_encoder/demos/vk-video-enc-test -i $VVS_DIR/tests/resources/video/yuv/7680x4320_420_8le.yuv --codec h264 --inputWidth 7680 --inputHeight 4320 --inputNumPlanes 3 --verbose --logLevel 4 --noDeviceFallback -o $VVS_DIR/tests/results/test_output_h264_resolution_too_large.264

Additional information

  • In the case of H.264 tested with RADV, the large resolution test (7680x4320) requires levelIdc 6.0. The encoder capabilities for H.264 report maxLevelIdc is 5.2.
  • For the failing tests, the resolution is above the maxCodedExtent.
Device Codec maxLevelIdc maxCodedExtent
RADV NAVI33 H.264 5.2 4096 x 4096
RADV NAVI33 H.265 (8K passes) 8192 x 4352
ANV Arc A750 H.264 5.1 4096 x 4096
ANV Arc A750 H.265 5.1 4096 x 4096
Lingua principale
C++
Stelle
44
Fork
20
Merge medio
6g 11h
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di KhronosGroup/Vulkan-Video-Samples

Tutte le issue di KhronosGroup/Vulkan-Video-Samples

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.