Repository navigation
media: apple: prores: fix 1-byte shift in v1 frame header colour offsets - #3713
RyanTheTide merged 1 commit into
Conversation
In apr_build_desc() (v1 descriptor), D_FH_PRIMARIES..D_FH_ALPHA were defined at 0x089..0x08c, omitting the SMPTE RDD 36 aspect/frame-rate byte at 0x089 (which apr_build_desc_v0() leaves at 0x065 and apr_parse_frame() skips at header[13]). As a result, v1 hardware encodes on T6050 (J714s M5 Pro) signalled frame-rate code 1 (23.976 fps) at header[13] and wrote the constant alpha byte (0) into the matrix slot at header[16], causing decoders/ffprobe to report color_space=gbr. Shift D_FH_PRIMARIES..D_FH_ALPHA up by one byte to 0x08a..0x08d so 0x089 stays zero (unspecified aspect/rate), matching SMPTE RDD 36 and apr_build_desc_v0(). Update the KUnit test to use distinct colour codes (1, 16, 9) and assert every byte from format (0x88) through flags (0x8f). Signed-off-by: vlad <[email protected]>
|
Hardware encode row from Encode:
The picture is unchanged. A raw NV16 round trip (30 frames, 1080p) gives 65.9 dB with the software decoder and 65.6 dB with I did not run the KUnit test. |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
Additional hardware encode row from
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
The v1 descriptor now places primaries, transfer, matrix and alpha after the reserved byte. The new distinct test values catch the offset error, and the v0 layout is unchanged. The exact-head J614s and J714s encodes both confirm the corrected header. The hosted ProRes KUnit check still needs a result.
|
Merging at |
What: Fix a 1-byte shift in the v1 ProRes encode descriptor's frame-header colour offsets (
D_FH_PRIMARIES..D_FH_ALPHAindrivers/media/platform/apple/prores/apple-prores-desc.c) and update the KUnit descriptor test to check distinct colour codes (1/16/9) across0x88..0x8f.Tested:
apple,j714s/apple,t6050, firmware27.2,linux-aurora 7.3.0-17.v272-24-ARCH): 1920x1080 4:2:2 hardware encode wroteheader[12..19] = 80 01 01 01 00 00 00 03, shiftingprimariesinto the SMPTE RDD 36 aspect/frame-rate byte (header[13]) andalpha = 0intomatrix(header[16]), soffprobereportedcolor_space=gbr.2a7359b5d916by @e-fu on a 14-inch MacBook Pro M4 Pro (apple,j614s/apple,t6040, firmware27.2, v1 ProRes id0x40008):header[12..18]changed from80 01 01 01 00 00 00(gbr / bt709 / bt709) to80 00 01 01 01 00 00(bt709 / bt709 / bt709), 83.6 dB HW vs SW decode, 65.9 dB round trip.Risk: two-way door · all Macs using
apr_build_desc()(v1 ProRes engines: T6041, T8132, T6050, T8140, T8142); T6000 (apr_build_desc_v0()) is untouched.Not yet: CI KUnit run (
proressuite).Details and evidence
Root cause
apr_build_desc()definedD_FH_PRIMARIES..D_FH_ALPHAat0x089..0x08c, omitting the SMPTE RDD 36 aspect/frame-rate byte at0x089thatapr_build_desc_v0()documents at0x065(+0x24base shift from0x058to0x07c) andapr_parse_frame()skips atheader[13].header[i]base 0x058)v0 + 0x24)[12]0x0640x0880x088[13]0x0650x089[14]0x0660x08a0x089[15]0x0670x08b0x08a[16]0x0680x08c0x08b[17]0x0690x08d0x08c[19]0x06b0x08f0x08fObserved unpatched J714s hardware encode (
od -A d -t x1 -N 32):header[13..16]is01 01 01 00(primaries=1, transfer=1, matrix=1, alpha=0shifted left by 1 byte). The existing KUnit test masked the shift becauseapr_test_frame()setprimaries = transfer = matrix = 1.