@@ -424,7 +424,32 @@ def parse_hvcC_box(ps: Parser):
424424 ps .print (f' - NALU { n } ' )
425425 print_hex_dump (ps .read (ps .int (2 )), ps .prefix + ' ' )
426426
427- # FIXME: implement av1C
427+ def parse_av1C_box (ps : Parser ):
428+ with ps .bits (4 ) as br :
429+ ps .reserved ('marker' , br .bit (), 1 )
430+ if (version := br .read (7 )) != 1 :
431+ raise AssertionError (f'invalid configuration version: { version } ' )
432+ ps .field ('seq_profile' , br .read (3 ))
433+ ps .field ('seq_level_idx_0' , br .read (5 ))
434+ ps .field ('seq_tier_0' , br .bit ())
435+ ps .field ('high_bitdepth' , br .bit ())
436+ ps .field ('twelve_bit' , br .bit ())
437+ ps .field ('monochrome' , br .bit ())
438+ ps .field ('chroma_subsampling_x' , br .bit ())
439+ ps .field ('chroma_subsampling_y' , br .bit ())
440+ ps .field ('chroma_sample_position' , br .read (2 ))
441+ ps .reserved ('reserved' , br .read (3 ))
442+
443+ if br .bit ():
444+ ps .field ('initial_presentation_delay_minus_one' , br .read (4 ))
445+ else :
446+ ps .reserved ('reserved' , br .read (4 ))
447+
448+ ps .print ('configOBUs =' )
449+ print_hex_dump (ps .read (), ps .prefix + ' ' )
450+
451+ def parse_av1f_box (ps : Parser ):
452+ ps .field ('fwd_distance' , ps .int (1 ))
428453
429454def parse_esds_box (ps : Parser ):
430455 parse_fullbox (ps )
0 commit comments