av1encode: reference_frames[2..7] left as surface 0 (memset only covers 8 bytes)
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- c
- Ambito
- audio-video-rtc
Direzione di ricerca
Inizia da build_pps_buffer() in encode/av1encode.c e guarda la chiamata memset(&(pps->reference_frames), VA_INVALID_ID, 8): reference_frames è un VASurfaceID[8], quindi la lunghezza dovrebbe coprire l'intero array e non 8 byte. Leggi l'inizializzazione circostante e va_enc_av1.h per confermare che gli slot non usati devono essere VA_INVALID_SURFACE. Poi ricompila e riesegui il comando av1encode -n 4 ... del segnalatore con una libva stub, per verificare che gli slot 2-7 stampino 0xffffffff mentre lo slot 0 conserva ancora il riferimento reale. È completato quando il memset copre tutte e otto le voci e non resta alcun avviso -Wmemset-elt-size.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
build_pps_buffer() in encode/av1encode.c initializes the reference list with
memset(&(pps->reference_frames), VA_INVALID_ID, 8);
reference_frames is VASurfaceID[8], i.e. 32 bytes, so this only sets entries 0 and 1 to 0xffffffff. The caller zeroes the whole struct first, so entries 2–7 stay 0. Surface ID 0 is a real surface: it is src_surface[0], the first surface av1encode creates. GCC 15 also warns about it (-Wmemset-elt-size).
So every frame tells the driver that the first input surface is a reference in slots 2–7. va_enc_av1.h says unused entries must not point to a picture. iHD's AV1 DDI calls UpdateRegisteredRTSurfaceFlag() for every entry that is not VA_INVALID_SURFACE, then SetupCodecPicture() for all eight. So it registers that input surface as a reference render target on every frame and puts it in RefFrameList[2..7]. iHD numbers surfaces from 0 in a new context.
How I checked: I built av1encode against a small stub libva that prints reference_frames from each VAEncPictureParameterBufferType buffer. Then I ran av1encode -n 4 -f 30 --width 64 --height 64 --intra_period 8 --ip_period 1 -o out.ivf:
frame 0 type 0 reference_frames: 0xffffffff 0xffffffff 0 0 0 0 0 0
frame 1 type 1 reference_frames: 0x10 0xffffffff 0 0 0 0 0 0
frame 2 type 1 reference_frames: 0x11 0xffffffff 0 0 0 0 0 0
frame 3 type 1 reference_frames: 0x12 0xffffffff 0 0 0 0 0 0
Setting all eight entries to VA_INVALID_SURFACE gives 0xffffffff in slots 2–7, and slot 0 keeps the real reference. I don't have an Intel GPU here, so I haven't checked whether this changes the encoded stream on real hardware.
- Lingua principale
- C
- Stelle
- 244
- Fork
- 175
- Merge medio
- 9g 7h
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di intel/libva-utils
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
intel/libva-utils#387 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
intel/libva-utils#378 · 6 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
intel/libva-utils#376 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
intel/libva-utils#374 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
intel/libva-utils#366 · 3 commenti ·
Tutte le issue di intel/libva-utils
Issue simili
-
ecs_ptr_from_json does not free the buffer of a string longer than 256 bytes on two error pathsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SanderMertens/flecs#2444 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Cisco-Talos/clamav#1941 ·
I maintainer di solito rispondono entro 2 giorni
-
Status: Opened
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
espressif/esp-eth-drivers#201 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100
libsdl-org/SDL#16788 ·
I maintainer di solito rispondono entro 1 giorno