av1encode: reference_frames[2..7] left as surface 0 (memset only covers 8 bytes)
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- c
調査の方向性
encode/av1encode.c の build_pps_buffer() から始め、memset(&(pps->reference_frames), VA_INVALID_ID, 8) の呼び出しを確認してください。reference_frames は VASurfaceID[8] なので、長さは 8 バイトではなく配列全体を覆う必要があります。前後の初期化処理と va_enc_av1.h を読み、未使用のスロットが VA_INVALID_SURFACE でなければならないことを確認してください。その後、再ビルドし、スタブの libva に対して報告者の av1encode -n 4 ... コマンドを再実行して、スロット 2〜7 が 0xffffffff を表示し、スロット 0 は実際の参照を保持し続けることを確認してください。memset が 8 個すべてのエントリを覆い、-Wmemset-elt-size の警告が残っていなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C
- スター
- 244
- フォーク
- 175
- 平均マージ
- 9日 7時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
intel/libva-utils のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
intel/libva-utils#387 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
intel/libva-utils#378 · コメント 6 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
intel/libva-utils#376 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
intel/libva-utils#374 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
intel/libva-utils#366 · コメント 3 件 ·
intel/libva-utils の issue をすべて見る
似ている issue
-
ecs_ptr_from_json does not free the buffer of a string longer than 256 bytes on two error pathsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SanderMertens/flecs#2444 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Cisco-Talos/clamav#1941 ·
メンテナーはふだん 2 日以内に返信
-
Status: Opened
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
espressif/esp-eth-drivers#201 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
libsdl-org/SDL#16788 ·
メンテナーはふだん 1 日以内に返信