Skip to content

Commit 106e505

Browse files
docs: record direct VP9 resize validation
1 parent a527eb0 commit 106e505

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

docs/applications.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ three plane checksums. Both application paths are exact:
213213
The VP9 result includes the final chroma row at the odd 173-line height. The
214214
visible NV12 contract is `width * height + 2 * ceil(width/2) *
215215
ceil(height/2)`, rather than the even-dimension shortcut `width * height *
216-
3/2`.
216+
3/2`. Decode surfaces are realigned to the retained MediaCodec allocation when
217+
FFmpeg recreates a smaller VA context, so all ten outputs now remain direct;
218+
the three realignments cost 3.271 ms total in the app-domain probe.
217219

218220
Use the application-level verifier with a full FFmpeg build that includes the
219221
`showinfo` filter:

docs/vp9.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,37 @@ dimensions are even and omitted the last chroma row at 282x173. FMA now uses
6464
output and VA image paths. All ten resize frames, including all three odd-height
6565
frames, now match FFmpeg software decode byte for byte.
6666

67+
FFmpeg recreates its VA context and surfaces at both size transitions while
68+
FMA deliberately retains the larger stateful MediaCodec session. Initially the
69+
three 282x173 surfaces used their smaller 320x176 allocation and could not be
70+
registered as direct outputs for the retained 384x288 decoder pool. FMA now
71+
realigns a newly used VA surface to the active decoder pool in `vaBeginPicture`.
72+
Visible dimensions remain 282x173, but MediaCodec can write directly into every
73+
surface.
74+
75+
| Dynamic-resize measurement | Before realignment | After realignment |
76+
| --- | ---: | ---: |
77+
| Exact frames | 10/10 | 10/10 |
78+
| Direct surfaces | 7/10 | 10/10 |
79+
| Driver surface-store copy | 0.209 MiB | 0 MiB |
80+
| Surface-reallocation cost | n/a | 3.271 ms total |
81+
82+
```mermaid
83+
xychart-beta
84+
title "VP9 dynamic-resize direct surfaces"
85+
x-axis ["Before", "After"]
86+
y-axis "Direct frames" 0 --> 10
87+
bar [7, 10]
88+
```
89+
90+
This result was reproduced through the real uDroid supervisor and app SELinux
91+
domain on a Pixel 6a. The 147,804-byte quantizer vector also remained exact and
92+
direct for both frames, and a 50-frame Gravity H.264 run remained 50/50 exact
93+
and direct after the shared allocation change. No decoded frame bytes crossed
94+
the Unix socket in these probes. MediaCodec still copies `AImage` output into
95+
the registered DMA-BUF; eliminating that Android-side copy is a separate
96+
AHardwareBuffer checkpoint.
97+
6798
A forced 16 KiB MediaCodec input limit correctly rejects the 147,804-byte,
6899
two-packet quantizer sample before submitting an incomplete VP9 frame. Android's
69100
VP9 decoder does not accept MediaCodec partial-frame input reliably; the normal

0 commit comments

Comments
 (0)