mirror of
https://github.com/wader/fq.git
synced 2024-12-27 15:42:07 +03:00
Merge pull request #203 from wader/avc-sps-chroma-format-map
avc_sps: Add chroma format name mapping
This commit is contained in:
commit
df4a1e1ee0
2
format/matroska/testdata/avc.fqtest
vendored
2
format/matroska/testdata/avc.fqtest
vendored
@ -263,7 +263,7 @@ $ fq -d matroska dv /avc.mkv
|
||||
0x000| 00 | . | reserved_zero_2bits: 0 0x1.6-0x1.7 (0.2)
|
||||
0x000| 0d | . | level_idc: "1.3" (13) 0x2-0x2.7 (1)
|
||||
0x000| 91 | . | seq_parameter_set_id: 0 0x3-0x3 (0.1)
|
||||
0x000| 91 | . | chroma_format_idc: 3 0x3.1-0x3.5 (0.5)
|
||||
0x000| 91 | . | chroma_format_idc: "4:4:4" (3) 0x3.1-0x3.5 (0.5)
|
||||
0x000| 91 | . | separate_colour_plane_flag: false 0x3.6-0x3.6 (0.1)
|
||||
0x000| 91 | . | bit_depth_luma: 8 0x3.7-0x3.7 (0.1)
|
||||
0x000| 9b | . | bit_depth_chroma: 8 0x4-0x4 (0.1)
|
||||
|
2
format/mp4/testdata/avc.fqtest
vendored
2
format/mp4/testdata/avc.fqtest
vendored
@ -246,7 +246,7 @@ $ fq -d mp4 dv /avc.mp4
|
||||
0x000| 00 | . | reserved_zero_2bits: 0 0x1.6-0x1.7 (0.2)
|
||||
0x000| 0d | . | level_idc: "1.3" (13) 0x2-0x2.7 (1)
|
||||
0x000| 91 | . | seq_parameter_set_id: 0 0x3-0x3 (0.1)
|
||||
0x000| 91 | . | chroma_format_idc: 3 0x3.1-0x3.5 (0.5)
|
||||
0x000| 91 | . | chroma_format_idc: "4:4:4" (3) 0x3.1-0x3.5 (0.5)
|
||||
0x000| 91 | . | separate_colour_plane_flag: false 0x3.6-0x3.6 (0.1)
|
||||
0x000| 91 | . | bit_depth_luma: 8 0x3.7-0x3.7 (0.1)
|
||||
0x000| 9b | . | bit_depth_chroma: 8 0x4-0x4 (0.1)
|
||||
|
2
format/mp4/testdata/dash.fqtest
vendored
2
format/mp4/testdata/dash.fqtest
vendored
@ -721,7 +721,7 @@ $ fq -d mp4 dv /dash_video_init.mp4
|
||||
0x00| 10 | . | reserved_zero_2bits: 0 0x1.6-0x1.7 (0.2)
|
||||
0x00| 0d | . | level_idc: "1.3" (13) 0x2-0x2.7 (1)
|
||||
0x00| 91 | . | seq_parameter_set_id: 0 0x3-0x3 (0.1)
|
||||
0x00| 91 | . | chroma_format_idc: 3 0x3.1-0x3.5 (0.5)
|
||||
0x00| 91 | . | chroma_format_idc: "4:4:4" (3) 0x3.1-0x3.5 (0.5)
|
||||
0x00| 91 | . | separate_colour_plane_flag: false 0x3.6-0x3.6 (0.1)
|
||||
0x00| 91 | . | bit_depth_luma: 8 0x3.7-0x3.7 (0.1)
|
||||
0x00| 97 | . | bit_depth_chroma: 8 0x4-0x4 (0.1)
|
||||
|
2
format/mp4/testdata/fragmented.fqtest
vendored
2
format/mp4/testdata/fragmented.fqtest
vendored
@ -205,7 +205,7 @@ $ fq -d mp4 dv /fragmented.mp4
|
||||
0x000| 10 | . | reserved_zero_2bits: 0 0x1.6-0x1.7 (0.2)
|
||||
0x000| 0d | . | level_idc: "1.3" (13) 0x2-0x2.7 (1)
|
||||
0x000| 91 | . | seq_parameter_set_id: 0 0x3-0x3 (0.1)
|
||||
0x000| 91 | . | chroma_format_idc: 3 0x3.1-0x3.5 (0.5)
|
||||
0x000| 91 | . | chroma_format_idc: "4:4:4" (3) 0x3.1-0x3.5 (0.5)
|
||||
0x000| 91 | . | separate_colour_plane_flag: false 0x3.6-0x3.6 (0.1)
|
||||
0x000| 91 | . | bit_depth_luma: 8 0x3.7-0x3.7 (0.1)
|
||||
0x000| 97 | . | bit_depth_chroma: 8 0x4-0x4 (0.1)
|
||||
|
@ -46,6 +46,13 @@ var avcAspectRatioIdcMap = scalar.UToSymStr{
|
||||
16: "2:1",
|
||||
}
|
||||
|
||||
var chromaFormatMap = scalar.UToSymStr{
|
||||
0: "monochrome",
|
||||
1: "4:2:0",
|
||||
2: "4:2:2",
|
||||
3: "4:4:4",
|
||||
}
|
||||
|
||||
func avcVuiParameters(d *decode.D) {
|
||||
aspectRatioInfoPresentFlag := d.FieldBool("aspect_ratio_info_present_flag")
|
||||
if aspectRatioInfoPresentFlag {
|
||||
@ -142,7 +149,7 @@ func avcSPSDecode(d *decode.D, in interface{}) interface{} {
|
||||
switch profileIdc {
|
||||
// TODO: ffmpeg has some more (legacy values?)
|
||||
case 100, 110, 122, 244, 44, 83, 86, 118, 128, 138, 139, 134, 135:
|
||||
chromaFormatIdc := d.FieldUFn("chroma_format_idc", uEV)
|
||||
chromaFormatIdc := d.FieldUFn("chroma_format_idc", uEV, chromaFormatMap)
|
||||
if chromaFormatIdc == 3 {
|
||||
d.FieldBool("separate_colour_plane_flag")
|
||||
}
|
||||
|
2
format/mpeg/testdata/avc_annexb.fqtest
vendored
2
format/mpeg/testdata/avc_annexb.fqtest
vendored
@ -14,7 +14,7 @@ $ fq -d avc_annexb dv /avc_annexb
|
||||
0x000| 00 | . | reserved_zero_2bits: 0 0x1.6-0x1.7 (0.2)
|
||||
0x000| 0d | . | level_idc: "1.3" (13) 0x2-0x2.7 (1)
|
||||
0x000| 91 | . | seq_parameter_set_id: 0 0x3-0x3 (0.1)
|
||||
0x000| 91 | . | chroma_format_idc: 3 0x3.1-0x3.5 (0.5)
|
||||
0x000| 91 | . | chroma_format_idc: "4:4:4" (3) 0x3.1-0x3.5 (0.5)
|
||||
0x000| 91 | . | separate_colour_plane_flag: false 0x3.6-0x3.6 (0.1)
|
||||
0x000| 91 | . | bit_depth_luma: 8 0x3.7-0x3.7 (0.1)
|
||||
0x000| 9b | . | bit_depth_chroma: 8 0x4-0x4 (0.1)
|
||||
|
Loading…
Reference in New Issue
Block a user