xref: /aosp_15_r20/external/libopenapv/readme/apv_isobmff.md (revision abb65b4b03b69e1d508d4d9a44dcf199df16e7c3)
1*abb65b4bSAndroid Build Coastguard WorkerISOBMFF binding for APV
2*abb65b4bSAndroid Build Coastguard Worker==============
3*abb65b4bSAndroid Build Coastguard Worker
4*abb65b4bSAndroid Build Coastguard Worker# Introduction
5*abb65b4bSAndroid Build Coastguard Worker
6*abb65b4bSAndroid Build Coastguard WorkerThis document specifies methods to store data encoded with Advanced Professional Video (APV) codec in ISO Base Media File Format (ISOBMFF) files. APV is a mezzanine video codec for storage, exchange and editing of professional quality video. To support extensive, repeated editing including multiple rounds of decompression and compression all the necessary information for decoding, frame header and metadata for processing of decoded video and presentation are put together for fast and simple access. For example, frame header data are repeated in each frame even if the information in frame header are exactly identical for series of frames. When APV bitstream is stored in a file, to avoid such inefficiency codec configuration box indicates whether header information is identical to entire frames stored in a track. In this file format, for efficient access of portions of a frame, a method to identify the location of tiles are supported.
7*abb65b4bSAndroid Build Coastguard Worker
8*abb65b4bSAndroid Build Coastguard Worker# ISOBMFF binding for APV
9*abb65b4bSAndroid Build Coastguard Worker
10*abb65b4bSAndroid Build Coastguard Worker## APV Sample Entry
11*abb65b4bSAndroid Build Coastguard Worker
12*abb65b4bSAndroid Build Coastguard Worker### Definition
13*abb65b4bSAndroid Build Coastguard Worker
14*abb65b4bSAndroid Build Coastguard Worker+ Sample Entry Type: apv1
15*abb65b4bSAndroid Build Coastguard Worker
16*abb65b4bSAndroid Build Coastguard Worker+ Container: Sample Description Box ('stsd')
17*abb65b4bSAndroid Build Coastguard Worker
18*abb65b4bSAndroid Build Coastguard Worker+ Mandatory: Yes
19*abb65b4bSAndroid Build Coastguard Worker
20*abb65b4bSAndroid Build Coastguard Worker+ Quantity: One or more
21*abb65b4bSAndroid Build Coastguard Worker
22*abb65b4bSAndroid Build Coastguard Worker### Description
23*abb65b4bSAndroid Build Coastguard Worker
24*abb65b4bSAndroid Build Coastguard WorkerThe sample entry with APV1SampleEntry type specifies that the track contains APV coded video data samples. This type of sample entry shall use APVCodecConfiguraionBox.
25*abb65b4bSAndroid Build Coastguard Worker
26*abb65b4bSAndroid Build Coastguard Worker
27*abb65b4bSAndroid Build Coastguard Worker### Syntax
28*abb65b4bSAndroid Build Coastguard Worker
29*abb65b4bSAndroid Build Coastguard Workerclass APV1SmapleEntry extends VisualSampleEntry('apv1'){
30*abb65b4bSAndroid Build Coastguard Worker	APVCodecConfigurationBox	config;
31*abb65b4bSAndroid Build Coastguard Worker}
32*abb65b4bSAndroid Build Coastguard Worker
33*abb65b4bSAndroid Build Coastguard Worker### Semantics
34*abb65b4bSAndroid Build Coastguard Worker
35*abb65b4bSAndroid Build Coastguard WorkerThe value of largest_frame_width_minus1 + 1 and largest_frame_height_minus1 + 1 of the APVCodecConfigurationBox shall be used for the value of width and height fields of the VisualSampleEntry, respectively.
36*abb65b4bSAndroid Build Coastguard Worker
37*abb65b4bSAndroid Build Coastguard WorkerWhen the sample entry name is 'apv1', the stream to which this sample entry applies shall be a compliant APV stream as viewed by an APV decoder operating under the configuration (including profile, level, and so on) given in the APVCodecConfigurationBox.
38*abb65b4bSAndroid Build Coastguard Worker
39*abb65b4bSAndroid Build Coastguard WorkerThe compressorname field of the VisualSampleEntry shall have '\012APV Coding'. The sample entry with APV1SampleEntry type specifies that the track contains APV coded video data samples. This type of sample entry shall use APVCodecConfiguraionBox.
40*abb65b4bSAndroid Build Coastguard Worker
41*abb65b4bSAndroid Build Coastguard Worker## APV Codec Configuration Box
42*abb65b4bSAndroid Build Coastguard Worker
43*abb65b4bSAndroid Build Coastguard Worker### Definition
44*abb65b4bSAndroid Build Coastguard Worker
45*abb65b4bSAndroid Build Coastguard Worker+ Box Type: apvC
46*abb65b4bSAndroid Build Coastguard Worker
47*abb65b4bSAndroid Build Coastguard Worker+ Container: APV Sample Entry ('apv1')
48*abb65b4bSAndroid Build Coastguard Worker
49*abb65b4bSAndroid Build Coastguard Worker+ Mandatory: Yes
50*abb65b4bSAndroid Build Coastguard Worker
51*abb65b4bSAndroid Build Coastguard Worker+ Quantity: Exactly One
52*abb65b4bSAndroid Build Coastguard Worker
53*abb65b4bSAndroid Build Coastguard Worker### Description
54*abb65b4bSAndroid Build Coastguard Worker
55*abb65b4bSAndroid Build Coastguard WorkerThe box with APVCodecConfigurationBox shall contains information for initial configuration of a decoder which consumes the samples references the sample entry type of apv1.
56*abb65b4bSAndroid Build Coastguard Worker
57*abb65b4bSAndroid Build Coastguard WorkerAll variation of information required to decide appropriate resource for decoding, e.g. the profiles a decoder compliant to, are carried so that the client can decide whether it has appropriate resources to completely decode the AUs in that track.
58*abb65b4bSAndroid Build Coastguard Worker
59*abb65b4bSAndroid Build Coastguard Worker
60*abb65b4bSAndroid Build Coastguard Worker### Syntax
61*abb65b4bSAndroid Build Coastguard Worker
62*abb65b4bSAndroid Build Coastguard Worker~~~~
63*abb65b4bSAndroid Build Coastguard Workeraligned(8) class APVDecoderConfigurationBox extends FullBox('apvC',version=0, flags) {
64*abb65b4bSAndroid Build Coastguard Worker   unsigned int(8) configurationVersion = 1;
65*abb65b4bSAndroid Build Coastguard Worker   unsigned int(8) number_of_configuration_entry;
66*abb65b4bSAndroid Build Coastguard Worker   for (i=0; i<number_of_configuration_entry; i++) {
67*abb65b4bSAndroid Build Coastguard Worker      unsigned int(8) pbu_type[i];
68*abb65b4bSAndroid Build Coastguard Worker      unsigned int(8) number_of_frame_info[i];
69*abb65b4bSAndroid Build Coastguard Worker      for (j=0; j<number_of_frame_info[i]; j++) {
70*abb65b4bSAndroid Build Coastguard Worker         reserved_zero_6bits;
71*abb65b4bSAndroid Build Coastguard Worker         unsigned int(1) color_description_present_flag[i][j];
72*abb65b4bSAndroid Build Coastguard Worker         unsigned int(1) capture_time_distance_ignored[i][j];
73*abb65b4bSAndroid Build Coastguard Worker         unsigned int(8) profile_idc[i][j];
74*abb65b4bSAndroid Build Coastguard Worker         unsigned int(8) level_idc[i][j];
75*abb65b4bSAndroid Build Coastguard Worker         unsigned int(8) band_idc[i][j];
76*abb65b4bSAndroid Build Coastguard Worker         unsigned int(32) frame_width_minus1[i][j];
77*abb65b4bSAndroid Build Coastguard Worker         unsigned int(32) frame_height_minus1[i][j];
78*abb65b4bSAndroid Build Coastguard Worker         unsigned int(4) chroma_format_idc[i][j];
79*abb65b4bSAndroid Build Coastguard Worker         unsigned int(4) bit_depth_minus8[i][j];
80*abb65b4bSAndroid Build Coastguard Worker         unsigned int(8) capture_time_distance[i][j];
81*abb65b4bSAndroid Build Coastguard Worker         if (color_description_present_flag[i][j]) {
82*abb65b4bSAndroid Build Coastguard Worker            unsigned int(8) color_primaries[i][j];
83*abb65b4bSAndroid Build Coastguard Worker            unsigned int(8) transfer_characteristics[i][j];
84*abb65b4bSAndroid Build Coastguard Worker            unsigned int(8) matrix_coefficients[i][j];
85*abb65b4bSAndroid Build Coastguard Worker         }
86*abb65b4bSAndroid Build Coastguard Worker      }
87*abb65b4bSAndroid Build Coastguard Worker   }
88*abb65b4bSAndroid Build Coastguard Worker}
89*abb65b4bSAndroid Build Coastguard Worker~~~~
90*abb65b4bSAndroid Build Coastguard Worker
91*abb65b4bSAndroid Build Coastguard Worker### Semantics
92*abb65b4bSAndroid Build Coastguard Worker
93*abb65b4bSAndroid Build Coastguard Worker+ number_of_configuration_entry
94*abb65b4bSAndroid Build Coastguard Worker    > indicates the number of frame header information for a specific PBU types are stored.
95*abb65b4bSAndroid Build Coastguard Worker
96*abb65b4bSAndroid Build Coastguard Worker+ pbu_type[i]
97*abb65b4bSAndroid Build Coastguard Worker
98*abb65b4bSAndroid Build Coastguard Worker   > indicates the value of the pbu_type field in the pbu header immediately preceding the frame data for a certain index i.
99*abb65b4bSAndroid Build Coastguard Worker
100*abb65b4bSAndroid Build Coastguard Worker+ number_of_frame_info[i]
101*abb65b4bSAndroid Build Coastguard Worker
102*abb65b4bSAndroid Build Coastguard Worker   > indicates the number of variations of the frame header information for the frames whose value of the pbu_type field in the pbu header immediately preceding it is idendtical with the value of the pub_type[i] field for a certain index i.
103*abb65b4bSAndroid Build Coastguard Worker
104*abb65b4bSAndroid Build Coastguard Worker+ color_description_present_flag[i][j]
105*abb65b4bSAndroid Build Coastguard Worker   >indicates whether the color description information is provided for the jth variation of frame header whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i.
106*abb65b4bSAndroid Build Coastguard Worker
107*abb65b4bSAndroid Build Coastguard Worker+ capture_time_distance_ignored[i][j]
108*abb65b4bSAndroid Build Coastguard Worker   > indicates whether the value of the capture_time_distance field in the jth variation of frame header is used for the processing of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i.
109*abb65b4bSAndroid Build Coastguard Worker
110*abb65b4bSAndroid Build Coastguard Worker+ profile_idc[i][j]
111*abb65b4bSAndroid Build Coastguard Worker   > indicates the value of the profile_idc field in the jth variation of the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1, then the same value of this field must be used as the value of the profile_idc field in the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1 is greater than 1, then the frame header in each sample must provide the value of profile_idc field matched with one among the values of this field for all index j for the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i.
112*abb65b4bSAndroid Build Coastguard Worker
113*abb65b4bSAndroid Build Coastguard Worker+ level_idc[i][j]
114*abb65b4bSAndroid Build Coastguard Worker   > indicates the value of the level_idc field in the jth variation of the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1, then the same value of this field must be used as the value of the level_idc field in the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1 is greater than 1, then the frame header in each sample must provide the value of level_idc field matched with one among the values of this field for all index j for the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i.
115*abb65b4bSAndroid Build Coastguard Worker
116*abb65b4bSAndroid Build Coastguard Worker+ band_idc[i][j]
117*abb65b4bSAndroid Build Coastguard Worker   > indicates the value of the band_idc field in the jth variation of the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1, then the same value of this field must be used as the value of the band_idc field in the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1 is greater than 1, then the frame header in each sample must provide the value of band_idc field matched with one among the values of this field for all index j for the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i.
118*abb65b4bSAndroid Build Coastguard Worker
119*abb65b4bSAndroid Build Coastguard Worker+ frame_width_minus1[i][j]
120*abb65b4bSAndroid Build Coastguard Worker   > indicates the value of the frame_width_minus1 field in the jth variation of the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1, then the same value of this field must be used as the value of the frame_width_minus1 field in the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1 is greater than 1, then the frame header in each sample must provide the value of frame_width_minus1 field matched with one among the values of this field for all index j for the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i.
121*abb65b4bSAndroid Build Coastguard Worker
122*abb65b4bSAndroid Build Coastguard Worker+ frame_height_minus1[i][j]
123*abb65b4bSAndroid Build Coastguard Worker   > indicates the value of the frame_height_minus1 field in the jth variation of the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1, then the same value of this field must be used as the value of the frame_height_minus1 field in the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1 is greater than 1, then the frame header in each sample must provide the value of frame_height_minus1 field matched with one among the values of this field for all index j for the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i.
124*abb65b4bSAndroid Build Coastguard Worker
125*abb65b4bSAndroid Build Coastguard Worker+ chroma_format_idc[i][j]
126*abb65b4bSAndroid Build Coastguard Worker   > indicates the value of the chroma_format_idc field in the jth variation of the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1, then the same value of this field must be used as the value of the chroma_format_idc field in the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1 is greater than 1, then the frame header in each sample must provide the value of chroma_format_idc field matched with one among the values of this field for all index j for the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i.
127*abb65b4bSAndroid Build Coastguard Worker
128*abb65b4bSAndroid Build Coastguard Worker+ bit_depth_minus8[i]
129*abb65b4bSAndroid Build Coastguard Worker   > indicates the value of the bit_depth_minus8 field in the jth variation of the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1, then the same value of this field must be used as the value of the bit_depth_minus8 field in the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1 is greater than 1, then the frame header in each sample must provide the value of bit_depth_minus8 field matched with one among the values of this field for all index j for the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i.
130*abb65b4bSAndroid Build Coastguard Worker
131*abb65b4bSAndroid Build Coastguard Worker+ capture_time_distance[i][j]
132*abb65b4bSAndroid Build Coastguard Worker   > indicates the value of the capture_time_distance field in the jth variation of the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1, then the same value of this field must be used as the value of the capture_time_distance field in the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1 is greater than 1, then the frame header in each sample must provide the value of capture_time_distance field matched with one among the values of this field for all index j for the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i.
133*abb65b4bSAndroid Build Coastguard Worker
134*abb65b4bSAndroid Build Coastguard Worker+ color_primaries[i][j]
135*abb65b4bSAndroid Build Coastguard Worker > indicates the value of the color_primaries field in the jth variation of the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1, then the same value of this field must be used as the value of the profile_idc field in the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1 is greater than 1, then the frame header in each sample must provide the value of color_primaries field matched with one among the values of this field for all index j for the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i.
136*abb65b4bSAndroid Build Coastguard Worker
137*abb65b4bSAndroid Build Coastguard Worker+ transfer_characteristics[i][j]
138*abb65b4bSAndroid Build Coastguard Worker > indicates the value of the transfer_characteristics field in the jth variation of the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1, then the same value of this field must be used as the value of the profile_idc field in the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1 is greater than 1, then the frame header in each sample must provide the value of transfer_characteristics field matched with one among the values of this field for all index j for the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i.
139*abb65b4bSAndroid Build Coastguard Worker
140*abb65b4bSAndroid Build Coastguard Worker+ matrix_coefficients[i][j]
141*abb65b4bSAndroid Build Coastguard Worker > indicates the value of the matrix_coefficients field in the jth variation of the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1, then the same value of this field must be used as the value of the profile_idc field in the frame header of the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i. If the value of number_of_frame_info[i] is 1 is greater than 1, then the frame header in each sample must provide the value of matrix_cofficients field matched with one among the values of this field for all index j for the frames whose value of the pbu_type field in the pbu header immediately preceding it is identical with the value of the pbu_type[i] field for a certain index i.
142*abb65b4bSAndroid Build Coastguard Worker
143*abb65b4bSAndroid Build Coastguard Worker## APV Sample Description
144*abb65b4bSAndroid Build Coastguard Worker
145*abb65b4bSAndroid Build Coastguard Worker###	Format of sample
146*abb65b4bSAndroid Build Coastguard WorkerWhen APV coded bitstream is encapsulated in a track with APVSamspleEntry, each sample shall contain one and only one access unit of APV coded data
147*abb65b4bSAndroid Build Coastguard Worker
148*abb65b4bSAndroid Build Coastguard Worker###	Sync sample
149*abb65b4bSAndroid Build Coastguard WorkerEvery samples of APV bitstream shall be sync samples.
150*abb65b4bSAndroid Build Coastguard Worker
151*abb65b4bSAndroid Build Coastguard Worker###	Sub-sample for APV
152*abb65b4bSAndroid Build Coastguard WorkerFor the use of the SubSampleInformationBox as defined in ISO/IEC 14496-12 in an APV stream, a sub-sample is defined on the basis of the value of the flags field of the sub-sample information box as specified below. The presence of this box is optional; however, if present in a track containing APV data, the codec_specific_parameters field in the box shall have the semantics defined here.
153*abb65b4bSAndroid Build Coastguard Worker
154*abb65b4bSAndroid Build Coastguard Workerflags specifies the type of sub-sample information given in this box as follows:
155*abb65b4bSAndroid Build Coastguard Worker>0:	tile-based sub-samples: A sub-sample contains one tile.
156*abb65b4bSAndroid Build Coastguard Worker>1:	PBU-based sub-samples : A sub-sample contains one PBU
157*abb65b4bSAndroid Build Coastguard WorkerOther values of flags are reserved.
158*abb65b4bSAndroid Build Coastguard Worker
159*abb65b4bSAndroid Build Coastguard WorkerThe subsample_priority field shall be set to a value in accordance with the specification of this field in ISO/IEC 14496-12.
160*abb65b4bSAndroid Build Coastguard WorkerThe discardable field shall be set to 1 only if this sample would still be decodable if this sub-sample is discarded.
161*abb65b4bSAndroid Build Coastguard Worker
162*abb65b4bSAndroid Build Coastguard WorkerThe codec_specific_parameters field of the SubSampleInformationBox is defined for APV as follows:
163*abb65b4bSAndroid Build Coastguard Worker~~~~
164*abb65b4bSAndroid Build Coastguard Worker
165*abb65b4bSAndroid Build Coastguard Worker		if (flags == 0) {
166*abb65b4bSAndroid Build Coastguard Worker			unsigned int(32) tile_index;
167*abb65b4bSAndroid Build Coastguard Worker                             }
168*abb65b4bSAndroid Build Coastguard Worker		else {
169*abb65b4bSAndroid Build Coastguard Worker			bit(32) reserved = 0;
170*abb65b4bSAndroid Build Coastguard Worker		}
171*abb65b4bSAndroid Build Coastguard Worker~~~~
172*abb65b4bSAndroid Build Coastguard Worker
173*abb65b4bSAndroid Build Coastguard Workertile_index for sub-samples based on tiles, this parameter indicates the tile index in raster order in a frame.
174