1
1
mirror of https://github.com/wader/fq.git synced 2024-11-22 07:16:49 +03:00

av1_obu: Decode more of sequence header

Also update to golangci/golangci-lint-action@v6
This commit is contained in:
Mattias Wadman 2024-10-18 17:48:02 +02:00
parent e927a94ca1
commit d0c7e8004c
9 changed files with 1644 additions and 1158 deletions

View File

@ -17,7 +17,7 @@ jobs:
with:
go-version: "1.23.0"
- uses: actions/checkout@v3
- uses: golangci/golangci-lint-action@v3
- uses: golangci/golangci-lint-action@v6
with:
version: v${{ env.GOLANGCILINT_VERSION }}

View File

@ -13,7 +13,7 @@
|[`apple_bookmark`](#apple_bookmark) |Apple&nbsp;BookmarkData |<sub></sub>|
|`ar` |Unix&nbsp;archive |<sub>`probe`</sub>|
|[`asn1_ber`](#asn1_ber) |ASN1&nbsp;BER&nbsp;(basic&nbsp;encoding&nbsp;rules,&nbsp;also&nbsp;CER&nbsp;and&nbsp;DER) |<sub></sub>|
|`av1_ccr` |AV1&nbsp;Codec&nbsp;Configuration&nbsp;Record |<sub></sub>|
|`av1_ccr` |AV1&nbsp;Codec&nbsp;Configuration&nbsp;Record |<sub>`av1_obu`</sub>|
|`av1_frame` |AV1&nbsp;frame |<sub>`av1_obu`</sub>|
|`av1_obu` |AV1&nbsp;Open&nbsp;Bitstream&nbsp;Unit |<sub></sub>|
|`avc_annexb` |H.264/AVC&nbsp;Annex&nbsp;B |<sub>`avc_nalu`</sub>|

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 160 KiB

View File

@ -11,12 +11,17 @@ import (
"github.com/wader/fq/pkg/scalar"
)
var av1CCRav1OBUGroup decode.Group
func init() {
interp.RegisterFormat(
format.AV1_CCR,
&decode.Format{
Description: "AV1 Codec Configuration Record",
DecodeFn: ccrDecode,
Dependencies: []decode.Dependency{
{Groups: []*decode.Group{format.AV1_OBU}, Out: &av1CCRav1OBUGroup},
},
})
}
@ -39,9 +44,11 @@ func ccrDecode(d *decode.D) any {
} else {
d.FieldU4("reserved")
}
if d.BitsLeft() > 0 {
d.FieldRawLen("config_obus", d.BitsLeft())
d.FieldArray("config_obus", func(d *decode.D) {
for d.BitsLeft() > 0 {
d.FieldFormat("config_obu", &av1CCRav1OBUGroup, nil)
}
})
return nil
}

View File

@ -29,17 +29,145 @@ const (
)
var obuTypeNames = scalar.UintMapSymStr{
OBU_SEQUENCE_HEADER: "OBU_SEQUENCE_HEADER",
OBU_TEMPORAL_DELIMITER: "OBU_TEMPORAL_DELIMITER",
OBU_FRAME_HEADER: "OBU_FRAME_HEADER",
OBU_TILE_GROUP: "OBU_TILE_GROUP",
OBU_METADATA: "OBU_METADATA",
OBU_FRAME: "OBU_FRAME",
OBU_REDUNDANT_FRAME_HEADER: "OBU_REDUNDANT_FRAME_HEADER",
OBU_TILE_LIST: "OBU_TILE_LIST",
OBU_PADDING: "OBU_PADDING",
OBU_SEQUENCE_HEADER: "sequence_header",
OBU_TEMPORAL_DELIMITER: "temporal_delimiter",
OBU_FRAME_HEADER: "frame_header",
OBU_TILE_GROUP: "tile_group",
OBU_METADATA: "metadata",
OBU_FRAME: "frame",
OBU_REDUNDANT_FRAME_HEADER: "redundant_frame_header",
OBU_TILE_LIST: "tile_list",
OBU_PADDING: "padding",
}
const (
CP_BT_709 = 1 // BT.709
CP_UNSPECIFIED = 2 // Unspecified
CP_BT_470_M = 4 // BT.470 System M (historical)
CP_BT_470_B_G = 5 // BT.470 System B, G (historical)
CP_BT_601 = 6 // BT.601
CP_SMPTE_240 = 7 // SMPTE 240
CP_GENERIC_FILM = 8 // Generic film (color filters using illuminant C)
CP_BT_2020 = 9 // BT.2020, BT.2100
CP_XYZ = 10 // SMPTE 428 (CIE 1921 XYZ)
CP_SMPTE_431 = 11 // SMPTE RP 431-2
CP_SMPTE_432 = 12 // SMPTE EG 432-,1
CP_EBU_3213 = 22 // EBU Tech. 3213-E
)
var cpTypeNames = scalar.UintMapSymStr{
CP_BT_709: "bt_709",
CP_UNSPECIFIED: "unspecified",
CP_BT_470_M: "bt_470_m",
CP_BT_470_B_G: "bt_470_b_g",
CP_BT_601: "bt_601",
CP_SMPTE_240: "smpte_240",
CP_GENERIC_FILM: "generic_film",
CP_BT_2020: "bt_2020",
CP_XYZ: "xyz",
CP_SMPTE_431: "smpte_431",
CP_SMPTE_432: "smpte_432",
CP_EBU_3213: "ebu_3213",
}
const (
TC_RESERVED_0 = 0 // For future use
TC_BT_709 = 1 // BT.709
TC_UNSPECIFIED = 2 // Unspecified
TC_RESERVED_3 = 3 // For future use
TC_BT_470_M = 4 // BT.470 System M (historical)
TC_BT_470_B_G = 5 // BT.470 System B, G (historical)
TC_BT_601 = 6 // BT.601
TC_SMPTE_240 = 7 // SMPTE 240 M
TC_LINEAR = 8 // Linear
TC_LOG_100 = 9 // Logarithmic (100 : 1 range)
TC_LOG_100_SQRT10 = 10 // Logarithmic (100 * Sqrt(10) : 1 range)
TC_IEC_61966 = 11 // IEC 61966-2-4
TC_BT_1361 = 12 // BT.1361
TC_SRGB = 13 // sRGB or sYCC
TC_BT_2020_10_BIT = 14 // BT.2020 10-bit systems
TC_BT_2020_12_BIT = 15 // BT.2020 12-bit systems
TC_SMPTE_2084 = 16 // SMPTE ST 2084, ITU BT.2100 PQ
TC_SMPTE_428 = 17 // SMPTE ST 428
TC_HLG = 18 // BT.2100 HLG, ARIB STD-B67
)
var tcTypeNames = scalar.UintMapSymStr{
TC_RESERVED_0: "reserved_0",
TC_BT_709: "bt_709",
TC_UNSPECIFIED: "unspecified",
TC_RESERVED_3: "reserved_3",
TC_BT_470_M: "bt_470_m",
TC_BT_470_B_G: "bt_470_b_g",
TC_BT_601: "bt_601",
TC_SMPTE_240: "smpte_240",
TC_LINEAR: "linear",
TC_LOG_100: "log_100",
TC_LOG_100_SQRT10: "log_100_sqrt10",
TC_IEC_61966: "iec_61966",
TC_BT_1361: "bt_1361",
TC_SRGB: "srgb",
TC_BT_2020_10_BIT: "bt_2020_10_bit",
TC_BT_2020_12_BIT: "bt_2020_12_bit",
TC_SMPTE_2084: "smpte_2084",
TC_SMPTE_428: "smpte_428",
TC_HLG: "hlg",
}
const (
MC_IDENTITY = 0 // Identity matrix
MC_BT_709 = 1 // BT.709
MC_UNSPECIFIED = 2 // Unspecified
MC_RESERVED_3 = 3 // For future use
MC_FCC = 4 // US FCC 73.628
MC_BT_470_B_G = 5 // BT.470 System B, G (historical)
MC_BT_601 = 6 // BT.601
MC_SMPTE_240 = 7 // SMPTE 240 M
MC_SMPTE_YCGCO = 8 // YCgCo
MC_BT_2020_NCL = 9 // BT.2020 non-constant luminance, BT.2100 YCbCr
MC_BT_2020_CL = 10 // BT.2020 constant luminance
MC_SMPTE_2085 = 11 // SMPTE ST 2085 YDzDx
MC_CHROMAT_NCL = 12 // Chromaticity-derived non-constant luminance
MC_CHROMAT_CL = 13 // Chromaticity-derived constant luminance
MC_ICTCP = 14 // BT.2100 ICtCp
)
var mcTypeNames = scalar.UintMapSymStr{
MC_IDENTITY: "identity",
MC_BT_709: "bt_709",
MC_UNSPECIFIED: "unspecified",
MC_RESERVED_3: "reserved_3",
MC_FCC: "fcc",
MC_BT_470_B_G: "bt_470_b_g",
MC_BT_601: "bt_601",
MC_SMPTE_240: "smpte_240",
MC_SMPTE_YCGCO: "smpte_ycgco",
MC_BT_2020_NCL: "bt_2020_ncl",
MC_BT_2020_CL: "bt_2020_cl",
MC_SMPTE_2085: "smpte_2085",
MC_CHROMAT_NCL: "chromat_ncl",
MC_CHROMAT_CL: "chromat_cl",
MC_ICTCP: "ictcp",
}
const (
SEQ_PROFILE_MAIN = 0
SEQ_PROFILE_HIGH = 1
SEQ_PROFILE_PROFESSIONAL = 2
)
var seqProfileNames = scalar.UintMapSymStr{
SEQ_PROFILE_MAIN: "main",
SEQ_PROFILE_HIGH: "high",
SEQ_PROFILE_PROFESSIONAL: "professional",
}
// from https://aomediacodec.github.io/av1-spec/#symbols-and-abbreviated-terms
const SELECT_SCREEN_CONTENT_TOOLS = 2
// TODO: ignore empty branch lint warnings
//
//nolint:staticcheck
func obuDecode(d *decode.D) any {
var obuType uint64
var obuSize int64
@ -68,11 +196,170 @@ func obuDecode(d *decode.D) any {
}
}
_ = obuType
d.FramedFn(obuSize*8, func(d *decode.D) {
// TODO: this only handles the OBU_SEQUENCE_HEADER case for now
// fro spec https://aomediacodec.github.io/av1-spec/#general-obu-syntax
// if ( obu_type != OBU_SEQUENCE_HEADER &&
// obu_type != OBU_TEMPORAL_DELIMITER &&
// OperatingPointIdc != 0 &&
// obu_extension_flag == 1 )
if d.BitsLeft() > 0 {
d.FieldRawLen("data", obuSize*8)
switch obuType {
case OBU_SEQUENCE_HEADER:
seqProfile := d.FieldU3("seq_profile", seqProfileNames)
d.FieldU1("still_picture")
reducedStillPictureHeader := d.FieldU1("reduced_still_picture_header")
if reducedStillPictureHeader == 1 {
d.FieldU5("seq_level_idx0") // TODO: array as below?
} else {
timingInfoPresentFlag := d.FieldU1("timing_info_present_flag")
if timingInfoPresentFlag == 1 {
// TODO:
return
}
initialDisplayDelayPresentFlag := d.FieldU1("initial_display_delay_present_flag")
operatingPointsCntMinus1 := d.FieldU5("operating_points_cnt_minus_1")
d.FieldArray("operating_points", func(d *decode.D) {
for i := uint64(0); i <= operatingPointsCntMinus1; i++ {
d.FieldStruct("operating_point", func(d *decode.D) {
d.FieldU12("operating_point_idc")
seqLevelIdx := d.FieldU5("seq_level_idx")
if seqLevelIdx > 7 {
d.FieldU1("seq_tier")
} else {
// nop
}
})
if initialDisplayDelayPresentFlag == 1 {
initialDisplayDelayPresentForThisOp := d.FieldU1("seq_tier")
if initialDisplayDelayPresentForThisOp == 1 {
d.FieldU4("initial_display_delay_minus_1")
}
}
}
})
}
frameWidthBitsMinus1 := d.FieldU4("frame_width_bits_minus_1")
frameHeightBitsMinus1 := d.FieldU4("frame_height_bits_minus_1")
d.FieldU("max_frame_width_minus_1", int(frameWidthBitsMinus1)+1)
d.FieldU("max_frame_height_minus_1", int(frameHeightBitsMinus1)+1)
var frameIdNumbersPresentFlag uint64 = 0
if reducedStillPictureHeader == 1 {
// nop
} else {
frameIdNumbersPresentFlag = d.FieldU1("frame_id_numbers_present_flag")
}
if frameIdNumbersPresentFlag == 1 {
d.FieldU4("delta_frame_id_length_minus_2")
d.FieldU3("additional_frame_id_length_minus_1")
}
d.FieldU1("use_128x128_superblock")
d.FieldU1("enable_filter_intra")
d.FieldU1("enable_intra_edge_filter")
if reducedStillPictureHeader == 1 {
//nop
} else {
d.FieldU1("enable_interintra_compound")
d.FieldU1("enable_masked_compound")
d.FieldU1("enable_warped_motion")
d.FieldU1("enable_dual_filter")
enableOrderHint := d.FieldU1("enable_order_hint")
if enableOrderHint == 1 {
d.FieldU1("enable_jnt_comp")
d.FieldU1("enable_ref_frame_mvs")
}
seqChooseScreenContentTools := d.FieldU1("seq_choose_screen_content_tools")
var seqForceScreenContentTools uint64 = SELECT_SCREEN_CONTENT_TOOLS
if seqChooseScreenContentTools == 1 {
// nop
} else {
seqForceScreenContentTools = d.FieldU1("seq_force_screen_content_tools")
}
if seqForceScreenContentTools > 0 {
seqChooseIntegerMv := d.FieldU1("seq_choose_integer_mv")
if seqChooseIntegerMv == 1 {
// nop
} else {
d.FieldU1("seq_force_integer_mv")
}
}
if enableOrderHint == 1 {
d.FieldU3("order_hint_bits_minus_1")
}
}
d.FieldU1("enable_superres")
d.FieldU1("enable_cdef")
d.FieldU1("enable_restoration")
d.FieldStruct("color_config", func(d *decode.D) {
highBitdepth := d.FieldU1("high_bitdepth")
var twelveBit uint64
if seqProfile == 2 && highBitdepth == 1 {
twelveBit = d.FieldU1("twelve_bit")
}
var monoChrome uint64 = 0
if seqProfile == 1 {
// nop
} else {
d.FieldU1("mono_chrome")
}
colorDescriptionPresentFlag := d.FieldU1("color_description_present_flag")
var colorPrimaries uint64 = 0
var transferCharacteristics uint64 = 0
var matrixCoefficients uint64 = 0
if colorDescriptionPresentFlag == 1 {
colorPrimaries = d.FieldU8("color_primaries", cpTypeNames)
transferCharacteristics = d.FieldU8("transfer_characteristics", tcTypeNames)
matrixCoefficients = d.FieldU8("matrix_coefficients", mcTypeNames)
}
if monoChrome == 1 {
d.FieldU1("color_range")
} else if colorPrimaries == CP_BT_709 &&
transferCharacteristics == TC_SRGB &&
matrixCoefficients == MC_IDENTITY {
// nop
} else {
d.FieldU1("color_range")
var subsamplingX uint64 = 0
var subsamplingY uint64 = 0
if seqProfile == 0 {
subsamplingX = 1
subsamplingY = 1
} else if seqProfile == 1 {
// nop
} else {
if twelveBit == 1 {
subsamplingX = d.FieldU1("subsampling_x")
if subsamplingX == 1 {
subsamplingY = d.FieldU1("subsampling_y")
}
} else {
subsamplingX = 1
}
}
if subsamplingX == 1 && subsamplingY == 1 {
d.FieldU2("chroma_sample_position")
}
}
d.FieldU1("separate_uv_delta_q")
})
d.FieldU1("film_grain_params_present")
default:
}
d.FieldRawLen("data", d.BitsLeft())
})
return nil
}

Binary file not shown.

View File

@ -0,0 +1,53 @@
$ fq -d av1_obu dv av1_obu_seq_header_film_grain_chrome_sample_pos
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: av1_obu_seq_header_film_grain_chrome_sample_pos (av1_obu) 0x0-0x10 (16)
| | | header{}: 0x0-0x1 (1)
0x00|0a |. | forbidden_bit: 0 0x0-0x0.1 (0.1)
0x00|0a |. | type: "sequence_header" (1) 0x0.1-0x0.5 (0.4)
0x00|0a |. | extension_flag: false 0x0.5-0x0.6 (0.1)
0x00|0a |. | has_size_field: true 0x0.6-0x0.7 (0.1)
0x00|0a |. | reserved_1bit: 0 0x0.7-0x1 (0.1)
0x00| 0e | . | size: 14 0x1-0x2 (1)
0x00| 00 | . | seq_profile: "main" (0) 0x2-0x2.3 (0.3)
0x00| 00 | . | still_picture: 0 0x2.3-0x2.4 (0.1)
0x00| 00 | . | reduced_still_picture_header: 0 0x2.4-0x2.5 (0.1)
0x00| 00 | . | timing_info_present_flag: 0 0x2.5-0x2.6 (0.1)
0x00| 00 | . | initial_display_delay_present_flag: 0 0x2.6-0x2.7 (0.1)
0x00| 00 00 | .. | operating_points_cnt_minus_1: 0 0x2.7-0x3.4 (0.5)
| | | operating_points[0:1]: 0x3.4-0x5.6 (2.2)
| | | [0]{}: operating_point 0x3.4-0x5.6 (2.2)
0x00| 00 00 | .. | operating_point_idc: 0 0x3.4-0x5 (1.4)
0x00| 42 | B | seq_level_idx: 8 0x5-0x5.5 (0.5)
0x00| 42 | B | seq_tier: 0 0x5.5-0x5.6 (0.1)
0x00| 42 ab | B. | frame_width_bits_minus_1: 10 0x5.6-0x6.2 (0.4)
0x00| ab | . | frame_height_bits_minus_1: 10 0x6.2-0x6.6 (0.4)
0x00| ab bf c3 | ... | max_frame_width_minus_1: 1919 0x6.6-0x8.1 (1.3)
0x00| c3 71 | .q | max_frame_height_minus_1: 1079 0x8.1-0x9.4 (1.3)
0x00| 71 | q | frame_id_numbers_present_flag: 0 0x9.4-0x9.5 (0.1)
0x00| 71 | q | use_128x128_superblock: 0 0x9.5-0x9.6 (0.1)
0x00| 71 | q | enable_filter_intra: 0 0x9.6-0x9.7 (0.1)
0x00| 71 | q | enable_intra_edge_filter: 1 0x9.7-0xa (0.1)
0x00| ab | . | enable_interintra_compound: 1 0xa-0xa.1 (0.1)
0x00| ab | . | enable_masked_compound: 0 0xa.1-0xa.2 (0.1)
0x00| ab | . | enable_warped_motion: 1 0xa.2-0xa.3 (0.1)
0x00| ab | . | enable_dual_filter: 0 0xa.3-0xa.4 (0.1)
0x00| ab | . | enable_order_hint: 1 0xa.4-0xa.5 (0.1)
0x00| ab | . | enable_jnt_comp: 0 0xa.5-0xa.6 (0.1)
0x00| ab | . | enable_ref_frame_mvs: 1 0xa.6-0xa.7 (0.1)
0x00| ab | . | seq_choose_screen_content_tools: 1 0xa.7-0xb (0.1)
0x00| e6 | . | seq_choose_integer_mv: 1 0xb-0xb.1 (0.1)
0x00| e6 | . | order_hint_bits_minus_1: 6 0xb.1-0xb.4 (0.3)
0x00| e6 | . | enable_superres: 0 0xb.4-0xb.5 (0.1)
0x00| e6 | . | enable_cdef: 1 0xb.5-0xb.6 (0.1)
0x00| e6 | . | enable_restoration: 1 0xb.6-0xb.7 (0.1)
| | | color_config{}: 0xb.7-0xf.6 (3.7)
0x00| e6 | . | high_bitdepth: 0 0xb.7-0xc (0.1)
0x00| 40 | @ | mono_chrome: 0 0xc-0xc.1 (0.1)
0x00| 40 | @ | color_description_present_flag: 1 0xc.1-0xc.2 (0.1)
0x00| 40 40 | @@ | color_primaries: "bt_709" (1) 0xc.2-0xd.2 (1)
0x00| 40 40 | @@ | transfer_characteristics: "bt_709" (1) 0xd.2-0xe.2 (1)
0x00| 40 43| @C| matrix_coefficients: "bt_709" (1) 0xe.2-0xf.2 (1)
0x00| 43| C| color_range: 0 0xf.2-0xf.3 (0.1)
0x00| 43| C| chroma_sample_position: 0 0xf.3-0xf.5 (0.2)
0x00| 43| C| separate_uv_delta_q: 0 0xf.5-0xf.6 (0.1)
0x00| 43| C| film_grain_params_present: 1 0xf.6-0xf.7 (0.1)
0x00| 43| C| data: raw bits 0xf.7-0x10 (0.1)

View File

@ -253,6 +253,7 @@ $ fq -d matroska dv av1.mkv
0x0170| 00 | . | reserved = 0: 0 0x179-0x179.3 (0.3)
0x0170| 00 | . | initial_presentation_delay_present: false 0x179.3-0x179.4 (0.1)
0x0170| 00 | . | reserved: 0 0x179.4-0x17a (0.4)
| | | config_obus[0:0]: 0x17a-0x17a (0)
| | | [4]{}: element 0x17a-0x221 (167)
0x0170| 12 54 c3 67 | .T.g | id: "tags" (0x1254c367) (Element containing metadata describing Tracks) 0x17a-0x17e (4)
| | | type: "master"
@ -372,17 +373,57 @@ $ fq -d matroska dv av1.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [0]{}: obu (av1_obu) 0x237-0x246 (15)
| | | header{}: 0x237-0x238 (1)
0x0230| 0a | . | forbidden_bit: 0 0x237-0x237.1 (0.1)
0x0230| 0a | . | type: "OBU_SEQUENCE_HEADER" (1) 0x237.1-0x237.5 (0.4)
0x0230| 0a | . | type: "sequence_header" (1) 0x237.1-0x237.5 (0.4)
0x0230| 0a | . | extension_flag: false 0x237.5-0x237.6 (0.1)
0x0230| 0a | . | has_size_field: true 0x237.6-0x237.7 (0.1)
0x0230| 0a | . | reserved_1bit: 0 0x237.7-0x238 (0.1)
0x0230| 0d | . | size: 13 0x238-0x239 (1)
0x0230| 20 00 00 fa 1e 7f de| ......| data: raw bits 0x239-0x246 (13)
0x0240|21 0a d0 20 20 25 |!.. % |
0x0230| 20 | | seq_profile: "high" (1) 0x239-0x239.3 (0.3)
0x0230| 20 | | still_picture: 0 0x239.3-0x239.4 (0.1)
0x0230| 20 | | reduced_still_picture_header: 0 0x239.4-0x239.5 (0.1)
0x0230| 20 | | timing_info_present_flag: 0 0x239.5-0x239.6 (0.1)
0x0230| 20 | | initial_display_delay_present_flag: 0 0x239.6-0x239.7 (0.1)
0x0230| 20 00 | . | operating_points_cnt_minus_1: 0 0x239.7-0x23a.4 (0.5)
| | | operating_points[0:1]: 0x23a.4-0x23c.6 (2.2)
| | | [0]{}: operating_point 0x23a.4-0x23c.6 (2.2)
0x0230| 00 00 | .. | operating_point_idc: 0 0x23a.4-0x23c (1.4)
0x0230| fa | . | seq_level_idx: 31 0x23c-0x23c.5 (0.5)
0x0230| fa | . | seq_tier: 0 0x23c.5-0x23c.6 (0.1)
0x0230| fa 1e | .. | frame_width_bits_minus_1: 8 0x23c.6-0x23d.2 (0.4)
0x0230| 1e | . | frame_height_bits_minus_1: 7 0x23d.2-0x23d.6 (0.4)
0x0230| 1e 7f | .. | max_frame_width_minus_1: 319 0x23d.6-0x23e.7 (1.1)
0x0230| 7f de| ..| max_frame_height_minus_1: 239 0x23e.7-0x23f.7 (1)
0x0230| de| .| frame_id_numbers_present_flag: 0 0x23f.7-0x240 (0.1)
0x0240|21 |! | use_128x128_superblock: 0 0x240-0x240.1 (0.1)
0x0240|21 |! | enable_filter_intra: 0 0x240.1-0x240.2 (0.1)
0x0240|21 |! | enable_intra_edge_filter: 1 0x240.2-0x240.3 (0.1)
0x0240|21 |! | enable_interintra_compound: 0 0x240.3-0x240.4 (0.1)
0x0240|21 |! | enable_masked_compound: 0 0x240.4-0x240.5 (0.1)
0x0240|21 |! | enable_warped_motion: 0 0x240.5-0x240.6 (0.1)
0x0240|21 |! | enable_dual_filter: 0 0x240.6-0x240.7 (0.1)
0x0240|21 |! | enable_order_hint: 1 0x240.7-0x241 (0.1)
0x0240| 0a | . | enable_jnt_comp: 0 0x241-0x241.1 (0.1)
0x0240| 0a | . | enable_ref_frame_mvs: 0 0x241.1-0x241.2 (0.1)
0x0240| 0a | . | seq_choose_screen_content_tools: 0 0x241.2-0x241.3 (0.1)
0x0240| 0a | . | seq_force_screen_content_tools: 0 0x241.3-0x241.4 (0.1)
0x0240| 0a | . | order_hint_bits_minus_1: 5 0x241.4-0x241.7 (0.3)
0x0240| 0a | . | enable_superres: 0 0x241.7-0x242 (0.1)
0x0240| d0 | . | enable_cdef: 1 0x242-0x242.1 (0.1)
0x0240| d0 | . | enable_restoration: 1 0x242.1-0x242.2 (0.1)
| | | color_config{}: 0x242.2-0x245.6 (3.4)
0x0240| d0 | . | high_bitdepth: 0 0x242.2-0x242.3 (0.1)
0x0240| d0 | . | color_description_present_flag: 1 0x242.3-0x242.4 (0.1)
0x0240| d0 20 | . | color_primaries: "unspecified" (2) 0x242.4-0x243.4 (1)
0x0240| 20 20 | | transfer_characteristics: "unspecified" (2) 0x243.4-0x244.4 (1)
0x0240| 20 25 | % | matrix_coefficients: "unspecified" (2) 0x244.4-0x245.4 (1)
0x0240| 25 | % | color_range: 0 0x245.4-0x245.5 (0.1)
0x0240| 25 | % | separate_uv_delta_q: 1 0x245.5-0x245.6 (0.1)
0x0240| 25 | % | film_grain_params_present: 0 0x245.6-0x245.7 (0.1)
0x0240| 25 | % | data: raw bits 0x245.7-0x246 (0.1)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [1]{}: obu (av1_obu) 0x246-0x258 (18)
| | | header{}: 0x246-0x247 (1)
0x0240| 1a | . | forbidden_bit: 0 0x246-0x246.1 (0.1)
0x0240| 1a | . | type: "OBU_FRAME_HEADER" (3) 0x246.1-0x246.5 (0.4)
0x0240| 1a | . | type: "frame_header" (3) 0x246.1-0x246.5 (0.4)
0x0240| 1a | . | extension_flag: false 0x246.5-0x246.6 (0.1)
0x0240| 1a | . | has_size_field: true 0x246.6-0x246.7 (0.1)
0x0240| 1a | . | reserved_1bit: 0 0x246.7-0x247 (0.1)
@ -392,7 +433,7 @@ $ fq -d matroska dv av1.mkv
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [2]{}: obu (av1_obu) 0x258-0x13cb (4467)
| | | header{}: 0x258-0x259 (1)
0x0250| 22 | " | forbidden_bit: 0 0x258-0x258.1 (0.1)
0x0250| 22 | " | type: "OBU_TILE_GROUP" (4) 0x258.1-0x258.5 (0.4)
0x0250| 22 | " | type: "tile_group" (4) 0x258.1-0x258.5 (0.4)
0x0250| 22 | " | extension_flag: false 0x258.5-0x258.6 (0.1)
0x0250| 22 | " | has_size_field: true 0x258.6-0x258.7 (0.1)
0x0250| 22 | " | reserved_1bit: 0 0x258.7-0x259 (0.1)

View File

@ -225,8 +225,57 @@ $ fq -d mp4 dv av1.mp4
0x13c0| 00 | . | reserved = 0: 0 0x13ca-0x13ca.3 (0.3)
0x13c0| 00 | . | initial_presentation_delay_present: false 0x13ca.3-0x13ca.4 (0.1)
0x13c0| 00 | . | reserved: 0 0x13ca.4-0x13cb (0.4)
0x13c0| 0a 0d 20 00 00| .. ..| config_obus: raw bits 0x13cb-0x13da (15)
0x13d0|fa 1e 7f de 21 0a d0 20 20 25 |....!.. % |
| | | config_obus[0:1]: 0x13cb-0x13da (15)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [0]{}: config_obu (av1_obu) 0x13cb-0x13da (15)
| | | header{}: 0x13cb-0x13cc (1)
0x13c0| 0a | . | forbidden_bit: 0 0x13cb-0x13cb.1 (0.1)
0x13c0| 0a | . | type: "sequence_header" (1) 0x13cb.1-0x13cb.5 (0.4)
0x13c0| 0a | . | extension_flag: false 0x13cb.5-0x13cb.6 (0.1)
0x13c0| 0a | . | has_size_field: true 0x13cb.6-0x13cb.7 (0.1)
0x13c0| 0a | . | reserved_1bit: 0 0x13cb.7-0x13cc (0.1)
0x13c0| 0d | . | size: 13 0x13cc-0x13cd (1)
0x13c0| 20 | | seq_profile: "high" (1) 0x13cd-0x13cd.3 (0.3)
0x13c0| 20 | | still_picture: 0 0x13cd.3-0x13cd.4 (0.1)
0x13c0| 20 | | reduced_still_picture_header: 0 0x13cd.4-0x13cd.5 (0.1)
0x13c0| 20 | | timing_info_present_flag: 0 0x13cd.5-0x13cd.6 (0.1)
0x13c0| 20 | | initial_display_delay_present_flag: 0 0x13cd.6-0x13cd.7 (0.1)
0x13c0| 20 00 | . | operating_points_cnt_minus_1: 0 0x13cd.7-0x13ce.4 (0.5)
| | | operating_points[0:1]: 0x13ce.4-0x13d0.6 (2.2)
| | | [0]{}: operating_point 0x13ce.4-0x13d0.6 (2.2)
0x13c0| 00 00| ..| operating_point_idc: 0 0x13ce.4-0x13d0 (1.4)
0x13d0|fa |. | seq_level_idx: 31 0x13d0-0x13d0.5 (0.5)
0x13d0|fa |. | seq_tier: 0 0x13d0.5-0x13d0.6 (0.1)
0x13d0|fa 1e |.. | frame_width_bits_minus_1: 8 0x13d0.6-0x13d1.2 (0.4)
0x13d0| 1e | . | frame_height_bits_minus_1: 7 0x13d1.2-0x13d1.6 (0.4)
0x13d0| 1e 7f | .. | max_frame_width_minus_1: 319 0x13d1.6-0x13d2.7 (1.1)
0x13d0| 7f de | .. | max_frame_height_minus_1: 239 0x13d2.7-0x13d3.7 (1)
0x13d0| de | . | frame_id_numbers_present_flag: 0 0x13d3.7-0x13d4 (0.1)
0x13d0| 21 | ! | use_128x128_superblock: 0 0x13d4-0x13d4.1 (0.1)
0x13d0| 21 | ! | enable_filter_intra: 0 0x13d4.1-0x13d4.2 (0.1)
0x13d0| 21 | ! | enable_intra_edge_filter: 1 0x13d4.2-0x13d4.3 (0.1)
0x13d0| 21 | ! | enable_interintra_compound: 0 0x13d4.3-0x13d4.4 (0.1)
0x13d0| 21 | ! | enable_masked_compound: 0 0x13d4.4-0x13d4.5 (0.1)
0x13d0| 21 | ! | enable_warped_motion: 0 0x13d4.5-0x13d4.6 (0.1)
0x13d0| 21 | ! | enable_dual_filter: 0 0x13d4.6-0x13d4.7 (0.1)
0x13d0| 21 | ! | enable_order_hint: 1 0x13d4.7-0x13d5 (0.1)
0x13d0| 0a | . | enable_jnt_comp: 0 0x13d5-0x13d5.1 (0.1)
0x13d0| 0a | . | enable_ref_frame_mvs: 0 0x13d5.1-0x13d5.2 (0.1)
0x13d0| 0a | . | seq_choose_screen_content_tools: 0 0x13d5.2-0x13d5.3 (0.1)
0x13d0| 0a | . | seq_force_screen_content_tools: 0 0x13d5.3-0x13d5.4 (0.1)
0x13d0| 0a | . | order_hint_bits_minus_1: 5 0x13d5.4-0x13d5.7 (0.3)
0x13d0| 0a | . | enable_superres: 0 0x13d5.7-0x13d6 (0.1)
0x13d0| d0 | . | enable_cdef: 1 0x13d6-0x13d6.1 (0.1)
0x13d0| d0 | . | enable_restoration: 1 0x13d6.1-0x13d6.2 (0.1)
| | | color_config{}: 0x13d6.2-0x13d9.6 (3.4)
0x13d0| d0 | . | high_bitdepth: 0 0x13d6.2-0x13d6.3 (0.1)
0x13d0| d0 | . | color_description_present_flag: 1 0x13d6.3-0x13d6.4 (0.1)
0x13d0| d0 20 | . | color_primaries: "unspecified" (2) 0x13d6.4-0x13d7.4 (1)
0x13d0| 20 20 | | transfer_characteristics: "unspecified" (2) 0x13d7.4-0x13d8.4 (1)
0x13d0| 20 25 | % | matrix_coefficients: "unspecified" (2) 0x13d8.4-0x13d9.4 (1)
0x13d0| 25 | % | color_range: 0 0x13d9.4-0x13d9.5 (0.1)
0x13d0| 25 | % | separate_uv_delta_q: 1 0x13d9.5-0x13d9.6 (0.1)
0x13d0| 25 | % | film_grain_params_present: 0 0x13d9.6-0x13d9.7 (0.1)
0x13d0| 25 | % | data: raw bits 0x13d9.7-0x13da (0.1)
| | | [1]{}: box 0x13da-0x13e4 (10)
0x13d0| 00 00 00 0a | .... | size: 10 0x13da-0x13de (4)
0x13d0| 66 69| fi| type: "fiel" (Video field order) 0x13de-0x13e2 (4)
@ -318,17 +367,58 @@ $ fq -d mp4 dv av1.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [0]{}: obu (av1_obu) 0x2c-0x3b (15)
| | | header{}: 0x2c-0x2d (1)
0x0020| 0a | . | forbidden_bit: 0 0x2c-0x2c.1 (0.1)
0x0020| 0a | . | type: "OBU_SEQUENCE_HEADER" (1) 0x2c.1-0x2c.5 (0.4)
0x0020| 0a | . | type: "sequence_header" (1) 0x2c.1-0x2c.5 (0.4)
0x0020| 0a | . | extension_flag: false 0x2c.5-0x2c.6 (0.1)
0x0020| 0a | . | has_size_field: true 0x2c.6-0x2c.7 (0.1)
0x0020| 0a | . | reserved_1bit: 0 0x2c.7-0x2d (0.1)
0x0020| 0d | . | size: 13 0x2d-0x2e (1)
0x0020| 20 00| .| data: raw bits 0x2e-0x3b (13)
0x0030|00 fa 1e 7f de 21 0a d0 20 20 25 |.....!.. % |
0x0020| 20 | | seq_profile: "high" (1) 0x2e-0x2e.3 (0.3)
0x0020| 20 | | still_picture: 0 0x2e.3-0x2e.4 (0.1)
0x0020| 20 | | reduced_still_picture_header: 0 0x2e.4-0x2e.5 (0.1)
0x0020| 20 | | timing_info_present_flag: 0 0x2e.5-0x2e.6 (0.1)
0x0020| 20 | | initial_display_delay_present_flag: 0 0x2e.6-0x2e.7 (0.1)
0x0020| 20 00| .| operating_points_cnt_minus_1: 0 0x2e.7-0x2f.4 (0.5)
| | | operating_points[0:1]: 0x2f.4-0x31.6 (2.2)
| | | [0]{}: operating_point 0x2f.4-0x31.6 (2.2)
0x0020| 00| .| operating_point_idc: 0 0x2f.4-0x31 (1.4)
0x0030|00 |. |
0x0030| fa | . | seq_level_idx: 31 0x31-0x31.5 (0.5)
0x0030| fa | . | seq_tier: 0 0x31.5-0x31.6 (0.1)
0x0030| fa 1e | .. | frame_width_bits_minus_1: 8 0x31.6-0x32.2 (0.4)
0x0030| 1e | . | frame_height_bits_minus_1: 7 0x32.2-0x32.6 (0.4)
0x0030| 1e 7f | .. | max_frame_width_minus_1: 319 0x32.6-0x33.7 (1.1)
0x0030| 7f de | .. | max_frame_height_minus_1: 239 0x33.7-0x34.7 (1)
0x0030| de | . | frame_id_numbers_present_flag: 0 0x34.7-0x35 (0.1)
0x0030| 21 | ! | use_128x128_superblock: 0 0x35-0x35.1 (0.1)
0x0030| 21 | ! | enable_filter_intra: 0 0x35.1-0x35.2 (0.1)
0x0030| 21 | ! | enable_intra_edge_filter: 1 0x35.2-0x35.3 (0.1)
0x0030| 21 | ! | enable_interintra_compound: 0 0x35.3-0x35.4 (0.1)
0x0030| 21 | ! | enable_masked_compound: 0 0x35.4-0x35.5 (0.1)
0x0030| 21 | ! | enable_warped_motion: 0 0x35.5-0x35.6 (0.1)
0x0030| 21 | ! | enable_dual_filter: 0 0x35.6-0x35.7 (0.1)
0x0030| 21 | ! | enable_order_hint: 1 0x35.7-0x36 (0.1)
0x0030| 0a | . | enable_jnt_comp: 0 0x36-0x36.1 (0.1)
0x0030| 0a | . | enable_ref_frame_mvs: 0 0x36.1-0x36.2 (0.1)
0x0030| 0a | . | seq_choose_screen_content_tools: 0 0x36.2-0x36.3 (0.1)
0x0030| 0a | . | seq_force_screen_content_tools: 0 0x36.3-0x36.4 (0.1)
0x0030| 0a | . | order_hint_bits_minus_1: 5 0x36.4-0x36.7 (0.3)
0x0030| 0a | . | enable_superres: 0 0x36.7-0x37 (0.1)
0x0030| d0 | . | enable_cdef: 1 0x37-0x37.1 (0.1)
0x0030| d0 | . | enable_restoration: 1 0x37.1-0x37.2 (0.1)
| | | color_config{}: 0x37.2-0x3a.6 (3.4)
0x0030| d0 | . | high_bitdepth: 0 0x37.2-0x37.3 (0.1)
0x0030| d0 | . | color_description_present_flag: 1 0x37.3-0x37.4 (0.1)
0x0030| d0 20 | . | color_primaries: "unspecified" (2) 0x37.4-0x38.4 (1)
0x0030| 20 20 | | transfer_characteristics: "unspecified" (2) 0x38.4-0x39.4 (1)
0x0030| 20 25 | % | matrix_coefficients: "unspecified" (2) 0x39.4-0x3a.4 (1)
0x0030| 25 | % | color_range: 0 0x3a.4-0x3a.5 (0.1)
0x0030| 25 | % | separate_uv_delta_q: 1 0x3a.5-0x3a.6 (0.1)
0x0030| 25 | % | film_grain_params_present: 0 0x3a.6-0x3a.7 (0.1)
0x0030| 25 | % | data: raw bits 0x3a.7-0x3b (0.1)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [1]{}: obu (av1_obu) 0x3b-0x4d (18)
| | | header{}: 0x3b-0x3c (1)
0x0030| 1a | . | forbidden_bit: 0 0x3b-0x3b.1 (0.1)
0x0030| 1a | . | type: "OBU_FRAME_HEADER" (3) 0x3b.1-0x3b.5 (0.4)
0x0030| 1a | . | type: "frame_header" (3) 0x3b.1-0x3b.5 (0.4)
0x0030| 1a | . | extension_flag: false 0x3b.5-0x3b.6 (0.1)
0x0030| 1a | . | has_size_field: true 0x3b.6-0x3b.7 (0.1)
0x0030| 1a | . | reserved_1bit: 0 0x3b.7-0x3c (0.1)
@ -338,7 +428,7 @@ $ fq -d mp4 dv av1.mp4
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef| [2]{}: obu (av1_obu) 0x4d-0x11c0 (4467)
| | | header{}: 0x4d-0x4e (1)
0x0040| 22 | " | forbidden_bit: 0 0x4d-0x4d.1 (0.1)
0x0040| 22 | " | type: "OBU_TILE_GROUP" (4) 0x4d.1-0x4d.5 (0.4)
0x0040| 22 | " | type: "tile_group" (4) 0x4d.1-0x4d.5 (0.4)
0x0040| 22 | " | extension_flag: false 0x4d.5-0x4d.6 (0.1)
0x0040| 22 | " | has_size_field: true 0x4d.6-0x4d.7 (0.1)
0x0040| 22 | " | reserved_1bit: 0 0x4d.7-0x4e (0.1)