@@ -64,6 +64,37 @@ dimensions are even and omitted the last chroma row at 282x173. FMA now uses
6464output and VA image paths. All ten resize frames, including all three odd-height
6565frames, 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+
6798A forced 16 KiB MediaCodec input limit correctly rejects the 147,804-byte,
6899two-packet quantizer sample before submitting an incomplete VP9 frame. Android's
69100VP9 decoder does not accept MediaCodec partial-frame input reliably; the normal
0 commit comments