Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEI UserDataUnregistered payloadSize appears incorrect #152

Open
bradh opened this issue Nov 9, 2024 · 0 comments
Open

SEI UserDataUnregistered payloadSize appears incorrect #152

bradh opened this issue Nov 9, 2024 · 0 comments

Comments

@bradh
Copy link

bradh commented Nov 9, 2024

I'm trying to parse out a bitstream from xeve (git master branch).

Here is the SEI NAL unit from that. The part up to and including 05 looks
OK, but then the long string of FF indicates a lot of SEI data (9872 bytes) - more than
the length of the NALU (1276 bytes).

Note: The derivation for 9872 is 38 * 0xFF + 0xB6, or 38 * 255 + 182.

0000:0020 |       00 00  04 FC 3A 00  05 FF FF FF  FF FF FF FF |   ...ü:..ÿÿÿÿÿÿÿ
0000:0030 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:0040 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF B6 | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶
0000:0050 | 2C A2 DE 09  B5 17 47 DB  BB 55 A4 FE  7F C2 FC 4E | ,¢Þ.µ.GÛ»U¤þ.ÂüN
0000:0060 | 20 78 65 76  65 20 2D 20  4D 50 45 47  2D 35 20 45 |  xeve - MPEG-5 E
0000:0070 | 56 43 20 63  6F 64 65 63  20 2D 20 45  53 53 45 4E | VC codec - ESSEN
0000:0080 | 54 49 41 4C  20 56 49 44  45 4F 20 43  4F 44 49 4E | TIAL VIDEO CODIN
0000:0090 | 47 20 68 74  74 70 73 3A  2F 2F 67 69  74 68 75 62 | G https://github
0000:00A0 | 2E 63 6F 6D  2F 6D 70 65  67 35 2F 78  65 76 65 20 | .com/mpeg5/xeve 
0000:00B0 | 2D 20 6F 70  74 69 6F 6E  73 3A 20 70  72 6F 66 69 | - options: profi
0000:00C0 | 6C 65 3D 30  20 74 68 72  65 61 64 73  3D 31 20 69 | le=0 threads=1 i
0000:00D0 | 6E 70 75 74  2D 72 65 73  3D 31 39 32  30 78 31 30 | nput-res=1920x10
0000:00E0 | 38 30 20 66  70 73 3D 32  35 2E 30 30  30 20 6B 65 | 80 fps=25.000 ke
0000:00F0 | 79 69 6E 74  3D 30 20 63  6F 6C 6F 72  2D 73 70 61 | yint=0 color-spa
0000:0100 | 63 65 3D 32  35 37 31 20  72 63 2D 74  79 70 65 3D | ce=2571 rc-type=
0000:0110 | 43 51 50 20  71 70 3D 33  32 20 71 70  5F 63 62 5F | CQP qp=32 qp_cb_
0000:0120 | 6F 66 66 73  65 74 3D 30  20 71 70 5F  63 72 5F 6F | offset=0 qp_cr_o
0000:0130 | 66 66 73 65  74 3D 30 20  69 6E 66 6F  3D 31 20 68 | ffset=0 info=1 h
0000:0140 | 61 73 68 3D  30 20 62 66  72 61 6D 65  73 3D 31 35 | ash=0 bframes=15
0000:0150 | 20 61 71 2D  6D 6F 64 65  3D 30 20 6C  6F 6F 6B 61 |  aq-mode=0 looka
0000:0160 | 68 65 61 64  3D 31 37 20  63 6C 6F 73  65 64 2D 67 | head=17 closed-g
0000:0170 | 6F 70 3D 30  20 64 69 73  61 62 6C 65  2D 68 67 6F | op=0 disable-hgo
0000:0180 | 70 3D 30 20  72 65 66 5F  70 69 63 5F  67 61 70 5F | p=0 ref_pic_gap_
0000:0190 | 6C 65 6E 67  74 68 3D 30  20 63 6F 64  65 63 2D 62 | length=0 codec-b
0000:01A0 | 69 74 2D 64  65 70 74 68  3D 31 30 20  6C 65 76 65 | it-depth=10 leve
0000:01B0 | 6C 2D 69 64  63 3D 34 30  20 63 75 2D  74 72 65 65 | l-idc=40 cu-tree
0000:01C0 | 3D 30 20 63  6F 6E 73 74  72 61 69 6E  65 64 2D 69 | =0 constrained-i
0000:01D0 | 70 3D 30 20  75 73 65 2D  64 65 62 6C  6F 63 6B 3D | p=0 use-deblock=
0000:01E0 | 31 20 69 6E  74 65 72 2D  73 6C 69 63  65 2D 74 79 | 1 inter-slice-ty
0000:01F0 | 70 65 3D 30  20 72 64 6F  2D 64 65 62  6C 6B 2D 73 | pe=0 rdo-deblk-s
0000:0200 | 77 69 74 63  68 3D 30 20  71 70 2D 69  6E 63 72 65 | witch=0 qp-incre
0000:0210 | 61 73 65 64  2D 66 72 61  6D 65 3D 30  20 66 6F 72 | ased-frame=0 for
0000:0220 | 63 65 64 2D  69 64 72 2D  66 72 61 6D  65 2D 66 6C | ced-idr-frame-fl
0000:0230 | 61 67 3D 30  20 71 70 2D  69 6E 63 72  65 61 73 65 | ag=0 qp-increase
0000:0240 | 64 2D 66 72  61 6D 65 3D  30 20 71 70  2D 6D 61 78 | d-frame=0 qp-max
0000:0250 | 3D 35 31 20  71 70 2D 6D  69 6E 3D 30  20 67 6F 70 | =51 qp-min=0 gop
0000:0260 | 2D 73 69 7A  65 3D 31 36  20 75 73 65  2D 66 63 73 | -size=16 use-fcs
0000:0270 | 74 3D 30 20  63 68 72 6F  6D 61 2D 66  6F 72 6D 61 | t=0 chroma-forma
0000:0280 | 74 2D 69 64  63 3D 31 20  63 73 2D 77  2D 73 68 69 | t-idc=1 cs-w-shi
0000:0290 | 66 74 3D 31  20 63 73 2D  68 2D 73 68  69 66 74 3D | ft=1 cs-h-shift=
0000:02A0 | 31 20 6D 61  78 2D 63 75  2D 69 6E 74  72 61 3D 33 | 1 max-cu-intra=3
0000:02B0 | 32 20 6D 69  6E 2D 63 75  2D 69 6E 74  72 61 3D 34 | 2 min-cu-intra=4
0000:02C0 | 20 6D 61 78  2D 63 75 2D  69 6E 74 65  72 3D 36 34 |  max-cu-inter=64
0000:02D0 | 20 6D 69 6E  2D 63 75 2D  69 6E 74 65  72 3D 38 20 |  min-cu-inter=8 
0000:02E0 | 20 6D 61 78  2D 6E 75 6D  2D 72 65 66  3D 30 20 6D |  max-num-ref=0 m
0000:02F0 | 65 2D 72 65  66 2D 6E 75  6D 3D 31 20  6D 65 2D 61 | e-ref-num=1 me-a
0000:0300 | 6C 67 6F 3D  31 20 6D 65  2D 72 61 6E  67 65 3D 36 | lgo=1 me-range=6
0000:0310 | 34 20 6D 65  2D 73 75 62  3D 32 20 6D  65 2D 73 75 | 4 me-sub=2 me-su
0000:0320 | 62 2D 70 6F  73 3D 34 20  6D 65 2D 73  75 62 2D 72 | b-pos=4 me-sub-r
0000:0330 | 61 6E 67 65  3D 31 20 20  72 64 6F 71  3D 31 20 63 | ange=1  rdoq=1 c
0000:0340 | 61 62 61 63  2D 72 65 66  69 6E 65 3D  31 20 69 6E | abac-refine=1 in
0000:0350 | 74 72 61 2D  62 6C 6F 63  6B 2D 63 6F  70 79 3D 30 | tra-block-copy=0
0000:0360 | 20 62 74 74  3D 30 20 73  75 63 6F 3D  30 20 61 6D |  btt=0 suco=0 am
0000:0370 | 76 72 3D 30  20 76 64 3D  30 20 61 66  66 69 6E 65 | vr=0 vd=0 affine
0000:0380 | 3D 30 20 64  6D 76 72 3D  30 20 61 64  64 62 3D 30 | =0 dmvr=0 addb=0
0000:0390 | 20 61 6C 66  3D 30 20 68  74 64 66 3D  30 20 61 64 |  alf=0 htdf=0 ad
0000:03A0 | 6D 76 70 3D  30 20 68 6D  76 70 3D 30  20 65 69 70 | mvp=0 hmvp=0 eip
0000:03B0 | 64 3D 30 20  69 71 74 3D  30 20 63 6D  2D 69 6E 69 | d=0 iqt=0 cm-ini
0000:03C0 | 74 3D 30 20  61 64 63 63  3D 30 20 72  70 6C 3D 30 | t=0 adcc=0 rpl=0
0000:03D0 | 20 70 6F 63  73 3D 30 20  61 74 73 3D  30 20 70 6F |  pocs=0 ats=0 po
0000:03E0 | 63 73 3D 30  20 64 65 62  6C 6F 63 6B  2D 61 6C 70 | cs=0 deblock-alp
0000:03F0 | 68 61 2D 6F  66 66 73 65  74 3D 30 20  64 65 62 6C | ha-offset=0 debl
0000:0400 | 6F 63 6B 2D  62 65 74 61  2D 6F 66 66  73 65 74 3D | ock-beta-offset=
0000:0410 | 30 20 64 72  61 3D 30 20  61 73 70 65  63 74 2D 72 | 0 dra=0 aspect-r
0000:0420 | 61 74 69 6F  6E 2D 69 6E  66 6F 2D 66  6C 61 67 3D | ation-info-flag=
0000:0430 | 30 20 6F 76  65 72 73 63  61 6E 3D 30  20 76 69 64 | 0 overscan=0 vid
0000:0440 | 65 6F 66 6F  72 6D 61 74  3D 32 20 72  61 6E 67 65 | eoformat=2 range
0000:0450 | 3D 30 20 63  6F 6C 6F 72  70 72 69 6D  3D 32 20 74 | =0 colorprim=2 t
0000:0460 | 72 61 6E 73  66 65 72 3D  32 20 63 6F  6C 6F 72 6D | ransfer=2 colorm
0000:0470 | 61 74 72 69  78 3D 32 20  6D 61 73 74  65 72 2D 64 | atrix=2 master-d
0000:0480 | 69 73 70 6C  61 79 3D 32  20 63 68 72  6F 6D 61 6C | isplay=2 chromal
0000:0490 | 6F 63 3D 30  20 66 69 65  6C 64 2D 73  65 71 2D 66 | oc=0 field-seq-f
0000:04A0 | 6C 61 67 3D  30 20 76 75  69 2D 74 69  6D 69 6E 67 | lag=0 vui-timing
0000:04B0 | 2D 69 6E 66  6F 2D 66 6C  61 67 3D 30  20 66 69 78 | -info-flag=0 fix
0000:04C0 | 65 64 2D 70  69 63 2D 72  61 74 65 2D  66 6C 61 67 | ed-pic-rate-flag
0000:04D0 | 3D 30 20 6E  61 6C 2D 68  72 64 2D 70  61 72 61 6D | =0 nal-hrd-param
0000:04E0 | 73 2D 70 72  65 73 65 6E  74 2D 66 6C  61 67 3D 30 | s-present-flag=0
0000:04F0 | 20 76 63 6C  2D 68 72 64  2D 70 61 72  61 6D 73 2D |  vcl-hrd-params-
0000:0500 | 70 72 65 73  65 6E 74 2D  66 6C 61 67  3D 30 20 6E | present-flag=0 n
0000:0510 | 75 6D 2D 72  65 6F 72 64  65 72 2D 70  69 63 73 3D | um-reorder-pics=
0000:0520 | 32 31                                              | 21              

Looking at the code at

u32 payload_size = (ISO_IEC_11578_LEN + sei_userdata->payload_size) << 3;

there is an unexpected left shift by 3 bits. Why is the payload_size being shifted 3 bits?

The parsing works out OK for me without that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant