New upstream version 20.09+dfsg
Chow Loong Jin
3 years ago
6 | 6 | bug reports and feature request are here: |
7 | 7 | https://sourceforge.net/p/mediainfo/_list/tickets |
8 | 8 | |
9 | Version 20.09, 2020-10-09 | |
10 | ------------- | |
11 | + Dolby ED2: full featured support (presentations, presentation targets, beds, objects) | |
12 | + MKV: support of Dolby Vision metadata | |
13 | + MXF: detection of Dolby E hidden in PCM tracks having more than 2 channels | |
14 | + WAV: detection of Dolby E hidden in PCM tracks having more than 2 channels | |
15 | + CineForm: display of color space (including Bayer), bit depth | |
16 | x WAV: more precise sample count | |
17 | x SMPTE ST 337: catch of streams starting later than usual (probing increased from 4 to 16 PCM "frames") | |
18 | x PNG: detection of additional alpha plane in color space | |
19 | x MXF: detection of additional alpha plane in color space | |
20 | x AVI: detection of additional alpha plane in color space | |
21 | x MPEG Audio: was wrongly flagging Xing info tag as CBR | |
22 | x VorbisTag: does not skip DISCID | |
23 | x Miscellaneous bug/crash fixes | |
24 | ||
9 | 25 | Version 20.08, 2020-08-11 |
10 | 26 | ------------- |
11 | 27 | + MPEG-H 3D Audio full featured support (group presets, switch groups, groups, signal groups) |
1 | 1 | |
2 | 2 | project(MediaInfoLib) |
3 | 3 | |
4 | set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") | |
4 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules") | |
5 | 5 | |
6 | 6 | set(MediaInfoLib_MAJOR_VERSION 20) |
7 | set(MediaInfoLib_MINOR_VERSION 08) | |
7 | set(MediaInfoLib_MINOR_VERSION 09) | |
8 | 8 | set(MediaInfoLib_PATCH_VERSION 0) |
9 | 9 | set(MediaInfoLib_VERSION ${MediaInfoLib_MAJOR_VERSION}.${MediaInfoLib_MINOR_VERSION}) |
10 | 10 | |
168 | 168 | ${MediaInfoLib_SOURCES_PATH}/MediaInfo/Audio/File_Caf.cpp |
169 | 169 | ${MediaInfoLib_SOURCES_PATH}/MediaInfo/Audio/File_Celt.cpp |
170 | 170 | ${MediaInfoLib_SOURCES_PATH}/MediaInfo/Audio/File_ChannelGrouping.cpp |
171 | ${MediaInfoLib_SOURCES_PATH}/MediaInfo/Audio/File_ChannelSplitting.cpp | |
171 | 172 | ${MediaInfoLib_SOURCES_PATH}/MediaInfo/Audio/File_Dsdiff.cpp |
172 | 173 | ${MediaInfoLib_SOURCES_PATH}/MediaInfo/Audio/File_Dsf.cpp |
173 | 174 | ${MediaInfoLib_SOURCES_PATH}/MediaInfo/Audio/File_Dts.cpp |
321 | 322 | ${MediaInfoLib_SOURCES_PATH}/MediaInfo/Video/File_Avc_Duplicate.cpp |
322 | 323 | ${MediaInfoLib_SOURCES_PATH}/MediaInfo/Video/File_AvsV.cpp |
323 | 324 | ${MediaInfoLib_SOURCES_PATH}/MediaInfo/Video/File_Canopus.cpp |
325 | ${MediaInfoLib_SOURCES_PATH}/MediaInfo/Video/File_CineForm.cpp | |
324 | 326 | ${MediaInfoLib_SOURCES_PATH}/MediaInfo/Video/File_Dirac.cpp |
325 | 327 | ${MediaInfoLib_SOURCES_PATH}/MediaInfo/Video/File_DolbyVisionMetadata.cpp |
326 | 328 | ${MediaInfoLib_SOURCES_PATH}/MediaInfo/Video/File_Ffv1.cpp |
53 | 53 | ../../../Source/MediaInfo/Audio/File_Caf.cpp \ |
54 | 54 | ../../../Source/MediaInfo/Audio/File_Celt.cpp \ |
55 | 55 | ../../../Source/MediaInfo/Audio/File_ChannelGrouping.cpp \ |
56 | ../../../Source/MediaInfo/Audio/File_ChannelSplitting.cpp \ | |
56 | 57 | ../../../Source/MediaInfo/Audio/File_Dsdiff.cpp \ |
57 | 58 | ../../../Source/MediaInfo/Audio/File_Dsf.cpp \ |
58 | 59 | ../../../Source/MediaInfo/Audio/File_Dts.cpp \ |
205 | 206 | ../../../Source/MediaInfo/Video/File_Avc_Duplicate.cpp \ |
206 | 207 | ../../../Source/MediaInfo/Video/File_AvsV.cpp \ |
207 | 208 | ../../../Source/MediaInfo/Video/File_Canopus.cpp \ |
209 | ../../../Source/MediaInfo/Video/File_CineForm.cpp \ | |
208 | 210 | ../../../Source/MediaInfo/Video/File_Dirac.cpp \ |
209 | 211 | ../../../Source/MediaInfo/Video/File_DolbyVisionMetadata.cpp \ |
210 | 212 | ../../../Source/MediaInfo/Video/File_Ffv1.cpp \ |
4 | 4 | dnl ------------------------------------------------------------------------- |
5 | 5 | dnl Name and version |
6 | 6 | dnl |
7 | AC_INIT([libmediainfo], [20.08]) | |
7 | AC_INIT([libmediainfo], [20.09]) | |
8 | 8 | |
9 | 9 | dnl ------------------------------------------------------------------------- |
10 | 10 | dnl Test if we are at the good place |
495 | 495 | CXXFLAGS="$CXXFLAGS -DMEDIAINFO_LIBCURL_NO" |
496 | 496 | using_libcurl="no" |
497 | 497 | elif test "$with_libcurl" = "runtime"; then |
498 | AC_CHECK_LIB([dl], [dlopen], [use_libdl="yes"], [use_libdl="no"]) | |
499 | if test "$use_libdl" = "yes"; then | |
500 | MediaInfoLib_LIBS_Static="$MediaInfoLib_LIBS_Static -ldl" | |
501 | Curl_Lib=" -ldl" | |
502 | fi | |
498 | 503 | CXXFLAGS="$CXXFLAGS -DMEDIAINFO_LIBCURL_DLL_RUNTIME" |
499 | 504 | using_libcurl="system (runtime)" |
500 | 505 | elif test -e ../../../../curl/libcurl.pc; then |
2 | 2 | # Contributor: hydro <hydro@freenet.de> |
3 | 3 | |
4 | 4 | pkgname=('libmediainfo' 'python2-mediainfo' 'python-mediainfo') |
5 | pkgver=20.08 | |
5 | pkgver=20.09 | |
6 | 6 | pkgrel=1 |
7 | 7 | pkgdesc="shared library for mediainfo" |
8 | 8 | arch=('i686' 'x86_64') |
1 | 1 | Source: libmediainfo |
2 | 2 | Binary: libmediainfo-dev, libmediainfo0, python-mediainfodll, python3-mediainfodll, libmediainfo-doc libmediainfo0-dbg |
3 | 3 | Architecture: any all |
4 | Version: 20.08-1 | |
4 | Version: 20.09-1 | |
5 | 5 | Maintainer: MediaArea.net SARL <info@mediaarea.net> |
6 | 6 | Homepage: http://MediaArea.net/MediaInfo |
7 | 7 | Standards-Version: 3.9.6 |
15 | 15 | python-mediainfodll deb python optional arch=all |
16 | 16 | python3-mediainfodll deb python optional arch=all |
17 | 17 | Checksums-Sha1: |
18 | 0000000000000000000000000000000000000000 000000 libmediainfo_20.08.orig.tar.xz | |
19 | 0000000000000000000000000000000000000000 000000 libmediainfo_20.08-1.debian.tar.xz | |
18 | 0000000000000000000000000000000000000000 000000 libmediainfo_20.09.orig.tar.xz | |
19 | 0000000000000000000000000000000000000000 000000 libmediainfo_20.09-1.debian.tar.xz | |
20 | 20 | Checksums-Sha256: |
21 | 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_20.08.orig.tar.xz | |
22 | 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_20.08-1.debian.tar.xz | |
21 | 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_20.09.orig.tar.xz | |
22 | 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_20.09-1.debian.tar.xz | |
23 | 23 | Files: |
24 | 00000000000000000000000000000000 000000 libmediainfo_20.08.orig.tar.xz | |
25 | 00000000000000000000000000000000 000000 libmediainfo_20.08-1.debian.tar.xz | |
24 | 00000000000000000000000000000000 000000 libmediainfo_20.09.orig.tar.xz | |
25 | 00000000000000000000000000000000 000000 libmediainfo_20.09-1.debian.tar.xz |
0 | %global libmediainfo_version 20.08 | |
0 | %global libmediainfo_version 20.09 | |
1 | 1 | %global libmediainfo_version_major 20 |
2 | %global libmediainfo_version_minor 08 | |
2 | %global libmediainfo_version_minor 09 | |
3 | 3 | %global libzen_version 0.4.37 |
4 | 4 | %global libzen_version_major 0 |
5 | 5 | %global libzen_version_minor 4 |
410 | 410 | %endif |
411 | 411 | |
412 | 412 | %changelog |
413 | * Sun Jan 01 2012 MediaArea.net SARL <info@mediaarea.net> - 20.08-0 | |
413 | * Sun Jan 01 2012 MediaArea.net SARL <info@mediaarea.net> - 20.09-0 | |
414 | 414 | - See History.txt for more info and real dates |
415 | 415 | - Previous packages made by Toni Graffy <toni@links2linux.de> |
416 | 416 | - Fedora style made by Vasiliy N. Glazov <vascom2@gmail.com> |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | VS_VERSION_INFO VERSIONINFO |
3 | FILEVERSION 20,08,0,0 | |
4 | PRODUCTVERSION 20,08,0,0 | |
3 | FILEVERSION 20,09,0,0 | |
4 | PRODUCTVERSION 20,09,0,0 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | VALUE "FileDescription", "Most relevant technical and tag data for video and audio files" |
21 | VALUE "FileVersion", "20.08.0.0" | |
21 | VALUE "FileVersion", "20.09.0.0" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "20.08.0.0" | |
24 | VALUE "ProductVersion", "20.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
127 | 127 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Caf.cpp" /> |
128 | 128 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Celt.cpp" /> |
129 | 129 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelGrouping.cpp" /> |
130 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.cpp" /> | |
130 | 131 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_DolbyE.cpp" /> |
131 | 132 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Dsdiff.cpp" /> |
132 | 133 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Dsf.cpp" /> |
260 | 261 | <ClCompile Include="..\..\..\Source\MediaInfo\Text\File_Ttml.cpp" /> |
261 | 262 | <ClCompile Include="..\..\..\Source\MediaInfo\TimeCode.cpp" /> |
262 | 263 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_Av1.cpp" /> |
264 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_CineForm.cpp" /> | |
263 | 265 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.cpp" /> |
264 | 266 | <ClCompile Include="..\..\..\Source\MediaInfo\XmlUtils.cpp" /> |
265 | 267 | <ClCompile Include="..\..\..\Source\MediaInfo\OutputHelpers.cpp" /> |
416 | 418 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Caf.h" /> |
417 | 419 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Celt.h" /> |
418 | 420 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelGrouping.h" /> |
421 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.h" /> | |
419 | 422 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_DolbyE.h" /> |
420 | 423 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Dsdiff.h" /> |
421 | 424 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Dsf.h" /> |
577 | 580 | <ClInclude Include="..\..\..\Source\MediaInfo\Text\File_Ttml.h" /> |
578 | 581 | <ClInclude Include="..\..\..\Source\MediaInfo\TimeCode.h" /> |
579 | 582 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_Av1.h" /> |
583 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_CineForm.h" /> | |
580 | 584 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.h" /> |
581 | 585 | <ClInclude Include="..\..\..\Source\MediaInfo\XmlUtils.h" /> |
582 | 586 | <ClInclude Include="..\..\..\Source\MediaInfo\OutputHelpers.h" /> |
796 | 796 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.cpp"> |
797 | 797 | <Filter>Source Files\Video</Filter> |
798 | 798 | </ClCompile> |
799 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.cpp"> | |
800 | <Filter>Source Files\Audio</Filter> | |
801 | </ClCompile> | |
802 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_CineForm.cpp"> | |
803 | <Filter>Source Files\Video</Filter> | |
804 | </ClCompile> | |
799 | 805 | </ItemGroup> |
800 | 806 | <ItemGroup> |
801 | 807 | <ClInclude Include="..\..\..\Source\MediaInfo\File__Analyse_Automatic.h"> |
1491 | 1497 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Usac.h"> |
1492 | 1498 | <Filter>Header Files\Audio</Filter> |
1493 | 1499 | </ClInclude> |
1500 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.h"> | |
1501 | <Filter>Header Files\Audio</Filter> | |
1502 | </ClInclude> | |
1503 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_CineForm.h"> | |
1504 | <Filter>Header Files\Video</Filter> | |
1505 | </ClInclude> | |
1494 | 1506 | </ItemGroup> |
1495 | 1507 | </Project>⏎ |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | VS_VERSION_INFO VERSIONINFO |
3 | FILEVERSION 20,08,0,0 | |
4 | PRODUCTVERSION 20,08,0,0 | |
3 | FILEVERSION 20,09,0,0 | |
4 | PRODUCTVERSION 20,09,0,0 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | VALUE "FileDescription", "Most relevant technical and tag data for video and audio files" |
21 | VALUE "FileVersion", "20.08.0.0" | |
21 | VALUE "FileVersion", "20.09.0.0" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "20.08.0.0" | |
24 | VALUE "ProductVersion", "20.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | VS_VERSION_INFO VERSIONINFO |
3 | FILEVERSION 20,08,0,0 | |
4 | PRODUCTVERSION 20,08,0,0 | |
3 | FILEVERSION 20,09,0,0 | |
4 | PRODUCTVERSION 20,09,0,0 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | VALUE "FileDescription", "Most relevant technical and tag data for video and audio files" |
21 | VALUE "FileVersion", "20.08.0.0" | |
21 | VALUE "FileVersion", "20.09.0.0" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "20.08.0.0" | |
24 | VALUE "ProductVersion", "20.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
127 | 127 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Caf.cpp" /> |
128 | 128 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Celt.cpp" /> |
129 | 129 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelGrouping.cpp" /> |
130 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.cpp" /> | |
130 | 131 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_DolbyE.cpp" /> |
131 | 132 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Dsdiff.cpp" /> |
132 | 133 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Dsf.cpp" /> |
260 | 261 | <ClCompile Include="..\..\..\Source\MediaInfo\Text\File_Ttml.cpp" /> |
261 | 262 | <ClCompile Include="..\..\..\Source\MediaInfo\TimeCode.cpp" /> |
262 | 263 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_Av1.cpp" /> |
264 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_CineForm.cpp" /> | |
263 | 265 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.cpp" /> |
264 | 266 | <ClCompile Include="..\..\..\Source\MediaInfo\XmlUtils.cpp" /> |
265 | 267 | <ClCompile Include="..\..\..\Source\MediaInfo\OutputHelpers.cpp" /> |
416 | 418 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Caf.h" /> |
417 | 419 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Celt.h" /> |
418 | 420 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelGrouping.h" /> |
421 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.h" /> | |
419 | 422 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_DolbyE.h" /> |
420 | 423 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Dsdiff.h" /> |
421 | 424 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Dsf.h" /> |
577 | 580 | <ClInclude Include="..\..\..\Source\MediaInfo\Text\File_Ttml.h" /> |
578 | 581 | <ClInclude Include="..\..\..\Source\MediaInfo\TimeCode.h" /> |
579 | 582 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_Av1.h" /> |
583 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_CineForm.h" /> | |
580 | 584 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.h" /> |
581 | 585 | <ClInclude Include="..\..\..\Source\MediaInfo\XmlUtils.h" /> |
582 | 586 | <ClInclude Include="..\..\..\Source\MediaInfo\OutputHelpers.h" /> |
796 | 796 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.cpp"> |
797 | 797 | <Filter>Source Files\Video</Filter> |
798 | 798 | </ClCompile> |
799 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.cpp"> | |
800 | <Filter>Source Files\Audio</Filter> | |
801 | </ClCompile> | |
802 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_CineForm.cpp"> | |
803 | <Filter>Source Files\Video</Filter> | |
804 | </ClCompile> | |
799 | 805 | </ItemGroup> |
800 | 806 | <ItemGroup> |
801 | 807 | <ClInclude Include="..\..\..\Source\MediaInfo\File__Analyse_Automatic.h"> |
1491 | 1497 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Usac.h"> |
1492 | 1498 | <Filter>Header Files\Audio</Filter> |
1493 | 1499 | </ClInclude> |
1500 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.h"> | |
1501 | <Filter>Header Files\Audio</Filter> | |
1502 | </ClInclude> | |
1503 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_CineForm.h"> | |
1504 | <Filter>Header Files\Video</Filter> | |
1505 | </ClInclude> | |
1494 | 1506 | </ItemGroup> |
1495 | 1507 | </Project>⏎ |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | VS_VERSION_INFO VERSIONINFO |
3 | FILEVERSION 20,08,0,0 | |
4 | PRODUCTVERSION 20,08,0,0 | |
3 | FILEVERSION 20,09,0,0 | |
4 | PRODUCTVERSION 20,09,0,0 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | VALUE "FileDescription", "Most relevant technical and tag data for video and audio files" |
21 | VALUE "FileVersion", "20.08.0.0" | |
21 | VALUE "FileVersion", "20.09.0.0" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "20.08.0.0" | |
24 | VALUE "ProductVersion", "20.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | VS_VERSION_INFO VERSIONINFO |
3 | FILEVERSION 20,08,0,0 | |
4 | PRODUCTVERSION 20,08,0,0 | |
3 | FILEVERSION 20,09,0,0 | |
4 | PRODUCTVERSION 20,09,0,0 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | VALUE "FileDescription", "Most relevant technical and tag data for video and audio files" |
21 | VALUE "FileVersion", "20.08.0.0" | |
21 | VALUE "FileVersion", "20.09.0.0" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "20.08.0.0" | |
24 | VALUE "ProductVersion", "20.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
127 | 127 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Caf.cpp" /> |
128 | 128 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Celt.cpp" /> |
129 | 129 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelGrouping.cpp" /> |
130 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.cpp" /> | |
130 | 131 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_DolbyE.cpp" /> |
131 | 132 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Dsdiff.cpp" /> |
132 | 133 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Dsf.cpp" /> |
260 | 261 | <ClCompile Include="..\..\..\Source\MediaInfo\Text\File_Ttml.cpp" /> |
261 | 262 | <ClCompile Include="..\..\..\Source\MediaInfo\TimeCode.cpp" /> |
262 | 263 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_Av1.cpp" /> |
264 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_CineForm.cpp" /> | |
263 | 265 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.cpp" /> |
264 | 266 | <ClCompile Include="..\..\..\Source\MediaInfo\XmlUtils.cpp" /> |
265 | 267 | <ClCompile Include="..\..\..\Source\MediaInfo\OutputHelpers.cpp" /> |
416 | 418 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Caf.h" /> |
417 | 419 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Celt.h" /> |
418 | 420 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelGrouping.h" /> |
421 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.h" /> | |
419 | 422 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_DolbyE.h" /> |
420 | 423 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Dsdiff.h" /> |
421 | 424 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Dsf.h" /> |
577 | 580 | <ClInclude Include="..\..\..\Source\MediaInfo\Text\File_Ttml.h" /> |
578 | 581 | <ClInclude Include="..\..\..\Source\MediaInfo\TimeCode.h" /> |
579 | 582 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_Av1.h" /> |
583 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_CineForm.h" /> | |
580 | 584 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.h" /> |
581 | 585 | <ClInclude Include="..\..\..\Source\MediaInfo\XmlUtils.h" /> |
582 | 586 | <ClInclude Include="..\..\..\Source\MediaInfo\OutputHelpers.h" /> |
796 | 796 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.cpp"> |
797 | 797 | <Filter>Source Files\Video</Filter> |
798 | 798 | </ClCompile> |
799 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.cpp"> | |
800 | <Filter>Source Files\Audio</Filter> | |
801 | </ClCompile> | |
802 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_CineForm.cpp"> | |
803 | <Filter>Source Files\Video</Filter> | |
804 | </ClCompile> | |
799 | 805 | </ItemGroup> |
800 | 806 | <ItemGroup> |
801 | 807 | <ClInclude Include="..\..\..\Source\MediaInfo\File__Analyse_Automatic.h"> |
1491 | 1497 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Usac.h"> |
1492 | 1498 | <Filter>Header Files\Audio</Filter> |
1493 | 1499 | </ClInclude> |
1500 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.h"> | |
1501 | <Filter>Header Files\Audio</Filter> | |
1502 | </ClInclude> | |
1503 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_CineForm.h"> | |
1504 | <Filter>Header Files\Video</Filter> | |
1505 | </ClInclude> | |
1494 | 1506 | </ItemGroup> |
1495 | 1507 | </Project>⏎ |
0 | <?xml version="1.0" encoding="utf-8"?> | |
0 | <?xml version="1.0" encoding="utf-8"?> | |
1 | 1 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
2 | 2 | <ItemGroup Label="ProjectConfigurations"> |
3 | 3 | <ProjectConfiguration Include="Debug|ARM"> |
190 | 190 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Caf.cpp" /> |
191 | 191 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Celt.cpp" /> |
192 | 192 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelGrouping.cpp" /> |
193 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.cpp" /> | |
193 | 194 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_DolbyE.cpp" /> |
194 | 195 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Dsdiff.cpp" /> |
195 | 196 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Dsf.cpp" /> |
197 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Mpegh3da.cpp" /> | |
196 | 198 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_OpenMG.cpp" /> |
197 | 199 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Opus.cpp" /> |
198 | 200 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Pcm_M2ts.cpp" /> |
203 | 205 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_SmpteSt0337.cpp" /> |
204 | 206 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Usac.cpp" /> |
205 | 207 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_EbuCore.cpp" /> |
208 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_Niso.cpp" /> | |
206 | 209 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_Fims.cpp" /> |
207 | 210 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_PBCore2.cpp" /> |
208 | 211 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_reVTMD.cpp" /> |
266 | 269 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Mpc.cpp" /> |
267 | 270 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_MpcSv8.cpp" /> |
268 | 271 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Mpega.cpp" /> |
269 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Mpegh3da.cpp" /> | |
270 | 272 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Pcm.cpp" /> |
271 | 273 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Ps2Audio.cpp" /> |
272 | 274 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ScreamTracker3.cpp" /> |
322 | 324 | <ClCompile Include="..\..\..\Source\MediaInfo\Text\File_Ttml.cpp" /> |
323 | 325 | <ClCompile Include="..\..\..\Source\MediaInfo\TimeCode.cpp" /> |
324 | 326 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_Av1.cpp" /> |
327 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_CineForm.cpp" /> | |
325 | 328 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.cpp" /> |
326 | 329 | <ClCompile Include="..\..\..\Source\MediaInfo\XmlUtils.cpp" /> |
327 | 330 | <ClCompile Include="..\..\..\Source\MediaInfo\OutputHelpers.cpp" /> |
406 | 409 | <ClCompile Include="..\..\..\Source\MediaInfo\Reader\Reader_libmms.cpp" /> |
407 | 410 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_Mpeg7.cpp" /> |
408 | 411 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_PBCore.cpp" /> |
409 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_Niso.cpp" /> | |
410 | 412 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_Vc3.cpp" /> |
411 | 413 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_Vp8.cpp" /> |
412 | 414 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_Y4m.cpp" /> |
479 | 481 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Caf.h" /> |
480 | 482 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Celt.h" /> |
481 | 483 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelGrouping.h" /> |
484 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.h" /> | |
482 | 485 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_DolbyE.h" /> |
483 | 486 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Dsdiff.h" /> |
484 | 487 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Dsf.h" /> |
488 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Mpegh3da.h" /> | |
485 | 489 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_OpenMG.h" /> |
486 | 490 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Opus.h" /> |
487 | 491 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Pcm_M2ts.h" /> |
490 | 494 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_SmpteSt0302.h" /> |
491 | 495 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_SmpteSt0331.h" /> |
492 | 496 | <ClInclude Include="..\..\..\source\mediainfo\audio\File_SmpteSt0337.h" /> |
497 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Usac.h" /> | |
493 | 498 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_EbuCore.h" /> |
499 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_Niso.h" /> | |
494 | 500 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_Fims.h" /> |
495 | 501 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_PBCore2.h" /> |
496 | 502 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_reVTMD.h" /> |
582 | 588 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Mpc.h" /> |
583 | 589 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_MpcSv8.h" /> |
584 | 590 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Mpega.h" /> |
585 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Mpegh3da.h" /> | |
586 | 591 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Pcm.h" /> |
587 | 592 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Ps2Audio.h" /> |
588 | 593 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ScreamTracker3.h" /> |
638 | 643 | <ClInclude Include="..\..\..\Source\MediaInfo\Text\File_Ttml.h" /> |
639 | 644 | <ClInclude Include="..\..\..\Source\MediaInfo\TimeCode.h" /> |
640 | 645 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_Av1.h" /> |
646 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_CineForm.h" /> | |
641 | 647 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.h" /> |
642 | 648 | <ClInclude Include="..\..\..\Source\MediaInfo\XmlUtils.h" /> |
643 | 649 | <ClInclude Include="..\..\..\Source\MediaInfo\OutputHelpers.h" /> |
683 | 689 | <ClInclude Include="..\..\..\Source\MediaInfo\Reader\Reader_libmms.h" /> |
684 | 690 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_Mpeg7.h" /> |
685 | 691 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_PBCore.h" /> |
686 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_Niso.h" /> | |
687 | 692 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_Vc3.h" /> |
688 | 693 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_Vp8.h" /> |
689 | 694 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_Y4m.h" /> |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | VS_VERSION_INFO VERSIONINFO |
3 | FILEVERSION 20,08,0,0 | |
4 | PRODUCTVERSION 20,08,0,0 | |
3 | FILEVERSION 20,09,0,0 | |
4 | PRODUCTVERSION 20,09,0,0 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | VALUE "FileDescription", "Most relevant technical and tag data for video and audio files" |
21 | VALUE "FileVersion", "20.08.0.0" | |
21 | VALUE "FileVersion", "20.09.0.0" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "20.08.0.0" | |
24 | VALUE "ProductVersion", "20.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | VS_VERSION_INFO VERSIONINFO |
3 | FILEVERSION 20,08,0,0 | |
4 | PRODUCTVERSION 20,08,0,0 | |
3 | FILEVERSION 20,09,0,0 | |
4 | PRODUCTVERSION 20,09,0,0 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | VALUE "FileDescription", "Most relevant technical and tag data for video and audio files" |
21 | VALUE "FileVersion", "20.08.0.0" | |
21 | VALUE "FileVersion", "20.09.0.0" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "20.08.0.0" | |
24 | VALUE "ProductVersion", "20.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
128 | 128 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Caf.cpp" /> |
129 | 129 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Celt.cpp" /> |
130 | 130 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelGrouping.cpp" /> |
131 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.cpp" /> | |
131 | 132 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_DolbyE.cpp" /> |
132 | 133 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Dsdiff.cpp" /> |
133 | 134 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Dsf.cpp" /> |
261 | 262 | <ClCompile Include="..\..\..\Source\MediaInfo\Text\File_Ttml.cpp" /> |
262 | 263 | <ClCompile Include="..\..\..\Source\MediaInfo\TimeCode.cpp" /> |
263 | 264 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_Av1.cpp" /> |
265 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_CineForm.cpp" /> | |
264 | 266 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.cpp" /> |
265 | 267 | <ClCompile Include="..\..\..\Source\MediaInfo\XmlUtils.cpp" /> |
266 | 268 | <ClCompile Include="..\..\..\Source\MediaInfo\OutputHelpers.cpp" /> |
417 | 419 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Caf.h" /> |
418 | 420 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Celt.h" /> |
419 | 421 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelGrouping.h" /> |
422 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.h" /> | |
420 | 423 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_DolbyE.h" /> |
421 | 424 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Dsdiff.h" /> |
422 | 425 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Dsf.h" /> |
578 | 581 | <ClInclude Include="..\..\..\Source\MediaInfo\Text\File_Ttml.h" /> |
579 | 582 | <ClInclude Include="..\..\..\Source\MediaInfo\TimeCode.h" /> |
580 | 583 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_Av1.h" /> |
584 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_CineForm.h" /> | |
581 | 585 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.h" /> |
582 | 586 | <ClInclude Include="..\..\..\Source\MediaInfo\XmlUtils.h" /> |
583 | 587 | <ClInclude Include="..\..\..\Source\MediaInfo\OutputHelpers.h" /> |
796 | 796 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Mpegh3da.cpp"> |
797 | 797 | <Filter>Source Files\Audio</Filter> |
798 | 798 | </ClCompile> |
799 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.cpp"> | |
800 | <Filter>Source Files\Audio</Filter> | |
801 | </ClCompile> | |
802 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_CineForm.cpp"> | |
803 | <Filter>Source Files\Video</Filter> | |
804 | </ClCompile> | |
799 | 805 | </ItemGroup> |
800 | 806 | <ItemGroup> |
801 | 807 | <ClInclude Include="..\..\..\Source\MediaInfo\File__Analyse_Automatic.h"> |
1491 | 1497 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Usac.h"> |
1492 | 1498 | <Filter>Header Files\Audio</Filter> |
1493 | 1499 | </ClInclude> |
1500 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.h"> | |
1501 | <Filter>Header Files\Audio</Filter> | |
1502 | </ClInclude> | |
1503 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_CineForm.h"> | |
1504 | <Filter>Header Files\Video</Filter> | |
1505 | </ClInclude> | |
1494 | 1506 | </ItemGroup> |
1495 | 1507 | </Project>⏎ |
0 | <?xml version="1.0" encoding="utf-8"?> | |
0 | <?xml version="1.0" encoding="utf-8"?> | |
1 | 1 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
2 | 2 | <ItemGroup Label="ProjectConfigurations"> |
3 | 3 | <ProjectConfiguration Include="Debug|ARM"> |
190 | 190 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Caf.cpp" /> |
191 | 191 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Celt.cpp" /> |
192 | 192 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelGrouping.cpp" /> |
193 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.cpp" /> | |
193 | 194 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_DolbyE.cpp" /> |
194 | 195 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Dsdiff.cpp" /> |
195 | 196 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Dsf.cpp" /> |
197 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Mpegh3da.cpp" /> | |
196 | 198 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_OpenMG.cpp" /> |
197 | 199 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Opus.cpp" /> |
198 | 200 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Pcm_M2ts.cpp" /> |
201 | 203 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_SmpteSt0302.cpp" /> |
202 | 204 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_SmpteSt0331.cpp" /> |
203 | 205 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_SmpteSt0337.cpp" /> |
206 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Usac.cpp" /> | |
204 | 207 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_EbuCore.cpp" /> |
208 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_Niso.cpp" /> | |
205 | 209 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_Fims.cpp" /> |
206 | 210 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_PBCore2.cpp" /> |
207 | 211 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_reVTMD.cpp" /> |
265 | 269 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Mpc.cpp" /> |
266 | 270 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_MpcSv8.cpp" /> |
267 | 271 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Mpega.cpp" /> |
268 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Mpegh3da.cpp" /> | |
269 | 272 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Pcm.cpp" /> |
270 | 273 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_Ps2Audio.cpp" /> |
271 | 274 | <ClCompile Include="..\..\..\Source\MediaInfo\Audio\File_ScreamTracker3.cpp" /> |
321 | 324 | <ClCompile Include="..\..\..\Source\MediaInfo\Text\File_Ttml.cpp" /> |
322 | 325 | <ClCompile Include="..\..\..\Source\MediaInfo\TimeCode.cpp" /> |
323 | 326 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_Av1.cpp" /> |
327 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_CineForm.cpp" /> | |
324 | 328 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.cpp" /> |
325 | 329 | <ClCompile Include="..\..\..\Source\MediaInfo\XmlUtils.cpp" /> |
326 | 330 | <ClCompile Include="..\..\..\Source\MediaInfo\OutputHelpers.cpp" /> |
405 | 409 | <ClCompile Include="..\..\..\Source\MediaInfo\Reader\Reader_libmms.cpp" /> |
406 | 410 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_Mpeg7.cpp" /> |
407 | 411 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_PBCore.cpp" /> |
408 | <ClCompile Include="..\..\..\Source\MediaInfo\Export\Export_Niso.cpp" /> | |
409 | 412 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_Vc3.cpp" /> |
410 | 413 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_Vp8.cpp" /> |
411 | 414 | <ClCompile Include="..\..\..\Source\MediaInfo\Video\File_Y4m.cpp" /> |
478 | 481 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Caf.h" /> |
479 | 482 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Celt.h" /> |
480 | 483 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelGrouping.h" /> |
484 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ChannelSplitting.h" /> | |
481 | 485 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_DolbyE.h" /> |
482 | 486 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Dsdiff.h" /> |
483 | 487 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Dsf.h" /> |
488 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Mpegh3da.h" /> | |
484 | 489 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_OpenMG.h" /> |
485 | 490 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Opus.h" /> |
486 | 491 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Pcm_M2ts.h" /> |
489 | 494 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_SmpteSt0302.h" /> |
490 | 495 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_SmpteSt0331.h" /> |
491 | 496 | <ClInclude Include="..\..\..\source\mediainfo\audio\File_SmpteSt0337.h" /> |
497 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Usac.h" /> | |
492 | 498 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_EbuCore.h" /> |
499 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_Niso.h" /> | |
493 | 500 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_Fims.h" /> |
494 | 501 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_PBCore2.h" /> |
495 | 502 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_reVTMD.h" /> |
581 | 588 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Mpc.h" /> |
582 | 589 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_MpcSv8.h" /> |
583 | 590 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Mpega.h" /> |
584 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Mpegh3da.h" /> | |
585 | 591 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Pcm.h" /> |
586 | 592 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_Ps2Audio.h" /> |
587 | 593 | <ClInclude Include="..\..\..\Source\MediaInfo\Audio\File_ScreamTracker3.h" /> |
637 | 643 | <ClInclude Include="..\..\..\Source\MediaInfo\Text\File_Ttml.h" /> |
638 | 644 | <ClInclude Include="..\..\..\Source\MediaInfo\TimeCode.h" /> |
639 | 645 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_Av1.h" /> |
646 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_CineForm.h" /> | |
640 | 647 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_DolbyVisionMetadata.h" /> |
641 | 648 | <ClInclude Include="..\..\..\Source\MediaInfo\XmlUtils.h" /> |
642 | 649 | <ClInclude Include="..\..\..\Source\MediaInfo\OutputHelpers.h" /> |
682 | 689 | <ClInclude Include="..\..\..\Source\MediaInfo\Reader\Reader_libmms.h" /> |
683 | 690 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_Mpeg7.h" /> |
684 | 691 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_PBCore.h" /> |
685 | <ClInclude Include="..\..\..\Source\MediaInfo\Export\Export_Niso.h" /> | |
686 | 692 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_Vc3.h" /> |
687 | 693 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_Vp8.h" /> |
688 | 694 | <ClInclude Include="..\..\..\Source\MediaInfo\Video\File_Y4m.h" /> |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | VALUE "FileDescription", "Most relevant technical and tag data for video and audio files" |
21 | VALUE "FileVersion", "20.08.0.0" | |
21 | VALUE "FileVersion", "20.09.0.0" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "20.08.0.0" | |
24 | VALUE "ProductVersion", "20.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
0 | libmediainfo (20.08-1) experimental; urgency=medium | |
1 | ||
2 | * Upstream version 20.08 | |
0 | libmediainfo (20.09-1) experimental; urgency=medium | |
1 | ||
2 | * Upstream version 20.09 | |
3 | 3 | For details, see https://github.com/MediaArea/MediaInfoLib/blob/master/History_DLL.txt |
4 | 4 | |
5 | 5 | -- MediaArea <info@mediaarea.net> Mon, 02 Nov 2015 10:30:00 +0100 |
1 | 1 | Source: libmediainfo |
2 | 2 | Binary: libmediainfo-dev, libmediainfo0v5, python-mediainfodll, python3-mediainfodll, libmediainfo-doc libmediainfo0v5-dbg |
3 | 3 | Architecture: any all |
4 | Version: 20.08-1deb9 | |
4 | Version: 20.09-1deb9 | |
5 | 5 | Maintainer: MediaArea.net SARL <info@mediaarea.net> |
6 | 6 | Homepage: http://MediaArea.net/MediaInfo |
7 | 7 | Standards-Version: 3.9.6 |
15 | 15 | python-mediainfodll deb python optional arch=all |
16 | 16 | python3-mediainfodll deb python optional arch=all |
17 | 17 | Checksums-Sha1: |
18 | 0000000000000000000000000000000000000000 000000 libmediainfo_20.08.orig.tar.xz | |
19 | 0000000000000000000000000000000000000000 000000 libmediainfo_20.08-1deb9.debian.tar.xz | |
18 | 0000000000000000000000000000000000000000 000000 libmediainfo_20.09.orig.tar.xz | |
19 | 0000000000000000000000000000000000000000 000000 libmediainfo_20.09-1deb9.debian.tar.xz | |
20 | 20 | Checksums-Sha256: |
21 | 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_20.08.orig.tar.xz | |
22 | 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_20.08-1deb9.debian.tar.xz | |
21 | 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_20.09.orig.tar.xz | |
22 | 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_20.09-1deb9.debian.tar.xz | |
23 | 23 | Files: |
24 | 00000000000000000000000000000000 000000 libmediainfo_20.08.orig.tar.xz | |
25 | 00000000000000000000000000000000 000000 libmediainfo_20.08-1deb9.debian.tar.xz | |
24 | 00000000000000000000000000000000 000000 libmediainfo_20.09.orig.tar.xz | |
25 | 00000000000000000000000000000000 000000 libmediainfo_20.09-1deb9.debian.tar.xz |
8 | 8 | |
9 | 9 | #Creation of known directories and filenames |
10 | 10 | name="libmediainfo0" |
11 | version="20.08" | |
11 | version="20.09" | |
12 | 12 | Home=`pwd` |
13 | 13 | install_prefix=${Home}/mk_package |
14 | 14 | packagecreation_prefix=${Home}/create_package |
3 | 3 | ; Some defines |
4 | 4 | !define PRODUCT_NAME "MediaInfo" |
5 | 5 | !define PRODUCT_PUBLISHER "MediaArea.net" |
6 | !define PRODUCT_VERSION "20.08" | |
6 | !define PRODUCT_VERSION "20.09" | |
7 | 7 | !define PRODUCT_VERSION4 "${PRODUCT_VERSION}.0.0" |
8 | 8 | !define PRODUCT_WEB_SITE "http://MediaArea.net/MediaInfo" |
9 | 9 | !define COMPANY_REGISTRY "Software\MediaArea.net" |
3 | 3 | ; Some defines |
4 | 4 | !define PRODUCT_NAME "MediaInfo" |
5 | 5 | !define PRODUCT_PUBLISHER "MediaArea.net" |
6 | !define PRODUCT_VERSION "20.08" | |
6 | !define PRODUCT_VERSION "20.09" | |
7 | 7 | !define PRODUCT_VERSION4 "${PRODUCT_VERSION}.0.0" |
8 | 8 | !define PRODUCT_WEB_SITE "http://MediaArea.net/MediaInfo" |
9 | 9 | !define COMPANY_REGISTRY "Software\MediaArea.net" |
387 | 387 | 2, |
388 | 388 | 1, |
389 | 389 | }; |
390 | int32u AC3_bed_channel_assignment_mask_2_nonstd(int16u bed_channel_assignment_mask) | |
390 | extern int32u AC3_bed_channel_assignment_mask_2_nonstd(int16u bed_channel_assignment_mask) | |
391 | 391 | { |
392 | 392 | int32u ToReturn=0; |
393 | 393 | |
798 | 798 | }; |
799 | 799 | |
800 | 800 | //--------------------------------------------------------------------------- |
801 | const char* Ac3_emdf_payload_id[16]= | |
801 | extern const char* Ac3_emdf_payload_id[16]= | |
802 | 802 | { |
803 | 803 | "Container End", |
804 | 804 | "Programme loudness data", |
813 | 813 | "", |
814 | 814 | "OAMD", |
815 | 815 | "", |
816 | "", | |
816 | "Personalized Audio Mix-Graph", | |
817 | 817 | "JOC", |
818 | 818 | "", |
819 | 819 | }; |
0 | /* Copyright (c) MediaArea.net SARL. All Rights Reserved. | |
1 | * | |
2 | * Use of this source code is governed by a BSD-style license that can | |
3 | * be found in the License.html file in the root of the source tree. | |
4 | */ | |
5 | ||
6 | //--------------------------------------------------------------------------- | |
7 | // Pre-compilation | |
8 | #include "MediaInfo/PreComp.h" | |
9 | #ifdef __BORLANDC__ | |
10 | #pragma hdrstop | |
11 | #endif | |
12 | //--------------------------------------------------------------------------- | |
13 | ||
14 | //--------------------------------------------------------------------------- | |
15 | #include "MediaInfo/Setup.h" | |
16 | //--------------------------------------------------------------------------- | |
17 | ||
18 | //--------------------------------------------------------------------------- | |
19 | #if defined(MEDIAINFO_SMPTEST0337_YES) | |
20 | //--------------------------------------------------------------------------- | |
21 | ||
22 | //--------------------------------------------------------------------------- | |
23 | #include "MediaInfo/Audio/File_ChannelSplitting.h" | |
24 | #if defined(MEDIAINFO_SMPTEST0337_YES) | |
25 | #include "MediaInfo/Audio/File_SmpteSt0337.h" | |
26 | #endif | |
27 | #if defined(MEDIAINFO_PCM_YES) | |
28 | #include "MediaInfo/Audio/File_Pcm.h" | |
29 | #endif | |
30 | #if MEDIAINFO_EVENTS | |
31 | #include "MediaInfo/MediaInfo_Events.h" | |
32 | #endif //MEDIAINFO_EVENTS | |
33 | #include "MediaInfo/MediaInfo_Config_MediaInfo.h" | |
34 | //--------------------------------------------------------------------------- | |
35 | ||
36 | namespace MediaInfoLib | |
37 | { | |
38 | ||
39 | //*************************************************************************** | |
40 | // Constructor/Destructor | |
41 | //*************************************************************************** | |
42 | ||
43 | File_ChannelSplitting::File_ChannelSplitting() | |
44 | { | |
45 | //Configuration | |
46 | #if MEDIAINFO_EVENTS | |
47 | ParserIDs[0]=0; // MediaInfo_Parser_ChannelSplitting; | |
48 | StreamIDs_Width[0]=1; | |
49 | #endif //MEDIAINFO_EVENTS | |
50 | #if MEDIAINFO_DEMUX | |
51 | Demux_Level=2; //Container | |
52 | #endif //MEDIAINFO_DEMUX | |
53 | #if MEDIAINFO_TRACE | |
54 | Trace_Layers_Update(0); //Container1 | |
55 | #endif //MEDIAINFO_TRACE | |
56 | StreamSource=IsStream; | |
57 | ||
58 | //In | |
59 | BitDepth=0; | |
60 | SamplingRate=0; | |
61 | Endianness=0; | |
62 | Aligned=false; | |
63 | Common=NULL; | |
64 | Channel_Total=1; | |
65 | } | |
66 | ||
67 | File_ChannelSplitting::~File_ChannelSplitting() | |
68 | { | |
69 | delete Common; //Common=NULL; | |
70 | } | |
71 | ||
72 | //*************************************************************************** | |
73 | // Streams management | |
74 | //*************************************************************************** | |
75 | ||
76 | //--------------------------------------------------------------------------- | |
77 | void File_ChannelSplitting::Streams_Fill() | |
78 | { | |
79 | Fill(Stream_General, 0, General_Format, "ChannelSplitting"); | |
80 | ||
81 | for (size_t i=0; i<Common->SplittedChannels.size(); i++) | |
82 | { | |
83 | std::vector<File__Analyze*>& Parsers=Common->SplittedChannels[i]->Parsers; | |
84 | ||
85 | if (Parsers.size()!=1) | |
86 | continue; | |
87 | ||
88 | if (!Parsers[0]->Status[IsAccepted]) | |
89 | { | |
90 | for (int j=0; j<2; j++) | |
91 | { | |
92 | File_Pcm Parser; | |
93 | Parser.BitDepth=BitDepth; | |
94 | Parser.Channels=1; | |
95 | Parser.SamplingRate=SamplingRate; | |
96 | Parser.Endianness=Endianness; | |
97 | Open_Buffer_Init(&Parser); | |
98 | Parser.Accept(); | |
99 | Fill(&Parser); | |
100 | size_t Pos=Count_Get(Stream_Audio); | |
101 | Merge(Parser); | |
102 | Fill(Stream_Audio, Pos, Audio_ID, i*2+1+j, true); | |
103 | Fill(Stream_Audio, Pos, Audio_MuxingMode, "Multiple"); | |
104 | } | |
105 | continue; | |
106 | } | |
107 | ||
108 | Fill(Parsers[0]); | |
109 | size_t Pos=Count_Get(Stream_Audio); | |
110 | Merge(*Parsers[0]); | |
111 | for (size_t j=0; j<Parsers[0]->Count_Get(Stream_Audio); j++) | |
112 | { | |
113 | Ztring ID=Ztring().From_Number(i*2+1)+__T(" / ") + Ztring().From_Number(i*2+2); | |
114 | const Ztring& ID_Parser=Parsers[0]->Retrieve_Const(Stream_Audio, j, Audio_ID); | |
115 | if (!ID_Parser.empty()) | |
116 | { | |
117 | ID+=__T('-'); | |
118 | ID+=ID_Parser; | |
119 | } | |
120 | Fill(Stream_Audio, Pos+j, Audio_ID, ID, true); | |
121 | Ztring MuxingMode=__T("Multiple"); | |
122 | const Ztring& MuxingMode_Parser=Parsers[0]->Retrieve(Stream_Audio, j, Audio_MuxingMode); | |
123 | if (!MuxingMode_Parser.empty()) | |
124 | { | |
125 | MuxingMode+=__T(" / "); | |
126 | MuxingMode+=MuxingMode_Parser; | |
127 | } | |
128 | Fill(Stream_Audio, Pos+j, Audio_MuxingMode, MuxingMode, true); | |
129 | } | |
130 | } | |
131 | } | |
132 | ||
133 | //--------------------------------------------------------------------------- | |
134 | void File_ChannelSplitting::Streams_Finish() | |
135 | { | |
136 | for (size_t i = 0; i<Common->SplittedChannels.size(); i++) | |
137 | { | |
138 | std::vector<File__Analyze*>& Parsers=Common->SplittedChannels[i]->Parsers; | |
139 | ||
140 | if (Parsers.size()!=1) | |
141 | continue; | |
142 | ||
143 | Finish(Parsers[0]); | |
144 | } | |
145 | } | |
146 | ||
147 | //*************************************************************************** | |
148 | // Buffer - Global | |
149 | //*************************************************************************** | |
150 | ||
151 | //--------------------------------------------------------------------------- | |
152 | void File_ChannelSplitting::Read_Buffer_Init() | |
153 | { | |
154 | if (Common==NULL) | |
155 | { | |
156 | if (Channel_Total%2) | |
157 | { | |
158 | Reject(); | |
159 | return; //Currently supporting only pairs | |
160 | } | |
161 | ||
162 | //Common | |
163 | Common=new common; | |
164 | Common->SplittedChannels.resize(Channel_Total/2); | |
165 | ||
166 | for (size_t i=0; i<Common->SplittedChannels.size(); i++) | |
167 | { | |
168 | Common->SplittedChannels[i]=new common::channel; | |
169 | std::vector<File__Analyze*>& Parsers=Common->SplittedChannels[i]->Parsers; | |
170 | ||
171 | //SMPTE ST 337 | |
172 | { | |
173 | File_SmpteSt0337* Parser=new File_SmpteSt0337; | |
174 | Parser->Container_Bits=BitDepth; | |
175 | Parser->Endianness=Endianness; | |
176 | Parser->Aligned=Aligned; | |
177 | Parsers.push_back(Parser); | |
178 | } | |
179 | ||
180 | // PCM // TODO (currently no demux) | |
181 | ||
182 | //for all parsers | |
183 | for (size_t Pos=0; Pos<Parsers.size(); Pos++) | |
184 | { | |
185 | #if MEDIAINFO_DEMUX | |
186 | if (Config->Demux_Unpacketize_Get()) | |
187 | { | |
188 | Parsers[Pos]->Demux_UnpacketizeContainer=true; | |
189 | Parsers[Pos]->Demux_Level=2; //Container | |
190 | Demux_Level=4; //Intermediate | |
191 | } | |
192 | #endif //MEDIAINFO_DEMUX | |
193 | Element_Code=i+1; | |
194 | Open_Buffer_Init(Parsers[Pos]); | |
195 | } | |
196 | } | |
197 | } | |
198 | } | |
199 | ||
200 | //--------------------------------------------------------------------------- | |
201 | void File_ChannelSplitting::Read_Buffer_Continue() | |
202 | { | |
203 | //Handling of multiple frames in one block | |
204 | if (Buffer_Size==0) | |
205 | { | |
206 | Read_Buffer_Continue_Parse(); | |
207 | return; | |
208 | } | |
209 | ||
210 | //Size of buffer | |
211 | for (size_t i=0; i<Common->SplittedChannels.size(); i++) | |
212 | { | |
213 | common::channel* SplittedChannel=Common->SplittedChannels[i]; | |
214 | ||
215 | if (Buffer_Size/Common->SplittedChannels.size()>SplittedChannel->Buffer_Size_Max) | |
216 | SplittedChannel->resize(Buffer_Size/Common->SplittedChannels.size()); | |
217 | SplittedChannel->Buffer_Size=0; | |
218 | } | |
219 | ||
220 | //Copying to splitted channels | |
221 | Buffer_Offset=0; | |
222 | while (Channel_Total*BitDepth<=(Buffer_Size-Buffer_Offset)*8) | |
223 | { | |
224 | for (size_t i=0; i<Common->SplittedChannels.size(); i++) | |
225 | { | |
226 | common::channel* SplittedChannel=Common->SplittedChannels[i]; | |
227 | ||
228 | switch (BitDepth) | |
229 | { | |
230 | case 24: | |
231 | // Copy 6 bytes | |
232 | SplittedChannel->Buffer[SplittedChannel->Buffer_Size++]=Buffer[Buffer_Offset++]; | |
233 | case 20: | |
234 | // Copy 5 bytes | |
235 | SplittedChannel->Buffer[SplittedChannel->Buffer_Size++]=Buffer[Buffer_Offset++]; | |
236 | case 16: | |
237 | // Copy 4 bytes | |
238 | SplittedChannel->Buffer[SplittedChannel->Buffer_Size++]=Buffer[Buffer_Offset++]; | |
239 | SplittedChannel->Buffer[SplittedChannel->Buffer_Size++]=Buffer[Buffer_Offset++]; | |
240 | SplittedChannel->Buffer[SplittedChannel->Buffer_Size++]=Buffer[Buffer_Offset++]; | |
241 | SplittedChannel->Buffer[SplittedChannel->Buffer_Size++]=Buffer[Buffer_Offset++]; | |
242 | break; | |
243 | default: ; | |
244 | // Not supported | |
245 | Reject(); | |
246 | return; | |
247 | } | |
248 | } | |
249 | } | |
250 | ||
251 | for (size_t i=0; i<Common->SplittedChannels.size(); i++) | |
252 | { | |
253 | common::channel* SplittedChannel=Common->SplittedChannels[i]; | |
254 | ||
255 | for (size_t Pos=0; Pos<SplittedChannel->Parsers.size(); Pos++) | |
256 | { | |
257 | if (FrameInfo_Next.DTS!=(int64u)-1) | |
258 | SplittedChannel->Parsers[Pos]->FrameInfo = FrameInfo_Next; //AES3 parse has its own buffer management | |
259 | else if (FrameInfo.DTS!=(int64u)-1) | |
260 | SplittedChannel->Parsers[Pos]->FrameInfo = FrameInfo; | |
261 | } | |
262 | } | |
263 | FrameInfo=frame_info(); | |
264 | AllFilled=true; | |
265 | AllFinished=true; | |
266 | SplittedChannels_i=0; | |
267 | size_t ContentSize=Buffer_Offset; | |
268 | Buffer_Offset=0; | |
269 | Skip_XX(ContentSize, "Channel grouping data"); | |
270 | Element_Offset=0; | |
271 | Read_Buffer_Continue_Parse(); | |
272 | Buffer_Offset=ContentSize; | |
273 | Element_WaitForMoreData(); | |
274 | } | |
275 | ||
276 | void File_ChannelSplitting::Read_Buffer_Continue_Parse() | |
277 | { | |
278 | for (; SplittedChannels_i<Common->SplittedChannels.size(); SplittedChannels_i++) | |
279 | { | |
280 | common::channel* SplittedChannel=Common->SplittedChannels[SplittedChannels_i]; | |
281 | ||
282 | for (size_t Pos=0; Pos<SplittedChannel->Parsers.size(); Pos++) | |
283 | { | |
284 | Element_Code=SplittedChannels_i*2+1; | |
285 | #if MEDIAINFO_DEMUX | |
286 | Demux(Buffer+Buffer_Offset, Buffer_Size-Buffer_Offset, ContentType_MainStream); | |
287 | #endif //MEDIAINFO_EVENTS | |
288 | Open_Buffer_Continue(SplittedChannel->Parsers[Pos], SplittedChannel->Buffer, SplittedChannel->Buffer_Size, false); | |
289 | ||
290 | //Multiple parsers | |
291 | if (SplittedChannel->Parsers.size()>1) | |
292 | { | |
293 | //Test if valid | |
294 | if (!Status[IsAccepted] && SplittedChannel->Parsers[SplittedChannel->Parsers.size()-1]->Frame_Count+1 >= ((File_Pcm*)SplittedChannel->Parsers[SplittedChannel->Parsers.size()-1])->Frame_Count_Valid) | |
295 | { | |
296 | //Rejecting here, else the parser may emit a frame before we detect that we want to reject the stream because there are no PCM stream (not handled here) | |
297 | Reject(); | |
298 | return; | |
299 | } | |
300 | if (!SplittedChannel->Parsers[Pos]->Status[IsAccepted] && SplittedChannel->Parsers[Pos]->Status[IsFinished]) | |
301 | { | |
302 | delete *(SplittedChannel->Parsers.begin()+Pos); | |
303 | SplittedChannel->Parsers.erase(SplittedChannel->Parsers.begin()+Pos); | |
304 | Pos--; | |
305 | } | |
306 | else if (SplittedChannel->Parsers.size()>1 && SplittedChannel->Parsers[Pos]->Status[IsAccepted]) | |
307 | { | |
308 | if (Pos==SplittedChannel->Parsers.size()-1) | |
309 | SplittedChannel->IsPcm=true; //Last parser is PCM | |
310 | ||
311 | File__Analyze* Parser=SplittedChannel->Parsers[Pos]; | |
312 | for (size_t Pos2=0; Pos2<SplittedChannel->Parsers.size(); Pos2++) | |
313 | { | |
314 | if (Pos2!=Pos) | |
315 | delete *(SplittedChannel->Parsers.begin()+Pos2); | |
316 | } | |
317 | SplittedChannel->Parsers.clear(); | |
318 | SplittedChannel->Parsers.push_back(Parser); | |
319 | } | |
320 | } | |
321 | } | |
322 | if (!Status[IsAccepted] && !SplittedChannel->IsPcm && SplittedChannel->Parsers.size()==1 && SplittedChannel->Parsers[0]->Status[IsAccepted]) | |
323 | Accept(); | |
324 | if (SplittedChannel->IsPcm || SplittedChannel->Parsers.size()!=1 || (!SplittedChannel->Parsers[0]->Status[IsFinished] && !SplittedChannel->Parsers[0]->Status[IsFilled])) | |
325 | AllFilled=false; | |
326 | if (SplittedChannel->IsPcm || SplittedChannel->Parsers.size()!=1 || !SplittedChannel->Parsers[0]->Status[IsFinished]) | |
327 | AllFinished=false; | |
328 | ||
329 | #if MEDIAINFO_DEMUX | |
330 | if (Config->Demux_EventWasSent) | |
331 | { | |
332 | SplittedChannels_i++; | |
333 | return; | |
334 | } | |
335 | #endif //MEDIAINFO_DEMUX | |
336 | } | |
337 | Frame_Count++; | |
338 | if (!Status[IsFilled] && AllFilled) | |
339 | Fill(); | |
340 | if (!Status[IsFinished] && AllFinished) | |
341 | Finish(); | |
342 | } | |
343 | ||
344 | //--------------------------------------------------------------------------- | |
345 | void File_ChannelSplitting::Read_Buffer_Unsynched() | |
346 | { | |
347 | if (!Common) | |
348 | return; | |
349 | ||
350 | for (size_t i=0; i<Common->SplittedChannels.size(); i++) | |
351 | { | |
352 | common::channel* SplittedChannel=Common->SplittedChannels[i]; | |
353 | ||
354 | for (size_t Pos=0; Pos<Common->SplittedChannels[i]->Parsers.size(); Pos++) | |
355 | if (SplittedChannel->Parsers[Pos]) | |
356 | SplittedChannel->Parsers[Pos]->Open_Buffer_Unsynch(); | |
357 | } | |
358 | } | |
359 | ||
360 | //*************************************************************************** | |
361 | // C++ | |
362 | //*************************************************************************** | |
363 | ||
364 | } //NameSpace | |
365 | ||
366 | #endif //MEDIAINFO_SMPTEST0337_YES |
0 | /* Copyright (c) MediaArea.net SARL. All Rights Reserved. | |
1 | * | |
2 | * Use of this source code is governed by a BSD-style license that can | |
3 | * be found in the License.html file in the root of the source tree. | |
4 | */ | |
5 | ||
6 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
7 | // | |
8 | // Some containers use 4-channel stream for 2 AES3 (Stereo) transport | |
9 | // We need to split the 4-channel streams in two before sending | |
10 | // data to AES parser | |
11 | // | |
12 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
13 | ||
14 | //--------------------------------------------------------------------------- | |
15 | #ifndef MediaInfo_File_ChannelSplittingH | |
16 | #define MediaInfo_File_ChannelSplittingH | |
17 | //--------------------------------------------------------------------------- | |
18 | ||
19 | //--------------------------------------------------------------------------- | |
20 | #include "MediaInfo/File__Analyze.h" | |
21 | #include <cstring> | |
22 | //--------------------------------------------------------------------------- | |
23 | ||
24 | namespace MediaInfoLib | |
25 | { | |
26 | ||
27 | //*************************************************************************** | |
28 | // Class File_ChannelSplitting | |
29 | //*************************************************************************** | |
30 | #ifdef MEDIAINFO_SMPTEST0337_YES | |
31 | class File_ChannelSplitting : public File__Analyze | |
32 | { | |
33 | public : | |
34 | //In | |
35 | int8u BitDepth; | |
36 | int16u SamplingRate; | |
37 | int8u Endianness; | |
38 | bool Aligned; | |
39 | ||
40 | struct common | |
41 | { | |
42 | struct channel | |
43 | { | |
44 | int8u* Buffer; | |
45 | size_t Buffer_Size; | |
46 | size_t Buffer_Size_Max; | |
47 | std::vector<File__Analyze*> Parsers; | |
48 | bool IsPcm; | |
49 | ||
50 | channel() | |
51 | { | |
52 | Buffer=NULL; | |
53 | Buffer_Size=0; | |
54 | Buffer_Size_Max=0; | |
55 | IsPcm=false; | |
56 | } | |
57 | ||
58 | ~channel() | |
59 | { | |
60 | delete[] Buffer; //Buffer=NULL; | |
61 | for (size_t Pos=0; Pos<Parsers.size(); Pos++) | |
62 | delete Parsers[Pos]; | |
63 | } | |
64 | ||
65 | void resize(size_t NewSize) | |
66 | { | |
67 | delete[] Buffer; | |
68 | Buffer_Size_Max=NewSize; | |
69 | Buffer=new int8u[Buffer_Size_Max]; | |
70 | } | |
71 | }; | |
72 | vector<channel*> SplittedChannels; | |
73 | ||
74 | common() | |
75 | { | |
76 | } | |
77 | ||
78 | ~common() | |
79 | { | |
80 | for (size_t Pos=0; Pos<SplittedChannels.size(); Pos++) | |
81 | delete SplittedChannels[Pos]; //Channels[Pos]=NULL; | |
82 | } | |
83 | }; | |
84 | int64u StreamID; | |
85 | common* Common; | |
86 | int8u Channel_Total; | |
87 | ||
88 | //Constructor/Destructor | |
89 | File_ChannelSplitting(); | |
90 | ~File_ChannelSplitting(); | |
91 | ||
92 | private : | |
93 | //Streams management | |
94 | void Streams_Fill(); | |
95 | void Streams_Finish(); | |
96 | ||
97 | //Buffer - Global | |
98 | void Read_Buffer_Init (); | |
99 | void Read_Buffer_Continue (); | |
100 | void Read_Buffer_Continue_Parse (); | |
101 | void Read_Buffer_Unsynched(); | |
102 | ||
103 | //Temp | |
104 | bool AllFilled; | |
105 | bool AllFinished; | |
106 | size_t SplittedChannels_i; | |
107 | }; | |
108 | ||
109 | #endif // MEDIAINFO_SMPTEST0337_YES | |
110 | } //NameSpace | |
111 | ||
112 | #endif | |
113 |
3 | 3 | * be found in the License.html file in the root of the source tree. |
4 | 4 | */ |
5 | 5 | |
6 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
7 | // | |
8 | // Important note about Dolby E parser: | |
9 | // Open-Source version of MediaInfo has basic support of Dolby E, | |
10 | // created by reverse engineering by an anonymous third-party, | |
11 | // with the limitions due to reverse engineering: there is a risk | |
12 | // of wrong interpretation of the reverse engineeried bitstream. | |
13 | // If you want a safer Dolby E support, based on Dolby E specifications, | |
14 | // contact http://www.dolby.com/about/contact_us/contactus.aspx?goto=28 | |
15 | // for a license before asking it in a specific (and not Open-Source) version | |
16 | // of MediaInfo. | |
17 | // | |
18 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
6 | //--------------------------------------------------------------------------- | |
7 | // https://developer.dolby.com/globalassets/professional/dolby-e/dolby-e-high-level-frame-description.pdf | |
8 | //--------------------------------------------------------------------------- | |
19 | 9 | |
20 | 10 | //--------------------------------------------------------------------------- |
21 | 11 | // Pre-compilation |
35 | 25 | |
36 | 26 | //--------------------------------------------------------------------------- |
37 | 27 | #include "MediaInfo/Audio/File_DolbyE.h" |
28 | #include "MediaInfo/Audio/File_Aac.h" | |
38 | 29 | #include <cmath> |
30 | ||
31 | #if !defined(INT8_MAX) | |
32 | #define INT8_MAX (127) | |
33 | #endif //!defined(INT8_MAX) | |
34 | #if !defined(INT8_MIN) | |
35 | #define INT8_MIN (-128) | |
36 | #endif //!defined(INT8_MIN) | |
37 | ||
39 | 38 | using namespace std; |
40 | 39 | //--------------------------------------------------------------------------- |
41 | 40 | |
42 | 41 | namespace MediaInfoLib |
43 | 42 | { |
43 | ||
44 | //--------------------------------------------------------------------------- | |
45 | //CRC computing, with incomplete first and last bytes | |
46 | //Inspired by http://zorc.breitbandkatze.de/crc.html | |
47 | extern const int16u CRC_16_Table[256]; | |
48 | int16u CRC_16_Compute(const int8u* Buffer_Begin, size_t Buffer_Size, int8u SkipBits_Begin, int8u SkipBits_End) | |
49 | { | |
50 | int16u CRC_16=0x0000; | |
51 | const int8u* Buffer=Buffer_Begin; | |
52 | const int8u* Buffer_End=Buffer+Buffer_Size; | |
53 | if (SkipBits_End) | |
54 | Buffer_End--; //Not handling completely the last byte | |
55 | ||
56 | //First partial byte | |
57 | if (SkipBits_Begin) | |
58 | { | |
59 | for (int8u Mask=(1<<(7-SkipBits_Begin)); Mask; Mask>>=1) | |
60 | { | |
61 | bool NewBit=(CRC_16&0x8000)?true:false; | |
62 | CRC_16<<=1; | |
63 | if ((*Buffer)&Mask) | |
64 | NewBit=!NewBit; | |
65 | if (NewBit) | |
66 | CRC_16^=0x8005; | |
67 | } | |
68 | ||
69 | Buffer++; | |
70 | } | |
71 | ||
72 | //Complete bytes | |
73 | while (Buffer<Buffer_End) | |
74 | { | |
75 | CRC_16=(CRC_16<<8) ^ CRC_16_Table[(CRC_16>>8)^(*Buffer)]; | |
76 | Buffer++; | |
77 | } | |
78 | ||
79 | //Last partial byte | |
80 | if (SkipBits_End) | |
81 | { | |
82 | for (int8u Mask=0x80; Mask>(1<<(SkipBits_End-1)); Mask>>=1) | |
83 | { | |
84 | bool NewBit=(CRC_16&0x8000)?true:false; | |
85 | CRC_16<<=1; | |
86 | if ((*Buffer)&Mask) | |
87 | NewBit=!NewBit; | |
88 | if (NewBit) | |
89 | CRC_16^=0x8005; | |
90 | } | |
91 | ||
92 | Buffer++; | |
93 | } | |
94 | ||
95 | return CRC_16; | |
96 | } | |
44 | 97 | |
45 | 98 | //*************************************************************************** |
46 | 99 | // Infos |
55 | 108 | {8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 6, 6, 6, 6, 6, 4, 4, 4, 4, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; |
56 | 109 | |
57 | 110 | //--------------------------------------------------------------------------- |
58 | const int8u DolbyE_Channels_PerProgram(int8u ProgramConfiguration, int8u ProgramNumber) | |
59 | { | |
60 | switch (ProgramConfiguration) | |
61 | { | |
62 | case 0 : switch (ProgramNumber) | |
111 | const int8u DolbyE_Channels_PerProgram(int8u program_config, int8u program) | |
112 | { | |
113 | switch (program_config) | |
114 | { | |
115 | case 0 : switch (program) | |
63 | 116 | { |
64 | 117 | case 0 : return 6; |
65 | 118 | default : return 2; |
66 | 119 | } |
67 | case 1 : switch (ProgramNumber) | |
120 | case 1 : switch (program) | |
68 | 121 | { |
69 | 122 | case 0 : return 6; |
70 | 123 | default : return 1; |
72 | 125 | case 2 : |
73 | 126 | case 18 : return 4; |
74 | 127 | case 3 : |
75 | case 12 : switch (ProgramNumber) | |
128 | case 12 : switch (program) | |
76 | 129 | { |
77 | 130 | case 0 : return 4; |
78 | 131 | default : return 2; |
79 | 132 | } |
80 | case 4 : switch (ProgramNumber) | |
133 | case 4 : switch (program) | |
81 | 134 | { |
82 | 135 | case 0 : return 4; |
83 | 136 | case 1 : return 2; |
84 | 137 | default : return 1; |
85 | 138 | } |
86 | 139 | case 5 : |
87 | case 13 : switch (ProgramNumber) | |
140 | case 13 : switch (program) | |
88 | 141 | { |
89 | 142 | case 0 : return 4; |
90 | 143 | default : return 1; |
92 | 145 | case 6 : |
93 | 146 | case 14 : |
94 | 147 | case 19 : return 2; |
95 | case 7 : switch (ProgramNumber) | |
148 | case 7 : switch (program) | |
96 | 149 | { |
97 | 150 | case 0 : |
98 | 151 | case 1 : |
100 | 153 | default : return 1; |
101 | 154 | } |
102 | 155 | case 8 : |
103 | case 15 : switch (ProgramNumber) | |
156 | case 15 : switch (program) | |
104 | 157 | { |
105 | 158 | case 0 : |
106 | 159 | case 1 : return 2; |
108 | 161 | } |
109 | 162 | case 9 : |
110 | 163 | case 16 : |
111 | case 20 : switch (ProgramNumber) | |
164 | case 20 : switch (program) | |
112 | 165 | { |
113 | 166 | case 0 : return 2; |
114 | 167 | default : return 1; |
193 | 246 | }; |
194 | 247 | |
195 | 248 | //--------------------------------------------------------------------------- |
196 | const char* DolbyE_ChannelPositions_PerProgram(int8u ProgramConfiguration, int8u ProgramNumber) | |
197 | { | |
198 | switch (ProgramConfiguration) | |
199 | { | |
200 | case 0 : switch (ProgramNumber) | |
249 | const char* DolbyE_ChannelPositions_PerProgram(int8u program_config, int8u program) | |
250 | { | |
251 | switch (program_config) | |
252 | { | |
253 | case 0 : switch (program) | |
201 | 254 | { |
202 | 255 | case 0 : return "Front: L C R, Side: L R, LFE"; |
203 | 256 | default : return "Front: L R"; |
204 | 257 | } |
205 | case 1 : switch (ProgramNumber) | |
258 | case 1 : switch (program) | |
206 | 259 | { |
207 | 260 | case 0 : return "Front: L C R, Side: L R, LFE"; |
208 | 261 | default : return "Front: C"; |
210 | 263 | case 2 : |
211 | 264 | case 18 : return "Front: L C R, LFE"; |
212 | 265 | case 3 : |
213 | case 12 : switch (ProgramNumber) | |
266 | case 12 : switch (program) | |
214 | 267 | { |
215 | 268 | case 0 : return "Front: L C R, LFE"; |
216 | 269 | default : return "Front: L R"; |
217 | 270 | } |
218 | case 4 : switch (ProgramNumber) | |
271 | case 4 : switch (program) | |
219 | 272 | { |
220 | 273 | case 0 : return "Front: L C R, LFE"; |
221 | 274 | case 1 : return "Front: L R"; |
222 | 275 | default : return "Front: C"; |
223 | 276 | } |
224 | 277 | case 5 : |
225 | case 13 : switch (ProgramNumber) | |
278 | case 13 : switch (program) | |
226 | 279 | { |
227 | 280 | case 0 : return "Front: L C R, LFE"; |
228 | 281 | default : return "Front: C"; |
230 | 283 | case 6 : |
231 | 284 | case 14 : |
232 | 285 | case 19 : return "Front: L R"; |
233 | case 7 : switch (ProgramNumber) | |
286 | case 7 : switch (program) | |
234 | 287 | { |
235 | 288 | case 0 : |
236 | 289 | case 1 : |
238 | 291 | default : return "Front: C"; |
239 | 292 | } |
240 | 293 | case 8 : |
241 | case 15 : switch (ProgramNumber) | |
294 | case 15 : switch (program) | |
242 | 295 | { |
243 | 296 | case 0 : |
244 | 297 | case 1 : return "Front: L R"; |
246 | 299 | } |
247 | 300 | case 9 : |
248 | 301 | case 16 : |
249 | case 20 : switch (ProgramNumber) | |
302 | case 20 : switch (program) | |
250 | 303 | { |
251 | 304 | case 0 : return "Front: L R"; |
252 | 305 | default : return "Front: C"; |
331 | 384 | }; |
332 | 385 | |
333 | 386 | //--------------------------------------------------------------------------- |
334 | const char* DolbyE_ChannelPositions2_PerProgram(int8u ProgramConfiguration, int8u ProgramNumber) | |
335 | { | |
336 | switch (ProgramConfiguration) | |
337 | { | |
338 | case 0 : switch (ProgramNumber) | |
387 | const char* DolbyE_ChannelPositions2_PerProgram(int8u program_config, int8u program) | |
388 | { | |
389 | switch (program_config) | |
390 | { | |
391 | case 0 : switch (program) | |
339 | 392 | { |
340 | 393 | case 0 : return "3/2/0.1"; |
341 | 394 | default : return "2/0/0"; |
342 | 395 | } |
343 | case 1 : switch (ProgramNumber) | |
396 | case 1 : switch (program) | |
344 | 397 | { |
345 | 398 | case 0 : return "3/2/0.1"; |
346 | 399 | default : return "1/0/0"; |
348 | 401 | case 2 : |
349 | 402 | case 18 : return "3/0/0.1"; |
350 | 403 | case 3 : |
351 | case 12 : switch (ProgramNumber) | |
404 | case 12 : switch (program) | |
352 | 405 | { |
353 | 406 | case 0 : return "3/0/0.1"; |
354 | 407 | default : return "2/0/0"; |
355 | 408 | } |
356 | case 4 : switch (ProgramNumber) | |
409 | case 4 : switch (program) | |
357 | 410 | { |
358 | 411 | case 0 : return "3/0/0.1"; |
359 | 412 | case 1 : return "2/0/0"; |
360 | 413 | default : return "1/0/0"; |
361 | 414 | } |
362 | 415 | case 5 : |
363 | case 13 : switch (ProgramNumber) | |
416 | case 13 : switch (program) | |
364 | 417 | { |
365 | 418 | case 0 : return "3/0/0.1"; |
366 | 419 | default : return "1/0/0"; |
368 | 421 | case 6 : |
369 | 422 | case 14 : |
370 | 423 | case 19 : return "Front: L R"; |
371 | case 7 : switch (ProgramNumber) | |
424 | case 7 : switch (program) | |
372 | 425 | { |
373 | 426 | case 0 : |
374 | 427 | case 1 : |
376 | 429 | default : return "1/0/0"; |
377 | 430 | } |
378 | 431 | case 8 : |
379 | case 15 : switch (ProgramNumber) | |
432 | case 15 : switch (program) | |
380 | 433 | { |
381 | 434 | case 0 : |
382 | 435 | case 1 : return "2/0/0"; |
384 | 437 | } |
385 | 438 | case 9 : |
386 | 439 | case 16 : |
387 | case 20 : switch (ProgramNumber) | |
440 | case 20 : switch (program) | |
388 | 441 | { |
389 | 442 | case 0 : return "2/0/0"; |
390 | 443 | default : return "1/0/0"; |
402 | 455 | extern const char* AC3_Surround[]; |
403 | 456 | |
404 | 457 | //--------------------------------------------------------------------------- |
405 | const char* DolbyE_ChannelLayout_PerProgram(int8u ProgramConfiguration, int8u ProgramNumber) | |
406 | { | |
407 | switch (ProgramConfiguration) | |
458 | const char* DolbyE_ChannelLayout_PerProgram(int8u program_config, int8u ProgramNumber) | |
459 | { | |
460 | switch (program_config) | |
408 | 461 | { |
409 | 462 | case 0 : switch (ProgramNumber) |
410 | 463 | { |
560 | 613 | const bool Mpegv_frame_rate_type[16]= |
561 | 614 | {false, false, false, false, false, false, true, true, true, false, false, false, false, false, false, false}; |
562 | 615 | |
616 | ||
617 | //--------------------------------------------------------------------------- | |
618 | static const int8u intermediate_spatial_format_object_count[8]= | |
619 | { | |
620 | 4, | |
621 | 8, | |
622 | 10, | |
623 | 14, | |
624 | 15, | |
625 | 30, | |
626 | 0, | |
627 | 0, | |
628 | }; | |
629 | ||
630 | const char* sound_category_Values[4]= | |
631 | { | |
632 | "", | |
633 | "Dialog", | |
634 | "", | |
635 | "", | |
636 | }; | |
637 | const char* hp_render_mode_Values[4]= | |
638 | { | |
639 | "Bypassed", | |
640 | "Near", | |
641 | "Far", | |
642 | "", | |
643 | }; | |
644 | string default_target_device_config_Value(int32u config) | |
645 | { | |
646 | string Value; | |
647 | if (config&0x1) | |
648 | Value+="Stereo / "; | |
649 | if (config&0x2) | |
650 | Value+="Surround / "; | |
651 | if (config&0x4) | |
652 | Value+="Immersive / "; | |
653 | if (!Value.empty()) | |
654 | Value.resize(Value.size()-3); | |
655 | return Value; | |
656 | } | |
657 | struct pos3d | |
658 | { | |
659 | int8u x; | |
660 | int8u y; | |
661 | int8u z; | |
662 | const char* Value; | |
663 | }; | |
664 | int16u mgi_6bit_unsigned_to_oari_Q15[0x40]= | |
665 | { | |
666 | 0, 529, 1057, 1586, 2114, 2643, 3171, 3700, | |
667 | 4228, 4757, 5285, 5814, 6342, 6871, 7399, 7928, | |
668 | 8456, 8985, 9513, 10042, 10570, 11099, 11627, 12156, | |
669 | 12684, 13213, 13741, 14270, 14798, 15327, 15855, 16384, | |
670 | 16913, 17441, 17970, 18498, 19027, 19555, 20084, 20612, | |
671 | 21141, 21669, 22198, 22726, 23255, 23783, 24312, 24840, | |
672 | 25369, 25897, 26426, 26954, 27483, 28011, 28540, 29068, | |
673 | 29597, 30125, 30654, 31182, 31711, 32239, 32767, 32767 | |
674 | }; | |
675 | ||
676 | int16u mgi_4bit_unsigned_to_oari_Q15[0x10]= | |
677 | { | |
678 | 0, 2185, 4369, 6554, 8738, 10923, 13107, 15292, | |
679 | 17476, 19661, 21845, 24030, 26214, 28399, 30583, 32767 | |
680 | }; | |
681 | ||
682 | int mgi_bitstream_val_to_Q15(int value, int8u num_bits) | |
683 | { | |
684 | bool sign; | |
685 | if (value<0) | |
686 | { | |
687 | sign=true; | |
688 | value=-value; | |
689 | } | |
690 | else | |
691 | sign=false; | |
692 | ||
693 | int16u* Table; | |
694 | switch (num_bits) | |
695 | { | |
696 | case 4: Table=mgi_4bit_unsigned_to_oari_Q15; break; | |
697 | case 6: Table=mgi_6bit_unsigned_to_oari_Q15; break; | |
698 | default: return 0; //Problem | |
699 | } | |
700 | int decoded=Table[value]; | |
701 | ||
702 | return sign?-decoded:decoded; | |
703 | } | |
704 | ||
705 | int mgi_bitstream_pos_z_to_Q15(bool pos_z_sign, int8u pos_z_bits) | |
706 | { | |
707 | if (pos_z_bits == 0xf) { | |
708 | if (pos_z_sign == 1) /* +1 */ { | |
709 | return(32767); | |
710 | } | |
711 | else /* -1 */ { | |
712 | return(-32768); | |
713 | } | |
714 | } | |
715 | else { | |
716 | /* Negative number */ | |
717 | if (pos_z_sign == 1) { | |
718 | return(mgi_bitstream_val_to_Q15(pos_z_bits, 4)); | |
719 | } | |
720 | else { | |
721 | return(mgi_bitstream_val_to_Q15(-pos_z_bits, 4)); | |
722 | } | |
723 | } | |
724 | } | |
725 | ||
726 | //--------------------------------------------------------------------------- | |
727 | struct speaker_info | |
728 | { | |
729 | int8u AzimuthAngle; //0 to 180 (right, if AzimuthDirection is false) or 179 (left, if AzimuthDirection is true) | |
730 | int8s ElevationDirectionAngle; //-90 (bottom) to 90 (top) | |
731 | enum flag | |
732 | { | |
733 | None = 0, | |
734 | AzimuthDirection = 1<<0, // true = right | |
735 | isLFE = 1<<1, | |
736 | }; | |
737 | int8u Flags; | |
738 | }; | |
739 | bool operator== (const speaker_info& L, const speaker_info& R) | |
740 | { | |
741 | return L.AzimuthAngle==R.AzimuthAngle | |
742 | && L.ElevationDirectionAngle==R.ElevationDirectionAngle | |
743 | && L.Flags==R.Flags; | |
744 | } | |
745 | extern string Aac_ChannelLayout_GetString(const Aac_OutputChannel* const OutputChannels, size_t OutputChannels_Size); | |
746 | static const size_t SpeakerInfos_Size=43; | |
747 | static const speaker_info SpeakerInfos[SpeakerInfos_Size] = | |
748 | { | |
749 | { 30, 0, speaker_info::AzimuthDirection }, | |
750 | { 30, 0, speaker_info::None }, | |
751 | { 0, 0, speaker_info::None }, | |
752 | { 0, -15, speaker_info::isLFE }, | |
753 | { 110, 0, speaker_info::AzimuthDirection }, | |
754 | { 110, 0, speaker_info::None }, | |
755 | { 22, 0, speaker_info::AzimuthDirection }, | |
756 | { 22, 0, speaker_info::None }, | |
757 | { 135, 0, speaker_info::AzimuthDirection }, | |
758 | { 135, 0, speaker_info::None }, | |
759 | { 180, 0, speaker_info::None }, | |
760 | { 135, 0, speaker_info::AzimuthDirection }, | |
761 | { 135, 0, speaker_info::None }, | |
762 | { 90, 0, speaker_info::AzimuthDirection }, | |
763 | { 90, 0, speaker_info::None }, | |
764 | { 60, 0, speaker_info::AzimuthDirection }, | |
765 | { 60, 0, speaker_info::None }, | |
766 | { 30, 35, speaker_info::AzimuthDirection }, | |
767 | { 30, 35, speaker_info::None }, | |
768 | { 0, 35, speaker_info::None }, | |
769 | { 135, 35, speaker_info::AzimuthDirection }, | |
770 | { 135, 35, speaker_info::None }, | |
771 | { 180, 35, speaker_info::None }, | |
772 | { 90, 35, speaker_info::AzimuthDirection }, | |
773 | { 90, 35, speaker_info::None }, | |
774 | { 0, 90, speaker_info::None }, | |
775 | { 45, -15, speaker_info::isLFE }, | |
776 | { 45, -15, speaker_info::AzimuthDirection }, | |
777 | { 45, -15, speaker_info::None }, | |
778 | { 0, -15, speaker_info::None }, | |
779 | { 110, 35, speaker_info::AzimuthDirection }, | |
780 | { 110, 35, speaker_info::None }, | |
781 | { 45, 35, speaker_info::AzimuthDirection }, | |
782 | { 45, 35, speaker_info::None }, | |
783 | { 45, 0, speaker_info::AzimuthDirection }, | |
784 | { 45, 0, speaker_info::None }, | |
785 | { 45, -15, speaker_info::None | speaker_info::isLFE }, | |
786 | { 2, 0, speaker_info::AzimuthDirection }, | |
787 | { 2, 0, speaker_info::None }, | |
788 | { 1, 0, speaker_info::AzimuthDirection }, | |
789 | { 1, 0, speaker_info::None }, | |
790 | { 150, 0, speaker_info::AzimuthDirection }, | |
791 | { 150, 0, speaker_info::None }, | |
792 | }; | |
793 | ||
794 | struct angles | |
795 | { | |
796 | int Azimuth; | |
797 | int Elevation; | |
798 | ||
799 | angles() | |
800 | {} | |
801 | ||
802 | angles(int theta, int phi) : | |
803 | Azimuth(theta), | |
804 | Elevation(phi) | |
805 | {} | |
806 | }; | |
807 | Aac_OutputChannel AnglesToChannelName(angles Angles) | |
808 | { | |
809 | speaker_info SpeakerInfo; | |
810 | if (Angles.Azimuth<0) | |
811 | { | |
812 | SpeakerInfo.AzimuthAngle=(int8u)-Angles.Azimuth; | |
813 | SpeakerInfo.Flags=speaker_info::AzimuthDirection; | |
814 | } | |
815 | else | |
816 | { | |
817 | SpeakerInfo.AzimuthAngle=Angles.Azimuth; | |
818 | SpeakerInfo.Flags=speaker_info::None; | |
819 | } | |
820 | SpeakerInfo.ElevationDirectionAngle=Angles.Elevation; | |
821 | ||
822 | for (size_t i=0; i<SpeakerInfos_Size; i++) | |
823 | if (SpeakerInfos[i]==SpeakerInfo) | |
824 | return (Aac_OutputChannel)i; | |
825 | return CH_MAX; | |
826 | } | |
827 | string ToAngle3Digits(int Value) | |
828 | { | |
829 | string ToReturn=Ztring::ToZtring(Value).To_UTF8(); | |
830 | ToReturn.insert(0, 3-ToReturn.size(), '0'); | |
831 | return ToReturn; | |
832 | } | |
833 | angles mgi_bitstream_pos_ToAngles(int x_int, int y_int, int z_int) | |
834 | { | |
835 | //Center becomes 0 and edges +/-1 | |
836 | float x=(((float)x_int)*2-32768)/32768; | |
837 | float y=(((float)y_int)*2-32768)/32768; | |
838 | float z=((float)z_int)/32768; | |
839 | ||
840 | if (!x && !y) | |
841 | { | |
842 | if (z>0) | |
843 | return angles(0, 90); | |
844 | else if (z<0) | |
845 | return angles(0, -90); | |
846 | return angles(0, 0); // Should not happen (is the center in practice) | |
847 | } | |
848 | else | |
849 | { | |
850 | angles ToReturn; | |
851 | ||
852 | float radius=sqrt(x*x+y*y+z*z); | |
853 | float theta_float=round(atan2(y, x)*180/3.14159265359/5)*5; | |
854 | ToReturn.Azimuth=float32_int32s(theta_float); | |
855 | float phi_float=round(acos(z/radius)*180/3.14159265359); | |
856 | ToReturn.Elevation=float32_int32s(phi_float); | |
857 | ||
858 | //Reference is front of viewer | |
859 | if (ToReturn.Azimuth<90) | |
860 | ToReturn.Azimuth+=90; | |
861 | else | |
862 | ToReturn.Azimuth-=270; | |
863 | ToReturn.Elevation=90-ToReturn.Elevation; | |
864 | ||
865 | return ToReturn; | |
866 | } | |
867 | } | |
868 | ||
869 | string Angles2String(angles Angles) | |
870 | { | |
871 | string ToReturn; | |
872 | ||
873 | //Elevation | |
874 | switch (Angles.Elevation) | |
875 | { | |
876 | case 0: ToReturn+='M'; break; | |
877 | case 90: ToReturn+='T'; break; | |
878 | case -90: ToReturn+='X'; break; //No standard for that | |
879 | default : ToReturn+=(Angles.Elevation>0?'U':'B'); | |
880 | //if (Angles.phi!=35 && Angles.phi!=-15) | |
881 | ToReturn+=ToAngle3Digits(Angles.Elevation); | |
882 | } | |
883 | ||
884 | ToReturn+='_'; | |
885 | ||
886 | //Azimuth | |
887 | if (Angles.Azimuth<0) | |
888 | ToReturn+='L'; | |
889 | else if (Angles.Azimuth>0 && Angles.Azimuth!=180) | |
890 | ToReturn+='R'; | |
891 | ToReturn+=ToAngle3Digits(Angles.Azimuth<0?-Angles.Azimuth:Angles.Azimuth); | |
892 | ||
893 | return ToReturn; | |
894 | } | |
895 | ||
896 | string Angles2KnownChannelName(angles& Angles) | |
897 | { | |
898 | //Exception handling | |
899 | int Azimuth; | |
900 | if (Angles.Azimuth==-180) | |
901 | Azimuth=180; | |
902 | else | |
903 | Azimuth=Angles.Azimuth; | |
904 | int Elevation; | |
905 | if (Angles.Elevation>=35 && Angles.Elevation<=45) | |
906 | Elevation=35; | |
907 | else | |
908 | Elevation=Angles.Elevation; | |
909 | ||
910 | Aac_OutputChannel KnownChannel=AnglesToChannelName(angles(Azimuth, Elevation)); | |
911 | if (KnownChannel!=CH_MAX) | |
912 | return Aac_ChannelLayout_GetString(&KnownChannel, 1); | |
913 | else | |
914 | return Angles2String(Angles); | |
915 | } | |
916 | ||
917 | //--------------------------------------------------------------------------- | |
918 | extern int32u AC3_bed_channel_assignment_mask_2_nonstd(int16u bed_channel_assignment_mask); | |
919 | extern Ztring AC3_nonstd_bed_channel_assignment_mask_ChannelLayout(int32u nonstd_bed_channel_assignment_mask); | |
920 | size_t BedChannelConfiguration_ChannelCount(int32u nonstd_bed_channel_assignment_mask) | |
921 | { | |
922 | Ztring BedChannelConfiguration=AC3_nonstd_bed_channel_assignment_mask_ChannelLayout(nonstd_bed_channel_assignment_mask); | |
923 | size_t BedChannelCount=0; | |
924 | if (!BedChannelConfiguration.empty()) | |
925 | for (size_t i=0; i<BedChannelConfiguration.size();) | |
926 | { | |
927 | BedChannelCount++; | |
928 | i=BedChannelConfiguration.find(__T(' '), i+1); | |
929 | } | |
930 | return BedChannelCount; | |
931 | } | |
932 | ||
563 | 933 | //*************************************************************************** |
564 | 934 | // Constructor/Destructor |
565 | 935 | //*************************************************************************** |
583 | 953 | //Out |
584 | 954 | GuardBand_After=0; |
585 | 955 | |
956 | //ED2 | |
957 | Guardband_EMDF_PresentAndSize=0; | |
958 | num_desc_packets_m1=(int32u)-1; | |
959 | ||
586 | 960 | //Temp |
587 | 961 | SMPTE_time_code_StartTimecode=(int64u)-1; |
588 | 962 | FrameInfo.DTS=0; |
596 | 970 | void File_DolbyE::Streams_Fill() |
597 | 971 | { |
598 | 972 | Fill(Stream_General, 0, General_Format, "Dolby E"); |
599 | for (int8u ProgramNumber=0; ProgramNumber<DolbyE_Programs[ProgramConfiguration]; ProgramNumber++) | |
973 | ||
974 | if (!Presets.empty()) | |
975 | { | |
976 | Streams_Fill_ED2(); | |
977 | return; | |
978 | } | |
979 | ||
980 | int8u DolbyE_Audio_Pos=0; | |
981 | for (size_t i=0; i<8; i++) | |
982 | if (channel_subsegment_sizes[i].size()>1) | |
983 | DolbyE_Audio_Pos=(int8u)-1; | |
984 | for (int8u program=0; program<DolbyE_Programs[program_config]; program++) | |
600 | 985 | { |
601 | 986 | Stream_Prepare(Stream_Audio); |
602 | 987 | Fill(Stream_Audio, StreamPos_Last, Audio_Format, "Dolby E"); |
603 | if (DolbyE_Programs[ProgramConfiguration]>1) | |
988 | if (DolbyE_Programs[program_config]>1) | |
604 | 989 | Fill(Stream_Audio, StreamPos_Last, Audio_ID, Count_Get(Stream_Audio)); |
605 | Fill(Stream_Audio, StreamPos_Last, Audio_Channel_s_, DolbyE_Channels_PerProgram(ProgramConfiguration, ProgramNumber)); | |
606 | Fill(Stream_Audio, StreamPos_Last, Audio_ChannelPositions, DolbyE_ChannelPositions_PerProgram(ProgramConfiguration, ProgramNumber)); | |
607 | Fill(Stream_Audio, StreamPos_Last, Audio_ChannelPositions_String2, DolbyE_ChannelPositions2_PerProgram(ProgramConfiguration, ProgramNumber)); | |
608 | Fill(Stream_Audio, StreamPos_Last, Audio_ChannelLayout, DolbyE_ChannelLayout_PerProgram(ProgramConfiguration, ProgramNumber)); | |
609 | Fill(Stream_Audio, StreamPos_Last, Audio_SamplingRate, 48000); | |
610 | Fill(Stream_Audio, StreamPos_Last, Audio_BitDepth, BitDepth); | |
611 | if (SMPTE_time_code_StartTimecode!=(int64u)-1) | |
612 | { | |
613 | Fill(StreamKind_Last, StreamPos_Last, Audio_Delay, SMPTE_time_code_StartTimecode); | |
614 | Fill(StreamKind_Last, StreamPos_Last, Audio_Delay_Source, "Stream"); | |
615 | } | |
616 | ||
617 | Fill(Stream_Audio, StreamPos_Last, Audio_FrameRate, Mpegv_frame_rate[FrameRate]); | |
618 | if (FrameInfo.PTS!=(int64u)-1 && BitDepth) | |
619 | { | |
620 | float BitRate=(float)(96000*BitDepth); | |
621 | ||
622 | if (GuardBand_Before_Initial) | |
623 | { | |
624 | float GuardBand_Before_Initial_Duration=GuardBand_Before_Initial*8/BitRate; | |
625 | Fill(Stream_Audio, StreamPos_Last, "GuardBand_Before", GuardBand_Before_Initial_Duration, 9); | |
626 | Fill(Stream_Audio, StreamPos_Last, "GuardBand_Before/String", Ztring::ToZtring(GuardBand_Before_Initial_Duration*1000000, 0)+Ztring().From_UTF8(" \xC2xB5s")); //0xC2 0xB5 = micro sign | |
627 | Fill_SetOptions(Stream_Audio, StreamPos_Last, "GuardBand_Before", "N NT"); | |
628 | Fill_SetOptions(Stream_Audio, StreamPos_Last, "GuardBand_Before/String", "N NT"); | |
629 | ||
630 | float GuardBand_After_Initial_Duration=GuardBand_After_Initial*8/BitRate; | |
631 | Fill(Stream_Audio, StreamPos_Last, "GuardBand_After", GuardBand_After_Initial_Duration, 9); | |
632 | Fill(Stream_Audio, StreamPos_Last, "GuardBand_After/String", Ztring::ToZtring(GuardBand_After_Initial_Duration*1000000, 0)+Ztring().From_UTF8(" \xC2xB5s")); //0xC2 0xB5 = micro sign | |
633 | Fill_SetOptions(Stream_Audio, StreamPos_Last, "GuardBand_After", "N NT"); | |
634 | Fill_SetOptions(Stream_Audio, StreamPos_Last, "GuardBand_After/String", "N NT"); | |
635 | } | |
636 | } | |
637 | ||
638 | if (ProgramNumber<description_text_Values.size()) | |
639 | { | |
640 | Fill(Stream_Audio, StreamPos_Last, Audio_Title, description_text_Values[ProgramNumber].Previous); | |
641 | Fill(Stream_Audio, StreamPos_Last, "Title_FromStream", description_text_Values[ProgramNumber].Previous); | |
990 | Fill(Stream_Audio, StreamPos_Last, Audio_Channel_s_, DolbyE_Channels_PerProgram(program_config, program)); | |
991 | Fill(Stream_Audio, StreamPos_Last, Audio_ChannelPositions, DolbyE_ChannelPositions_PerProgram(program_config, program)); | |
992 | Fill(Stream_Audio, StreamPos_Last, Audio_ChannelPositions_String2, DolbyE_ChannelPositions2_PerProgram(program_config, program)); | |
993 | Fill(Stream_Audio, StreamPos_Last, Audio_ChannelLayout, DolbyE_ChannelLayout_PerProgram(program_config, program)); | |
994 | int32u Program_Size=0; | |
995 | if (DolbyE_Audio_Pos!=(int8u)-1) | |
996 | for (int8u Pos=0; Pos<DolbyE_Channels_PerProgram(program_config, program); Pos++) | |
997 | Program_Size+=channel_subsegment_size[DolbyE_Audio_Pos+Pos]; | |
998 | if (!Mpegv_frame_rate_type[frame_rate_code]) | |
999 | Program_Size*=2; //Low bit rate, 2 channel component per block | |
1000 | Program_Size*=bit_depth; | |
1001 | Fill(Stream_Audio, StreamPos_Last, Audio_BitRate, Program_Size*Mpegv_frame_rate[frame_rate_code], 0); | |
1002 | if (DolbyE_Audio_Pos!=(int8u)-1) | |
1003 | DolbyE_Audio_Pos+=DolbyE_Channels_PerProgram(program_config, program); | |
1004 | Streams_Fill_PerProgram(); | |
1005 | ||
1006 | if (program<description_text_Values.size()) | |
1007 | { | |
1008 | Fill(Stream_Audio, StreamPos_Last, Audio_Title, description_text_Values[program].Previous); | |
1009 | Fill(Stream_Audio, StreamPos_Last, "Title_FromStream", description_text_Values[program].Previous); | |
642 | 1010 | Fill_SetOptions(Stream_Audio, StreamPos_Last, "Title_FromStream", "N NT"); |
643 | 1011 | } |
644 | 1012 | } |
645 | Fill(Stream_General, 0, General_OverallBitRate, Element_Size*8*Mpegv_frame_rate[FrameRate], 0); | |
1013 | } | |
1014 | ||
1015 | //--------------------------------------------------------------------------- | |
1016 | void File_DolbyE::Streams_Fill_PerProgram() | |
1017 | { | |
1018 | Fill(Stream_Audio, StreamPos_Last, Audio_SamplingRate, 48000); | |
1019 | Fill(Stream_Audio, StreamPos_Last, Audio_BitDepth, bit_depth); | |
1020 | ||
1021 | if (SMPTE_time_code_StartTimecode!=(int64u)-1) | |
1022 | { | |
1023 | Fill(StreamKind_Last, StreamPos_Last, Audio_Delay, SMPTE_time_code_StartTimecode); | |
1024 | Fill(StreamKind_Last, StreamPos_Last, Audio_Delay_Source, "Stream"); | |
1025 | } | |
1026 | ||
1027 | Fill(Stream_Audio, StreamPos_Last, Audio_FrameRate, Mpegv_frame_rate[frame_rate_code]); | |
1028 | if (FrameInfo.PTS!=(int64u)-1 && bit_depth) | |
1029 | { | |
1030 | float BitRate=(float)(96000*bit_depth); | |
1031 | ||
1032 | if (GuardBand_Before_Initial) | |
1033 | { | |
1034 | float GuardBand_Before_Initial_Duration=GuardBand_Before_Initial*8/BitRate; | |
1035 | Fill(Stream_Audio, StreamPos_Last, "GuardBand_Before", GuardBand_Before_Initial_Duration, 9); | |
1036 | Fill(Stream_Audio, StreamPos_Last, "GuardBand_Before/String", Ztring::ToZtring(GuardBand_Before_Initial_Duration*1000000, 0)+Ztring().From_UTF8(" \xC2xB5s")); //0xC2 0xB5 = micro sign | |
1037 | Fill_SetOptions(Stream_Audio, StreamPos_Last, "GuardBand_Before", "N NT"); | |
1038 | Fill_SetOptions(Stream_Audio, StreamPos_Last, "GuardBand_Before/String", "N NT"); | |
1039 | ||
1040 | float GuardBand_After_Initial_Duration=GuardBand_After_Initial*8/BitRate; | |
1041 | Fill(Stream_Audio, StreamPos_Last, "GuardBand_After", GuardBand_After_Initial_Duration, 9); | |
1042 | Fill(Stream_Audio, StreamPos_Last, "GuardBand_After/String", Ztring::ToZtring(GuardBand_After_Initial_Duration*1000000, 0)+Ztring().From_UTF8(" \xC2xB5s")); //0xC2 0xB5 = micro sign | |
1043 | Fill_SetOptions(Stream_Audio, StreamPos_Last, "GuardBand_After", "N NT"); | |
1044 | Fill_SetOptions(Stream_Audio, StreamPos_Last, "GuardBand_After/String", "N NT"); | |
1045 | } | |
1046 | } | |
1047 | ||
1048 | if (FrameSizes.size()==1) | |
1049 | { | |
1050 | if (StreamPos_Last) | |
1051 | Fill(Stream_Audio, StreamPos_Last, Audio_BitRate_Encoded, 0, 0, true); | |
1052 | else | |
1053 | { | |
1054 | Fill(Stream_General, 0, General_OverallBitRate, FrameSizes.begin()->first*8*Mpegv_frame_rate[frame_rate_code], 0); | |
1055 | Fill(Stream_Audio, 0, Audio_BitRate_Encoded, FrameSizes.begin()->first*8*Mpegv_frame_rate[frame_rate_code], 0); | |
1056 | } | |
1057 | } | |
1058 | } | |
1059 | ||
1060 | //--------------------------------------------------------------------------- | |
1061 | void File_DolbyE::Streams_Fill_ED2() | |
1062 | { | |
1063 | Stream_Prepare(Stream_Audio); | |
1064 | Fill(Stream_Audio, StreamPos_Last, Audio_Format, "Dolby ED2"); | |
1065 | if (Guardband_EMDF_PresentAndSize) | |
1066 | Fill(Stream_Audio, StreamPos_Last, Audio_BitRate, Guardband_EMDF_PresentAndSize*8*Mpegv_frame_rate[frame_rate_code], 0); | |
1067 | size_t ChannelCount=DynObjects.size(); | |
1068 | for (size_t p=0; p<BedInstances.size(); p++) | |
1069 | if (p<nonstd_bed_channel_assignment_masks.size()) | |
1070 | ChannelCount+=BedChannelConfiguration_ChannelCount(nonstd_bed_channel_assignment_masks[p]); | |
1071 | if (ChannelCount) | |
1072 | Fill(Stream_Audio, StreamPos_Last, Audio_Channel_s_, ChannelCount); | |
1073 | Streams_Fill_PerProgram(); | |
1074 | ||
1075 | for (size_t p=0; p<Presets.size(); p++) | |
1076 | { | |
1077 | const preset& Presentation_Current=Presets[p]; | |
1078 | ||
1079 | string Title; | |
1080 | if (p<Presets_More.size() && !Presets_More[p].description.empty()) | |
1081 | Title=Presets_More[p].description; | |
1082 | ||
1083 | string Summary=Title; | |
1084 | if (Summary.empty()) | |
1085 | Summary="Yes"; | |
1086 | ||
1087 | string P="Presentation"+Ztring::ToZtring(p).To_UTF8(); | |
1088 | Fill(Stream_Audio, 0, P.c_str(), Summary); | |
1089 | if (!Title.empty()) | |
1090 | { | |
1091 | Fill(Stream_Audio, 0, (P+" Title").c_str(), Title); | |
1092 | Fill_SetOptions(Stream_Audio, 0, (P+" Title").c_str(), "N NTY"); | |
1093 | } | |
1094 | Fill(Stream_Audio, 0, (P+" DefaultTargetDeviceConfig").c_str(), default_target_device_config_Value(Presentation_Current.default_target_device_config)); | |
1095 | Fill_SetOptions(Stream_Audio, 0, (P+" DefaultTargetDeviceConfig").c_str(), "Y NTY"); | |
1096 | for (size_t t=0; t<Presentation_Current.target_device_configs.size(); t++) | |
1097 | { | |
1098 | const preset::target_device_config& Target_Current=Presentation_Current.target_device_configs[t]; | |
1099 | ||
1100 | string Summary2=default_target_device_config_Value(Target_Current.target_devices_mask); | |
1101 | if (Summary2.empty()) | |
1102 | Summary2="Yes"; | |
1103 | ||
1104 | string T=P+" Target"+Ztring::ToZtring(t).To_UTF8(); | |
1105 | Fill(Stream_Audio, 0, T.c_str(), Summary2); | |
1106 | ||
1107 | Fill(Stream_Audio, 0, (T+" TargetDeviceConfig").c_str(), default_target_device_config_Value(Target_Current.target_devices_mask)); | |
1108 | Fill_SetOptions(Stream_Audio, 0, (T+" TargetDeviceConfig").c_str(), "N NTY"); | |
1109 | ||
1110 | ZtringList GroupPos[2], GroupNum[2]; | |
1111 | for (size_t i=0; i<Target_Current.md_indexes.size(); i++) | |
1112 | { | |
1113 | if (Target_Current.md_indexes[i]!=(int32u)-1) | |
1114 | { | |
1115 | size_t I1, I2; | |
1116 | if (i<DynObjects.size()) | |
1117 | { | |
1118 | I1=i; | |
1119 | I2=Target_Current.md_indexes[i]; | |
1120 | if (I2 && I2>DynObjects[I1].Alts.size()) // 0 = OAMD, else Alt - 1 | |
1121 | I2=0; // There is a problem | |
1122 | } | |
1123 | else | |
1124 | { | |
1125 | I1=i-DynObjects.size(); | |
1126 | I2=Target_Current.md_indexes[i]; | |
1127 | if (I2 && I2>BedInstances[I1].Alts.size()) // 0 = OAMD, else Alt - 1 | |
1128 | I2=0; // There is a problem | |
1129 | } | |
1130 | ||
1131 | int j=i<DynObjects.size()?1:0; | |
1132 | GroupPos[j].push_back(Ztring::ToZtring(I1)); | |
1133 | GroupNum[j].push_back(Ztring::ToZtring(I1+1)); | |
1134 | if (I2 ) | |
1135 | { | |
1136 | GroupPos[j][GroupPos[j].size()-1]+=__T('-'); | |
1137 | GroupNum[j][GroupNum[j].size()-1]+=__T('-'); | |
1138 | GroupPos[j][GroupPos[j].size()-1]+=Ztring::ToZtring(I2-1); | |
1139 | GroupNum[j][GroupNum[j].size()-1]+=Ztring::ToZtring(I2); | |
1140 | } | |
1141 | } | |
1142 | } | |
1143 | ||
1144 | for (size_t i=0; i<2; i++) | |
1145 | { | |
1146 | GroupPos[i].Separator_Set(0, __T(" + ")); | |
1147 | Fill(Stream_Audio, 0, (T+(!i?" LinkedTo_Bed_Pos":" LinkedTo_Object_Pos")).c_str(), GroupPos[i].Read()); | |
1148 | Fill_SetOptions(Stream_Audio, 0, (T+(!i?" LinkedTo_Bed_Pos":" LinkedTo_Object_Pos")).c_str(), "N NIY"); | |
1149 | GroupNum[i].Separator_Set(0, __T(" + ")); | |
1150 | Fill(Stream_Audio, 0, (T+(!i?" LinkedTo_Bed_Pos/String":" LinkedTo_Object_Pos/String")).c_str(), GroupNum[i].Read()); | |
1151 | Fill_SetOptions(Stream_Audio, 0, (T+(!i?" LinkedTo_Bed_Pos/String":" LinkedTo_Object_Pos/String")).c_str(), "Y NIN"); | |
1152 | } | |
1153 | } | |
1154 | } | |
1155 | ||
1156 | // Computing the count of objects in bed instances | |
1157 | size_t Bed_Object_Count=0; | |
1158 | ||
1159 | // Beds | |
1160 | for (size_t p=0; p<BedInstances.size(); p++) | |
1161 | { | |
1162 | const bed_instance& BedInstance=BedInstances[p]; | |
1163 | ||
1164 | string Summary; | |
1165 | if (Summary.empty()) | |
1166 | Summary=AC3_nonstd_bed_channel_assignment_mask_ChannelLayout(nonstd_bed_channel_assignment_masks[p]).To_UTF8(); | |
1167 | if (Summary.empty()) | |
1168 | Summary="Yes"; | |
1169 | ||
1170 | string P=Ztring(__T("Bed")+Ztring::ToZtring(p)).To_UTF8(); | |
1171 | Fill(Stream_Audio, 0, P.c_str(), Summary); | |
1172 | ||
1173 | if (p<nonstd_bed_channel_assignment_masks.size()) | |
1174 | { | |
1175 | Fill(Stream_Audio, StreamPos_Last, (P+" Channel(s)").c_str(), BedChannelConfiguration_ChannelCount(nonstd_bed_channel_assignment_masks[p])); | |
1176 | Fill_SetOptions(Stream_Audio, 0, (P+" Channel(s)").c_str(), "Y NTY"); | |
1177 | Fill(Stream_Audio, 0, (P+" ChannelLayout").c_str(), AC3_nonstd_bed_channel_assignment_mask_ChannelLayout(nonstd_bed_channel_assignment_masks[p])); | |
1178 | Fill_SetOptions(Stream_Audio, 0, (P+" ChannelLayout").c_str(), "Y NTY"); | |
1179 | ||
1180 | // From OAMD | |
1181 | if (Bed_Object_Count<ObjectElements.size() && !ObjectElements[Bed_Object_Count].Alts.empty()) | |
1182 | { | |
1183 | string A=P; | |
1184 | ||
1185 | // Computing the count of objects in bed instances | |
1186 | size_t ThisBed_Object_Count=BedChannelConfiguration_ChannelCount(nonstd_bed_channel_assignment_masks[p]); | |
1187 | ||
1188 | if (ThisBed_Object_Count) | |
1189 | { | |
1190 | // Check if all same | |
1191 | int8s obj_gain_db_Ref=ObjectElements[Bed_Object_Count].Alts[0].obj_gain_db; | |
1192 | for (size_t o=1; o<ThisBed_Object_Count; o++) | |
1193 | { | |
1194 | int8s obj_gain_db=ObjectElements[Bed_Object_Count+o].Alts[0].obj_gain_db; | |
1195 | if (obj_gain_db!=obj_gain_db_Ref) | |
1196 | { | |
1197 | obj_gain_db_Ref=INT8_MAX; | |
1198 | break; | |
1199 | } | |
1200 | } | |
1201 | if (obj_gain_db_Ref!=INT8_MAX) | |
1202 | { | |
1203 | // Same | |
1204 | if (obj_gain_db_Ref==INT8_MIN) | |
1205 | Fill_Measure(Stream_Audio, 0, (A+" Gain").c_str(), string("-infinite"), " dB"); | |
1206 | else | |
1207 | Fill_Measure(Stream_Audio, 0, (A+" Gain").c_str(), obj_gain_db_Ref, " dB"); | |
1208 | } | |
1209 | else | |
1210 | { | |
1211 | // Not same | |
1212 | for (size_t o=0; o<ThisBed_Object_Count; o++) | |
1213 | { | |
1214 | const dyn_object::dyn_object_alt& DynObject_Current=ObjectElements[Bed_Object_Count+o].Alts[0]; | |
1215 | if (DynObject_Current.obj_gain_db!=INT8_MAX) | |
1216 | { | |
1217 | if (DynObject_Current.obj_gain_db==INT8_MIN) | |
1218 | Fill_Measure(Stream_Audio, 0, (A+" Gain").c_str(), string("-infinite"), " dB"); | |
1219 | else | |
1220 | Fill_Measure(Stream_Audio, 0, (A+" Gain").c_str(), DynObject_Current.obj_gain_db, " dB"); | |
1221 | } | |
1222 | } | |
1223 | } | |
1224 | ||
1225 | } | |
1226 | Bed_Object_Count+=ThisBed_Object_Count; | |
1227 | } | |
1228 | } | |
1229 | ||
1230 | for (size_t a=0; a<BedInstance.Alts.size(); a++) | |
1231 | { | |
1232 | const bed_instance::bed_alt& BedInstance_Current=BedInstance.Alts[a]; | |
1233 | ||
1234 | string Summary2; | |
1235 | if (Summary2.empty()) | |
1236 | Summary2="Yes"; | |
1237 | ||
1238 | string A=P+Ztring(__T(" Alt")+Ztring::ToZtring(a)).To_UTF8(); | |
1239 | Fill(Stream_Audio, 0, A.c_str(), Summary2); | |
1240 | if (BedInstance_Current.bed_gain_db!=INT8_MAX) | |
1241 | { | |
1242 | Fill_Measure(Stream_Audio, 0, (A+" Gain").c_str(), BedInstance_Current.bed_gain_db, " dB"); | |
1243 | } | |
1244 | } | |
1245 | ||
1246 | const substream_mapping& S=substream_mappings[DynObjects.size()+p]; | |
1247 | { | |
1248 | Fill(Stream_Audio, 0, (P+" SubtstreamIdChannel").c_str(), Ztring::ToZtring(S.substream_id)+__T('-')+Ztring::ToZtring(S.channel_index)); | |
1249 | Fill_SetOptions(Stream_Audio, 0, (P+" SubtstreamIdChannel").c_str(), "Y NTY"); | |
1250 | } | |
1251 | } | |
1252 | ||
1253 | // Dynamic objects | |
1254 | for (size_t p=0; p<DynObjects.size(); p++) | |
1255 | { | |
1256 | const dyn_object& DynObject=DynObjects[p]; | |
1257 | string P=Ztring(__T("Object")+Ztring::ToZtring(p)).To_UTF8(); | |
1258 | ||
1259 | // From OAMD | |
1260 | Ztring Position_Cartesian; | |
1261 | string Position_Polar; | |
1262 | string ChannelLayout; | |
1263 | if (Bed_Object_Count<ObjectElements.size() && p<ObjectElements.size()-Bed_Object_Count && !ObjectElements[Bed_Object_Count+p].Alts.empty()) | |
1264 | { | |
1265 | string A=P; | |
1266 | const dyn_object::dyn_object_alt& DynObject_Current=ObjectElements[Bed_Object_Count+p].Alts[0]; | |
1267 | if (DynObject_Current.pos3d_x_bits!=(int8u)-1) | |
1268 | { | |
1269 | int x_32k=mgi_bitstream_val_to_Q15(DynObject_Current.pos3d_x_bits, 6); | |
1270 | int y_32k=mgi_bitstream_val_to_Q15(DynObject_Current.pos3d_y_bits, 6); | |
1271 | int z_32k=mgi_bitstream_pos_z_to_Q15(DynObject_Current.pos3d_z_sig, DynObject_Current.pos3d_z_bits); | |
1272 | Position_Cartesian=__T("x=")+Ztring::ToZtring((((float)x_32k)*2-32768)/32768, 1)+__T(" y=")+Ztring::ToZtring((((float)y_32k)*2-32768)/32768, 1)+__T(" z=")+Ztring::ToZtring(((float)z_32k)/32768, 1); | |
1273 | angles Angles=mgi_bitstream_pos_ToAngles(x_32k, y_32k, z_32k); | |
1274 | Position_Polar=Angles2String(Angles); | |
1275 | ChannelLayout=Angles2KnownChannelName(Angles); | |
1276 | if (ChannelLayout==Position_Polar) | |
1277 | ChannelLayout.clear(); | |
1278 | } | |
1279 | } | |
1280 | ||
1281 | string Summary; | |
1282 | if (Summary.empty()) | |
1283 | Summary=sound_category_Values[DynObject.sound_category]; | |
1284 | /* | |
1285 | if (Summary.empty()) | |
1286 | Summary=ChannelLayout; | |
1287 | if (Summary.empty()) | |
1288 | Summary=Position_Polar; | |
1289 | */ | |
1290 | if (Summary.empty()) | |
1291 | Summary="Yes"; | |
1292 | ||
1293 | Fill(Stream_Audio, 0, P.c_str(), Summary); | |
1294 | ||
1295 | if (sound_category_Values[DynObject.sound_category][0]) | |
1296 | { | |
1297 | Fill(Stream_Audio, 0, (P+" SoundCategory").c_str(), sound_category_Values[DynObject.sound_category]); | |
1298 | Fill_SetOptions(Stream_Audio, 0, (P+" SoundCategory").c_str(), "Y NTY"); | |
1299 | } | |
1300 | ||
1301 | // From OAMD | |
1302 | if (Bed_Object_Count<ObjectElements.size() && p<ObjectElements.size()-Bed_Object_Count && !ObjectElements[Bed_Object_Count+p].Alts.empty()) | |
1303 | { | |
1304 | string A=P; | |
1305 | const dyn_object::dyn_object_alt& DynObject_Current=ObjectElements[Bed_Object_Count+p].Alts[0]; | |
1306 | /* | |
1307 | if (!ChannelLayout.empty()) | |
1308 | { | |
1309 | Fill(Stream_Audio, 0, (A+" ChannelLayout").c_str(), ChannelLayout); | |
1310 | Fill_SetOptions(Stream_Audio, 0, (A+" ChannelLayout").c_str(), "Y NTY"); | |
1311 | } | |
1312 | */ | |
1313 | if (!Position_Polar.empty()) | |
1314 | { | |
1315 | Fill(Stream_Audio, 0, (A+" Position_Polar").c_str(), Position_Polar); | |
1316 | Fill_SetOptions(Stream_Audio, 0, (A+" Position_Polar").c_str(), "Y NTY"); | |
1317 | } | |
1318 | if (!Position_Cartesian.empty()) | |
1319 | { | |
1320 | Fill(Stream_Audio, 0, (A+" Position_Cartesian").c_str(), Position_Cartesian); | |
1321 | Fill_SetOptions(Stream_Audio, 0, (A+" Position_Cartesian").c_str(), "Y NTY"); | |
1322 | } | |
1323 | if (DynObject_Current.obj_gain_db!=INT8_MAX) | |
1324 | { | |
1325 | if (DynObject_Current.obj_gain_db==INT8_MIN) | |
1326 | Fill_Measure(Stream_Audio, 0, (A+" Gain").c_str(), string("-infinite"), " dB"); | |
1327 | else | |
1328 | Fill_Measure(Stream_Audio, 0, (A+" Gain").c_str(), DynObject_Current.obj_gain_db, " dB"); | |
1329 | } | |
1330 | } | |
1331 | ||
1332 | for (size_t a=0; a<DynObject.Alts.size(); a++) | |
1333 | { | |
1334 | const dyn_object::dyn_object_alt& DynObject_Current=DynObject.Alts[a]; | |
1335 | Ztring Position_Cartesian; | |
1336 | string Position_Polar; | |
1337 | string ChannelLayout; | |
1338 | if (DynObject_Current.pos3d_x_bits!=(int8u)-1) | |
1339 | { | |
1340 | int x_32k=mgi_bitstream_val_to_Q15(DynObject_Current.pos3d_x_bits, 6); | |
1341 | int y_32k=mgi_bitstream_val_to_Q15(DynObject_Current.pos3d_y_bits, 6); | |
1342 | int z_32k=mgi_bitstream_pos_z_to_Q15(DynObject_Current.pos3d_z_sig, DynObject_Current.pos3d_z_bits); | |
1343 | Position_Cartesian=__T("x=")+Ztring::ToZtring((((float)x_32k)*2-32768)/32768, 1)+__T(" y=")+Ztring::ToZtring((((float)y_32k)*2-32768)/32768, 1)+__T(" z=")+Ztring::ToZtring(((float)z_32k)/32768, 1); | |
1344 | angles Angles=mgi_bitstream_pos_ToAngles(x_32k, y_32k, z_32k); | |
1345 | Position_Polar=Angles2String(Angles); | |
1346 | ChannelLayout=Angles2KnownChannelName(Angles); | |
1347 | if (ChannelLayout==Position_Polar) | |
1348 | ChannelLayout.clear(); | |
1349 | } | |
1350 | string Summary2; | |
1351 | if (Summary2.empty()) | |
1352 | Summary2=sound_category_Values[DynObject.sound_category]; | |
1353 | /* | |
1354 | if (Summary2.empty()) | |
1355 | Summary2=ChannelLayout; | |
1356 | if (Summary2.empty()) | |
1357 | Summary2=Position_Polar; | |
1358 | */ | |
1359 | if (Summary2.empty()) | |
1360 | Summary2="Yes"; | |
1361 | ||
1362 | string A=P+Ztring(__T(" Alt")+Ztring::ToZtring(a)).To_UTF8(); | |
1363 | Fill(Stream_Audio, 0, A.c_str(), Summary2); | |
1364 | /* | |
1365 | if (!ChannelLayout.empty()) | |
1366 | { | |
1367 | Fill(Stream_Audio, 0, (A+" ChannelLayout").c_str(), ChannelLayout); | |
1368 | Fill_SetOptions(Stream_Audio, 0, (A+" ChannelLayout").c_str(), "Y NTY"); | |
1369 | } | |
1370 | */ | |
1371 | if (!Position_Polar.empty()) | |
1372 | { | |
1373 | Fill(Stream_Audio, 0, (A+" Position_Polar").c_str(), Position_Polar); | |
1374 | Fill_SetOptions(Stream_Audio, 0, (A+" Position_Polar").c_str(), "Y NTY"); | |
1375 | } | |
1376 | if (!Position_Cartesian.empty()) | |
1377 | { | |
1378 | Fill(Stream_Audio, 0, (A+" Position_Cartesian").c_str(), Position_Cartesian); | |
1379 | Fill_SetOptions(Stream_Audio, 0, (A+" Position_Cartesian").c_str(), "Y NTY"); | |
1380 | } | |
1381 | if (DynObject_Current.obj_gain_db!=INT8_MAX) | |
1382 | { | |
1383 | if (DynObject_Current.obj_gain_db==INT8_MIN) | |
1384 | Fill_Measure(Stream_Audio, 0, (A+" Gain").c_str(), string("-infinite"), " dB"); | |
1385 | else | |
1386 | Fill_Measure(Stream_Audio, 0, (A+" Gain").c_str(), DynObject_Current.obj_gain_db, " dB"); | |
1387 | } | |
1388 | if (DynObject_Current.hp_render_mode!=(int8u)-1) | |
1389 | { | |
1390 | Fill(Stream_Audio, 0, (A+" RenderMode").c_str(), hp_render_mode_Values[DynObject_Current.hp_render_mode]); | |
1391 | Fill_SetOptions(Stream_Audio, 0, (P + " RenderMode").c_str(), "Y NTY"); | |
1392 | } | |
1393 | } | |
1394 | ||
1395 | const substream_mapping& S=substream_mappings[p]; | |
1396 | { | |
1397 | Fill(Stream_Audio, 0, (P+" SubtstreamIdChannel").c_str(), Ztring::ToZtring(S.substream_id)+__T('-')+Ztring::ToZtring(S.channel_index)); | |
1398 | Fill_SetOptions(Stream_Audio, 0, (P+" SubtstreamIdChannel").c_str(), "Y NTY"); | |
1399 | } | |
1400 | } | |
646 | 1401 | } |
647 | 1402 | |
648 | 1403 | //--------------------------------------------------------------------------- |
652 | 1407 | { |
653 | 1408 | int64s Duration=float64_int64s(((float64)(FrameInfo.PTS-PTS_Begin))/1000000); |
654 | 1409 | int64s FrameCount; |
655 | if (Mpegv_frame_rate[FrameRate]) | |
656 | FrameCount=float64_int64s(((float64)(FrameInfo.PTS-PTS_Begin))/1000000000*Mpegv_frame_rate[FrameRate]); | |
1410 | if (Mpegv_frame_rate[frame_rate_code]) | |
1411 | FrameCount=float64_int64s(((float64)(FrameInfo.PTS-PTS_Begin))/1000000000*Mpegv_frame_rate[frame_rate_code]); | |
657 | 1412 | else |
658 | 1413 | FrameCount=0; |
659 | 1414 | |
678 | 1433 | { |
679 | 1434 | if ((CC2(Buffer+Buffer_Offset_Temp)&0xFFFE)==0x078E) //16-bit |
680 | 1435 | { |
681 | BitDepth=16; | |
682 | ScrambledBitStream=(CC2(Buffer+Buffer_Offset)&0x0001)?true:false; | |
1436 | bit_depth=16; | |
1437 | key_present=(CC2(Buffer+Buffer_Offset)&0x0001)?true:false; | |
683 | 1438 | break; //while() |
684 | 1439 | } |
685 | 1440 | if ((CC3(Buffer+Buffer_Offset)&0xFFFFE0)==0x0788E0) //20-bit |
686 | 1441 | { |
687 | BitDepth=20; | |
688 | ScrambledBitStream=(CC3(Buffer+Buffer_Offset)&0x000010)?true:false; | |
1442 | bit_depth=20; | |
1443 | key_present=(CC3(Buffer+Buffer_Offset)&0x000010)?true:false; | |
689 | 1444 | break; //while() |
690 | 1445 | } |
691 | 1446 | if ((CC3(Buffer+Buffer_Offset)&0xFFFFFE)==0x07888E) //24-bit |
692 | 1447 | { |
693 | BitDepth=24; | |
694 | ScrambledBitStream=(CC3(Buffer+Buffer_Offset)&0x000001)?true:false; | |
1448 | bit_depth=24; | |
1449 | key_present=(CC3(Buffer+Buffer_Offset)&0x000001)?true:false; | |
695 | 1450 | break; //while() |
696 | 1451 | } |
697 | 1452 | Buffer_Offset++; |
713 | 1468 | return false; |
714 | 1469 | |
715 | 1470 | //Quick test of synchro |
716 | switch (BitDepth) | |
1471 | switch (bit_depth) | |
717 | 1472 | { |
718 | 1473 | case 16 : if ((CC2(Buffer+Buffer_Offset)&0xFFFE )!=0x078E ) {Synched=false; return true;} break; |
719 | 1474 | case 20 : if ((CC3(Buffer+Buffer_Offset)&0xFFFFE0)!=0x0788E0) {Synched=false; return true;} break; |
726 | 1481 | } |
727 | 1482 | |
728 | 1483 | //*************************************************************************** |
1484 | // Buffer - Global | |
1485 | //*************************************************************************** | |
1486 | ||
1487 | //--------------------------------------------------------------------------- | |
1488 | void File_DolbyE::Read_Buffer_Unsynched() | |
1489 | { | |
1490 | description_text_Values.clear(); | |
1491 | num_desc_packets_m1=(int32u)-1; | |
1492 | description_packet_data.clear(); | |
1493 | } | |
1494 | ||
1495 | //*************************************************************************** | |
729 | 1496 | // Buffer - Per element |
730 | 1497 | //*************************************************************************** |
731 | 1498 | |
740 | 1507 | //Looking for synchro |
741 | 1508 | //Synchronizing |
742 | 1509 | Buffer_Offset_Temp=Buffer_Offset+3; |
743 | if (BitDepth==16) | |
1510 | if (bit_depth==16) | |
744 | 1511 | while (Buffer_Offset_Temp+2<=Buffer_Size) |
745 | 1512 | { |
746 | 1513 | if ((CC2(Buffer+Buffer_Offset_Temp)&0xFFFE)==0x078E) //16-bit |
747 | 1514 | break; //while() |
748 | 1515 | Buffer_Offset_Temp++; |
749 | 1516 | } |
750 | if (BitDepth==20) | |
1517 | if (bit_depth==20) | |
751 | 1518 | while (Buffer_Offset_Temp+3<=Buffer_Size) |
752 | 1519 | { |
753 | 1520 | if ((CC3(Buffer+Buffer_Offset_Temp)&0xFFFFE0)==0x0788E0) //20-bit |
754 | 1521 | break; //while() |
755 | 1522 | Buffer_Offset_Temp++; |
756 | 1523 | } |
757 | if (BitDepth==24) | |
1524 | if (bit_depth==24) | |
758 | 1525 | while (Buffer_Offset_Temp+3<=Buffer_Size) |
759 | 1526 | { |
760 | 1527 | if ((CC3(Buffer+Buffer_Offset_Temp)&0xFFFFFE)==0x07888E) //24-bit |
762 | 1529 | Buffer_Offset_Temp++; |
763 | 1530 | } |
764 | 1531 | |
765 | if (Buffer_Offset_Temp+(BitDepth>16?3:2)>Buffer_Size) | |
1532 | if (Buffer_Offset_Temp+(bit_depth>16?3:2)>Buffer_Size) | |
766 | 1533 | { |
767 | 1534 | if (File_Offset+Buffer_Size==File_Size) |
768 | 1535 | Buffer_Offset_Temp=Buffer_Size; |
775 | 1542 | |
776 | 1543 | Header_Fill_Size(Buffer_Offset_Temp-Buffer_Offset); |
777 | 1544 | } |
778 | Header_Fill_Code(0, "Frame"); | |
1545 | Header_Fill_Code(0, "Dolby_E_frame"); | |
779 | 1546 | } |
780 | 1547 | |
781 | 1548 | //--------------------------------------------------------------------------- |
782 | 1549 | void File_DolbyE::Data_Parse() |
783 | 1550 | { |
1551 | FrameSizes[Element_Size]++; | |
1552 | ||
784 | 1553 | //In case of scrambling |
785 | 1554 | const int8u* Save_Buffer=NULL; |
786 | 1555 | size_t Save_Buffer_Offset=0; |
787 | 1556 | int64u Save_File_Offset=0; |
788 | if (ScrambledBitStream) | |
1557 | if (key_present) | |
789 | 1558 | { |
790 | 1559 | //We must change the buffer, |
791 | 1560 | Save_Buffer=Buffer; |
800 | 1569 | |
801 | 1570 | //Parsing |
802 | 1571 | BS_Begin(); |
803 | Block(); | |
1572 | sync_segment(); | |
1573 | metadata_segment(); | |
1574 | audio_segment(); | |
1575 | metadata_extension_segment(); | |
1576 | audio_extension_segment(); | |
1577 | meter_segment(); | |
804 | 1578 | BS_End(); |
1579 | ||
1580 | //Check if there is content in padding | |
1581 | int16u Padding; | |
1582 | if (Element_Size-Element_Offset>=2) | |
1583 | { | |
1584 | Peek_B2(Padding); | |
1585 | if (Padding==0x5838) | |
1586 | guard_band(); | |
1587 | } | |
805 | 1588 | |
806 | 1589 | if (Element_Offset<Element_Size) |
807 | 1590 | Skip_XX(Element_Size-Element_Offset, "Unknown"); |
808 | 1591 | |
809 | 1592 | //In case of scrambling |
810 | if (ScrambledBitStream) | |
1593 | if (key_present) | |
811 | 1594 | { |
812 | 1595 | delete[] Buffer; Buffer=Save_Buffer; |
813 | 1596 | Buffer_Offset=Save_Buffer_Offset; |
817 | 1600 | FILLING_BEGIN(); |
818 | 1601 | { |
819 | 1602 | //Guard band |
820 | if (Mpegv_frame_rate[FrameRate]) | |
821 | { | |
822 | int64u BytesPerSecond=96000*BitDepth/8; | |
823 | float64 BytesPerFrame=BytesPerSecond/Mpegv_frame_rate[FrameRate]; | |
1603 | if (Mpegv_frame_rate[frame_rate_code]) | |
1604 | { | |
1605 | int64u BytesPerSecond=96000*bit_depth/8; | |
1606 | float64 BytesPerFrame=BytesPerSecond/Mpegv_frame_rate[frame_rate_code]; | |
824 | 1607 | int64u BytesUpToLastFrame; |
825 | 1608 | int64u BytesUpToNextFrame; |
826 | 1609 | for (;;) |
827 | 1610 | { |
828 | 1611 | BytesUpToLastFrame=(int64u)(BytesPerFrame*Frame_Count); |
829 | BytesUpToLastFrame/=BitDepth/4; | |
830 | BytesUpToLastFrame*=BitDepth/4; | |
1612 | BytesUpToLastFrame/=bit_depth/4; | |
1613 | BytesUpToLastFrame*=bit_depth/4; | |
831 | 1614 | BytesUpToNextFrame=(int64u)(BytesPerFrame*(Frame_Count+1)); |
832 | BytesUpToNextFrame/=BitDepth/4; | |
833 | BytesUpToNextFrame*=BitDepth/4; | |
1615 | BytesUpToNextFrame/=bit_depth/4; | |
1616 | BytesUpToNextFrame*=bit_depth/4; | |
834 | 1617 | |
835 | 1618 | if (BytesUpToLastFrame+GuardBand_Before<BytesUpToNextFrame) |
836 | 1619 | break; |
840 | 1623 | GuardBand_Before-=BytesUpToNextFrame-BytesUpToLastFrame; |
841 | 1624 | } |
842 | 1625 | GuardBand_After=BytesUpToNextFrame-BytesUpToLastFrame; |
843 | int64u ToRemove=GuardBand_Before+(BitDepth>>1)+Element_Size; // Guardband + AES3 header + Dolby E frame | |
1626 | int64u ToRemove=GuardBand_Before+(bit_depth>>1)+Element_Size; // Guardband + AES3 header + Dolby E frame | |
844 | 1627 | if (ToRemove<(int64u)GuardBand_After) |
845 | 1628 | GuardBand_After-=ToRemove; |
846 | 1629 | else |
847 | 1630 | GuardBand_After=0; |
848 | GuardBand_After/=BitDepth/4; | |
849 | GuardBand_After*=BitDepth/4; | |
1631 | GuardBand_After/=bit_depth/4; | |
1632 | GuardBand_After*=bit_depth/4; | |
850 | 1633 | |
851 | 1634 | Element_Info1(GuardBand_Before); |
852 | 1635 | float64 GuardBand_Before_Duration=((float64)GuardBand_Before)/BytesPerSecond; |
867 | 1650 | Frame_Count++; |
868 | 1651 | if (Frame_Count_NotParsedIncluded!=(int64u)-1) |
869 | 1652 | Frame_Count_NotParsedIncluded++; |
870 | if (Mpegv_frame_rate[FrameRate]) | |
871 | FrameInfo.DUR=float64_int64s(1000000000/Mpegv_frame_rate[FrameRate]); | |
1653 | if (Mpegv_frame_rate[frame_rate_code]) | |
1654 | FrameInfo.DUR=float64_int64s(1000000000/Mpegv_frame_rate[frame_rate_code]); | |
872 | 1655 | else |
873 | 1656 | FrameInfo.DUR=(int64u)-1; |
874 | 1657 | if (FrameInfo.DTS!=(int64u)-1) |
875 | 1658 | FrameInfo.DTS+=FrameInfo.DUR; |
876 | 1659 | if (FrameInfo.PTS!=(int64u)-1) |
877 | 1660 | FrameInfo.PTS+=FrameInfo.DUR; |
878 | if (!Status[IsFilled] && (description_text_Values.empty() || Frame_Count>=32+1+1+32+1)) // max 32 chars (discarded) + ETX (discarded) + STX + max 32 chars + ETX | |
1661 | if (!Status[IsFilled] && ((description_packet_data.empty() && description_text_Values.empty()) || Frame_Count>=32+1+1+32+1)) // max 32 chars (discarded) + ETX (discarded) + STX + max 32 chars + ETX | |
879 | 1662 | Fill("Dolby E"); |
880 | 1663 | FILLING_END(); |
881 | 1664 | if (Frame_Count==0 && Buffer_TotalBytes>Buffer_TotalBytes_FirstSynched_Max) |
883 | 1666 | } |
884 | 1667 | |
885 | 1668 | //--------------------------------------------------------------------------- |
886 | void File_DolbyE::Block() | |
1669 | void File_DolbyE::sync_segment() | |
887 | 1670 | { |
888 | 1671 | //Parsing |
889 | Skip_S3(BitDepth, "Synchro"); | |
890 | if (ScrambledBitStream) | |
1672 | Element_Begin1("sync_segment"); | |
1673 | Skip_S3(bit_depth, "sync_word"); | |
1674 | Element_End0(); | |
1675 | } | |
1676 | ||
1677 | //--------------------------------------------------------------------------- | |
1678 | void File_DolbyE::metadata_segment() | |
1679 | { | |
1680 | //Parsing | |
1681 | Element_Begin1("metadata_segment"); | |
1682 | if (key_present) | |
891 | 1683 | { |
892 | 1684 | //We must change the buffer |
893 | switch (BitDepth) | |
1685 | switch (bit_depth) | |
894 | 1686 | { |
895 | 1687 | case 16 : |
896 | 1688 | { |
897 | int16u ScrambleMask; | |
898 | Get_S2 (16, ScrambleMask, "Scramble Mask"); | |
899 | int16u metadata_segment_size=((BigEndian2int16u(Buffer+Buffer_Offset+(size_t)Element_Size-Data_BS_Remain()/8)^ScrambleMask)>>2)&0x3FF; | |
900 | ||
901 | if (Data_BS_Remain()<((size_t)metadata_segment_size+1)*(size_t)BitDepth) //+1 for CRC | |
1689 | int16u metadata_key; | |
1690 | Get_S2 (16, metadata_key, "metadata_key"); | |
1691 | int16u metadata_segment_size=((BigEndian2int16u(Buffer+Buffer_Offset+(size_t)Element_Size-Data_BS_Remain()/8)^metadata_key)>>2)&0x3FF; | |
1692 | ||
1693 | if (Data_BS_Remain()<((size_t)metadata_segment_size+1)*(size_t)bit_depth) //+1 for CRC | |
902 | 1694 | return; //There is a problem |
903 | 1695 | |
904 | 1696 | int8u* Temp=Descrambled_Buffer+(size_t)Element_Size-Data_BS_Remain()/8; |
905 | 1697 | for (int16u Pos=0; Pos<metadata_segment_size+1; Pos++) |
906 | int16u2BigEndian(Temp+Pos*2, BigEndian2int16u(Temp+Pos*2)^ScrambleMask); | |
1698 | int16u2BigEndian(Temp+Pos*2, BigEndian2int16u(Temp+Pos*2)^metadata_key); | |
907 | 1699 | } |
908 | 1700 | break; |
909 | 1701 | case 20 : |
910 | 1702 | { |
911 | int32u ScrambleMask; | |
912 | Get_S3 (20, ScrambleMask, "Scramble Mask"); | |
913 | int16u metadata_segment_size=((BigEndian2int16u(Buffer+Buffer_Offset+(size_t)Element_Size-Data_BS_Remain()/8)^(ScrambleMask>>4))>>2)&0x3FF; | |
914 | ||
915 | if (Data_BS_Remain()<((size_t)metadata_segment_size+1)*(size_t)BitDepth) //+1 for CRC | |
1703 | int32u metadata_key; | |
1704 | Get_S3 (20, metadata_key, "metadata_key"); | |
1705 | int16u metadata_segment_size=((BigEndian2int16u(Buffer+Buffer_Offset+(size_t)Element_Size-Data_BS_Remain()/8)^(metadata_key>>4))>>2)&0x3FF; | |
1706 | ||
1707 | if (Data_BS_Remain()<((size_t)metadata_segment_size+1)*(size_t)bit_depth) //+1 for CRC | |
916 | 1708 | return; //There is a problem |
917 | 1709 | |
918 | Descramble_20bit(ScrambleMask, metadata_segment_size); | |
1710 | Descramble_20bit(metadata_key, metadata_segment_size); | |
919 | 1711 | } |
920 | 1712 | break; |
921 | 1713 | case 24 : |
922 | 1714 | { |
923 | int32u ScrambleMask; | |
924 | Get_S3 (24, ScrambleMask, "Scramble Mask"); | |
925 | int32u metadata_segment_size=((BigEndian2int16u(Buffer+Buffer_Offset+(size_t)Element_Size-Data_BS_Remain()/8)^ScrambleMask)>>2)&0x3FF; | |
926 | ||
927 | if (Data_BS_Remain()<((size_t)metadata_segment_size+1)*BitDepth) //+1 for CRC | |
1715 | int32u metadata_key; | |
1716 | Get_S3 (24, metadata_key, "metadata_key"); | |
1717 | int32u metadata_segment_size=((BigEndian2int16u(Buffer+Buffer_Offset+(size_t)Element_Size-Data_BS_Remain()/8)^metadata_key)>>2)&0x3FF; | |
1718 | ||
1719 | if (Data_BS_Remain()<((size_t)metadata_segment_size+1)*bit_depth) //+1 for CRC | |
928 | 1720 | return; //There is a problem |
929 | 1721 | |
930 | 1722 | int8u* Temp=Descrambled_Buffer+(size_t)Element_Size-Data_BS_Remain()/8; |
931 | 1723 | for (int16u Pos=0; Pos<metadata_segment_size+1; Pos++) |
932 | int24u2BigEndian(Temp+Pos*2, BigEndian2int24u(Temp+Pos*2)^ScrambleMask); | |
1724 | int24u2BigEndian(Temp+Pos*2, BigEndian2int24u(Temp+Pos*2)^metadata_key); | |
933 | 1725 | } |
934 | 1726 | break; |
935 | 1727 | default : ; |
936 | 1728 | } |
937 | 1729 | } |
938 | Skip_S2(14, "Unknown"); | |
939 | Get_S1 ( 6, ProgramConfiguration, "Program configuration"); Param_Info1(DolbyE_ChannelPositions[ProgramConfiguration]); | |
940 | Get_S1 ( 4, FrameRate, "Frame rate 1"); Param_Info3(Mpegv_frame_rate[FrameRate], " fps", 3); | |
941 | Skip_S1( 4, "Frame rate 2? Always same as Frame rate 1"); | |
942 | Skip_S2(16, "Frame number?"); | |
943 | Element_Begin1("SMPTE time code?"); | |
1730 | size_t metadata_segment_BitCountAfter=Data_BS_Remain(); | |
1731 | int16u metadata_segment_size; | |
1732 | Skip_S1( 4, "metadata_revision_id"); | |
1733 | Get_S2 (10, metadata_segment_size, "metadata_segment_size"); | |
1734 | metadata_segment_BitCountAfter-=metadata_segment_size*bit_depth; | |
1735 | Get_S1 ( 6, program_config, "program_config"); Param_Info1(DolbyE_ChannelPositions[program_config]); | |
1736 | Get_S1 ( 4, frame_rate_code, "frame_rate_code"); Param_Info3(Mpegv_frame_rate[frame_rate_code], " fps", 3); | |
1737 | Info_S1( 4, original_frame_rate_code, "original_frame_rate_code"); Param_Info3(Mpegv_frame_rate[original_frame_rate_code], " fps", 3); | |
1738 | Skip_S2(16, "frame_count"); | |
1739 | Element_Begin1("SMPTE_time_code"); | |
944 | 1740 | int8u Frames_Units, Frames_Tens, Seconds_Units, Seconds_Tens, Minutes_Units, Minutes_Tens, Hours_Units, Hours_Tens; |
945 | 1741 | bool DropFrame; |
946 | 1742 | |
982 | 1778 | + Minutes_Units *60*1000 |
983 | 1779 | + Seconds_Tens *10*1000 |
984 | 1780 | + Seconds_Units *1000 |
985 | + (Mpegv_frame_rate[FrameRate]?float64_int32s((Frames_Tens*10+Frames_Units)*1000/Mpegv_frame_rate[FrameRate]):0)); | |
1781 | + (Mpegv_frame_rate[frame_rate_code]?float64_int32s((Frames_Tens*10+Frames_Units)*1000/Mpegv_frame_rate[frame_rate_code]):0)); | |
986 | 1782 | |
987 | 1783 | Element_Info1(Ztring().Duration_From_Milliseconds(TimeCode)); |
988 | 1784 | |
991 | 1787 | SMPTE_time_code_StartTimecode=TimeCode; |
992 | 1788 | } |
993 | 1789 | Element_End0(); |
994 | Skip_S1( 8, "metadata_reserved_bits"); | |
995 | for (int8u Channel=0; Channel<DolbyE_Channels[ProgramConfiguration]; Channel++) | |
996 | Skip_S2(10, "channel_subsegment_size"); | |
997 | if (!Mpegv_frame_rate_type[FrameRate]) | |
998 | Skip_S1( 8, "metadata_extension_segment_size"); | |
999 | Skip_S1( 8, "meter_segment_size"); | |
1000 | for (int8u Program=0; Program<DolbyE_Programs[ProgramConfiguration]; Program++) | |
1790 | bool evolution_data_exists; | |
1791 | Get_SB ( evolution_data_exists, "evolution_data_exists"); | |
1792 | Skip_S1( 7, "metadata_reserved_bits"); | |
1793 | for (int8u Channel=0; Channel<DolbyE_Channels[program_config]; Channel++) | |
1794 | { | |
1795 | Get_S2 (10, channel_subsegment_size[Channel], "channel_subsegment_size"); | |
1796 | channel_subsegment_sizes[Channel][channel_subsegment_size[Channel]]++; | |
1797 | } | |
1798 | if (!Mpegv_frame_rate_type[frame_rate_code]) | |
1799 | Get_S1 ( 8, metadata_extension_segment_size, "metadata_extension_segment_size"); | |
1800 | else | |
1801 | metadata_extension_segment_size=0; | |
1802 | Get_S1 ( 8, meter_segment_size, "meter_segment_size"); | |
1803 | for (int8u Program=0; Program<DolbyE_Programs[program_config]; Program++) | |
1001 | 1804 | { |
1002 | 1805 | Element_Begin1("per program"); |
1003 | 1806 | int8u description_text; |
1030 | 1833 | } |
1031 | 1834 | Element_End0(); |
1032 | 1835 | } |
1836 | for (int8u Channel=0; Channel<DolbyE_Channels[program_config]; Channel++) | |
1837 | { | |
1838 | Element_Begin1("per channel"); | |
1839 | Info_S1( 4, revision_id, "revision_id"); Element_Info1(revision_id); | |
1840 | Info_SB( bitpool_type, "bitpool_type"); | |
1841 | Info_S2(10, begin_gain, "begin_gain"); Element_Info1(begin_gain); | |
1842 | Info_S2(10, end_gain, "end_gain"); Element_Info1(end_gain); | |
1843 | Element_End0(); | |
1844 | } | |
1845 | for(;;) | |
1846 | { | |
1847 | Element_Begin1("metadata_subsegment"); | |
1848 | int16u metadata_subsegment_length; | |
1849 | int8u metadata_subsegment_id; | |
1850 | Get_S1 ( 4, metadata_subsegment_id, "metadata_subsegment_id"); | |
1851 | if (metadata_subsegment_id==0) | |
1852 | { | |
1853 | Element_End0(); | |
1854 | break; | |
1855 | } | |
1856 | Get_S2 (12, metadata_subsegment_length, "metadata_subsegment_length"); | |
1857 | size_t End=Data_BS_Remain()-metadata_subsegment_length; | |
1858 | switch (metadata_subsegment_id) | |
1859 | { | |
1860 | case 1 : ac3_metadata_subsegment(true); break; | |
1861 | case 2 : ac3_metadata_subsegment(false); break; | |
1862 | default: Skip_BS(metadata_subsegment_length, "metadata_subsegment (unknown)"); | |
1863 | } | |
1864 | if (Data_BS_Remain()>End) | |
1865 | Skip_BS(Data_BS_Remain()-End, "unknown"); | |
1866 | Element_End0(); | |
1867 | } | |
1868 | if (evolution_data_exists) | |
1869 | { | |
1870 | for (;;) | |
1871 | { | |
1872 | const size_t evolution_data_segment_id_Name_Size=2; | |
1873 | const char* const evolution_data_segment_id_Name[evolution_data_segment_id_Name_Size]= | |
1874 | { | |
1875 | "End", | |
1876 | "intelligent_loudness_evolution_data_segment", | |
1877 | }; | |
1878 | ||
1879 | Element_Begin1("evolution_data_segment"); | |
1880 | int16u evolution_data_segment_length; | |
1881 | int8u evolution_data_segment_id; | |
1882 | Get_S1 ( 4, evolution_data_segment_id, "evolution_data_segment_id"); Param_Info1C(evolution_data_segment_id<evolution_data_segment_id_Name_Size, evolution_data_segment_id_Name[evolution_data_segment_id]); | |
1883 | if (!evolution_data_segment_id) | |
1884 | { | |
1885 | Element_End0(); | |
1886 | break; | |
1887 | } | |
1888 | Get_S2 (12, evolution_data_segment_length, "evolution_data_segment_length"); | |
1889 | size_t End=Data_BS_Remain()-evolution_data_segment_length; | |
1890 | switch (evolution_data_segment_id) | |
1891 | { | |
1892 | case 1: intelligent_loudness_evolution_data_segment(); break; | |
1893 | default: Skip_BS(evolution_data_segment_length, "evolution_data_segment (unknown)"); | |
1894 | } | |
1895 | if (Data_BS_Remain()>End) | |
1896 | Skip_BS(Data_BS_Remain()-End, "unknown"); | |
1897 | Element_End0(); | |
1898 | } | |
1899 | } | |
1900 | if (Data_BS_Remain()>metadata_segment_BitCountAfter) | |
1901 | Skip_BS(Data_BS_Remain()-metadata_segment_BitCountAfter,"reserved_metadata_bits"); | |
1902 | Skip_S3(bit_depth, "metadata_crc"); | |
1903 | ||
1904 | { | |
1905 | //CRC test | |
1906 | size_t Pos_End=Buffer_Offset*8+(size_t)Element_Size*8-Data_BS_Remain(); | |
1907 | size_t Pos_Begin=Pos_End-(metadata_segment_size+1)*bit_depth; //+1 for CRC | |
1908 | int8u BitSkip_Begin=Pos_Begin%8; | |
1909 | Pos_Begin/=8; | |
1910 | int8u BitSkip_End=0; // Pos_End%8; Looks like that the last bits must not be in the CRC computing | |
1911 | Pos_End/=8; | |
1912 | if (BitSkip_End) | |
1913 | Pos_End++; | |
1914 | ||
1915 | int16u CRC=CRC_16_Compute(Buffer+Pos_Begin, Pos_End-Pos_Begin, BitSkip_Begin, BitSkip_End); | |
1916 | if (CRC) | |
1917 | { | |
1918 | // CRC is wrong | |
1919 | Param_Info1("metadata_crc NOK"); | |
1920 | } | |
1921 | } | |
1922 | ||
1923 | Element_End0(); | |
1924 | } | |
1925 | ||
1926 | //--------------------------------------------------------------------------- | |
1927 | void File_DolbyE::guard_band() | |
1928 | { | |
1929 | int8u* NewBuffer=NULL; | |
1930 | size_t Buffer_Offset_Save; | |
1931 | size_t Buffer_Size_Save; | |
1932 | int64u Element_Offset_Save; | |
1933 | int64u Element_Size_Save; | |
1934 | ||
1935 | Element_Begin1("guard_band (with data)"); | |
1936 | int16u element_length; | |
1937 | int8u element_id; | |
1938 | bool escape_code_valid; | |
1939 | Skip_B2( "sync_word"); | |
1940 | BS_Begin(); | |
1941 | Skip_S1( 3, "reserved"); | |
1942 | Get_SB ( escape_code_valid, "escape_code_valid"); | |
1943 | if (escape_code_valid) | |
1944 | { | |
1945 | int16u escape_code; | |
1946 | Get_S2 (12, escape_code, "escape_code"); | |
1947 | BS_End(); | |
1948 | for (int64u i=Element_Offset; i+1<Element_Size; i++) | |
1949 | { | |
1950 | if ( Buffer[Buffer_Offset+i ] ==(escape_code>>4) && (Buffer[Buffer_Offset+i+1]>>4)==(escape_code&0x0F)) | |
1951 | { | |
1952 | //0xABCD --> 0x078D | |
1953 | if (!NewBuffer) | |
1954 | { | |
1955 | NewBuffer=new int8u[Element_Size-Element_Offset]; | |
1956 | memcpy(NewBuffer, Buffer+Buffer_Offset+Element_Offset, Element_Size-Element_Offset); | |
1957 | } | |
1958 | NewBuffer[i -Element_Offset]=0x07; | |
1959 | NewBuffer[i+1-Element_Offset]=(NewBuffer[i+1-Element_Offset]&0x0F)|0x80; | |
1960 | } | |
1961 | if ((Buffer[Buffer_Offset+i ]&0xF)==(escape_code>>8) && Buffer[Buffer_Offset+i+1] ==(escape_code&0xFF)) | |
1962 | { | |
1963 | //0xABCD --> 0xA078 | |
1964 | if (!NewBuffer) | |
1965 | { | |
1966 | NewBuffer=new int8u[Element_Size-Element_Offset]; | |
1967 | memcpy(NewBuffer, Buffer+Buffer_Offset+Element_Offset, Element_Size-Element_Offset); | |
1968 | } | |
1969 | NewBuffer[i -Element_Offset]=(NewBuffer[i -Element_Offset]&0xF0); | |
1970 | NewBuffer[i+1-Element_Offset]=0x78; | |
1971 | } | |
1972 | } | |
1973 | if (NewBuffer) | |
1974 | { | |
1975 | Buffer=NewBuffer; | |
1976 | Buffer_Offset_Save=Buffer_Offset; | |
1977 | Buffer_Size_Save=Buffer_Offset; | |
1978 | Element_Offset_Save=Element_Offset; | |
1979 | Element_Size_Save=Element_Size; | |
1980 | File_Offset+=Buffer_Offset+Element_Offset; | |
1981 | Buffer_Offset=0; | |
1982 | Buffer_Size=Element_Size-Element_Offset; | |
1983 | Element_Offset=0; | |
1984 | Element_Size=Buffer_Size; | |
1985 | } | |
1986 | } | |
1987 | else | |
1988 | { | |
1989 | Skip_S2(12, "escape_code"); | |
1990 | BS_End(); | |
1991 | } | |
1992 | Get_B1 ( element_id, "element_id"); | |
1993 | Get_B2 ( element_length, "element_length"); | |
1994 | int64u After=Element_Offset+element_length; | |
1995 | switch (element_id) | |
1996 | { | |
1997 | case 0xBB: evo_frame(); break; | |
1998 | default: Skip_XX(element_length, "Unknown"); | |
1999 | } | |
2000 | if (Element_Offset<After) | |
2001 | Skip_XX(After-Element_Offset, "Unknown"); | |
2002 | else if (Element_Offset>After) | |
2003 | { | |
2004 | Param_Info1("Problem"); | |
2005 | Element_Offset=After; | |
2006 | } | |
2007 | Skip_B2( "crc"); | |
2008 | { | |
2009 | //CRC test | |
2010 | size_t Pos_End=Buffer_Offset+Element_Offset; | |
2011 | size_t Pos_Begin=Pos_End-(element_length+2); //+2 for CRC | |
2012 | ||
2013 | int16u CRC=CRC_16_Compute(Buffer+Pos_Begin, Pos_End-Pos_Begin, 0, 0); | |
2014 | if (CRC) | |
2015 | { | |
2016 | // CRC is wrong | |
2017 | Param_Info1("crc NOK"); | |
2018 | } | |
2019 | Element_End0(); | |
2020 | int64u RemainingBytes=Element_Size-Element_Offset; | |
2021 | if (RemainingBytes && RemainingBytes<bit_depth/4) | |
2022 | { | |
2023 | bool HasContent=false; | |
2024 | size_t Offset=Buffer_Offset+(size_t)Element_Offset; | |
2025 | size_t Size=Buffer_Offset+(size_t)Element_Size; | |
2026 | for (; Offset<Size; Offset++) | |
2027 | if (Buffer[Offset]) | |
2028 | HasContent=true; | |
2029 | if (!HasContent) | |
2030 | Skip_XX(Element_Size-Element_Offset, "Padding"); | |
2031 | } | |
2032 | } | |
2033 | ||
2034 | if (NewBuffer) | |
2035 | { | |
2036 | delete[] Buffer; | |
2037 | Buffer_Offset=Buffer_Offset_Save; | |
2038 | Buffer_Size=Buffer_Offset_Save; | |
2039 | Element_Offset=Element_Offset_Save; | |
2040 | Element_Size=Element_Size_Save; | |
2041 | File_Offset-=Buffer_Offset+Element_Offset; | |
2042 | } | |
2043 | } | |
2044 | ||
2045 | //--------------------------------------------------------------------------- | |
2046 | void File_DolbyE::intelligent_loudness_evolution_data_segment() | |
2047 | { | |
2048 | Element_Begin1("intelligent_loudness_evolution_data_segment"); | |
2049 | for (int8u program=0; program<DolbyE_Programs[program_config]; program++) | |
2050 | { | |
2051 | Element_Begin1("per program"); | |
2052 | Skip_S1(4, "loudness_reg_type"); | |
2053 | Skip_SB( "dialogue_corrected"); | |
2054 | Skip_S1(1, "loudness_corr_type"); | |
2055 | Element_End0(); | |
2056 | } | |
2057 | Element_End0(); | |
2058 | } | |
2059 | ||
2060 | //--------------------------------------------------------------------------- | |
2061 | extern const char* Ac3_emdf_payload_id[16]; | |
2062 | void File_DolbyE::evo_frame() | |
2063 | { | |
2064 | if (!Guardband_EMDF_PresentAndSize) | |
2065 | Guardband_EMDF_PresentAndSize=Element_Size; | |
2066 | ||
2067 | Element_Begin1("evo_frame"); | |
2068 | BS_Begin(); | |
2069 | int8u evo_version, key_id; | |
2070 | Get_S1 (2, evo_version, "evo_version"); | |
2071 | if (evo_version==3) | |
2072 | { | |
2073 | int32u evo_version32; | |
2074 | Get_V4 (2, evo_version32, "evo_version"); | |
2075 | evo_version32+=3; | |
2076 | evo_version=(int8u)evo_version32; | |
2077 | } | |
2078 | if (evo_version) | |
2079 | { | |
2080 | Skip_BS(Data_BS_Remain(), "(Unparsed evo_frame data)"); | |
2081 | Element_End0(); | |
2082 | return; | |
2083 | } | |
2084 | Get_S1 (3, key_id, "key_id"); | |
2085 | if (key_id==7) | |
2086 | Skip_V4(3, "key_id"); | |
2087 | ||
2088 | int32u payload_id = 0; | |
2089 | ||
2090 | for(;;) | |
2091 | { | |
2092 | Element_Begin1("evo_payload"); | |
2093 | Get_S4 (5, payload_id, "payload_id"); | |
2094 | if (payload_id==0x1F) | |
2095 | { | |
2096 | int32u add; | |
2097 | Get_V4 (5, add, "payload_id"); | |
2098 | payload_id += add; | |
2099 | } | |
2100 | ||
2101 | if (payload_id<16) | |
2102 | Element_Info1(Ac3_emdf_payload_id[payload_id]); | |
2103 | if (!payload_id) | |
2104 | { | |
2105 | Element_End0(); | |
2106 | break; | |
2107 | } | |
2108 | ||
2109 | evo_payload_config(); | |
2110 | ||
2111 | int32u payload_size = 0; | |
2112 | Get_V4 (8, payload_size, "payload_size"); | |
2113 | size_t payload_End=(Data_BS_Remain()>payload_size*8)?(Data_BS_Remain()-payload_size*8):0; | |
2114 | ||
2115 | Element_Begin1("payload"); | |
2116 | switch (payload_id) | |
2117 | { | |
2118 | case 11: object_audio_metadata_payload(); break; | |
2119 | case 13: mgi_payload(); break; | |
2120 | default: Skip_BS(payload_size*8, "(Unknown)"); | |
2121 | } | |
2122 | size_t Remaining=Data_BS_Remain()-payload_End; | |
2123 | if (Remaining && Remaining<8) | |
2124 | { | |
2125 | int8u padding; | |
2126 | Peek_S1(Remaining, padding); | |
2127 | if (!padding) | |
2128 | Skip_S1(Remaining, "padding"); | |
2129 | } | |
2130 | if (Data_BS_Remain()>payload_End) | |
2131 | { | |
2132 | Skip_BS(Data_BS_Remain()-payload_End, "(Unparsed payload bytes)"); | |
2133 | } | |
2134 | else if (Data_BS_Remain()<payload_End) | |
2135 | { | |
2136 | //There is a problem, too many bits were consumed by the parser. //TODO: prevent the parser to consume more bits than count of bits in this element | |
2137 | if (Data_BS_Remain()>=payload_End) | |
2138 | Skip_BS(Data_BS_Remain()-payload_End, "(Problem during emdf_payload parsing)"); | |
2139 | else | |
2140 | Skip_BS(Data_BS_Remain(), "(Problem during payload parsing, going to end directly)"); | |
2141 | Element_End0(); | |
2142 | Element_End0(); | |
2143 | break; | |
2144 | } | |
2145 | Element_End0(); | |
2146 | Element_End0(); | |
2147 | } | |
2148 | ||
2149 | evo_protection(); | |
2150 | BS_End(); | |
2151 | Element_End0(); | |
2152 | } | |
2153 | ||
2154 | //--------------------------------------------------------------------------- | |
2155 | void File_DolbyE::evo_payload_config() | |
2156 | { | |
2157 | Element_Begin1("payload_config"); | |
2158 | bool timestamp_present; | |
2159 | TEST_SB_GET (timestamp_present, "timestamp_present"); | |
2160 | Skip_V4(11, "timestamp"); | |
2161 | TEST_SB_END(); | |
2162 | TEST_SB_SKIP( "duration_present"); | |
2163 | Skip_V4(11, "duration"); | |
2164 | TEST_SB_END(); | |
2165 | TEST_SB_SKIP( "group_id_present"); | |
2166 | Skip_V4(2, "group_id"); | |
2167 | TEST_SB_END(); | |
2168 | TEST_SB_SKIP( "codec_specific_id_present"); | |
2169 | Skip_S1(8, "codec_specific_id"); | |
2170 | TEST_SB_END(); | |
2171 | ||
2172 | bool dont_transcode; | |
2173 | Get_SB(dont_transcode, "dont_transcode"); | |
2174 | if (!dont_transcode) | |
2175 | { | |
2176 | bool now_or_never = false; | |
2177 | if (!timestamp_present) | |
2178 | { | |
2179 | Get_SB (now_or_never, "now_or_never"); | |
2180 | if (now_or_never) | |
2181 | { | |
2182 | Skip_SB( "create_duplicate"); | |
2183 | Skip_SB( "remove_duplicate"); | |
2184 | ||
2185 | } | |
2186 | } | |
2187 | ||
2188 | if (timestamp_present || now_or_never) | |
2189 | { | |
2190 | Skip_S1(5, "priority"); | |
2191 | Skip_S1(2, "tight_coupling"); | |
2192 | } | |
2193 | } | |
2194 | Element_End0(); | |
2195 | } | |
2196 | ||
2197 | //--------------------------------------------------------------------------- | |
2198 | void File_DolbyE::evo_protection() | |
2199 | { | |
2200 | Element_Begin1("protection"); | |
2201 | int8u len_primary, len_second; | |
2202 | Get_S1(2, len_primary, "protection_length_primary"); | |
2203 | Get_S1(2, len_second, "protection_length_secondary"); | |
2204 | ||
2205 | switch (len_primary) | |
2206 | { | |
2207 | case 0: len_primary = 0; break; | |
2208 | case 1: len_primary = 8; break; | |
2209 | case 2: len_primary = 32; break; | |
2210 | case 3: len_primary = 128; break; | |
2211 | default:; //Cannot append, read only 2 bits | |
2212 | }; | |
2213 | switch (len_second) | |
2214 | { | |
2215 | case 0: len_second = 0; break; | |
2216 | case 1: len_second = 8; break; | |
2217 | case 2: len_second = 32; break; | |
2218 | case 3: len_second = 128; break; | |
2219 | default:; //Cannot append, read only 2 bits | |
2220 | }; | |
2221 | Skip_BS(len_primary, "protection_bits_primary"); | |
2222 | if (len_second) | |
2223 | Skip_BS(len_primary, "protection_bits_secondary"); | |
2224 | ||
2225 | Element_End0(); | |
2226 | } | |
2227 | ||
2228 | ||
2229 | //--------------------------------------------------------------------------- | |
2230 | void File_DolbyE::object_audio_metadata_payload() | |
2231 | { | |
2232 | nonstd_bed_channel_assignment_masks.clear(); | |
2233 | ObjectElements.clear(); | |
2234 | ||
2235 | Element_Begin1("object_audio_metadata_payload"); | |
2236 | int8u oa_md_version_bits; | |
2237 | Get_S1 (2, oa_md_version_bits, "oa_md_version_bits"); | |
2238 | if (oa_md_version_bits == 0x3) | |
2239 | { | |
2240 | int8u oa_md_version_bits_ext; | |
2241 | Get_S1 (3, oa_md_version_bits_ext, "oa_md_version_bits_ext"); | |
2242 | oa_md_version_bits += oa_md_version_bits_ext; | |
2243 | } | |
2244 | ||
2245 | int8u object_count_bits; | |
2246 | Get_S1 (5, object_count_bits, "object_count_bits"); | |
2247 | if (object_count_bits==0x1F) | |
2248 | { | |
2249 | int8u object_count_bits_ext; | |
2250 | Get_S1 (7, object_count_bits_ext, "object_count_bits_ext"); | |
2251 | object_count_bits=0x1F+object_count_bits_ext; | |
2252 | } | |
2253 | object_count=object_count_bits+1; | |
2254 | Param_Info2(object_count, " objects"); | |
2255 | ||
2256 | program_assignment(); | |
2257 | ||
2258 | bool b_alternate_object_data_present; | |
2259 | Get_SB(b_alternate_object_data_present, "b_alternate_object_data_present"); | |
2260 | int8u oa_element_count_bits; | |
2261 | Get_S1(4, oa_element_count_bits, "oa_element_count_bits"); | |
2262 | if (oa_element_count_bits==0xF) | |
2263 | { | |
2264 | Get_S1(5, oa_element_count_bits, "oa_element_count_bits_ext"); | |
2265 | oa_element_count_bits+=0xF; | |
2266 | } | |
2267 | for (int8u i=0; i<oa_element_count_bits; i++) | |
2268 | oa_element_md(b_alternate_object_data_present); | |
2269 | ||
2270 | Element_End0(); | |
2271 | } | |
2272 | ||
2273 | void File_DolbyE::program_assignment() | |
2274 | { | |
2275 | Element_Begin1("program_assignment"); | |
2276 | bool b_dyn_object_only_program = false; | |
2277 | Get_SB (b_dyn_object_only_program, "b_dyn_object_only_program"); | |
2278 | if (b_dyn_object_only_program) | |
2279 | { | |
2280 | bool b_lfe_present; | |
2281 | Get_SB (b_lfe_present, "b_lfe_present"); | |
2282 | if (b_lfe_present) | |
2283 | { | |
2284 | nonstd_bed_channel_assignment_masks.push_back(1<<3); | |
2285 | b_object_in_bed_or_isf.push_back(true); | |
2286 | } | |
2287 | } | |
2288 | else | |
2289 | { | |
2290 | int8u content_description_mask; | |
2291 | Get_S1 (4, content_description_mask, "content_description_mask"); | |
2292 | if (content_description_mask & 0x1) | |
2293 | { | |
2294 | bool b_bed_object_chan_distribute, b_multiple_bed_instances_present; | |
2295 | ||
2296 | Get_SB (b_bed_object_chan_distribute, "b_bed_object_chan_distribute"); | |
2297 | Get_SB (b_multiple_bed_instances_present, "b_multiple_bed_instances_present"); | |
2298 | int32u num_bed_instances = 1; | |
2299 | if (b_multiple_bed_instances_present) | |
2300 | { | |
2301 | int8u num_bed_instances_bits = 0; | |
2302 | Get_S1 (3, num_bed_instances_bits, "num_bed_instances_bits"); | |
2303 | num_bed_instances = num_bed_instances_bits + 2; | |
2304 | } | |
2305 | ||
2306 | for (int32u bed = 0; bed < num_bed_instances; ++bed) | |
2307 | { | |
2308 | Element_Begin1("Bed"); | |
2309 | bool b_lfe_only = true; | |
2310 | Get_SB (b_lfe_only, "b_lfe_only"); | |
2311 | if (!b_lfe_only) | |
2312 | { | |
2313 | bool b_standard_chan_assign; | |
2314 | Get_SB (b_standard_chan_assign, "b_standard_chan_assign"); | |
2315 | int32u nonstd_bed_channel_assignment_mask; | |
2316 | if (b_standard_chan_assign) | |
2317 | { | |
2318 | int16u bed_channel_assignment_mask; | |
2319 | Get_S2 (10, bed_channel_assignment_mask, "bed_channel_assignment_mask"); | |
2320 | nonstd_bed_channel_assignment_mask=AC3_bed_channel_assignment_mask_2_nonstd(bed_channel_assignment_mask); | |
2321 | } | |
2322 | else | |
2323 | { | |
2324 | int32u nonstd_bed_channel_assignment_mask; | |
2325 | Get_S3 (17, nonstd_bed_channel_assignment_mask, "nonstd_bed_channel_assignment_mask"); | |
2326 | } | |
2327 | Param_Info1(AC3_nonstd_bed_channel_assignment_mask_ChannelLayout(nonstd_bed_channel_assignment_mask)); | |
2328 | nonstd_bed_channel_assignment_masks.push_back(nonstd_bed_channel_assignment_mask); | |
2329 | size_t BedChannelCount=BedChannelConfiguration_ChannelCount(nonstd_bed_channel_assignment_mask); | |
2330 | b_object_in_bed_or_isf.resize(b_object_in_bed_or_isf.size()+BedChannelCount, true); | |
2331 | } | |
2332 | else | |
2333 | b_object_in_bed_or_isf.push_back(true); | |
2334 | Element_End0(); | |
2335 | } | |
2336 | } | |
2337 | ||
2338 | if (content_description_mask & 0x2) | |
2339 | { | |
2340 | int8u intermediate_spatial_format_idx; | |
2341 | Get_S1 (3, intermediate_spatial_format_idx, "intermediate_spatial_format_idx"); | |
2342 | b_object_in_bed_or_isf.resize(b_object_in_bed_or_isf.size()+intermediate_spatial_format_object_count[intermediate_spatial_format_idx], true); | |
2343 | } | |
2344 | ||
2345 | if (content_description_mask & 0x4) | |
2346 | { | |
2347 | int8u num_dynamic_objects_bits; | |
2348 | Get_S1(5, num_dynamic_objects_bits, "num_dynamic_objects_bits"); | |
2349 | if (num_dynamic_objects_bits==0x1F) | |
2350 | { | |
2351 | int8u num_dynamic_objects_bits_ext = 0; | |
2352 | Get_S1 (7, num_dynamic_objects_bits_ext, "num_dynamic_objects_bits_ext"); | |
2353 | num_dynamic_objects_bits=0x1F+num_dynamic_objects_bits_ext; | |
2354 | } | |
2355 | num_dynamic_objects_bits++; | |
2356 | Param_Info2(object_count-num_dynamic_objects_bits, " static objects"); | |
2357 | Param_Info2(num_dynamic_objects_bits, " dynamic objects"); | |
2358 | b_object_in_bed_or_isf.resize(b_object_in_bed_or_isf.size()+num_dynamic_objects_bits, false); | |
2359 | } | |
2360 | ||
2361 | if (content_description_mask & 0x8) | |
2362 | { | |
2363 | int8u reserved_data_size_bits; | |
2364 | Get_S1 (4, reserved_data_size_bits, "reserved_data_size_bits"); | |
2365 | int8u padding = 8 - (reserved_data_size_bits % 8); | |
2366 | Skip_S1(reserved_data_size_bits, "reserved_data()"); | |
2367 | Skip_S1(padding, "padding"); | |
2368 | } | |
2369 | } | |
2370 | ||
2371 | Element_End0(); | |
2372 | } | |
2373 | ||
2374 | void File_DolbyE::oa_element_md(bool b_alternate_object_data_present) | |
2375 | { | |
2376 | Element_Begin1("oa_element_md"); | |
2377 | int8u oa_element_id_idx; | |
2378 | int32u oa_element_size_bits; | |
2379 | Get_S1 (4, oa_element_id_idx, "oa_element_id_idx"); | |
2380 | Get_V4 (4, 4, oa_element_size_bits, "oa_element_size_bits"); | |
2381 | oa_element_size_bits++; | |
2382 | oa_element_size_bits*=8; | |
2383 | int32u b_alternate_object_data_present_Reduced=b_alternate_object_data_present*4+1; | |
2384 | if (oa_element_size_bits<b_alternate_object_data_present_Reduced || oa_element_size_bits>Data_BS_Remain()) | |
2385 | { | |
2386 | Skip_BS(oa_element_size_bits, "?"); | |
2387 | Element_End0(); | |
2388 | return; | |
2389 | } | |
2390 | oa_element_size_bits-=b_alternate_object_data_present_Reduced; | |
2391 | if (b_alternate_object_data_present) | |
2392 | Skip_S1(4, "alternate_object_data_id_idx"); | |
2393 | Skip_SB( "b_discard_unknown_element"); | |
2394 | size_t End=Data_BS_Remain()-oa_element_size_bits; | |
2395 | switch (oa_element_id_idx) | |
2396 | { | |
2397 | case 1: object_element(); break; | |
2398 | default: Skip_BS(oa_element_size_bits, "oa_element"); | |
2399 | } | |
2400 | if (Data_BS_Remain()>End) | |
2401 | Skip_BS(Data_BS_Remain()-End, "padding"); | |
2402 | Element_End0(); | |
2403 | } | |
2404 | ||
2405 | void File_DolbyE::object_element() | |
2406 | { | |
2407 | Element_Begin1("object_element"); | |
2408 | int8u num_obj_info_blocks_bits; | |
2409 | md_update_info(num_obj_info_blocks_bits); | |
2410 | bool b_reserved_data_not_present; | |
2411 | Get_SB (b_reserved_data_not_present, "b_reserved_data_not_present"); | |
2412 | if (!b_reserved_data_not_present) | |
2413 | Skip_S1(5, "reserved"); | |
2414 | for (int8u i=0; i<object_count; i++) | |
2415 | object_data(i, num_obj_info_blocks_bits); | |
2416 | Element_End0(); | |
2417 | } | |
2418 | ||
2419 | void File_DolbyE::md_update_info(int8u& num_obj_info_blocks_bits) | |
2420 | { | |
2421 | Element_Begin1("md_update_info"); | |
2422 | int8u sample_offset_code; | |
2423 | Get_S1 (2, sample_offset_code, "sample_offset_code"); | |
2424 | switch (sample_offset_code) | |
2425 | { | |
2426 | case 1 : Skip_S1(2, "sample_offset_idx"); break; | |
2427 | case 2 : Skip_S1(5, "sample_offset_bits"); break; | |
2428 | default:; | |
2429 | } | |
2430 | Get_S1 (3, num_obj_info_blocks_bits, "num_obj_info_blocks_bits"); | |
2431 | for (int8u blk=0; blk<=num_obj_info_blocks_bits; blk++) | |
2432 | block_update_info(); | |
2433 | Element_End0(); | |
2434 | } | |
2435 | ||
2436 | void File_DolbyE::block_update_info() | |
2437 | { | |
2438 | Element_Begin1("block_update_info"); | |
2439 | int8u block_offset_factor_bits, ramp_duration_code; | |
2440 | Get_S1 (6, block_offset_factor_bits, "block_offset_factor_bits"); | |
2441 | Get_S1 (2, ramp_duration_code, "ramp_duration_code"); | |
2442 | switch (ramp_duration_code) | |
2443 | { | |
2444 | case 3 : | |
2445 | { | |
2446 | bool b_use_ramp_duration_idx; | |
2447 | Get_SB (b_use_ramp_duration_idx, "b_use_ramp_duration_idx"); | |
2448 | if (b_use_ramp_duration_idx) | |
2449 | Skip_S1( 4, "ramp_duration_idx"); | |
2450 | else | |
2451 | Skip_S1(11, "ramp_duration_bits"); | |
2452 | } | |
2453 | break; | |
2454 | default:; | |
2455 | } | |
2456 | Element_End0(); | |
2457 | } | |
2458 | ||
2459 | void File_DolbyE::object_data(int8u obj_idx, int8u num_obj_info_blocks_bits) | |
2460 | { | |
2461 | ObjectElements.resize(ObjectElements.size()+1); | |
2462 | ObjectElements[ObjectElements.size()-1].Alts.resize(num_obj_info_blocks_bits+1); | |
2463 | ||
2464 | Element_Begin1("object_data"); | |
2465 | for (int8u blk=0; blk<=num_obj_info_blocks_bits; blk++) | |
2466 | object_info_block(obj_idx, blk); | |
2467 | Element_End0(); | |
2468 | } | |
2469 | ||
2470 | void File_DolbyE::object_info_block(int8u obj_idx, int8u blk) | |
2471 | { | |
2472 | Element_Begin1("object_info_block"); | |
2473 | int8u object_basic_info_status_idx, object_render_info_status_idx; | |
2474 | bool b_object_not_active; | |
2475 | Get_SB (b_object_not_active, "b_object_not_active"); | |
2476 | if (b_object_not_active) | |
2477 | object_basic_info_status_idx=0; | |
2478 | else if (!blk) | |
2479 | object_basic_info_status_idx=1; | |
2480 | else | |
2481 | Get_S1 (2, object_basic_info_status_idx, "object_basic_info_status_idx"); | |
2482 | if (object_basic_info_status_idx&1) // 1 or 3 | |
2483 | object_basic_info(object_basic_info_status_idx>>1, blk); // Use bit 1 | |
2484 | else | |
2485 | { | |
2486 | dyn_object& D=ObjectElements[ObjectElements.size()-1]; | |
2487 | dyn_object::dyn_object_alt& A=D.Alts[blk]; | |
2488 | A.obj_gain_db=INT_MAX; | |
2489 | } | |
2490 | if (b_object_not_active || (obj_idx<b_object_in_bed_or_isf.size() && b_object_in_bed_or_isf[obj_idx])) | |
2491 | object_render_info_status_idx=0; | |
2492 | else if (!blk) | |
2493 | object_render_info_status_idx=1; | |
2494 | else | |
2495 | Get_S1 (2, object_render_info_status_idx, "object_render_info_status_idx"); | |
2496 | if (object_render_info_status_idx&1) // 1 or 3 | |
2497 | object_render_info(object_render_info_status_idx>>1, blk); // Use bit 1 | |
2498 | else | |
2499 | { | |
2500 | dyn_object& D=ObjectElements[ObjectElements.size()-1]; | |
2501 | dyn_object::dyn_object_alt& A=D.Alts[blk]; | |
2502 | A.pos3d_x_bits=(int8u)-1; | |
2503 | } | |
2504 | bool b_additional_table_data_exists; | |
2505 | Get_SB (b_additional_table_data_exists, "b_additional_table_data_exists"); | |
2506 | if (b_additional_table_data_exists) | |
2507 | { | |
2508 | int8u additional_table_data_size_bits; | |
2509 | Get_S1(4, additional_table_data_size_bits, "additional_table_data_size_bits"); | |
2510 | additional_table_data_size_bits++; | |
2511 | additional_table_data_size_bits*=8; | |
2512 | Skip_BS(additional_table_data_size_bits, "additional_table_data"); | |
2513 | } | |
2514 | Element_End0(); | |
2515 | } | |
2516 | ||
2517 | void File_DolbyE::object_basic_info(int8u object_basic_info_array, int8u blk) | |
2518 | { | |
2519 | Element_Begin1("object_basic_info"); | |
2520 | if (!object_basic_info_array) // object_basic_info_array is "reuse" info at this point | |
2521 | object_basic_info_array=3; // 2x 1 | |
2522 | else | |
2523 | Get_S1 (2, object_basic_info_array, "object_basic_info[]"); | |
2524 | dyn_object& D=ObjectElements[ObjectElements.size()-1]; | |
2525 | dyn_object::dyn_object_alt& A=D.Alts[blk]; | |
2526 | if (object_basic_info_array>>1) // bit 1 | |
2527 | { | |
2528 | int8u object_gain_idx; | |
2529 | Get_S1 (2, object_gain_idx, "object_gain_idx"); | |
2530 | switch (object_gain_idx) | |
2531 | { | |
2532 | case 0 : | |
2533 | A.obj_gain_db=0; | |
2534 | break; | |
2535 | case 1 : | |
2536 | A.obj_gain_db=INT8_MIN; | |
2537 | break; | |
2538 | case 2 : | |
2539 | { | |
2540 | int8u object_gain_bits; | |
2541 | Get_S1 (6, object_gain_bits, "object_gain_bits"); | |
2542 | A.obj_gain_db=(object_gain_bits<15?15:14)-object_gain_bits; | |
2543 | } | |
2544 | break; | |
2545 | default: | |
2546 | if (ObjectElements.size()>=2) | |
2547 | A.obj_gain_db=ObjectElements[ObjectElements.size()-2].Alts[blk].obj_gain_db; | |
2548 | else | |
2549 | A.obj_gain_db=0; | |
2550 | } | |
2551 | } | |
2552 | else | |
2553 | A.obj_gain_db=INT8_MAX; | |
2554 | if (object_basic_info_array&1) // bit 0 | |
2555 | { | |
2556 | bool b_default_object_priority; | |
2557 | Get_SB ( b_default_object_priority, "b_default_object_priority"); | |
2558 | if (!b_default_object_priority) | |
2559 | Skip_S1(5, "b_default_object_priority"); | |
2560 | } | |
2561 | Element_End0(); | |
2562 | } | |
2563 | ||
2564 | void File_DolbyE::object_render_info(int8u object_render_info_array, int8u blk) | |
2565 | { | |
2566 | Element_Begin1("object_render_info"); | |
2567 | if (!object_render_info_array) // object_render_info_array is "reuse" info at this point | |
2568 | object_render_info_array=0xF; // 4x 1 | |
2569 | else | |
2570 | Get_S1 (4, object_render_info_array, "object_render_info[]"); | |
2571 | dyn_object& D=ObjectElements[ObjectElements.size()-1]; | |
2572 | dyn_object::dyn_object_alt& A=D.Alts[blk]; | |
2573 | if (object_render_info_array&1) // bit 0 | |
2574 | { | |
2575 | bool b_differential_position_specified; | |
2576 | if (!blk) | |
2577 | b_differential_position_specified=0; | |
2578 | else | |
2579 | Get_SB(b_differential_position_specified, "b_differential_position_specified"); | |
2580 | if (b_differential_position_specified) | |
2581 | { | |
2582 | Skip_S1(3, "diff_pos3D_X_bits"); | |
2583 | Skip_S1(3, "diff_pos3D_Y_bits"); | |
2584 | Skip_S1(3, "diff_pos3D_Z_bits"); | |
2585 | A.pos3d_x_bits=(int8u)-1; // Not supported | |
2586 | } | |
2587 | else | |
2588 | { | |
2589 | bool b_object_distance_specified; | |
2590 | Get_S1 (6, A.pos3d_x_bits, "pos3d_x_bits"); Param_Info3(mgi_bitstream_val_to_Q15(A.pos3d_x_bits, 6)/32768.0*100, "%", 0); | |
2591 | Get_S1 (6, A.pos3d_y_bits, "pos3d_y_bits"); Param_Info3(mgi_bitstream_val_to_Q15(A.pos3d_y_bits, 6)/32768.0*100, "%", 0); | |
2592 | Get_SB ( A.pos3d_z_sig, "pos3d_z_sig"); | |
2593 | Get_S1 (4, A.pos3d_z_bits, "pos3d_z_bits"); Param_Info3(mgi_bitstream_pos_z_to_Q15(A.pos3d_z_sig, A.pos3d_z_bits)/32768.0*100, "%", 0); | |
2594 | Get_SB ( b_object_distance_specified, "b_object_distance_specified"); | |
2595 | if (b_object_distance_specified) | |
2596 | { | |
2597 | bool b_object_at_infinity; | |
2598 | Get_SB ( b_object_at_infinity, "b_object_at_infinity"); | |
2599 | if (!b_object_at_infinity) | |
2600 | Skip_S1(4, "distance_factor_idx"); | |
2601 | } | |
2602 | } | |
2603 | } | |
2604 | else | |
2605 | A.pos3d_x_bits=(int8u)-1; | |
2606 | A.hp_render_mode=(int8u)-1; | |
2607 | if ((object_render_info_array>>1)&1) // bit 1 | |
2608 | { | |
2609 | Skip_S1(3, "zone_constraints_idx"); | |
2610 | Skip_SB( "b_enable_elevation"); | |
2611 | } | |
2612 | if ((object_render_info_array>>2)&1) // bit 2 | |
2613 | { | |
2614 | int8u object_size_idx; | |
2615 | Get_S1 (2, object_size_idx, "object_size_idx"); | |
2616 | switch (object_size_idx) | |
2617 | { | |
2618 | case 1: | |
2619 | { | |
2620 | Skip_S1(5, "object_size_bits"); | |
2621 | } | |
2622 | break; | |
2623 | case 2: | |
2624 | { | |
2625 | Skip_S1(5, "object_width_bits"); | |
2626 | Skip_S1(5, "object_depth_bits"); | |
2627 | Skip_S1(5, "object_height_bits"); | |
2628 | } | |
2629 | break; | |
2630 | default:; | |
2631 | } | |
2632 | } | |
2633 | if (object_render_info_array>>3) // bit 3 | |
2634 | { | |
2635 | bool b_object_use_screen_ref; | |
2636 | Get_SB ( b_object_use_screen_ref, "b_object_use_screen_ref"); | |
2637 | if (b_object_use_screen_ref) | |
2638 | { | |
2639 | Skip_S1(3, "screen_factor_bits"); | |
2640 | Skip_S1(2, "depth_factor_idx"); | |
2641 | } | |
2642 | Skip_SB( "b_object_snap"); | |
2643 | } | |
2644 | Element_End0(); | |
2645 | } | |
2646 | ||
2647 | int8u bits_needed(size_t value) | |
2648 | { | |
2649 | if (!value) | |
2650 | return 0; | |
2651 | ||
2652 | int8u res = 0; | |
2653 | while (value) { | |
2654 | res += 1; | |
2655 | value >>= 1; | |
2656 | } | |
2657 | return res; | |
2658 | } | |
2659 | ||
2660 | void File_DolbyE::mgi_payload() | |
2661 | { | |
2662 | DynObjects.clear(); | |
2663 | BedInstances.clear(); | |
2664 | Presets.clear(); | |
2665 | substream_mappings.clear(); | |
2666 | ||
2667 | Element_Begin1("mgi_payload"); | |
2668 | size_t BS_Start=Data_BS_Remain(); | |
2669 | int8u mgi_version, num_presets_m1, num_dyn_objects, num_bed_instances; | |
2670 | bool program_id_available, is_substream_mapping_present, mini_mixgraph_extension_present, mini_mixgraph_description_present; | |
2671 | Get_S1 (2, mgi_version, "mgi_version"); | |
2672 | if (mgi_version ==3) | |
2673 | { | |
2674 | int32u mgi_version32; | |
2675 | Get_V4 (2, mgi_version32, "mgi_version"); | |
2676 | mgi_version32+=3; | |
2677 | mgi_version=(int8u)mgi_version32; | |
2678 | } | |
2679 | if (mgi_version!=5) | |
2680 | { | |
2681 | Skip_BS(1, "(Unparsed mgi_payload data)"); //TODO: exact count of bits | |
2682 | Element_End0(); | |
2683 | return; | |
2684 | } | |
2685 | Get_SB (program_id_available, "program_id_available"); | |
2686 | Get_SB (is_substream_mapping_present, "is_substream_mapping_present"); | |
2687 | Get_SB (mini_mixgraph_extension_present, "mini_mixgraph_extension_present"); | |
2688 | Get_SB (mini_mixgraph_description_present, "mini_mixgraph_description_present"); | |
2689 | if (program_id_available) | |
2690 | { | |
2691 | Skip_S1( 3, "program_uuid_segment_number"); | |
2692 | Skip_S2(16, "program_uuid_segment"); | |
2693 | } | |
2694 | { | |
2695 | size_t ToPadd=(BS_Start-Data_BS_Remain())%8; | |
2696 | if (ToPadd<8) | |
2697 | Skip_BS(8-ToPadd, "byte_align"); | |
2698 | } | |
2699 | Skip_S2(16, "short_program_id"); | |
2700 | Get_S1 (4, num_presets_m1, "num_presets_m1"); | |
2701 | Get_S1 (7, num_dyn_objects, "num_dyn_objects"); | |
2702 | Get_S1 (4, num_bed_instances, "num_bed_instances"); | |
2703 | ||
2704 | DynObjects.resize(num_dyn_objects); | |
2705 | for (int8u i=0; i<num_dyn_objects; i++) | |
2706 | { | |
2707 | dyn_object& D=DynObjects[i]; | |
2708 | Element_Begin1("dyn_object"); | |
2709 | int32u num_dyn_obj_alt_md; | |
2710 | Get_V4 (2, num_dyn_obj_alt_md, "num_dyn_obj_alt_md"); | |
2711 | Get_S1 (2, D.sound_category, "sound_category"); Param_Info1(sound_category_Values[D.sound_category]); | |
2712 | D.Alts.resize(num_dyn_obj_alt_md); | |
2713 | for (int32u j=0; j<num_dyn_obj_alt_md; j++) | |
2714 | { | |
2715 | dyn_object::dyn_object_alt& A=D.Alts[j]; | |
2716 | Element_Begin1("dyn_obj_alt_md"); | |
2717 | int32u object_info_mask, object_info_size_bytes; | |
2718 | Get_V4 (3, object_info_mask, "object_info_mask"); | |
2719 | //Get_V4 (3, object_info_size_bytes, "object_info_size_bytes"); //TODO | |
2720 | Get_S4 (4, object_info_size_bytes, "object_info_size_bytes, variable_bits ignored"); | |
2721 | object_info_size_bytes=4; | |
2722 | size_t Begin=Data_BS_Remain(); | |
2723 | if (object_info_size_bytes) | |
2724 | { | |
2725 | if (object_info_mask & 0x1) | |
2726 | { | |
2727 | int8u dyn_obj_gain_db_bits; | |
2728 | Get_S1(6, dyn_obj_gain_db_bits, "dyn_obj_gain_db_bits"); | |
2729 | if (dyn_obj_gain_db_bits==63) | |
2730 | A.obj_gain_db=INT_MIN; | |
2731 | else | |
2732 | A.obj_gain_db=15-dyn_obj_gain_db_bits; | |
2733 | } | |
2734 | else | |
2735 | A.obj_gain_db=INT_MAX; | |
2736 | if (object_info_mask & 0x2) | |
2737 | { | |
2738 | Get_S1 (6, A.pos3d_x_bits, "pos3d_x_bits"); Param_Info3(mgi_bitstream_val_to_Q15(A.pos3d_x_bits, 6)/32768.0*100, "%", 0); | |
2739 | Get_S1 (6, A.pos3d_y_bits, "pos3d_y_bits"); Param_Info3(mgi_bitstream_val_to_Q15(A.pos3d_y_bits, 6)/32768.0*100, "%", 0); | |
2740 | Get_SB ( A.pos3d_z_sig, "pos3d_z_sig"); | |
2741 | Get_S1 (4, A.pos3d_z_bits, "pos3d_z_bits"); Param_Info3(mgi_bitstream_pos_z_to_Q15(A.pos3d_z_sig, A.pos3d_z_bits)/32768.0*100, "%", 0); | |
2742 | Element_Level--; | |
2743 | Element_Info1(Angles2String(mgi_bitstream_pos_ToAngles(mgi_bitstream_val_to_Q15(A.pos3d_x_bits, 6), mgi_bitstream_val_to_Q15(A.pos3d_y_bits, 6), mgi_bitstream_pos_z_to_Q15(A.pos3d_z_sig, A.pos3d_z_bits)))); | |
2744 | Element_Level++; | |
2745 | } | |
2746 | else | |
2747 | A.pos3d_x_bits=(int8u)-1; | |
2748 | if (object_info_mask & 0x4) | |
2749 | { | |
2750 | Skip_SB( "hp_md_state"); | |
2751 | Get_S1 (2, A.hp_render_mode, "hp_render_mode"); Param_Info1(hp_render_mode_Values[A.hp_render_mode]); | |
2752 | Skip_SB( "hp_headtrack_state"); | |
2753 | } | |
2754 | else | |
2755 | A.hp_render_mode=(int8u)-1; | |
2756 | size_t Parsed=Begin-Data_BS_Remain(); | |
2757 | int8u Padding=8-(Parsed%8); | |
2758 | Skip_BS(Padding, "padding"); | |
2759 | } | |
2760 | Element_End0(); | |
2761 | } | |
2762 | Element_End0(); | |
2763 | } | |
2764 | ||
2765 | BedInstances.resize(num_bed_instances); | |
2766 | for (int8u i=0; i<num_bed_instances; i++) | |
2767 | { | |
2768 | bed_instance& B=BedInstances[i]; | |
2769 | Element_Begin1("bed_instance"); | |
2770 | int32u num_bed_alt_md; | |
2771 | Get_V4 (2, num_bed_alt_md, "num_bed_alt_md"); | |
2772 | B.Alts.resize(num_bed_alt_md); | |
2773 | for (int8u j=0; j<num_bed_alt_md; j++) | |
2774 | { | |
2775 | bed_instance::bed_alt& A=B.Alts[j]; | |
2776 | Element_Begin1("bed_alt_md"); | |
2777 | int32u bed_info_mask, bed_info_size_bytes; | |
2778 | Get_V4 (2, bed_info_mask, "bed_info_mask"); | |
2779 | Get_V4 (2, bed_info_size_bytes, "bed_info_size_bytes"); | |
2780 | size_t End=Data_BS_Remain()-bed_info_size_bytes*8; | |
2781 | if (bed_info_mask&1) | |
2782 | { | |
2783 | int8u bed_gain_db_bits; | |
2784 | Get_S1(6, bed_gain_db_bits, "bed_gain_db_bits"); | |
2785 | A.bed_gain_db=15-bed_gain_db_bits; | |
2786 | } | |
2787 | else | |
2788 | A.bed_gain_db=INT8_MAX; | |
2789 | if (Data_BS_Remain()>End) | |
2790 | Skip_BS(Data_BS_Remain()-End, "padding"); | |
2791 | Element_End0(); | |
2792 | } | |
2793 | Element_End0(); | |
2794 | } | |
2795 | ||
2796 | Presets.resize(num_presets_m1 + 1); | |
2797 | for (int8u i=0; i<=num_presets_m1; i++) | |
2798 | { | |
2799 | preset& P=Presets[i]; | |
2800 | Element_Begin1("preset"); | |
2801 | int32u num_target_device_configs_m1; | |
2802 | Get_V4 (2, num_target_device_configs_m1, "num_target_device_configs_m1"); | |
2803 | Get_V4 (2, P.default_target_device_config, "default_target_device_config"); Param_Info1(default_target_device_config_Value(P.default_target_device_config)); | |
2804 | P.target_device_configs.resize(num_target_device_configs_m1+1); | |
2805 | for (int32u j=0; j<=num_target_device_configs_m1; j++) | |
2806 | { | |
2807 | preset::target_device_config& T=P.target_device_configs[j]; | |
2808 | Element_Begin1("target_device_config"); | |
2809 | Get_V4 (3, T.target_devices_mask, "target_devices_mask"); Param_Info1(default_target_device_config_Value(T.target_devices_mask)); | |
2810 | for (int32u k=0; k<num_dyn_objects+num_bed_instances; k++) | |
2811 | { | |
2812 | Element_Begin1(k<num_dyn_objects?"object":"bed"); | |
2813 | bool active; | |
2814 | Get_SB (active, k<num_dyn_objects?"object_active":"bed_active"); | |
2815 | if (active) | |
2816 | { | |
2817 | int32u md_index; | |
2818 | size_t Size=k<num_dyn_objects?DynObjects[k].Alts.size():BedInstances[k-num_dyn_objects].Alts.size(); | |
2819 | Get_S4 (bits_needed(Size+1), md_index, k<num_dyn_objects?"obj_md_index":"bed_md_index"); | |
2820 | T.md_indexes.push_back(md_index); | |
2821 | } | |
2822 | else | |
2823 | T.md_indexes.push_back((int32u)-1); | |
2824 | Element_End0(); | |
2825 | } | |
2826 | Element_End0(); | |
2827 | } | |
2828 | TEST_SB_SKIP( "preset_extension"); | |
2829 | int32u extension_size; | |
2830 | Get_V4 (4, extension_size, "extension_size"); | |
2831 | Skip_BS(extension_size, "extension"); | |
2832 | TEST_SB_END(); | |
2833 | Element_End0(); | |
2834 | } | |
2835 | ||
2836 | substream_mappings.resize(num_dyn_objects+num_bed_instances); | |
2837 | if (is_substream_mapping_present) | |
2838 | { | |
2839 | Element_Begin1("substream_mapping"); | |
2840 | for (int8u i=0; i<substream_mappings.size(); i++) | |
2841 | { | |
2842 | substream_mapping& S=substream_mappings[i]; | |
2843 | Element_Begin1(i<num_dyn_objects?"dyn_object":"bed_instance"); | |
2844 | bool standard_index; | |
2845 | Get_S1(4, S.substream_id, "substream_id"); | |
2846 | Get_SB( standard_index, "standard_index"); | |
2847 | if (standard_index) | |
2848 | Get_S4 (3, S.channel_index, "channel_index"); | |
2849 | else | |
2850 | { | |
2851 | Get_S4(5, S.channel_index, "channel_index"); | |
2852 | if (S.channel_index==0x1F) | |
2853 | { | |
2854 | Get_V4(3, S.channel_index, "channel_index"); | |
2855 | S.channel_index+=0x1F; | |
2856 | } | |
2857 | } | |
2858 | ||
2859 | Element_End0(); | |
2860 | } | |
2861 | Element_End0(); | |
2862 | } | |
2863 | int8u byte_align_Content=0; | |
2864 | { | |
2865 | size_t ToPadd=(BS_Start-Data_BS_Remain())%8; | |
2866 | if (ToPadd) | |
2867 | Get_S1(8-ToPadd, byte_align_Content, "byte_align"); | |
2868 | } | |
2869 | if (mini_mixgraph_extension_present) | |
2870 | { | |
2871 | Element_Begin1("mini_mixgraph_extension"); | |
2872 | TEST_SB_SKIP( "mgi_extension"); | |
2873 | int32u extension_size; | |
2874 | Get_V4 (4, extension_size, "extension_size"); | |
2875 | Skip_BS(extension_size, "extension"); | |
2876 | TEST_SB_END(); | |
2877 | Element_End0(); | |
2878 | } | |
2879 | if (mini_mixgraph_description_present) | |
2880 | { | |
2881 | Element_Begin1("mini_mixgraph_description"); | |
2882 | int32u desc_packet_idx, desc_pkt_size_bits; | |
2883 | if (!byte_align_Content) | |
2884 | { | |
2885 | Get_V4 (5, desc_packet_idx, "desc_packet_idx"); | |
2886 | } | |
2887 | else | |
2888 | { | |
2889 | Skip_S1(6, "0x3F?"); | |
2890 | desc_packet_idx = 30; //Not in spec. Bug in the stream here? | |
2891 | } | |
2892 | if (!desc_packet_idx) | |
2893 | { | |
2894 | Get_V4 (5, num_desc_packets_m1, "num_desc_packets_m1"); | |
2895 | } | |
2896 | if (desc_packet_idx==num_desc_packets_m1) | |
2897 | { | |
2898 | Get_V4 (7, desc_pkt_size_bits, "desc_pkt_size_bits"); | |
2899 | } | |
2900 | else | |
2901 | { | |
2902 | Get_V4 (4, desc_pkt_size_bits, "desc_pkt_size_bytes"); | |
2903 | desc_pkt_size_bits<<=3; //bits to bytes | |
2904 | } | |
2905 | while (desc_pkt_size_bits) | |
2906 | { | |
2907 | int8u bits8=desc_pkt_size_bits>8?8:desc_pkt_size_bits; | |
2908 | int8u data; | |
2909 | Get_S1(bits8, data, "description_packet_data"); | |
2910 | if (num_desc_packets_m1!=(int32u)-1) | |
2911 | description_packet_data.push_back(data<<(8-bits8)); | |
2912 | desc_pkt_size_bits-=bits8; | |
2913 | } | |
2914 | if (desc_packet_idx==num_desc_packets_m1 && !description_packet_data.empty()) | |
2915 | { | |
2916 | Presets_More.clear(); | |
2917 | BitStream_Fast* BS_Save=BS; | |
2918 | BS=new BitStream_Fast(&*description_packet_data.begin(), description_packet_data.size()); //In bytes, we can not provide a precise count of bits | |
2919 | Element_Begin1("packet_description"); | |
2920 | int8u preset_description_id_bits; | |
2921 | Get_S1(3, preset_description_id_bits, "preset_description_id_bits"); | |
2922 | for (int8u i=0; i <=num_presets_m1; i++) | |
2923 | { | |
2924 | Skip_BS(preset_description_id_bits, "preset_description_id[i]"); | |
2925 | } | |
2926 | TEST_SB_SKIP("preset_description_text_present"); | |
2927 | Presets_More.resize(num_presets_m1+1); | |
2928 | for (int8u i=0; i<=num_presets_m1; i++) | |
2929 | { | |
2930 | preset_more& P=Presets_More[i]; | |
2931 | int8u desc_text_len; | |
2932 | Get_S1(5, desc_text_len, "desc_text_len"); | |
2933 | Element_Begin1("preset_description"); | |
2934 | for (int8u j=0; j<desc_text_len; j++) | |
2935 | { | |
2936 | int8u preset_description_char; | |
2937 | Get_S1(8, preset_description_char, "preset_description_char"); | |
2938 | P.description+=(char)preset_description_char; | |
2939 | } | |
2940 | if (Ztring().From_UTF8(P.description).empty()) | |
2941 | P.description.clear(); // Problem while parsing | |
2942 | Element_Info1(P.description); | |
2943 | Element_End0(); | |
2944 | } | |
2945 | TEST_SB_END(); | |
2946 | Element_End0(); | |
2947 | delete BS; BS=BS_Save; | |
2948 | description_packet_data.clear(); | |
2949 | mini_mixgraph_description_present=false; //Indicates that the stream is ready for data filling | |
2950 | } | |
2951 | Element_End0(); | |
2952 | { | |
2953 | size_t ToPadd=(BS_Start-Data_BS_Remain())%8; | |
2954 | if (ToPadd<8) | |
2955 | Skip_BS(8-ToPadd, "byte_align"); | |
2956 | } | |
2957 | } | |
2958 | Element_End0(); | |
2959 | } | |
2960 | ||
2961 | //--------------------------------------------------------------------------- | |
2962 | void File_DolbyE::Get_V4(int8u Bits, int8u MaxLoops, int32u& Info, const char* Name) | |
2963 | { | |
2964 | Info=0; | |
2965 | #if MEDIAINFO_TRACE | |
2966 | if (Trace_Activated) | |
2967 | { | |
2968 | int8u Count=0; | |
2969 | for (;;) | |
2970 | { | |
2971 | Info+=BS->Get4(Bits); | |
2972 | Count+=1+Bits; | |
2973 | if (!BS->GetB() || !(--MaxLoops)) | |
2974 | break; | |
2975 | Info<<=Bits; | |
2976 | Info+=(1<<Bits); | |
2977 | } | |
2978 | ||
2979 | Param(Name, Info, Count); | |
2980 | Param_Info(__T("(")+Ztring::ToZtring(Count)+__T(" bits)")); | |
2981 | } | |
2982 | else | |
2983 | #endif //MEDIAINFO_TRACE | |
2984 | { | |
2985 | for (;;) | |
2986 | { | |
2987 | Info+=BS->Get4(Bits); | |
2988 | if (!BS->GetB() || !(--MaxLoops)) | |
2989 | break; | |
2990 | Info<<=Bits; | |
2991 | Info+=(1<<Bits); | |
2992 | } | |
2993 | } | |
2994 | } | |
2995 | ||
2996 | //--------------------------------------------------------------------------- | |
2997 | void File_DolbyE::Get_V4(int8u Bits, int32u& Info, const char* Name) | |
2998 | { | |
2999 | Info=0; | |
3000 | #if MEDIAINFO_TRACE | |
3001 | if (Trace_Activated) | |
3002 | { | |
3003 | int8u Count=0; | |
3004 | for (;;) | |
3005 | { | |
3006 | Info+=BS->Get4(Bits); | |
3007 | Count+=1+Bits; | |
3008 | if (!BS->GetB()) | |
3009 | break; | |
3010 | Info<<=Bits; | |
3011 | Info+=(1<<Bits); | |
3012 | } | |
3013 | ||
3014 | Param(Name, Info, Count); | |
3015 | Param_Info(__T("(")+Ztring::ToZtring(Count)+__T(" bits)")); | |
3016 | } | |
3017 | else | |
3018 | #endif //MEDIAINFO_TRACE | |
3019 | { | |
3020 | for (;;) | |
3021 | { | |
3022 | Info+=BS->Get4(Bits); | |
3023 | if (!BS->GetB()) | |
3024 | break; | |
3025 | Info<<=Bits; | |
3026 | Info+=(1<<Bits); | |
3027 | } | |
3028 | } | |
3029 | } | |
3030 | ||
3031 | //--------------------------------------------------------------------------- | |
3032 | void File_DolbyE::Skip_V4(int8u Bits, const char* Name) | |
3033 | { | |
3034 | #if MEDIAINFO_TRACE | |
3035 | if (Trace_Activated) | |
3036 | { | |
3037 | int32u Info=0; | |
3038 | int8u Count=0; | |
3039 | for (;;) | |
3040 | { | |
3041 | Info+=BS->Get4(Bits); | |
3042 | Count+=1+Bits; | |
3043 | if (!BS->GetB()) | |
3044 | break; | |
3045 | Info<<=Bits; | |
3046 | Info+=(1<<Bits); | |
3047 | } | |
3048 | ||
3049 | Param(Name, Info, Count); | |
3050 | Param_Info(__T("(")+Ztring::ToZtring(Count)+__T(" bits)")); | |
3051 | } | |
3052 | else | |
3053 | #endif //MEDIAINFO_TRACE | |
3054 | { | |
3055 | for (;;) | |
3056 | { | |
3057 | BS->Skip(Bits); | |
3058 | if (!BS->GetB()) | |
3059 | break; | |
3060 | } | |
3061 | } | |
3062 | } | |
3063 | ||
3064 | //--------------------------------------------------------------------------- | |
3065 | void File_DolbyE::audio_segment() | |
3066 | { | |
3067 | //Parsing | |
3068 | Element_Begin1("audio_segment"); | |
3069 | #if MEDIAINFO_TRACE | |
3070 | //CRC test | |
3071 | size_t Pos_Begin=0; | |
3072 | #endif //MEDIAINFO_TRACE | |
3073 | for (int8u Channel=0; Channel<DolbyE_Channels[program_config]; Channel++) | |
3074 | { | |
3075 | if ((Channel%(DolbyE_Channels[program_config]/2))==0 && key_present) | |
3076 | { | |
3077 | int16u audio_subsegment_size=0; | |
3078 | for (int8u ChannelForSize=0; ChannelForSize<DolbyE_Channels[program_config]/2; ChannelForSize++) | |
3079 | audio_subsegment_size+=channel_subsegment_size[((Channel<DolbyE_Channels[program_config]/2)?0:(DolbyE_Channels[program_config]/2))+ChannelForSize]; | |
3080 | ||
3081 | if (Data_BS_Remain()<(audio_subsegment_size+1)*(size_t)bit_depth) | |
3082 | return; //There is a problem | |
3083 | ||
3084 | //We must change the buffer | |
3085 | switch (bit_depth) | |
3086 | { | |
3087 | case 16 : | |
3088 | { | |
3089 | int16u audio_subsegment_key; | |
3090 | Get_S2 (16, audio_subsegment_key, (Channel+1==DolbyE_Channels[program_config])?"audio_subsegment1_key":"audio_subsegment0_key"); | |
3091 | ||
3092 | int8u* Temp=Descrambled_Buffer+(size_t)Element_Size-Data_BS_Remain()/8; | |
3093 | for (int16u Pos=0; Pos<audio_subsegment_size+1; Pos++) | |
3094 | int16u2BigEndian(Temp+Pos*2, BigEndian2int16u(Temp+Pos*2)^audio_subsegment_key); | |
3095 | } | |
3096 | break; | |
3097 | case 20 : | |
3098 | { | |
3099 | int32u audio_subsegment_key; | |
3100 | Get_S3 (20, audio_subsegment_key, (Channel+1==DolbyE_Channels[program_config])?"audio_subsegment1_key":"audio_subsegment0_key"); | |
3101 | ||
3102 | Descramble_20bit(audio_subsegment_key, audio_subsegment_size); | |
3103 | } | |
3104 | break; | |
3105 | default : ; | |
3106 | } | |
3107 | } | |
3108 | ||
3109 | #if MEDIAINFO_TRACE | |
3110 | //CRC test | |
3111 | if ((Channel%(DolbyE_Channels[program_config]/2))==0) | |
3112 | Pos_Begin=Buffer_Offset*8+(size_t)Element_Size*8-Data_BS_Remain(); | |
3113 | #endif //MEDIAINFO_TRACE | |
3114 | ||
3115 | Element_Begin1(__T("Channel ")+Ztring::ToZtring(Channel)); | |
3116 | Element_Info1(Ztring::ToZtring(channel_subsegment_size[Channel])+__T(" words")); | |
3117 | Skip_BS(channel_subsegment_size[Channel]*bit_depth, "channel_subsegment"); | |
3118 | Element_End0(); | |
3119 | if ((Channel%(DolbyE_Channels[program_config]/2))==DolbyE_Channels[program_config]/2-1) | |
3120 | { | |
3121 | Skip_S3(bit_depth, (Channel+1==DolbyE_Channels[program_config])?"audio_subsegment1_crc":"audio_subsegment0_crc"); | |
3122 | ||
3123 | #if MEDIAINFO_TRACE | |
3124 | //CRC test | |
3125 | size_t Pos_End=Buffer_Offset*8+(size_t)Element_Size*8-Data_BS_Remain(); | |
3126 | int8u BitSkip_Begin=Pos_Begin%8; | |
3127 | Pos_Begin/=8; | |
3128 | int8u BitSkip_End=0; // Pos_End%8; Looks like that the last bits must not be in the CRC computing | |
3129 | Pos_End/=8; | |
3130 | if (BitSkip_End) | |
3131 | Pos_End++; | |
3132 | ||
3133 | int16u CRC=CRC_16_Compute(Buffer+Pos_Begin, Pos_End-Pos_Begin, BitSkip_Begin, BitSkip_End); | |
3134 | if (CRC) | |
3135 | { | |
3136 | //CRC is wrong | |
3137 | Param_Info1("NOK"); | |
3138 | } | |
3139 | #endif //MEDIAINFO_TRACE | |
3140 | } | |
3141 | } | |
3142 | Element_End0(); | |
3143 | } | |
3144 | ||
3145 | //--------------------------------------------------------------------------- | |
3146 | void File_DolbyE::metadata_extension_segment() | |
3147 | { | |
3148 | //Parsing | |
3149 | Element_Begin1("metadata_extension_segment"); | |
3150 | if (key_present) | |
3151 | { | |
3152 | if (Data_BS_Remain()<((size_t)metadata_extension_segment_size+1)*(size_t)bit_depth) //+1 for CRC | |
3153 | return; //There is a problem | |
3154 | ||
3155 | //We must change the buffer | |
3156 | switch (bit_depth) | |
3157 | { | |
3158 | case 16 : | |
3159 | { | |
3160 | int16u metadata_extension_segment_key; | |
3161 | Get_S2 (16, metadata_extension_segment_key, "metadata_extension_segment_key"); | |
3162 | ||
3163 | int8u* Temp=Descrambled_Buffer+(size_t)Element_Size-Data_BS_Remain()/8; | |
3164 | for (int16u Pos=0; Pos<metadata_extension_segment_size+1; Pos++) | |
3165 | int16u2BigEndian(Temp+Pos*2, BigEndian2int16u(Temp+Pos*2)^metadata_extension_segment_key); | |
3166 | } | |
3167 | break; | |
3168 | case 20 : | |
3169 | { | |
3170 | int32u metadata_extension_segment_key; | |
3171 | Get_S3 (20, metadata_extension_segment_key, "metadata_extension_segment_key"); | |
3172 | ||
3173 | Descramble_20bit(metadata_extension_segment_key, metadata_extension_segment_size); | |
3174 | } | |
3175 | break; | |
3176 | default : ; | |
3177 | } | |
3178 | } | |
3179 | ||
3180 | #if MEDIAINFO_TRACE | |
3181 | //CRC test | |
3182 | size_t Pos_Begin=Buffer_Offset*8+(size_t)Element_Size*8-Data_BS_Remain(); | |
3183 | #endif //MEDIAINFO_TRACE | |
3184 | ||
3185 | size_t metadata_extension_segment_BitCountAfter=Data_BS_Remain(); | |
3186 | metadata_extension_segment_BitCountAfter-=metadata_extension_segment_size*bit_depth; | |
3187 | if (metadata_extension_segment_size) | |
3188 | { | |
3189 | for(;;) | |
3190 | { | |
3191 | Element_Begin1("metadata_extension_subsegment"); | |
3192 | int16u metadata_extension_subsegment_length; | |
3193 | int8u metadata_extension_subsegment_id; | |
3194 | Get_S1 ( 4, metadata_extension_subsegment_id, "metadata_extension_subsegment_id"); | |
3195 | if (metadata_extension_subsegment_id==0) | |
3196 | { | |
3197 | Element_End0(); | |
3198 | break; | |
3199 | } | |
3200 | Get_S2 (12, metadata_extension_subsegment_length, "metadata_extension_subsegment_length"); | |
3201 | switch (metadata_extension_subsegment_id) | |
3202 | { | |
3203 | default: Skip_BS(metadata_extension_subsegment_length,"metadata_extension_subsegment (unknown)"); | |
3204 | } | |
3205 | Element_End0(); | |
3206 | } | |
3207 | Param_Info1(metadata_extension_segment_BitCountAfter); | |
3208 | Param_Info1(Data_BS_Remain()); | |
3209 | Param_Info1(Data_BS_Remain()-metadata_extension_segment_BitCountAfter); | |
3210 | if (Data_BS_Remain()>metadata_extension_segment_BitCountAfter) | |
3211 | Skip_BS(Data_BS_Remain()-metadata_extension_segment_BitCountAfter,"reserved_metadata_extension_bits"); | |
3212 | } | |
3213 | Skip_S3(bit_depth, "metadata_extension_crc"); | |
3214 | ||
3215 | #if MEDIAINFO_TRACE | |
3216 | //CRC test | |
3217 | size_t Pos_End=Buffer_Offset*8+(size_t)Element_Size*8-Data_BS_Remain(); | |
3218 | int8u BitSkip_Begin=Pos_Begin%8; | |
3219 | Pos_Begin/=8; | |
3220 | int8u BitSkip_End=0; // Pos_End%8; Looks like that the last bits must not be in the CRC computing | |
3221 | Pos_End/=8; | |
3222 | if (BitSkip_End) | |
3223 | Pos_End++; | |
3224 | ||
3225 | int16u CRC=CRC_16_Compute(Buffer+Pos_Begin, Pos_End-Pos_Begin, BitSkip_Begin, BitSkip_End); | |
3226 | if (CRC) | |
3227 | { | |
3228 | //CRC is wrong | |
3229 | Param_Info1("NOK"); | |
3230 | } | |
3231 | #endif //MEDIAINFO_TRACE | |
3232 | ||
3233 | Element_End0(); | |
3234 | } | |
3235 | ||
3236 | //--------------------------------------------------------------------------- | |
3237 | void File_DolbyE::audio_extension_segment() | |
3238 | { | |
3239 | //Parsing | |
3240 | Element_Begin1("audio_extension_segment"); | |
3241 | #if MEDIAINFO_TRACE | |
3242 | //CRC test | |
3243 | size_t Pos_Begin=0; | |
3244 | #endif //MEDIAINFO_TRACE | |
3245 | for (int8u Channel=0; Channel<DolbyE_Channels[program_config]; Channel++) | |
3246 | { | |
3247 | if ((Channel%(DolbyE_Channels[program_config]/2))==0 && key_present) | |
3248 | { | |
3249 | int16u audio_extension_subsegment_size=0; | |
3250 | for (int8u ChannelForSize=0; ChannelForSize<DolbyE_Channels[program_config]/2; ChannelForSize++) | |
3251 | audio_extension_subsegment_size+=channel_subsegment_size[((Channel<DolbyE_Channels[program_config]/2)?0:(DolbyE_Channels[program_config]/2))+ChannelForSize]; | |
3252 | ||
3253 | if (Data_BS_Remain()<((size_t)audio_extension_subsegment_size+1)*(size_t)bit_depth) | |
3254 | return; //There is a problem | |
3255 | ||
3256 | //We must change the buffer | |
3257 | switch (bit_depth) | |
3258 | { | |
3259 | case 16 : | |
3260 | { | |
3261 | int16u audio_extension_subsegment_key; | |
3262 | Get_S2 (16, audio_extension_subsegment_key, (Channel+1==DolbyE_Channels[program_config])?"audio_extension_subsegment1_key":"audio_extension_subsegment0_key"); | |
3263 | ||
3264 | int8u* Temp=Descrambled_Buffer+(size_t)Element_Size-Data_BS_Remain()/8; | |
3265 | for (int16u Pos=0; Pos<audio_extension_subsegment_size+1; Pos++) | |
3266 | int16u2BigEndian(Temp+Pos*2, BigEndian2int16u(Temp+Pos*2)^audio_extension_subsegment_key); | |
3267 | } | |
3268 | break; | |
3269 | case 20 : | |
3270 | { | |
3271 | int32u audio_extension_subsegment_key; | |
3272 | Get_S3 (20, audio_extension_subsegment_key, (Channel+1==DolbyE_Channels[program_config])?"audio_extension_subsegment1_key":"audio_extension_subsegment0_key"); | |
3273 | ||
3274 | Descramble_20bit(audio_extension_subsegment_key, audio_extension_subsegment_size); | |
3275 | } | |
3276 | break; | |
3277 | default : ; | |
3278 | } | |
3279 | } | |
3280 | ||
3281 | #if MEDIAINFO_TRACE | |
3282 | //CRC test | |
3283 | if ((Channel%(DolbyE_Channels[program_config]/2))==0) | |
3284 | Pos_Begin=Buffer_Offset*8+(size_t)Element_Size*8-Data_BS_Remain(); | |
3285 | #endif //MEDIAINFO_TRACE | |
3286 | ||
3287 | Element_Begin1(__T("Channel ")+Ztring::ToZtring(Channel)); | |
3288 | Element_Info1(Ztring::ToZtring(channel_subsegment_size[Channel])+__T(" words")); | |
3289 | Skip_BS(channel_subsegment_size[Channel]*bit_depth, "channel_subsegment"); | |
3290 | Element_End0(); | |
3291 | if ((Channel%(DolbyE_Channels[program_config]/2))==DolbyE_Channels[program_config]/2-1) | |
3292 | { | |
3293 | Skip_S3(bit_depth, (Channel+1==DolbyE_Channels[program_config])?"audio_extension_subsegment1_crc":"audio_extension_subsegment0_crc"); | |
3294 | ||
3295 | #if MEDIAINFO_TRACE | |
3296 | //CRC test | |
3297 | size_t Pos_End=Buffer_Offset*8+(size_t)Element_Size*8-Data_BS_Remain(); | |
3298 | int8u BitSkip_Begin=Pos_Begin%8; | |
3299 | Pos_Begin/=8; | |
3300 | int8u BitSkip_End=0; // Pos_End%8; Looks like that the last bits must not be in the CRC computing | |
3301 | Pos_End/=8; | |
3302 | if (BitSkip_End) | |
3303 | Pos_End++; | |
3304 | ||
3305 | int16u CRC=CRC_16_Compute(Buffer+Pos_Begin, Pos_End-Pos_Begin, BitSkip_Begin, BitSkip_End); | |
3306 | if (CRC) | |
3307 | { | |
3308 | //CRC is wrong | |
3309 | Param_Info1("NOK"); | |
3310 | } | |
3311 | #endif //MEDIAINFO_TRACE | |
3312 | } | |
3313 | } | |
3314 | Element_End0(); | |
3315 | } | |
3316 | ||
3317 | //--------------------------------------------------------------------------- | |
3318 | void File_DolbyE::meter_segment() | |
3319 | { | |
3320 | //Parsing | |
3321 | Element_Begin1("meter_segment"); | |
3322 | if (key_present) | |
3323 | { | |
3324 | if (Data_BS_Remain()<((size_t)meter_segment_size+1)*(size_t)bit_depth) //+1 for CRC | |
3325 | return; //There is a problem | |
3326 | ||
3327 | //We must change the buffer | |
3328 | switch (bit_depth) | |
3329 | { | |
3330 | case 16 : | |
3331 | { | |
3332 | int16u meter_segment_key; | |
3333 | Get_S2 (16, meter_segment_key, "meter_segment_key"); | |
3334 | ||
3335 | int8u* Temp=Descrambled_Buffer+(size_t)Element_Size-Data_BS_Remain()/8; | |
3336 | for (int16u Pos=0; Pos<meter_segment_size+1; Pos++) | |
3337 | int16u2BigEndian(Temp+Pos*2, BigEndian2int16u(Temp+Pos*2)^meter_segment_key); | |
3338 | } | |
3339 | break; | |
3340 | case 20 : | |
3341 | { | |
3342 | int32u meter_segment_key; | |
3343 | Get_S3 (20, meter_segment_key, "meter_segment_key"); | |
3344 | ||
3345 | Descramble_20bit(meter_segment_key, meter_segment_size); | |
3346 | } | |
3347 | break; | |
3348 | default : ; | |
3349 | } | |
3350 | } | |
3351 | size_t meter_segment_BitCountAfter=Data_BS_Remain(); | |
3352 | meter_segment_BitCountAfter-=meter_segment_size*bit_depth; | |
3353 | for (int8u Channel=0; Channel<DolbyE_Channels[program_config]; Channel++) | |
3354 | Skip_S2(10, "peak_meter"); | |
3355 | for (int8u Channel=0; Channel<DolbyE_Channels[program_config]; Channel++) | |
3356 | Skip_S2(10, "rms_meter"); | |
3357 | if (Data_BS_Remain()>meter_segment_BitCountAfter) | |
3358 | Skip_BS(Data_BS_Remain()>meter_segment_BitCountAfter, "reserved_meter_bits"); | |
3359 | Skip_S3(bit_depth, "meter_crc"); | |
3360 | ||
3361 | #if MEDIAINFO_TRACE | |
3362 | //CRC test | |
3363 | size_t Pos_End=Buffer_Offset*8+(size_t)Element_Size*8-Data_BS_Remain(); | |
3364 | size_t Pos_Begin=Pos_End-(meter_segment_size+1)*bit_depth; //+1 for CRC | |
3365 | int8u BitSkip_Begin=Pos_Begin%8; | |
3366 | Pos_Begin/=8; | |
3367 | int8u BitSkip_End=0; // Pos_End%8; Looks like that the last bits must not be in the CRC computing | |
3368 | Pos_End/=8; | |
3369 | if (BitSkip_End) | |
3370 | Pos_End++; | |
3371 | ||
3372 | int16u CRC=CRC_16_Compute(Buffer+Pos_Begin, Pos_End-Pos_Begin, BitSkip_Begin, BitSkip_End); | |
3373 | if (CRC) | |
3374 | { | |
3375 | //CRC is wrong | |
3376 | Param_Info1("NOK"); | |
3377 | } | |
3378 | #endif //MEDIAINFO_TRACE | |
3379 | ||
3380 | Element_End0(); | |
3381 | } | |
3382 | ||
3383 | //--------------------------------------------------------------------------- | |
3384 | void File_DolbyE::ac3_metadata_subsegment(bool xbsi) | |
3385 | { | |
3386 | for (int8u program=0; program<DolbyE_Programs[program_config]; program++) | |
3387 | { | |
3388 | Element_Begin1("per program"); | |
3389 | Skip_S1(5, "ac3_datarate"); | |
3390 | Skip_S1(3, "ac3_bsmod"); | |
3391 | Skip_S1(3, "ac3_acmod"); | |
3392 | Skip_S1(2, "ac3_cmixlev"); | |
3393 | Skip_S1(2, "ac3_surmixlev"); | |
3394 | Skip_S1(2, "ac3_dsurmod"); | |
3395 | Skip_S1(1, "ac3_lfeon"); | |
3396 | Skip_S1(5, "ac3_dialnorm"); | |
3397 | Skip_S1(1, "ac3_langcode"); | |
3398 | Skip_S1(8, "ac3_langcod"); | |
3399 | Skip_S1(1, "ac3_audprodie"); | |
3400 | Skip_S1(5, "ac3_mixlevel"); | |
3401 | Skip_S1(2, "ac3_roomtyp"); | |
3402 | Skip_S1(1, "ac3_copyrightb"); | |
3403 | Skip_S1(1, "ac3_origbs"); | |
3404 | if (xbsi) | |
3405 | { | |
3406 | Skip_S1(1, "ac3_xbsi1e"); | |
3407 | Skip_S1(2, "ac3_dmixmod"); | |
3408 | Skip_S1(3, "ac3_ltrtcmixlev"); | |
3409 | Skip_S1(3, "ac3_ltrtsurmixlev"); | |
3410 | Skip_S1(3, "ac3_lorocmixlev"); | |
3411 | Skip_S1(3, "ac3_lorosurmixlev"); | |
3412 | Skip_S1(1, "ac3_xbsi2e"); | |
3413 | Skip_S1(2, "ac3_dsurexmod"); | |
3414 | Skip_S1(2, "ac3_dheadphonmod"); | |
3415 | Skip_S1(1, "ac3_adconvtyp"); | |
3416 | Skip_S1(8, "ac3_xbsi2"); | |
3417 | Skip_S1(1, "ac3_encinfo"); | |
3418 | } | |
3419 | else | |
3420 | { | |
3421 | Skip_S1(1, "ac3_timecode1e"); | |
3422 | Skip_S2(14, "ac3_timecode1"); | |
3423 | Skip_S1(1, "ac3_timecode2e"); | |
3424 | Skip_S2(14, "ac3_timecode2"); | |
3425 | } | |
3426 | Skip_S1(1, "ac3_hpfon"); | |
3427 | Skip_S1(1, "ac3_bwlpfon"); | |
3428 | Skip_S1(1, "ac3_lfelpfon"); | |
3429 | Skip_S1(1, "ac3_sur90on"); | |
3430 | Skip_S1(1, "ac3_suratton"); | |
3431 | Skip_S1(1, "ac3_rfpremphon"); | |
3432 | Skip_S1(1, "ac3_compre"); | |
3433 | Skip_S1(8, "ac3_compr1"); | |
3434 | Skip_S1(1, "ac3_dynrnge"); | |
3435 | Skip_S1(8, "ac3_dynrng1"); | |
3436 | Skip_S1(8, "ac3_dynrng2"); | |
3437 | Skip_S1(8, "ac3_dynrng3"); | |
3438 | Skip_S1(8, "ac3_dynrng4"); | |
3439 | Element_End0(); | |
3440 | } | |
3441 | for (int8u program=0; program<DolbyE_Programs[program_config]; program++) | |
3442 | { | |
3443 | Element_Begin1("per program"); | |
3444 | bool ac3_addbsie; | |
3445 | Get_SB ( ac3_addbsie, "ac3_addbsie"); | |
3446 | if (ac3_addbsie) | |
3447 | { | |
3448 | int8u ac3_addbsil; | |
3449 | Get_S1 (6, ac3_addbsil, "ac3_addbsil"); | |
3450 | for (int8u Pos=0; Pos<ac3_addbsil+1; Pos++) | |
3451 | Skip_S1(8, "ac3_addbsi[x]"); | |
3452 | } | |
3453 | Element_End0(); | |
3454 | } | |
1033 | 3455 | } |
1034 | 3456 | |
1035 | 3457 | //*************************************************************************** |
40 | 40 | private : |
41 | 41 | //Streams management |
42 | 42 | void Streams_Fill(); |
43 | void Streams_Fill_PerProgram(); | |
43 | 44 | void Streams_Finish(); |
44 | 45 | |
45 | 46 | //Buffer - Synchro |
46 | 47 | bool Synchronize(); |
47 | 48 | bool Synched_Test(); |
48 | 49 | |
50 | //Buffer - Global | |
51 | void Read_Buffer_Unsynched(); | |
52 | ||
49 | 53 | //Buffer - Per element |
50 | 54 | void Header_Parse(); |
51 | 55 | void Data_Parse(); |
52 | 56 | |
53 | 57 | //Elements |
54 | void Block(); | |
58 | void sync_segment(); | |
59 | void metadata_segment(); | |
60 | void audio_segment(); | |
61 | void metadata_extension_segment(); | |
62 | void audio_extension_segment(); | |
63 | void meter_segment(); | |
64 | void ac3_metadata_subsegment(bool xbsi); | |
65 | ||
66 | //Evolution | |
67 | void guard_band(); | |
68 | void intelligent_loudness_evolution_data_segment(); | |
69 | void evo_frame(); | |
70 | void evo_payload_config(); | |
71 | void evo_protection(); | |
72 | void object_audio_metadata_payload(); | |
73 | void program_assignment(); | |
74 | void oa_element_md(bool b_alternate_object_data_present); | |
75 | void object_element(); | |
76 | void md_update_info(int8u& num_obj_info_blocks_bits); | |
77 | void block_update_info(); | |
78 | void object_data(int8u obj_idx, int8u num_obj_info_blocks_bits); | |
79 | void object_info_block(int8u obj_idx, int8u blk); | |
80 | void object_basic_info(int8u object_basic_info_array, int8u blk); | |
81 | void object_render_info(int8u object_render_info_status_idx, int8u blk); | |
82 | void Get_V4 (int8u Bits, int32u& Info, const char* Name); | |
83 | void Skip_V4(int8u Bits, const char* Name); | |
84 | void Get_V4 (int8u Bits, int8u MaxLoops, int32u& Info, const char* Name); | |
85 | int32u Guardband_EMDF_PresentAndSize; | |
86 | int8u object_count; | |
87 | vector<bool> b_object_in_bed_or_isf; | |
88 | vector<int32u> nonstd_bed_channel_assignment_masks; | |
89 | int32u num_desc_packets_m1; | |
90 | vector<uint8_t> description_packet_data; | |
91 | void mgi_payload(); | |
92 | void Streams_Fill_ED2(); | |
93 | struct dyn_object | |
94 | { | |
95 | int8u sound_category; | |
96 | struct dyn_object_alt | |
97 | { | |
98 | int8u pos3d_x_bits; | |
99 | int8u pos3d_y_bits; | |
100 | bool pos3d_z_sig; | |
101 | int8u pos3d_z_bits; | |
102 | int8s obj_gain_db; // In dB, INT8_MAX = Not available, INT8_MIN = Infinite | |
103 | int8u hp_render_mode; | |
104 | }; | |
105 | vector<dyn_object_alt> Alts; | |
106 | }; | |
107 | vector<dyn_object> ObjectElements; // OAMD | |
108 | vector<dyn_object> DynObjects; | |
109 | struct bed_instance | |
110 | { | |
111 | struct bed_alt | |
112 | { | |
113 | int8s bed_gain_db; // In dB, INT8_MAX = Not available, INT8_MIN = Infinite | |
114 | }; | |
115 | vector<bed_alt> Alts; | |
116 | }; | |
117 | vector<bed_instance> BedInstances; | |
118 | struct preset | |
119 | { | |
120 | int32u default_target_device_config; | |
121 | struct target_device_config | |
122 | { | |
123 | int32u target_devices_mask; | |
124 | vector<int32u> md_indexes; | |
125 | }; | |
126 | vector<target_device_config> target_device_configs; | |
127 | }; | |
128 | vector<preset> Presets; | |
129 | struct preset_more | |
130 | { | |
131 | string description; | |
132 | }; | |
133 | vector<preset_more> Presets_More; | |
134 | struct substream_mapping | |
135 | { | |
136 | int8u substream_id; | |
137 | int32u channel_index; | |
138 | }; | |
139 | vector<substream_mapping> substream_mappings; | |
140 | ||
55 | 141 | |
56 | 142 | //Helpers |
57 | 143 | void Descramble_20bit(int32u key, int16u size); |
58 | 144 | |
59 | 145 | //Temp |
60 | 146 | int64u SMPTE_time_code_StartTimecode; |
61 | int8u ProgramConfiguration; | |
62 | int8u FrameRate; | |
63 | int8u BitDepth; | |
64 | bool ScrambledBitStream; | |
65 | int8u* Descrambled_Buffer; //Used in case of scrambled bitstream | |
147 | int16u channel_subsegment_size[8]; | |
148 | int8u program_config; | |
149 | int8u metadata_extension_segment_size; | |
150 | int8u meter_segment_size; | |
151 | int8u frame_rate_code; | |
152 | int8u bit_depth; | |
153 | bool key_present; | |
154 | int8u* Descrambled_Buffer; //Used in case of key_present | |
155 | std::map<int64u, int64u> FrameSizes; | |
156 | std::map<int16u, int64u> channel_subsegment_sizes[8]; | |
66 | 157 | int64u GuardBand_Before_Initial; |
67 | 158 | int64u GuardBand_After_Initial; |
68 | 159 | struct description_text_value |
335 | 335 | Xing_Scale=0; |
336 | 336 | BitRate=0; |
337 | 337 | MpegPsPattern_Count=0; |
338 | VBR_Frames_IsCbr=false; | |
338 | 339 | } |
339 | 340 | |
340 | 341 | //*************************************************************************** |
463 | 464 | else |
464 | 465 | Divider=1152/8; |
465 | 466 | if (ID<4 && sampling_frequency<4) |
466 | BitRate=(int32u)(FrameLength*Mpega_SamplingRate[ID][sampling_frequency]/Divider); | |
467 | BitRate_Mode=__T("VBR"); | |
467 | BitRate=float32_int32s(FrameLength*Mpega_SamplingRate[ID][sampling_frequency]/Divider); | |
468 | BitRate_Mode=(VBR_Frames_IsCbr?__T("CBR"):__T("VBR")); | |
468 | 469 | } |
469 | 470 | //if (BitRate_Count.size()>1) |
470 | 471 | //{ |
1278 | 1279 | |
1279 | 1280 | //Parsing |
1280 | 1281 | if (FrameCount) |
1282 | { | |
1281 | 1283 | Get_B4 (VBR_Frames, "FrameCount"); //FrameCount exclude this frame |
1284 | VBR_Frames_IsCbr=(CC4(Xing_Header)==CC4("Info")); | |
1285 | } | |
1282 | 1286 | if (FileSize) |
1283 | 1287 | { |
1284 | 1288 | int32u VBR_FileSize_Temp; |
92 | 92 | bool padding_bit; |
93 | 93 | bool copyright; |
94 | 94 | bool original_home; |
95 | bool VBR_Frames_IsCbr; | |
95 | 96 | size_t MpegPsPattern_Count; |
96 | 97 | |
97 | 98 | //Helpers |
79 | 79 | PTS_DTS_Needed=true; |
80 | 80 | |
81 | 81 | //In |
82 | Frame_Count_Valid=4; | |
82 | Frame_Count_Valid=16; | |
83 | 83 | BitDepth=0; |
84 | 84 | BitDepth_Significant=0; |
85 | 85 | Channels=0; |
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
145 | Fill(Stream_Audio, 0, Audio_BitRate_Encoded, (5+bits_per_sample)*(1+number_channels)*8*48000); | |
145 | Fill(Stream_Audio, 0, Audio_BitRate_Encoded, (5+bits_per_sample)*(1+number_channels)*8*48000, 10, true); | |
146 | 146 | for (size_t Pos=1; Pos<Count_Get(Stream_Audio); Pos++) |
147 | Fill(Stream_Audio, Pos, Audio_BitRate_Encoded, 0); | |
147 | Fill(Stream_Audio, Pos, Audio_BitRate_Encoded, 0, 10, true); | |
148 | 148 | } |
149 | 149 | |
150 | 150 | //--------------------------------------------------------------------------- |
186 | 186 | Fill(Parser); |
187 | 187 | Merge(*Parser); |
188 | 188 | |
189 | int64u OverallBitRate=Parser->Retrieve(Stream_General, 0, General_OverallBitRate).To_int64u(); | |
190 | if (OverallBitRate) | |
191 | { | |
192 | OverallBitRate*=Element_Size; OverallBitRate/=Element_Size-Stream_Bits*4/8; | |
193 | OverallBitRate*=Container_Bits; | |
194 | OverallBitRate/=Stream_Bits; | |
195 | Fill(Stream_General, 0, General_OverallBitRate, OverallBitRate); | |
196 | } | |
197 | 189 | if (Parser->Count_Get(Stream_Audio)) |
190 | { | |
198 | 191 | FrameRate=Retrieve(Stream_Audio, 0, Audio_FrameRate).To_float64(); |
192 | float64 FrameRate_Int=float64_int64s(FrameRate); | |
193 | if (FrameRate>=FrameRate_Int/1.0015 && FrameRate<=FrameRate_Int/1.0005) | |
194 | FrameRate=FrameRate_Int/1.001; | |
195 | } | |
199 | 196 | } |
200 | 197 | else if (data_type!=(int8u)-1) |
201 | 198 | { |
207 | 204 | } |
208 | 205 | } |
209 | 206 | |
210 | // Guard band | |
211 | if (GuardBand_Before) // With guard band, there is big chances that AES3 bit rate is respected | |
212 | { | |
213 | Fill(Stream_General, 0, General_OverallBitRate, Container_Bits*2*48000); | |
214 | if (!IsSub && File_Size!=(int64u)-1) | |
215 | Fill(Stream_General, 0, General_Duration, ((float64)File_Size)*8/(Container_Bits*2*48000)*1000); | |
216 | } | |
217 | ||
218 | if (FrameRate && FrameSizes.size()==1) | |
219 | { | |
220 | Fill(Stream_General, 0, General_OverallBitRate, FrameSizes.begin()->first*8*FrameRate, 0, true); | |
207 | // Bit rate | |
208 | if (FrameRate) | |
209 | { | |
210 | size_t StartPosToClear=0; | |
211 | float64 FrameSize=0; | |
212 | ||
213 | if (FrameSizes.size()==1) | |
214 | { | |
215 | FrameSize=FrameSizes.begin()->first; | |
216 | } | |
217 | else if (FrameSizes.size()==2 && ((--FrameSizes.end())->first-FrameSizes.begin()->first)*4==Container_Bits && FrameSizes.begin()->second*3<=(--FrameSizes.end())->second*2 && (FrameSizes.begin()->second+1)*3>=(--FrameSizes.end())->second*2) | |
218 | { | |
219 | // Maybe NTSC frame rate and 48 kHz. | |
220 | FrameSize=FrameSizes.begin()->first+((float64)Container_Bits)/4*3/5; //2x small then 3x big | |
221 | } | |
222 | else | |
223 | { | |
224 | int64u FrameSize_Total=0; | |
225 | int64u FrameSize_Count=0; | |
226 | for (std::map<int64u, int64u>::iterator F=FrameSizes.begin(); F!=FrameSizes.end(); ++F) | |
227 | { | |
228 | FrameSize_Total+=F->first*F->second; | |
229 | FrameSize_Count+=F->second; | |
230 | } | |
231 | if (FrameSize_Count>=10) | |
232 | FrameSize=((float64)FrameSize_Total/FrameSize_Count); | |
233 | } | |
234 | ||
235 | if (FrameSize) | |
236 | { | |
237 | float64 BitRate=FrameSize*8*FrameRate; | |
238 | float64 BitRate_Theory=Container_Bits*2*48000; | |
239 | if (BitRate>=BitRate_Theory*0.999 && BitRate<=BitRate_Theory*1.001) | |
240 | BitRate=BitRate_Theory; | |
241 | Fill(Stream_General, 0, General_OverallBitRate, BitRate, 0, true); | |
242 | Fill(Stream_Audio, 0, Audio_BitRate_Encoded, BitRate, 0, true); | |
243 | StartPosToClear=1; | |
244 | } | |
245 | ||
246 | //Underlying encoded bit rate has no meaning | |
247 | if (StartPosToClear) | |
248 | { | |
249 | for (size_t i=StartPosToClear; i<Count_Get(Stream_Audio); i++) | |
250 | Fill(Stream_Audio, i, Audio_BitRate_Encoded, 0, 10, true); | |
251 | } | |
252 | else | |
253 | { | |
254 | for (size_t i=0; i<Count_Get(Stream_Audio); i++) | |
255 | Clear(Stream_Audio, i, Audio_BitRate_Encoded); | |
256 | } | |
221 | 257 | } |
222 | 258 | |
223 | 259 | for (size_t Pos=0; Pos<Count_Get(StreamKind_Last); Pos++) |
268 | 304 | Fill(StreamKind_Last, Pos, Fill_Parameter(StreamKind_Last, Generic_Duration), Retrieve(Stream_General, 0, General_Duration)); |
269 | 305 | } |
270 | 306 | } |
307 | } | |
308 | ||
309 | if (!IsSub && File_Size!=(int64u)-1) | |
310 | { | |
311 | Fill(Stream_Audio, 0, Audio_StreamSize_Encoded, File_Size, 10, true); | |
312 | for (size_t Pos=1; Pos<Count_Get(Stream_Audio); Pos++) | |
313 | Fill(Stream_Audio, Pos, Audio_StreamSize_Encoded, 0, 10, true); | |
271 | 314 | } |
272 | 315 | } |
273 | 316 | |
373 | 416 | // Synchronizing |
374 | 417 | while (Buffer_Offset+16<=Buffer_Size) |
375 | 418 | { |
376 | if (!Status[IsAccepted] && !IsSub && File_Offset_FirstSynched==(int64u)-1 && Buffer_TotalBytes+Buffer_Offset>=Buffer_TotalBytes_FirstSynched_Max) | |
419 | if (!Status[IsAccepted] && File_Offset_FirstSynched==(int64u)-1 && Buffer_TotalBytes+Buffer_Offset>=Buffer_TotalBytes_FirstSynched_Max) | |
377 | 420 | { |
378 | 421 | Reject(); |
379 | 422 | return false; |
1390 | 1433 | Buffer_Offset=Save_Buffer_Offset; |
1391 | 1434 | Buffer_Size=Save_Buffer_Size; |
1392 | 1435 | File_Offset-=Buffer_Offset; |
1393 | } | |
1394 | ||
1395 | // Guard band | |
1396 | GuardBand_Before=0; | |
1436 | Element_Size=Save_Element_Size; | |
1437 | } | |
1397 | 1438 | |
1398 | 1439 | FILLING_BEGIN(); |
1399 | FrameSizes[IsSub?Buffer_Size:((GuardBand_Before+Element_Size)*Container_Bits/Stream_Bits)]++; | |
1440 | if (Frame_Count) // Ignore first GuardBand_Before | |
1441 | FrameSizes[(IsSub && !GuardBand_Before && !GuardBand_After)?Buffer_Size:(GuardBand_Before+Element_Size+GuardBand_After)]++; | |
1400 | 1442 | |
1401 | 1443 | Frame_Count++; |
1402 | 1444 | if (Frame_Count_NotParsedIncluded!=(int64u)-1) |
1414 | 1456 | if (Parser==NULL || (Frame_Count>=2 && Parser->Status[IsFinished])) |
1415 | 1457 | Finish("SMPTE ST 337"); |
1416 | 1458 | FILLING_END(); |
1459 | ||
1460 | // Guard band | |
1461 | GuardBand_Before=0; | |
1417 | 1462 | } |
1418 | 1463 | |
1419 | 1464 | //*************************************************************************** |
2134 | 2134 | else |
2135 | 2135 | { |
2136 | 2136 | Buffer_Offset+=(size_t)Element_Offset; |
2137 | if (Buffer_Offset>Buffer_Size) | |
2138 | Buffer_Size=Buffer_Offset; | |
2137 | 2139 | Element_Offset=0; |
2138 | 2140 | } |
2139 | 2141 |
892 | 892 | }; |
893 | 893 | void Get_MasteringDisplayColorVolume(Ztring &MasteringDisplay_ColorPrimaries, Ztring &MasteringDisplay_Luminance, mastering_metadata_2086 &Meta); |
894 | 894 | #endif |
895 | #if defined(MEDIAINFO_MPEGPS_YES) || defined(MEDIAINFO_MPEGTS_YES) || defined(MEDIAINFO_MPEG4_YES) || defined(MEDIAINFO_MK_YES) | |
896 | void dvcC(bool has_dependency_pid=false, std::map<std::string, Ztring>* Infos=NULL); | |
897 | #endif | |
895 | 898 | |
896 | 899 | //*************************************************************************** |
897 | 900 | // Unknown |
781 | 781 | }; |
782 | 782 | void Get_MasteringDisplayColorVolume(Ztring &MasteringDisplay_ColorPrimaries, Ztring &MasteringDisplay_Luminance, mastering_metadata_2086 &Meta); |
783 | 783 | #endif |
784 | #if defined(MEDIAINFO_MPEGPS_YES) || defined(MEDIAINFO_MPEGTS_YES) || defined(MEDIAINFO_MPEG4_YES) || defined(MEDIAINFO_MK_YES) | |
785 | void dvcC(bool has_dependency_pid=false, std::map<std::string, Ztring>* Infos=NULL); | |
786 | #endif | |
784 | 787 | |
785 | 788 | //*************************************************************************** |
786 | 789 | // Unknown |
149 | 149 | MasteringDisplay_Luminance= __T("min: ")+Ztring::ToZtring(((float64)Meta.Luminance[0])/10000, 4) |
150 | 150 | +__T(" cd/m2, max: ")+Ztring::ToZtring(((float64)Meta.Luminance[1])/10000, (Meta.Luminance[1]-((int)Meta.Luminance[1])==0)?0:4) |
151 | 151 | +__T(" cd/m2"); |
152 | } | |
153 | #endif | |
154 | ||
155 | //--------------------------------------------------------------------------- | |
156 | #if defined(MEDIAINFO_HEVC_YES) || defined(MEDIAINFO_MPEG4_YES) || defined(MEDIAINFO_MATROSKA_YES) | |
157 | static const size_t DolbyVision_Profiles_Size=10; | |
158 | static const char* DolbyVision_Profiles[DolbyVision_Profiles_Size] = // dv[BL_codec_type].[number_of_layers][bit_depth][cross-compatibility] | |
159 | { | |
160 | "dvav", | |
161 | "dvav", | |
162 | "dvhe", | |
163 | "dvhe", | |
164 | "dvhe", | |
165 | "dvhe", | |
166 | "dvhe", | |
167 | "dvhe", | |
168 | "dvhe", | |
169 | "dvav", | |
170 | }; | |
171 | ||
172 | extern const size_t DolbyVision_Compatibility_Size = 7; | |
173 | extern const char* DolbyVision_Compatibility[DolbyVision_Compatibility_Size] = | |
174 | { | |
175 | "", | |
176 | "HDR10", | |
177 | "SDR", | |
178 | NULL, | |
179 | "HLG", | |
180 | NULL, | |
181 | "Blu-ray", | |
182 | }; | |
183 | void File__Analyze::dvcC(bool has_dependency_pid, std::map<std::string, Ztring>* Infos) | |
184 | { | |
185 | Element_Name("Dolby Vision Configuration"); | |
186 | ||
187 | //Parsing | |
188 | int8u dv_version_major, dv_version_minor, dv_profile, dv_level, dv_bl_signal_compatibility_id; | |
189 | bool rpu_present_flag, el_present_flag, bl_present_flag; | |
190 | Get_B1 (dv_version_major, "dv_version_major"); | |
191 | if (dv_version_major && dv_version_major<=2) //Spec says nothing, we hope that a minor version change means that the stream is backward compatible | |
192 | { | |
193 | Get_B1 (dv_version_minor, "dv_version_minor"); | |
194 | BS_Begin(); | |
195 | size_t End=Data_BS_Remain(); | |
196 | if (End>=176) | |
197 | End-=176; | |
198 | else | |
199 | End=0; // Not enough place for reserved bits, but we currently ignore such case, just considered as unknown | |
200 | Get_S1 (7, dv_profile, "dv_profile"); | |
201 | Get_S1 (6, dv_level, "dv_level"); | |
202 | Get_SB ( rpu_present_flag, "rpu_present_flag"); | |
203 | Get_SB ( el_present_flag, "el_present_flag"); | |
204 | Get_SB ( bl_present_flag, "bl_present_flag"); | |
205 | if (has_dependency_pid && !bl_present_flag) | |
206 | { | |
207 | Skip_S2(13, "dependency_pid"); | |
208 | Skip_S1( 3, "reserved"); | |
209 | } | |
210 | if (Data_BS_Remain()) | |
211 | { | |
212 | Get_S1 (4, dv_bl_signal_compatibility_id, "dv_bl_signal_compatibility_id"); // in dv_version_major 2 only if based on specs but it was confirmed to be seen in dv_version_major 1 too and it does not hurt (value 0 means no new display) | |
213 | if (End<Data_BS_Remain()) | |
214 | Skip_BS(Data_BS_Remain()-End, "reserved"); | |
215 | } | |
216 | else | |
217 | dv_bl_signal_compatibility_id=0; | |
218 | BS_End(); | |
219 | } | |
220 | Skip_XX(Element_Size-Element_Offset, "Unknown"); | |
221 | ||
222 | FILLING_BEGIN(); | |
223 | if (Infos) | |
224 | (*Infos)["HDR_Format"].From_UTF8("Dolby Vision"); | |
225 | else | |
226 | Fill(Stream_Video, StreamPos_Last, Video_HDR_Format, "Dolby Vision"); | |
227 | if (dv_version_major && dv_version_major<=2) | |
228 | { | |
229 | Ztring Summary=Ztring::ToZtring(dv_version_major)+__T('.')+Ztring::ToZtring(dv_version_minor); | |
230 | if (Infos) | |
231 | (*Infos)["HDR_Format_Version"]=Summary; | |
232 | else | |
233 | Fill(Stream_Video, StreamPos_Last, Video_HDR_Format_Version, Summary); | |
234 | string Profile, Level; | |
235 | if (dv_profile<DolbyVision_Profiles_Size) | |
236 | Profile+=DolbyVision_Profiles[dv_profile]; | |
237 | else | |
238 | Profile+=Ztring().From_CC1(dv_profile).To_UTF8(); | |
239 | Profile+=__T('.'); | |
240 | Profile+=Ztring().From_CC1(dv_profile).To_UTF8(); | |
241 | Level+=Ztring().From_CC1(dv_level).To_UTF8(); | |
242 | if (Infos) | |
243 | { | |
244 | (*Infos)["HDR_Format_Profile"].From_UTF8(Profile); | |
245 | (*Infos)["HDR_Format_Level"].From_UTF8(Level); | |
246 | } | |
247 | else | |
248 | { | |
249 | Fill(Stream_Video, StreamPos_Last, Video_HDR_Format_Profile, Profile); | |
250 | Fill(Stream_Video, StreamPos_Last, Video_HDR_Format_Level, Level); | |
251 | } | |
252 | Summary += __T(','); | |
253 | Summary+=__T(' '); | |
254 | Summary+=Ztring().From_UTF8(Profile); | |
255 | Summary+=__T('.'); | |
256 | Summary+=Ztring().From_UTF8(Level); | |
257 | ||
258 | string Layers; | |
259 | if (rpu_present_flag|el_present_flag|bl_present_flag) | |
260 | { | |
261 | Summary+=','; | |
262 | Summary+=' '; | |
263 | if (bl_present_flag) | |
264 | Layers +="BL+"; | |
265 | if (el_present_flag) | |
266 | Layers +="EL+"; | |
267 | if (rpu_present_flag) | |
268 | Layers +="RPU+"; | |
269 | Layers.resize(Layers.size()-1); | |
270 | Summary+=Ztring().From_UTF8(Layers); | |
271 | } | |
272 | if (Infos) | |
273 | (*Infos)["HDR_Format_Settings"].From_UTF8(Layers); | |
274 | else | |
275 | Fill(Stream_Video, StreamPos_Last, Video_HDR_Format_Settings, Layers); | |
276 | if (dv_bl_signal_compatibility_id) | |
277 | { | |
278 | string Compatibility; | |
279 | if (dv_bl_signal_compatibility_id<DolbyVision_Compatibility_Size && DolbyVision_Compatibility[dv_bl_signal_compatibility_id]) | |
280 | Compatibility=DolbyVision_Compatibility[dv_bl_signal_compatibility_id]; | |
281 | else | |
282 | Compatibility=Ztring().From_Number(dv_bl_signal_compatibility_id).To_UTF8(); | |
283 | if (Infos) | |
284 | (*Infos)["HDR_Format_Compatibility"].From_UTF8(Compatibility); | |
285 | else | |
286 | Fill(Stream_Video, StreamPos_Last, Video_HDR_Format_Compatibility, Compatibility); | |
287 | } | |
288 | } | |
289 | else | |
290 | if (Infos) | |
291 | (*Infos)["HDR_Format_Version"]=Ztring::ToZtring(dv_version_major); | |
292 | else | |
293 | Fill(Stream_Video, StreamPos_Last, Video_HDR_Format_Version, dv_version_major); | |
294 | FILLING_END(); | |
152 | 295 | } |
153 | 296 | #endif |
154 | 297 |
641 | 641 | if (Duration==0) |
642 | 642 | Duration=Retrieve(StreamKind, Pos, Fill_Parameter(StreamKind, Generic_Duration)).To_float64(); |
643 | 643 | int64u StreamSize_Encoded=Retrieve(StreamKind, Pos, Fill_Parameter(StreamKind, Generic_StreamSize_Encoded)).To_int64u(); |
644 | if (Duration>0 && StreamSize_Encoded>0) | |
644 | if (Duration>0) | |
645 | 645 | Fill(StreamKind, Pos, Fill_Parameter(StreamKind, Generic_BitRate_Encoded), StreamSize_Encoded*8*1000/Duration, 0); |
646 | 646 | } |
647 | 647 | |
657 | 657 | //StreamSize from BitRate and Duration |
658 | 658 | if (StreamKind!=Stream_Other && Retrieve(StreamKind, Pos, Fill_Parameter(StreamKind, Generic_StreamSize)).empty() && !Retrieve(StreamKind, Pos, "BitRate").empty() && !Retrieve(StreamKind, Pos, Fill_Parameter(StreamKind, Generic_Duration)).empty() && Retrieve(StreamKind, Pos, "BitRate").find(__T(" / "))==std::string::npos) //If not done the first time or by other routine |
659 | 659 | { |
660 | int64u BitRate=Retrieve(StreamKind, Pos, "BitRate").To_int64u(); | |
661 | int64u Duration=Retrieve(StreamKind, Pos, Fill_Parameter(StreamKind, Generic_Duration)).To_int64u(); | |
660 | float64 BitRate=Retrieve(StreamKind, Pos, "BitRate").To_float64(); | |
661 | float64 Duration=Retrieve(StreamKind, Pos, Fill_Parameter(StreamKind, Generic_Duration)).To_float64(); | |
662 | 662 | if (BitRate>0 && Duration>0) |
663 | Fill(StreamKind, Pos, Fill_Parameter(StreamKind, Generic_StreamSize), BitRate*Duration/8/1000); | |
663 | { | |
664 | float64 StreamSize=BitRate*Duration/8/1000; | |
665 | Fill(StreamKind, Pos, Fill_Parameter(StreamKind, Generic_StreamSize), StreamSize, 0); | |
666 | } | |
664 | 667 | } |
665 | 668 | |
666 | 669 | //Bit rate and maximum bit rate |
991 | 994 | //--------------------------------------------------------------------------- |
992 | 995 | void File__Analyze::Streams_Finish_StreamOnly_Audio(size_t Pos) |
993 | 996 | { |
997 | // | |
998 | if (Retrieve(Stream_Audio, Pos, Audio_StreamSize_Encoded)==Retrieve(Stream_Audio, Pos, Audio_StreamSize)) | |
999 | Clear(Stream_Audio, Pos, Audio_StreamSize_Encoded); | |
1000 | if (Retrieve(Stream_Audio, Pos, Audio_BitRate_Encoded)==Retrieve(Stream_Audio, Pos, Audio_BitRate)) | |
1001 | Clear(Stream_Audio, Pos, Audio_BitRate_Encoded); | |
1002 | ||
1003 | //Dolby ED2 merge | |
1004 | if (Retrieve(Stream_Audio, Pos, Audio_Format)==__T("Dolby ED2")) | |
1005 | { | |
1006 | int64u BitRate=Retrieve(Stream_Audio, Pos, Audio_BitRate).To_int64u(); | |
1007 | int64u BitRate_Encoded=Retrieve(Stream_Audio, Pos, Audio_BitRate_Encoded).To_int64u(); | |
1008 | int64u StreamSize=Retrieve(Stream_Audio, Pos, Audio_StreamSize).To_int64u(); | |
1009 | int64u StreamSize_Encoded=Retrieve(Stream_Audio, Pos, Audio_StreamSize_Encoded).To_int64u(); | |
1010 | for (size_t i=Pos+1; i<Count_Get(Stream_Audio);) | |
1011 | { | |
1012 | size_t OtherID_Count; | |
1013 | Ztring OtherID; | |
1014 | Ztring OtherID_String; | |
1015 | if (Retrieve_Const(Stream_Audio, i, Audio_Format)==__T("Dolby ED2")) | |
1016 | { | |
1017 | //if (Retrieve_Const(Stream_Audio, i, Audio_Channel_s_).To_int64u()) | |
1018 | if (!Retrieve_Const(Stream_Audio, i, "Presentation0").empty()) | |
1019 | break; // It is the next ED2 | |
1020 | OtherID_Count=0; | |
1021 | OtherID=Retrieve(Stream_Audio, i, Audio_ID); | |
1022 | OtherID_String =Retrieve(Stream_Audio, i, Audio_ID_String); | |
1023 | } | |
1024 | if (i+7<Count_Get(Stream_Audio) // 8 tracks Dolby E | |
1025 | && Retrieve_Const(Stream_Audio, i , Audio_Format)==__T("Dolby E") | |
1026 | && Retrieve_Const(Stream_Audio, i+7, Audio_Format)==__T("Dolby E")) | |
1027 | { | |
1028 | Ztring NextID=Retrieve_Const(Stream_Audio, i, Audio_ID); | |
1029 | size_t NextID_DashPos=NextID.rfind(__T('-')); | |
1030 | if (NextID_DashPos!=(size_t)-1) | |
1031 | NextID.erase(NextID_DashPos); | |
1032 | if (Retrieve_Const(Stream_Audio, i+7, Audio_ID)==NextID+__T("-8")) | |
1033 | { | |
1034 | OtherID_Count=7; | |
1035 | OtherID=NextID; | |
1036 | } | |
1037 | NextID=Retrieve_Const(Stream_Audio, i, Audio_ID_String); | |
1038 | NextID_DashPos=NextID.rfind(__T('-')); | |
1039 | if (NextID_DashPos!=(size_t)-1) | |
1040 | NextID.erase(NextID_DashPos); | |
1041 | if (Retrieve_Const(Stream_Audio, i+7, Audio_ID_String)==NextID+__T("-8")) | |
1042 | { | |
1043 | OtherID_String=NextID; | |
1044 | } | |
1045 | } | |
1046 | if (OtherID.empty()) | |
1047 | break; | |
1048 | ||
1049 | size_t OtherID_DashPos=OtherID.rfind(__T('-')); | |
1050 | if (OtherID_DashPos!=(size_t)-1) | |
1051 | OtherID.erase(0, OtherID_DashPos+1); | |
1052 | if (!OtherID.empty() && OtherID[0]==__T('(') && OtherID[OtherID.size()-1]==__T(')')) | |
1053 | { | |
1054 | OtherID.resize(OtherID.size()-1); | |
1055 | OtherID.erase(0, 1); | |
1056 | } | |
1057 | Ztring ID=Retrieve(Stream_Audio, Pos, Audio_ID); | |
1058 | if (!ID.empty() && ID[ID.size()-1]==__T(')')) | |
1059 | { | |
1060 | ID.resize(ID.size()-1); | |
1061 | ID+=__T(" / "); | |
1062 | ID+=OtherID; | |
1063 | ID+=__T(')'); | |
1064 | Fill(Stream_Audio, Pos, Audio_ID, ID, true); | |
1065 | } | |
1066 | else | |
1067 | { | |
1068 | Ztring CurrentID_String=Retrieve(Stream_Audio, Pos, Audio_ID_String); | |
1069 | Fill(Stream_Audio, Pos, Audio_ID, OtherID); | |
1070 | Fill(Stream_Audio, Pos, Audio_ID_String, CurrentID_String+__T(" / ")+OtherID_String, true); | |
1071 | } | |
1072 | for (size_t j=i+OtherID_Count; j>=i; j--) | |
1073 | { | |
1074 | BitRate+=Retrieve(Stream_Audio, j, Audio_BitRate).To_int64u(); | |
1075 | BitRate_Encoded+=Retrieve(Stream_Audio, j, Audio_BitRate_Encoded).To_int64u(); | |
1076 | StreamSize+=Retrieve(Stream_Audio, j, Audio_StreamSize).To_int64u(); | |
1077 | StreamSize_Encoded+=Retrieve(Stream_Audio, j, Audio_StreamSize_Encoded).To_int64u(); | |
1078 | Stream_Erase(Stream_Audio, j); | |
1079 | } | |
1080 | ||
1081 | ZtringList List[6]; | |
1082 | for (size_t j=0; j<6; j++) | |
1083 | List[j].Separator_Set(0, __T(" / ")); | |
1084 | List[0].Write(Get(Stream_Menu, 0, __T("Format"))); | |
1085 | List[1].Write(Get(Stream_Menu, 0, __T("Format/String"))); | |
1086 | List[2].Write(Get(Stream_Menu, 0, __T("List_StreamKind"))); | |
1087 | List[3].Write(Get(Stream_Menu, 0, __T("List_StreamPos"))); | |
1088 | List[4].Write(Get(Stream_Menu, 0, __T("List"))); | |
1089 | List[5].Write(Get(Stream_Menu, 0, __T("List/String"))); | |
1090 | bool IsNok=false; | |
1091 | for (size_t j=0; j<6; j++) | |
1092 | if (!List[j].empty() && List[j].size()!=List[3].size()) | |
1093 | IsNok=true; | |
1094 | if (!IsNok && !List[2].empty() && List[2].size()==List[3].size()) | |
1095 | { | |
1096 | size_t Audio_Begin; | |
1097 | for (Audio_Begin=0; Audio_Begin <List[2].size(); Audio_Begin++) | |
1098 | if (List[2][Audio_Begin]==__T("2")) | |
1099 | break; | |
1100 | if (Audio_Begin!=List[2].size()) | |
1101 | { | |
1102 | for (size_t j=0; j<6; j++) | |
1103 | if (!List[j].empty()) | |
1104 | List[j].erase(List[j].begin()+Audio_Begin+i); | |
1105 | size_t Audio_End; | |
1106 | for (Audio_End=Audio_Begin+1; Audio_End<List[2].size(); Audio_End++) | |
1107 | if (List[2][Audio_End]!=__T("2")) | |
1108 | break; | |
1109 | for (size_t j=Audio_Begin+i; j<Audio_End; j++) | |
1110 | List[3][j].From_Number(List[3][j].To_int32u()-1-OtherID_Count); | |
1111 | Fill(Stream_Menu, 0, "Format", List[0].Read(), true); | |
1112 | Fill(Stream_Menu, 0, "Format/String", List[1].Read(), true); | |
1113 | Fill(Stream_Menu, 0, "List_StreamKind", List[2].Read(), true); | |
1114 | Fill(Stream_Menu, 0, "List_StreamPos", List[3].Read(), true); | |
1115 | Fill(Stream_Menu, 0, "List", List[4].Read(), true); | |
1116 | Fill(Stream_Menu, 0, "List/String", List[5].Read(), true); | |
1117 | } | |
1118 | } | |
1119 | } | |
1120 | if (BitRate) | |
1121 | Fill(Stream_Audio, Pos, Audio_BitRate, BitRate, 10, true); | |
1122 | if (BitRate_Encoded) | |
1123 | Fill(Stream_Audio, Pos, Audio_BitRate_Encoded, BitRate_Encoded, 10, true); | |
1124 | if (StreamSize) | |
1125 | Fill(Stream_Audio, Pos, Audio_StreamSize, StreamSize, 10, true); | |
1126 | if (StreamSize_Encoded) | |
1127 | Fill(Stream_Audio, Pos, Audio_StreamSize_Encoded, StreamSize_Encoded, 10, true); | |
1128 | } | |
1129 | ||
994 | 1130 | //Channels |
995 | 1131 | if (Retrieve(Stream_Audio, Pos, Audio_Channel_s_).empty()) |
996 | 1132 | { |
1005 | 1141 | //SamplingCount |
1006 | 1142 | if (Retrieve(Stream_Audio, Pos, Audio_SamplingCount).empty()) |
1007 | 1143 | { |
1008 | int64s Duration=Retrieve(Stream_Audio, Pos, Audio_Duration).To_int64s(); | |
1144 | float64 Duration=Retrieve(Stream_Audio, Pos, Audio_Duration).To_float64(); | |
1009 | 1145 | bool DurationFromGeneral; |
1010 | 1146 | if (Duration==0) |
1011 | 1147 | { |
1012 | Duration=Retrieve(Stream_General, 0, General_Duration).To_int64s(); | |
1148 | Duration=Retrieve(Stream_General, 0, General_Duration).To_float64(); | |
1013 | 1149 | DurationFromGeneral=Retrieve(Stream_General, 0, General_Format)!=Retrieve(Stream_Audio, Pos, Audio_Format); |
1014 | 1150 | } |
1015 | 1151 | else |
1016 | 1152 | DurationFromGeneral=false; |
1017 | float SamplingRate=Retrieve(Stream_Audio, Pos, Audio_SamplingRate).To_float32(); | |
1153 | float64 SamplingRate=Retrieve(Stream_Audio, Pos, Audio_SamplingRate).To_float64(); | |
1018 | 1154 | if (Duration && SamplingRate) |
1019 | 1155 | { |
1020 | Fill(Stream_Audio, Pos, Audio_SamplingCount, ((float64)Duration)/1000*SamplingRate, 0); | |
1156 | Fill(Stream_Audio, Pos, Audio_SamplingCount, Duration/1000*SamplingRate, 0); | |
1021 | 1157 | if (DurationFromGeneral && Retrieve_Const(Stream_Audio, Pos, Audio_Format)!=Retrieve_Const(Stream_General, 0, General_Format)) |
1022 | 1158 | { |
1023 | 1159 | Fill(Stream_Audio, Pos, "SamplingCount_Source", "General_Duration"); |
1076 | 1212 | } |
1077 | 1213 | |
1078 | 1214 | //Duration |
1079 | if (Retrieve(Stream_Audio, Pos, Audio_Duration).empty() && Retrieve(Stream_Audio, Pos, Audio_SamplingRate).To_int64u()!=0) | |
1080 | { | |
1081 | int64u Duration=Retrieve(Stream_Audio, Pos, Audio_SamplingCount).To_int64u()*1000/Retrieve(Stream_Audio, Pos, Audio_SamplingRate).To_int64u(); | |
1215 | if (Retrieve(Stream_Audio, Pos, Audio_Duration).empty()) | |
1216 | { | |
1217 | float64 SamplingRate=Retrieve(Stream_Audio, Pos, Audio_SamplingRate).To_float64(); | |
1218 | if (SamplingRate) | |
1219 | { | |
1220 | float64 Duration=Retrieve(Stream_Audio, Pos, Audio_SamplingCount).To_float64()*1000/SamplingRate; | |
1221 | if (Duration) | |
1222 | { | |
1223 | Fill(Stream_Audio, Pos, Audio_Duration, Duration, 0); | |
1224 | Ztring Source=Retrieve(Stream_Audio, Pos, "SamplingCount_Source"); | |
1225 | if (!Source.empty()) | |
1226 | { | |
1227 | Fill(Stream_Audio, Pos, "Duration_Source", Source); | |
1228 | Fill_SetOptions(Stream_Audio, Pos, "Duration_Source", "N NTN"); | |
1229 | } | |
1230 | } | |
1231 | } | |
1232 | } | |
1233 | ||
1234 | //Stream size | |
1235 | if (Retrieve(Stream_Audio, Pos, Audio_StreamSize).empty() && Retrieve(Stream_Audio, Pos, Audio_BitRate_Mode)==__T("CBR")) | |
1236 | { | |
1237 | float64 Duration=Retrieve(Stream_Audio, Pos, Audio_Duration).To_float64(); | |
1238 | float64 BitRate=Retrieve(Stream_Audio, Pos, Audio_BitRate).To_float64(); | |
1239 | if (Duration && BitRate) | |
1240 | Fill(Stream_Audio, Pos, Audio_StreamSize, Duration*BitRate/8/1000, 0, true); | |
1241 | } | |
1242 | if (Retrieve(Stream_Audio, Pos, Audio_StreamSize_Encoded).empty() && !Retrieve(Stream_Audio, Pos, Audio_BitRate_Encoded).empty() && Retrieve(Stream_Audio, Pos, Audio_BitRate_Mode)==__T("CBR")) | |
1243 | { | |
1244 | float64 Duration=Retrieve(Stream_Audio, Pos, Audio_Duration).To_float64(); | |
1245 | float64 BitRate_Encoded=Retrieve(Stream_Audio, Pos, Audio_BitRate_Encoded).To_float64(); | |
1082 | 1246 | if (Duration) |
1083 | { | |
1084 | Fill(Stream_Audio, Pos, Audio_Duration, Duration); | |
1085 | Ztring Source=Retrieve(Stream_Audio, Pos, "SamplingCount_Source"); | |
1086 | if (!Source.empty()) | |
1087 | { | |
1088 | Fill(Stream_Audio, Pos, "Duration_Source", Source); | |
1089 | Fill_SetOptions(Stream_Audio, Pos, "Duration_Source", "N NTN"); | |
1090 | } | |
1091 | } | |
1092 | } | |
1093 | ||
1094 | //Stream size | |
1095 | if (Retrieve(Stream_Audio, Pos, Audio_StreamSize).empty() && !Retrieve(Stream_Audio, Pos, Audio_BitRate).empty() && !Retrieve(Stream_Audio, Pos, Audio_Duration).empty() && Retrieve(Stream_Audio, Pos, Audio_BitRate_Mode)==__T("CBR")) | |
1096 | { | |
1097 | int64u Duration=Retrieve(Stream_Audio, Pos, Audio_Duration).To_int64u(); | |
1098 | int64u BitRate=Retrieve(Stream_Audio, Pos, Audio_BitRate).To_int64u(); | |
1099 | int64u BitRate_Encoded=Retrieve(Stream_Audio, Pos, Audio_BitRate_Encoded).To_int64u(); | |
1100 | if (Duration && BitRate) | |
1101 | Fill(Stream_Audio, Pos, Audio_StreamSize, Duration*BitRate/8/1000); | |
1102 | if (Duration && BitRate_Encoded) | |
1103 | Fill(Stream_Audio, Pos, Audio_StreamSize_Encoded, Duration*BitRate_Encoded/8/1000); | |
1247 | Fill(Stream_Audio, Pos, Audio_StreamSize_Encoded, Duration*BitRate_Encoded/8/1000, 0, true); | |
1104 | 1248 | } |
1105 | 1249 | |
1106 | 1250 | //CBR/VBR |
1365 | 1509 | for (size_t StreamKind_Pos=Stream_General+1; StreamKind_Pos<Stream_Menu; StreamKind_Pos++) |
1366 | 1510 | for (size_t Pos=0; Pos<Count_Get((stream_t)StreamKind_Pos); Pos++) |
1367 | 1511 | { |
1368 | int64u StreamXX_StreamSize=Retrieve((stream_t)StreamKind_Pos, Pos, Fill_Parameter((stream_t)StreamKind_Pos, Generic_StreamSize)).To_int64u(); | |
1512 | int64u StreamXX_StreamSize=0; | |
1513 | if (!Retrieve((stream_t)StreamKind_Pos, Pos, Fill_Parameter((stream_t)StreamKind_Pos, Generic_StreamSize_Encoded)).empty()) | |
1514 | StreamXX_StreamSize+=Retrieve((stream_t)StreamKind_Pos, Pos, Fill_Parameter((stream_t)StreamKind_Pos, Generic_StreamSize_Encoded)).To_int64u(); | |
1515 | else if (!Retrieve((stream_t)StreamKind_Pos, Pos, Fill_Parameter((stream_t)StreamKind_Pos, Generic_StreamSize)).empty()) | |
1516 | StreamXX_StreamSize+=Retrieve((stream_t)StreamKind_Pos, Pos, Fill_Parameter((stream_t)StreamKind_Pos, Generic_StreamSize)).To_int64u(); | |
1369 | 1517 | if (StreamXX_StreamSize>0 || StreamKind_Pos==Stream_Text) |
1370 | 1518 | StreamSize-=StreamXX_StreamSize; |
1371 | 1519 | else |
79 | 79 | #endif //MEDIAINFO_TRACE |
80 | 80 | StreamSource=IsStream; |
81 | 81 | |
82 | //In | |
83 | StreamKind=Stream_Max; | |
84 | ||
82 | 85 | //Temp |
83 | 86 | Signature_Parsed=false; |
84 | 87 | } |
101 | 104 | Fill(Stream_Video, StreamPos_Last, Video_FrameCount, Config->File_Names.size()); |
102 | 105 | } |
103 | 106 | else |
104 | Stream_Prepare(StreamKind_Last); | |
107 | Stream_Prepare(StreamKind==Stream_Max?StreamKind_Last:StreamKind); | |
105 | 108 | } |
106 | 109 | |
107 | 110 | //*************************************************************************** |
268 | 271 | { |
269 | 272 | Fill(StreamKind_Last, 0, "Width", Width); |
270 | 273 | Fill(StreamKind_Last, 0, "Height", Height); |
271 | int8u Resolution; | |
272 | switch (Colour_type) | |
273 | { | |
274 | case 0 : Resolution=Bit_depth; break; | |
275 | case 2 : Resolution=Bit_depth*3; break; | |
276 | case 3 : Resolution=Bit_depth; break; | |
277 | case 4 : Resolution=Bit_depth*2; break; | |
278 | case 6 : Resolution=Bit_depth*4; break; | |
279 | default: Resolution=0; | |
280 | } | |
281 | if (Resolution) | |
282 | Fill(StreamKind_Last, 0, "BitDepth", Resolution); | |
274 | string ColorSpace=(Colour_type&(1<<1))?"RGB":"Y"; | |
275 | if (Colour_type&(1<<2)) | |
276 | ColorSpace+='A'; | |
277 | Fill(StreamKind_Last, 0, "ColorSpace", ColorSpace); | |
278 | Fill(StreamKind_Last, 0, "BitDepth", Bit_depth); | |
283 | 279 | switch (Compression_method) |
284 | 280 | { |
285 | 281 | case 0 : |
286 | Fill(StreamKind_Last, 0, "Format_Compression", "LZ77"); | |
282 | Fill(StreamKind_Last, 0, "Format_Compression", "Deflate"); | |
287 | 283 | break; |
288 | 284 | default: ; |
289 | 285 | } |
30 | 30 | public : |
31 | 31 | //Constructor/Destructor |
32 | 32 | File_Png(); |
33 | ||
34 | //In | |
35 | stream_t StreamKind; | |
33 | 36 | |
34 | 37 | private : |
35 | 38 | //Streams management |
132 | 132 | { |
133 | 133 | |
134 | 134 | //--------------------------------------------------------------------------- |
135 | const Char* MediaInfo_Version=__T("MediaInfoLib - v20.08"); | |
135 | const Char* MediaInfo_Version=__T("MediaInfoLib - v20.09"); | |
136 | 136 | const Char* MediaInfo_Url=__T("http://MediaArea.net/MediaInfo"); |
137 | 137 | Ztring EmptyZtring; //Use it when we can't return a reference to a true Ztring |
138 | 138 | const Ztring EmptyZtring_Const; //Use it when we can't return a reference to a true Ztring, const version |
62 | 62 | " day1; day\n" |
63 | 63 | " day2; days\n" |
64 | 64 | " day3; days\n" |
65 | " dB0;0 dB\n" | |
65 | 66 | " dB1; dB\n" |
66 | 67 | " dB2; dB\n" |
67 | 68 | " dB3; dB\n" |
329 | 330 | "Date;Date\n" |
330 | 331 | "Debug;Debug\n" |
331 | 332 | "Decimal point;Decimal point\n" |
333 | "DefaultTargetDeviceConfig;Default target device config\n" | |
332 | 334 | "Delay;Delay\n" |
333 | 335 | "Delay_Source;Delay, origin\n" |
334 | 336 | "Delay_Source_Container;Container\n" |
905 | 907 | "Library;Muxing library\n" |
906 | 908 | "Lightness;Lightness\n" |
907 | 909 | "LineUpStart;Line Up Start\n" |
910 | "LinkedTo_Bed_Pos;Bed #s\n" | |
908 | 911 | "LinkedTo_Group_Pos;Group #s\n" |
912 | "LinkedTo_Object_Pos;Object #s\n" | |
909 | 913 | "LinkedTo_SignalGroup_Pos;Signal group #s\n" |
910 | 914 | "LinkedTo_Substream_Pos;Substream #s\n" |
911 | 915 | "List;List\n" |
1068 | 1072 | "PortableHeadphones;Portable headphones\n" |
1069 | 1073 | "PortableSpeakers;Portable speakers\n" |
1070 | 1074 | "Position;Position\n" |
1075 | "Position_Cartesian;Position (cartesian)\n" | |
1076 | "Position_Polar;Position (polar)\n" | |
1071 | 1077 | "Position_Total;Total\n" |
1072 | 1078 | "Preferences;Preferences\n" |
1073 | 1079 | "PreferredDownmix;Preferred downmix\n" |
1097 | 1103 | "Recorded_Location;Recorded location\n" |
1098 | 1104 | "Released_Date;Released date\n" |
1099 | 1105 | "RemixedBy;Remixed by\n" |
1106 | "RenderMode;Render mode\n" | |
1100 | 1107 | "ReplayGain_Gain;Replay gain\n" |
1101 | 1108 | "ReplayGain_Peak;Replay gain peak\n" |
1102 | 1109 | "Resolution;Resolution\n" |
1145 | 1152 | "SigningPresent;Signing Present\n" |
1146 | 1153 | "SignLanguage;Sign Language\n" |
1147 | 1154 | "Sort;Sorted by\n" |
1155 | "SoundCategory;Sound category\n" | |
1148 | 1156 | "SoundEngineer;Sound engineer\n" |
1149 | 1157 | "Source;Source\n" |
1150 | 1158 | "Source_Duration;Source duration\n" |
1173 | 1181 | "Subject;Subject\n" |
1174 | 1182 | "Substream;Substream\n" |
1175 | 1183 | "SubTrack;SubTrack\n" |
1184 | "SubtstreamIdChannel;Substream start ID & channel index\n" | |
1176 | 1185 | "Summary;Summary\n" |
1177 | 1186 | "Supported formats;Supported formats\n" |
1178 | 1187 | "Supported?;Supported?\n" |
1182 | 1191 | "SystemId;Id\n" |
1183 | 1192 | "Tagged_Application;Tagging application\n" |
1184 | 1193 | "Tagged_Date;Tagged date\n" |
1194 | "TargetDeviceConfig;Target device config\n" | |
1185 | 1195 | "Technician;Technician\n" |
1186 | 1196 | "TermsOfUse;Terms of use\n" |
1187 | 1197 | "TertiaryAudioLanguage;Tertiary Audio Language\n" |
1541 | 1541 | size_t Up_Pos=Name.find(__T(" LinkedTo_")); |
1542 | 1542 | size_t Up_Pos_End; |
1543 | 1543 | if (Up_Pos!=string::npos) |
1544 | Up_Pos_End=Name.find(__T("_Pos"), Up_Pos); | |
1544 | Up_Pos_End=Name.find(__T("_Pos"), Name.size()-4); | |
1545 | 1545 | if (Up_Pos!=string::npos && Up_Pos_End==Name.size()-4) |
1546 | 1546 | { |
1547 | 1547 | Ztring Up=Name.substr(Up_Pos); |
1583 | 1583 | ToSearch2+=__T(" Alt"); |
1584 | 1584 | ToSearch2+=ID2; |
1585 | 1585 | } |
1586 | ||
1587 | // Search the linked element | |
1586 | 1588 | for (size_t j=Pos+1; j<(*Stream_More)[StreamKind][StreamPos].size(); j++) |
1587 | 1589 | { |
1588 | if ((*Stream_More)[StreamKind][StreamPos][j][Info_Name]==ToSearch2) | |
1590 | if ((*Stream_More)[StreamKind][StreamPos][j][Info_Name]==ToSearch) | |
1589 | 1591 | { |
1590 | while (j<(*Stream_More)[StreamKind][StreamPos].size()) | |
1592 | // Append the sub-elements of the linked element | |
1593 | for (; j<(*Stream_More)[StreamKind][StreamPos].size(); j++) | |
1591 | 1594 | { |
1592 | if ((*Stream_More)[StreamKind][StreamPos][j][Info_Name].rfind(ToSearch2, ToSearch2.size())==0) | |
1595 | // Stop if not the linked element | |
1596 | if ((*Stream_More)[StreamKind][StreamPos][j][Info_Name].rfind(ToSearch, 0)==string::npos) | |
1597 | break; | |
1598 | ||
1599 | // Manage Alt parts when it is inside a list | |
1600 | Ztring ToSearchAlt=ToSearch+__T(" Alt"); | |
1601 | if ((*Stream_More)[StreamKind][StreamPos][j][Info_Name].rfind(ToSearchAlt, 0)!=string::npos) | |
1593 | 1602 | { |
1594 | Temp.push_back((*Stream_More)[StreamKind][StreamPos][j]); | |
1595 | Temp.back()[Info_Name].insert(0, SpacesCount, __T(' ')); | |
1596 | if (!ID2.empty()) | |
1603 | size_t NextChar=(*Stream_More)[StreamKind][StreamPos][j][Info_Name].find_first_not_of(__T("0123456789"), ToSearchAlt.size()); | |
1604 | if (NextChar==string::npos || (*Stream_More)[StreamKind][StreamPos][j][Info_Name][NextChar]==__T(' ')) | |
1597 | 1605 | { |
1598 | size_t k=Temp.back()[Info_Name].find(__T(" Alt")); | |
1599 | if (k!=(size_t)-1) | |
1606 | if (ID2.empty()) | |
1607 | continue; | |
1608 | ||
1609 | // Check if content is not in main and we have the right Alt | |
1610 | if ((*Stream_More)[StreamKind][StreamPos][j][Info_Name].rfind(ToSearch2, 0)==0 && (*Stream_More)[StreamKind][StreamPos][j][Info_Name].size()>=ToSearch2.size()) | |
1600 | 1611 | { |
1601 | if (Temp.back()[Info_Name].find(__T(' '), k+1)==(size_t)-1) | |
1612 | Ztring Name=ToSearch; | |
1613 | if ((*Stream_More)[StreamKind][StreamPos][j][Info_Name].size()>ToSearch2.size()) | |
1614 | Name+=__T(' ')+(*Stream_More)[StreamKind][StreamPos][j][Info_Name].substr(ToSearch2.size()+1); | |
1615 | size_t IsFound=(size_t)-1; | |
1616 | for (size_t k=Pos+1; k<j; k++) | |
1602 | 1617 | { |
1603 | size_t ValueFirstField=(*Stream_More)[StreamKind][StreamPos].Find(Temp.back()[Info_Name].substr(SpacesCount, k-SpacesCount)); | |
1604 | if (ValueFirstField!=(size_t)-1) | |
1618 | if ((*Stream_More)[StreamKind][StreamPos][k][Info_Name]==Name) | |
1605 | 1619 | { |
1606 | if (Temp.back()[Info_Text]==__T("Yes")) | |
1607 | Temp.back()[Info_Text].clear(); | |
1608 | if (!Temp.back()[Info_Text].empty()) | |
1609 | Temp.back()[Info_Text].insert(0, 1, __T(' ')); | |
1610 | Temp.back()[Info_Text].insert(0, (*Stream_More)[StreamKind][StreamPos][ValueFirstField][Info_Text]); | |
1620 | IsFound=k; | |
1621 | break; | |
1611 | 1622 | } |
1612 | 1623 | } |
1613 | Temp.back()[Info_Name][k]=__T('-'); | |
1624 | if (IsFound==(size_t)-1) | |
1625 | { | |
1626 | Temp.push_back((*Stream_More)[StreamKind][StreamPos][j]); | |
1627 | Temp.back()[Info_Name]=Name; | |
1628 | Temp.back()[Info_Name].insert(0, SpacesCount, __T(' ')); | |
1629 | } | |
1630 | } | |
1631 | ||
1632 | continue; | |
1633 | } | |
1634 | } | |
1635 | ||
1636 | // If Alt link, find the Alt element and replace the main element with the alt value | |
1637 | Ztring Found; | |
1638 | if (!ID2.empty()) | |
1639 | { | |
1640 | size_t Space=(*Stream_More)[StreamKind][StreamPos][j][Info_Name].rfind(__T(' ')); | |
1641 | if (Space!=string::npos || (*Stream_More)[StreamKind][StreamPos][j][Info_Name]==ToSearch) | |
1642 | { | |
1643 | Ztring ToSearch3=ToSearch2; | |
1644 | if (Space!=string::npos) | |
1645 | ToSearch3+=(*Stream_More)[StreamKind][StreamPos][j][Info_Name].substr(Space); | |
1646 | for (size_t k=Pos+1; k<(*Stream_More)[StreamKind][StreamPos].size(); k++) | |
1647 | { | |
1648 | if ((*Stream_More)[StreamKind][StreamPos][k][Info_Name]==ToSearch3) | |
1649 | { | |
1650 | Found=(*Stream_More)[StreamKind][StreamPos][k][Info_Text]; | |
1651 | if (k && !Temp.empty() | |
1652 | && Temp[Temp.size()-1][Info_Name].rfind(__T(" ChannelLayout" ))+14==Temp[Temp.size()-1][Info_Name].size() | |
1653 | && (*Stream_More)[StreamKind][StreamPos][k ][Info_Name].rfind(__T(" Position_Polar"))+15==(*Stream_More)[StreamKind][StreamPos][k ][Info_Name].size() | |
1654 | && (*Stream_More)[StreamKind][StreamPos][k-1][Info_Name].rfind(__T(" ChannelLayout" ))+14!=(*Stream_More)[StreamKind][StreamPos][k-1][Info_Name].size()) | |
1655 | { | |
1656 | Temp.resize(Temp.size()-1); | |
1657 | } | |
1658 | } | |
1614 | 1659 | } |
1615 | 1660 | } |
1616 | j++; | |
1617 | 1661 | } |
1618 | else if (j<(*Stream_More)[StreamKind][StreamPos].size() && (*Stream_More)[StreamKind][StreamPos][j][Info_Name].rfind(ToSearch, ToSearch.size())==0) | |
1619 | { | |
1620 | Temp.push_back((*Stream_More)[StreamKind][StreamPos][j]); | |
1662 | ||
1663 | // Append | |
1664 | Temp.push_back((*Stream_More)[StreamKind][StreamPos][j]); | |
1665 | if (!ID2.empty()) | |
1621 | 1666 | Temp.back()[Info_Name].insert(ToSearch.size(), __T("-Alt")+ID2); |
1622 | Temp.back()[Info_Name].insert(0, SpacesCount, __T(' ')); | |
1623 | j++; | |
1624 | } | |
1625 | else | |
1626 | break; | |
1667 | Temp.back()[Info_Name].insert(0, SpacesCount, __T(' ')); | |
1668 | if (!Found.empty()) | |
1669 | Temp.back()[Info_Text]=Found;; | |
1627 | 1670 | } |
1628 | 1671 | } |
1629 | 1672 | } |
1630 | 1673 | } |
1631 | 1674 | } |
1632 | else | |
1675 | else if (Up_Pos==string::npos || Name.size()<=11 || Name.find(__T("_Pos/String"), Name.size()-11)==Name.size()-11) | |
1633 | 1676 | Temp.push_back((*Stream_More)[StreamKind][StreamPos][Pos]); |
1634 | 1677 | |
1635 | 1678 | } |
1670 | 1713 | j=2; |
1671 | 1714 | else |
1672 | 1715 | j=1; |
1673 | if (!Nested && Spaces && Pos && i && i-j<=Track[Pos-1][Info_Name].size() && Name.substr(0, i-j)==Track[Pos-1][Info_Name].substr(0, i-j) && Info_Name_Text<Track[Pos-1].size() && Spaces-1<=Track[Pos-1][Info_Name_Text].find_first_not_of(__T(' '))) | |
1716 | size_t PosPrevious=Pos; | |
1717 | if (PosPrevious) | |
1718 | PosPrevious--; | |
1719 | while (PosPrevious && Track[PosPrevious][Info_Name][0]==__T(' ')) // avoid injected lines | |
1720 | PosPrevious--; | |
1721 | if (!Nested && Spaces && Pos && i && i-j<=Track[PosPrevious][Info_Name].size() && Name.substr(0, i-j)==Track[PosPrevious][Info_Name].substr(0, i-j) && Info_Name_Text<Track[PosPrevious].size() && Spaces-1<=Track[PosPrevious][Info_Name_Text].find_first_not_of(__T(' '))) | |
1674 | 1722 | Nested=true; |
1675 | 1723 | if (Nested) |
1676 | 1724 | Name.erase(0, i); |
521 | 521 | size_t Audio_Data_Errors_Count; |
522 | 522 | size_t* Audio_Data_Errors; |
523 | 523 | MediaInfo_int32u Captions_Errors; // bit 0 = parity issue |
524 | MediaInfo_int32u Coherency_Flags; // bit 0 = no pack sub, bit 1 = no pack vid, bit 2 = no pack aud, bit 3 = no data vid, bit 4 = no data aud, bit 5 = no vid source/control, bit 6 = no aud source/control | |
524 | 525 | }; |
525 | 526 | |
526 | 527 | /*-------------------------------------------------------------------------*/ |
413 | 413 | ShouldReturn=true; |
414 | 414 | if (StreamKind==Stream_Audio && (Parameter==__T("BedChannelConfiguration") || (Parameter.size()>=14 && Parameter.find(__T(" ChannelLayout"), Parameter.size()-14)!=string::npos))) |
415 | 415 | return ChannelLayout_2018_Rename(Value, StreamFormat); |
416 | if (StreamKind==Stream_Audio) | |
417 | { | |
418 | size_t ObjectPos=Parameter.find(__T("Object")); | |
419 | if (ObjectPos!=string::npos) | |
420 | { | |
421 | bool NoRename=false; | |
422 | if (ObjectPos && !(Parameter[ObjectPos-1]==__T(' '))) | |
423 | NoRename=true; | |
424 | if (ObjectPos+6>=Parameter.size() || !(Parameter[ObjectPos+6]>=__T('0') && Parameter[ObjectPos+6]<=__T('9'))) | |
425 | NoRename=true; | |
426 | if (!NoRename) | |
427 | { | |
428 | size_t SpacePos=Parameter.find(__T(' '), ObjectPos); | |
429 | if (SpacePos==string::npos) | |
430 | return ChannelLayout_2018_Rename(Value, StreamFormat); | |
431 | } | |
432 | } | |
433 | size_t AltPos=Parameter.find(__T("Alt")); | |
434 | if (AltPos!=string::npos) | |
435 | { | |
436 | bool NoRename=false; | |
437 | if (AltPos && !(Parameter[AltPos-1]==__T(' '))) | |
438 | NoRename=true; | |
439 | if (AltPos+3>=Parameter.size() || !(Parameter[AltPos+3]>=__T('0') && Parameter[AltPos+3]<=__T('9'))) | |
440 | NoRename=true; | |
441 | if (!NoRename) | |
442 | { | |
443 | size_t SpacePos=Parameter.find(__T(' '), AltPos); | |
444 | if (SpacePos==string::npos) | |
445 | return ChannelLayout_2018_Rename(Value, StreamFormat); | |
446 | } | |
447 | } | |
448 | size_t BedPos=Parameter.find(__T("Bed")); | |
449 | if (BedPos!=string::npos) | |
450 | { | |
451 | bool NoRename=false; | |
452 | if (BedPos && !(Parameter[BedPos-1]==__T(' '))) | |
453 | NoRename=true; | |
454 | if (BedPos+3>=Parameter.size() || !(Parameter[BedPos+3]>=__T('0') && Parameter[BedPos+3]<=__T('9'))) | |
455 | NoRename=true; | |
456 | if (!NoRename) | |
457 | { | |
458 | size_t SpacePos=Parameter.find(__T(' '), BedPos); | |
459 | if (SpacePos==string::npos) | |
460 | return ChannelLayout_2018_Rename(Value, StreamFormat); | |
461 | } | |
462 | } | |
463 | } | |
416 | 464 | ShouldReturn=ShouldReturn_Save; |
417 | 465 | return Value; |
418 | 466 | } |
242 | 242 | std::vector<size_t> Video_STA_Errors_Total; //Per STA type |
243 | 243 | static const size_t ChannelGroup_Count=2; |
244 | 244 | static const size_t Dseq_Count=16; |
245 | bitset<64> Captions_Flags; | |
245 | bitset<32> Captions_Flags; | |
246 | enum coherency | |
247 | { | |
248 | Coherency_PackInSub, | |
249 | Coherency_PackInVid, | |
250 | Coherency_PackInAud, | |
251 | Coherency_DataInVid, | |
252 | Coherency_DataInAud, | |
253 | Coherency_video_source, | |
254 | Coherency_video_control, | |
255 | Coherency_audio_source, | |
256 | Coherency_audio_control, | |
257 | }; | |
258 | bitset<32> Coherency_Flags; | |
246 | 259 | std::vector<std::vector<int8u> > audio_source_mode; //Per ChannelGroup and Dseq, -1 means not present |
247 | 260 | bitset<ChannelGroup_Count*2> ChannelInfo; |
248 | 261 | std::vector<std::vector<size_t> > Audio_Errors; //Per ChannelGroup and Dseq |
87 | 87 | for (size_t Pos=0; Pos<48; Pos+=8) |
88 | 88 | { |
89 | 89 | int8u PackType=Buffer[Buffer_Offset+3+Pos+3]; |
90 | if (PackType!=0xFF) | |
91 | Coherency_Flags.set(Coherency_PackInSub); | |
92 | ||
90 | 93 | //dv_timecode |
91 | 94 | if (PackType==0x13) //Pack type=0x13 (dv_timecode) |
92 | 95 | { |
220 | 223 | for (size_t Pos=0; Pos<15*5; Pos+=5) |
221 | 224 | { |
222 | 225 | int8u PackType=Buffer[Buffer_Offset+3+Pos]; |
226 | if (PackType!=0xFF) | |
227 | Coherency_Flags.set(Coherency_PackInVid); | |
228 | ||
223 | 229 | //video_source |
224 | 230 | if (PackType==0x60) //Pack type=0x60 (video_source) |
225 | 231 | { |
226 | 232 | system=(Buffer[Buffer_Offset+3+Pos+3]&0x20)==0x20?true:false; |
227 | 233 | video_source_stype=Buffer[Buffer_Offset+3+Pos+3]&0x1F; |
234 | Coherency_Flags.set(Coherency_video_source); | |
228 | 235 | } |
229 | 236 | //video_sourcecontrol |
230 | 237 | if (PackType==0x61) |
231 | 238 | { |
232 | 239 | aspect=(Buffer[Buffer_Offset+3+Pos+2]&0x7); |
240 | Coherency_Flags.set(Coherency_video_control); | |
233 | 241 | } |
234 | 242 | |
235 | 243 | //video_recdate |
317 | 325 | |
318 | 326 | case 0x60 : //SCT=3 (Audio) |
319 | 327 | { |
328 | int8u PackType=Buffer[Buffer_Offset+3+0]; | |
329 | if (PackType!=0xFF) | |
330 | Coherency_Flags.set(Coherency_PackInAud); | |
331 | ||
320 | 332 | //audio_source |
321 | if (Buffer[Buffer_Offset+3+0]==0x50) //audio_source | |
333 | if (PackType==0x50) //audio_source | |
322 | 334 | { |
323 | 335 | QU_FSC =(Buffer[Buffer_Offset+1 ]&0x08)?true:false; //FSC |
324 | 336 | QU_System =(Buffer[Buffer_Offset+3+3]&0x20)?true:false; //50/60 |
334 | 346 | if (audio_source_mode[ChannelGroup].empty()) |
335 | 347 | audio_source_mode[ChannelGroup].resize(Dseq_Count, (int8u)-1); |
336 | 348 | audio_source_mode[ChannelGroup][Dseq]=AUDIO_MODE; |
349 | Coherency_Flags.set(Coherency_audio_source); | |
337 | 350 | } |
338 | 351 | |
339 | 352 | //audio_source_control |
340 | if (Buffer[Buffer_Offset+3+0]==0x51) //audio_source_control | |
353 | if (PackType==0x51) //audio_source_control | |
341 | 354 | { |
342 | 355 | REC_ST =(Buffer[Buffer_Offset+3+2]&0x80)?true:false; |
343 | 356 | REC_END=(Buffer[Buffer_Offset+3+2]&0x40)?true:false; |
344 | 357 | REC_IsValid=true; |
358 | Coherency_Flags.set(Coherency_audio_source); | |
345 | 359 | } |
346 | 360 | |
347 | 361 | //audio_recdate |
348 | if (Buffer[Buffer_Offset+3+0]==0x52) //Pack type=0x52 (audio_rectime) | |
362 | if (PackType==0x52) //Pack type=0x52 (audio_rectime) | |
349 | 363 | { |
350 | 364 | int8u Days =((Buffer[Buffer_Offset+3+2]&0x30)>>4)*10 |
351 | 365 | + ((Buffer[Buffer_Offset+3+2]&0x0F) ) ; |
374 | 388 | } |
375 | 389 | |
376 | 390 | //audio_rectime |
377 | if (Buffer[Buffer_Offset+3+0]==0x53) //Pack type=0x53 (audio_rectime) | |
391 | if (PackType==0x53) //Pack type=0x53 (audio_rectime) | |
378 | 392 | { |
379 | 393 | int8u Frames =((Buffer[Buffer_Offset+3+1]&0x30)>>4)*10 |
380 | 394 | + ((Buffer[Buffer_Offset+3+1]&0x0F) ) ; |
1394 | 1408 | Event1.Errors=Event.Errors; |
1395 | 1409 | Event1.Video_STA_Errors_Count=Video_STA_Errors_ByDseq.size(); |
1396 | 1410 | Event1.Video_STA_Errors=Video_STA_Errors_ByDseq.empty()?NULL:&Video_STA_Errors_ByDseq[0]; |
1411 | size_t Video_Errors_PerSta[16]; //Per STA | |
1412 | memset(Video_Errors_PerSta, 0, sizeof(Video_Errors_PerSta)); | |
1413 | for (size_t i=0; i<Video_STA_Errors_ByDseq.size(); i++) | |
1414 | Video_Errors_PerSta[i%16]+=Video_STA_Errors_ByDseq[i]; | |
1415 | int MaxStaErrors=((DSF?1500:1350)*(FSC_WasSet?2:1)); | |
1416 | bool Video_StaNonZero=false; | |
1417 | for (size_t i=0; i<16; i++) | |
1418 | if (Video_Errors_PerSta[i]) | |
1419 | Video_StaNonZero=true; // Only if all from the same STA value | |
1420 | size_t Audio_TotalErrors=0; | |
1421 | size_t Audio_Errors_PerDseq[16]; //Per Dseq | |
1397 | 1422 | if (Audio_Errors.empty()) |
1398 | 1423 | { |
1399 | 1424 | Event1.Audio_Data_Errors_Count=0; |
1401 | 1426 | } |
1402 | 1427 | else |
1403 | 1428 | { |
1404 | size_t Audio_Errors_PerDseq[16]; //Per Dseq | |
1405 | 1429 | memset(Audio_Errors_PerDseq, 0, sizeof(Audio_Errors_PerDseq)); |
1406 | 1430 | for (size_t ChannelGroup=0; ChannelGroup<Audio_Errors.size(); ChannelGroup++) |
1407 | 1431 | for (size_t Dseq=0; Dseq<Dseq_Count; Dseq++) |
1408 | 1432 | Audio_Errors_PerDseq[Dseq]+=Audio_Errors[ChannelGroup][Dseq]; |
1433 | for (size_t Dseq=0; Dseq<Dseq_Count; Dseq++) | |
1434 | Audio_TotalErrors+=Audio_Errors_PerDseq[Dseq]; | |
1409 | 1435 | Event1.Audio_Data_Errors_Count=16; |
1410 | 1436 | Event1.Audio_Data_Errors=Audio_Errors_PerDseq; |
1411 | 1437 | } |
1412 | 1438 | Event1.Captions_Errors=Captions_Flags[1]?1:0; |
1413 | 1439 | Captions_Flags.reset(1); |
1440 | Event1.Coherency_Flags=(Coherency_Flags[Coherency_PackInSub]?0:(1<<0)) | |
1441 | | (Coherency_Flags[Coherency_PackInVid]?0:(1<<1)) | |
1442 | | (Coherency_Flags[Coherency_DataInAud]?0:(1<<2)) | |
1443 | | ((!Video_StaNonZero)?0:(1<<3)) | |
1444 | | ((Audio_TotalErrors<((DSF?100:90)*(FSC_WasSet?2:1)))?0:(1<<4)) | |
1445 | | ((Coherency_Flags[Coherency_video_source] && Coherency_Flags[Coherency_video_control])?0:(1<<5)) | |
1446 | | ((Coherency_Flags[Coherency_audio_source] && Coherency_Flags[Coherency_audio_control])?0:(1<<6)) | |
1447 | ; | |
1448 | Coherency_Flags.reset(); | |
1414 | 1449 | Config->Event_Send(NULL, (const int8u*)&Event1, sizeof(MediaInfo_Event_DvDif_Analysis_Frame_1)); |
1415 | 1450 | Config->Event_Send(NULL, (const int8u*)&Event, sizeof(MediaInfo_Event_DvDif_Analysis_Frame_0)); |
1416 | 1451 | #endif //MEDIAINFO_EVENTS |
487 | 487 | |
488 | 488 | for (std::map<std::string, Ztring>::iterator Info=Temp.Infos.begin(); Info!=Temp.Infos.end(); ++Info) |
489 | 489 | if (Info->first=="BitRate" && Temp.Parsers[0]->Count_Get(Stream_Audio)>1) |
490 | Fill(Stream_Audio, StreamPos_Last, Audio_BitRate_Encoded, Pos?Ztring(__T("0")):Info->second); // In case of more than 1 audio sub-stream Encoded bit rate is the bit rate of all streams + overhead | |
490 | Fill(Stream_Audio, StreamPos_Last, Audio_BitRate_Encoded, Pos?Ztring(__T("0")):Info->second, true); // In case of more than 1 audio sub-stream Encoded bit rate is the bit rate of all streams + overhead | |
491 | 491 | else if (Retrieve(Stream_Audio, StreamPos_Last, Info->first.c_str()).empty()) |
492 | 492 | Fill(Stream_Audio, StreamPos_Last, Info->first.c_str(), Info->second); |
493 | 493 | } |
310 | 310 | const int64u Segment_Tracks_TrackEntry_TrickTrackFlag=0x46; |
311 | 311 | const int64u Segment_Tracks_TrackEntry_TrickMasterTrackUID=0x47; |
312 | 312 | const int64u Segment_Tracks_TrackEntry_TrickMasterTrackSegmentUID=0x44; |
313 | const int64u Segment_Tracks_TrackEntry_BlockAdditionMapping=0x1E4; | |
314 | const int64u Segment_Tracks_TrackEntry_BlockAdditionMapping_BlockAddIDName=0x1A4; | |
315 | const int64u Segment_Tracks_TrackEntry_BlockAdditionMapping_BlockAddIDType=0x1E7; | |
316 | const int64u Segment_Tracks_TrackEntry_BlockAdditionMapping_BlockAddIDExtraData=0x1ED; | |
317 | const int64u Segment_Tracks_TrackEntry_BlockAdditionMapping_BlockAddIDValue=0x1F0; | |
313 | 318 | const int64u Segment_Tracks_TrackEntry_ContentEncodings=0x2D80; |
314 | 319 | const int64u Segment_Tracks_TrackEntry_ContentEncodings_ContentEncoding=0x2240; |
315 | 320 | const int64u Segment_Tracks_TrackEntry_ContentEncodings_ContentEncoding_ContentEncodingOrder=0x1031; |
715 | 720 | Segment_Cluster_Count=0; |
716 | 721 | CurrentAttachmentIsCover=false; |
717 | 722 | CoverIsSetFromAttachment=false; |
723 | BlockAddIDType=0; | |
718 | 724 | Laces_Pos=0; |
719 | 725 | IsParsingSegmentTrack_SeekBackTo=0; |
720 | 726 | SegmentTrack_Offset_End=0; |
1836 | 1842 | ATO2(Segment_Tracks_TrackEntry_TrickTrackFlag, "TrickTrackFlag") |
1837 | 1843 | ATO2(Segment_Tracks_TrackEntry_TrickMasterTrackUID, "TrickMasterTrackUID") |
1838 | 1844 | ATO2(Segment_Tracks_TrackEntry_TrickMasterTrackSegmentUID, "TrickMasterTrackSegmentUID") |
1845 | LIS2(Segment_Tracks_TrackEntry_BlockAdditionMapping, "BlockAdditionMapping") | |
1846 | ATOM_BEGIN | |
1847 | ATO2(Segment_Tracks_TrackEntry_BlockAdditionMapping_BlockAddIDName, "BlockAddIDName") | |
1848 | ATO2(Segment_Tracks_TrackEntry_BlockAdditionMapping_BlockAddIDType, "BlockAddIDType") | |
1849 | ATO2(Segment_Tracks_TrackEntry_BlockAdditionMapping_BlockAddIDExtraData, "BlockAddIDExtraData") | |
1850 | ATO2(Segment_Tracks_TrackEntry_BlockAdditionMapping_BlockAddIDValue, "BlockAddIDValue") | |
1851 | ATOM_END_MK | |
1839 | 1852 | LIS2(Segment_Tracks_TrackEntry_ContentEncodings, "ContentEncodings") |
1840 | 1853 | ATOM_BEGIN |
1841 | 1854 | LIS2(Segment_Tracks_TrackEntry_ContentEncodings_ContentEncoding, "ContentEncoding") |
3348 | 3361 | } |
3349 | 3362 | |
3350 | 3363 | //--------------------------------------------------------------------------- |
3364 | void File_Mk::Segment_Tracks_TrackEntry_BlockAdditionMapping_BlockAddIDType() | |
3365 | { | |
3366 | //Parsing | |
3367 | int32u Value; | |
3368 | Get_C4(Value, "Value"); | |
3369 | ||
3370 | FILLING_BEGIN(); | |
3371 | BlockAddIDType=Value; | |
3372 | FILLING_END(); | |
3373 | } | |
3374 | ||
3375 | //--------------------------------------------------------------------------- | |
3376 | void File_Mk::Segment_Tracks_TrackEntry_BlockAdditionMapping_BlockAddIDExtraData() | |
3377 | { | |
3378 | //Parsing | |
3379 | switch (BlockAddIDType) | |
3380 | { | |
3381 | case 0x64766343: // dvcC | |
3382 | case 0x64767643: // dvvC | |
3383 | Element_Name("Dolby Vision Configuration"); | |
3384 | dvcC(); | |
3385 | break; | |
3386 | case 0x68766345: | |
3387 | Element_Name("Dolby Vision EL HEVC"); | |
3388 | #if MEDIAINFO_TRACE | |
3389 | if (Trace_Activated) | |
3390 | { | |
3391 | File_Hevc* Parser=new File_Hevc(); | |
3392 | Parser->FrameIsAlwaysComplete=true; | |
3393 | Parser->MustSynchronize=false; | |
3394 | Parser->MustParse_VPS_SPS_PPS=true; | |
3395 | Parser->SizedBlocks=true; | |
3396 | Open_Buffer_Init(Parser); | |
3397 | Open_Buffer_Continue(Parser); | |
3398 | delete Parser; | |
3399 | } | |
3400 | #else | |
3401 | Skip_XX(Element_Size, "HEVCDecoderConfigurationRecord"); //enhancement-layer configuration information required to initialize the Dolby Vision decoder for the enhancement - layer substream | |
3402 | #endif | |
3403 | break; | |
3404 | case 0x6D766343: | |
3405 | Element_Name("MVC configuration"); | |
3406 | #if MEDIAINFO_TRACE | |
3407 | if (Trace_Activated) | |
3408 | { | |
3409 | File_Avc* Parser=new File_Avc(); | |
3410 | Parser->FrameIsAlwaysComplete=true; | |
3411 | Parser->MustSynchronize=false; | |
3412 | Parser->MustParse_SPS_PPS=true; | |
3413 | Parser->SizedBlocks=true; | |
3414 | Open_Buffer_Init(Parser); | |
3415 | Open_Buffer_Continue(Parser); | |
3416 | delete Parser; | |
3417 | } | |
3418 | #else | |
3419 | Skip_XX(Element_Size, "MVCDecoderConfigurationRecord"); | |
3420 | #endif | |
3421 | break; | |
3422 | default:; | |
3423 | } | |
3424 | } | |
3425 | ||
3426 | //--------------------------------------------------------------------------- | |
3351 | 3427 | void File_Mk::Segment_Tracks_TrackEntry_ContentEncodings_ContentEncoding_ContentCompression() |
3352 | 3428 | { |
3353 | 3429 | FILLING_BEGIN(); |
247 | 247 | void Segment_Tracks_TrackEntry_TrickTrackFlag(){UInteger_Info();}; |
248 | 248 | void Segment_Tracks_TrackEntry_TrickMasterTrackUID(){UInteger_Info();}; |
249 | 249 | void Segment_Tracks_TrackEntry_TrickMasterTrackSegmentUID(){UInteger_Info();}; |
250 | void Segment_Tracks_TrackEntry_BlockAdditionMapping(){}; | |
251 | void Segment_Tracks_TrackEntry_BlockAdditionMapping_BlockAddIDName(){UTF8_Info();}; | |
252 | void Segment_Tracks_TrackEntry_BlockAdditionMapping_BlockAddIDType(); | |
253 | void Segment_Tracks_TrackEntry_BlockAdditionMapping_BlockAddIDExtraData(); | |
254 | void Segment_Tracks_TrackEntry_BlockAdditionMapping_BlockAddIDValue(){UInteger_Info();}; | |
250 | 255 | void Segment_Tracks_TrackEntry_ContentEncodings(){}; |
251 | 256 | void Segment_Tracks_TrackEntry_ContentEncodings_ContentEncoding(){}; |
252 | 257 | void Segment_Tracks_TrackEntry_ContentEncodings_ContentEncoding_ContentEncodingOrder(){UInteger_Info();}; |
451 | 456 | string AttachedFile_FileName; |
452 | 457 | string AttachedFile_FileMimeType; |
453 | 458 | string AttachedFile_FileDescription; |
459 | int64u BlockAddIDType; | |
454 | 460 | struct crc32 |
455 | 461 | { |
456 | 462 | int64u Pos; |
931 | 931 | || Temp->second.Parsers[0]->Retrieve(Stream_General, 0, General_Format)==__T("Final Cut CDP")) |
932 | 932 | { |
933 | 933 | //Before |
934 | int64u StreamSize_Encoded=Retrieve(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_StreamSize_Encoded)).To_int64u(); | |
935 | if (!StreamSize_Encoded) | |
936 | StreamSize_Encoded=Retrieve(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_StreamSize)).To_int64u(); | |
934 | 937 | Clear(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_StreamSize)); |
935 | 938 | if (StreamKind_Last==Stream_Audio) |
936 | 939 | { |
951 | 954 | if (Temp->second.Parsers[0]->Retrieve(Stream_General, 0, General_Format)==__T("ChannelGrouping")) |
952 | 955 | { |
953 | 956 | //Channel coupling, removing the 2 corresponding streams |
954 | NewPos1=(StreamPos_Last/2)*2; | |
955 | size_t NewPos2=NewPos1+1; | |
956 | ID=Retrieve(StreamKind_Last, NewPos1, General_ID)+__T(" / ")+Retrieve(StreamKind_Last, NewPos2, General_ID); | |
957 | ||
958 | Stream_Erase(NewKind, NewPos2); | |
957 | NewPos1=StreamPos_Last-1; | |
958 | ID=Retrieve(StreamKind_Last, NewPos1, General_ID)+__T(" / ")+Retrieve(StreamKind_Last, StreamPos_Last, General_ID); | |
959 | if (StreamSize_Encoded) | |
960 | StreamSize_Encoded+=Retrieve(StreamKind_Last, NewPos1, Fill_Parameter(StreamKind_Last, Generic_StreamSize)).To_int64u(); | |
961 | ||
962 | Stream_Erase(NewKind, StreamPos_Last); | |
959 | 963 | Stream_Erase(NewKind, NewPos1); |
960 | 964 | |
961 | 965 | streams::iterator NextStream=Temp; |
985 | 989 | { |
986 | 990 | Stream_Prepare(NewKind, NewPos1+StreamPos); |
987 | 991 | Merge(*Temp->second.Parsers[0], StreamKind_Last, StreamPos, StreamPos_Last); |
988 | Ztring Parser_ID=Retrieve(StreamKind_Last, StreamPos_Last, General_ID); | |
989 | Fill(StreamKind_Last, StreamPos_Last, General_ID, ID+__T("-")+Parser_ID, true); | |
992 | Ztring Parser_ID=ID+__T('-')+Retrieve(StreamKind_Last, StreamPos_Last, General_ID); | |
993 | if (ID.size()+1==Parser_ID.size()) | |
994 | Parser_ID.resize(ID.size()); | |
995 | Fill(StreamKind_Last, StreamPos_Last, General_ID, Parser_ID, true); | |
990 | 996 | for (size_t Pos=0; Pos<StreamSave.size(); Pos++) |
991 | 997 | if (Retrieve(StreamKind_Last, StreamPos_Last, Pos).empty()) |
992 | 998 | Fill(StreamKind_Last, StreamPos_Last, Pos, StreamSave[Pos]); |
993 | 999 | for (size_t Pos=0; Pos<StreamMoreSave.size(); Pos++) |
994 | 1000 | Fill(StreamKind_Last, StreamPos_Last, StreamMoreSave(Pos, 0).To_UTF8().c_str(), StreamMoreSave(Pos, 1)); |
1001 | if (StreamPos) | |
1002 | { | |
1003 | if (StreamSize_Encoded) | |
1004 | Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_StreamSize_Encoded), 0, 10, true); | |
1005 | } | |
1006 | else | |
1007 | { | |
1008 | if (StreamSize_Encoded) | |
1009 | Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_StreamSize_Encoded), StreamSize_Encoded, 10, true); | |
1010 | } | |
995 | 1011 | } |
996 | 1012 | Ztring LawRating=Temp->second.Parsers[0]->Retrieve(Stream_General, 0, General_LawRating); |
997 | 1013 | if (!LawRating.empty()) |
1010 | 1026 | ZtringListList StreamMoreSave; |
1011 | 1027 | if (New_Count > 1) |
1012 | 1028 | { |
1029 | if (StreamKind_Last==Stream_Audio) | |
1030 | { | |
1031 | //Content from underlying format is preferred | |
1032 | Clear(Stream_Audio, StreamPos_Last, Audio_Channel_s_); | |
1033 | Clear(Stream_Audio, StreamPos_Last, Audio_BitRate); | |
1034 | Clear(Stream_Audio, StreamPos_Last, Audio_SamplingRate); | |
1035 | } | |
1036 | Clear(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_StreamSize)); | |
1037 | Clear(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_StreamSize_Encoded)); | |
1038 | Clear(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_BitRate)); | |
1039 | Clear(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_BitRate_Encoded)); | |
1013 | 1040 | ID = Retrieve(StreamKind_Last, StreamPos_Last, General_ID); |
1014 | 1041 | if (StreamKind_Last != Stream_Max) |
1015 | 1042 | { |
1034 | 1061 | } |
1035 | 1062 | } |
1036 | 1063 | Merge(*Temp->second.Parsers[0], StreamKind_Last, Parser_StreamPos, StreamPos_Last); |
1037 | const Ztring& Parser_ID=Temp->second.Parsers[0]->Retrieve(StreamKind_Last, Parser_StreamPos, General_ID); | |
1064 | Ztring Parser_ID=Temp->second.Parsers[0]->Retrieve(StreamKind_Last, Parser_StreamPos, General_ID); | |
1038 | 1065 | if (!Parser_ID.empty()) |
1066 | { | |
1067 | if (Parser_ID.find(__T(" / "))!=string::npos) | |
1068 | { | |
1069 | Parser_ID.insert(0, 1, __T('(')); | |
1070 | size_t End=Parser_ID.find(__T('-')); | |
1071 | if (End==string::npos) | |
1072 | End=Parser_ID.size(); | |
1073 | Parser_ID.insert(End, 1, __T(')')); | |
1074 | } | |
1039 | 1075 | Fill(StreamKind_Last, StreamPos_Last, General_ID, ID + __T('-') + Parser_ID, true); |
1076 | } | |
1040 | 1077 | if (Parser_StreamPos) |
1041 | 1078 | { |
1042 | 1079 | for (size_t Pos=0; Pos<StreamSave.size(); Pos++) |
1080 | { | |
1081 | if (StreamKind_Last==Stream_Audio && Pos==Audio_Channel_s_) | |
1082 | continue; | |
1043 | 1083 | if (Retrieve(StreamKind_Last, StreamPos_Last, Pos).empty()) |
1044 | 1084 | Fill(StreamKind_Last, StreamPos_Last, Pos, StreamSave[Pos]); |
1085 | } | |
1045 | 1086 | for (size_t Pos=0; Pos<StreamMoreSave.size(); Pos++) |
1046 | 1087 | Fill(StreamKind_Last, StreamPos_Last, StreamMoreSave(Pos, 0).To_UTF8().c_str(), StreamMoreSave(Pos, 1)); |
1047 | 1088 | } |
42 | 42 | #if defined(MEDIAINFO_AVC_YES) |
43 | 43 | #include "MediaInfo/Video/File_Avc.h" |
44 | 44 | #endif |
45 | #if defined(MEDIAINFO_CINEFORM_YES) | |
46 | #include "MediaInfo/Video/File_CineForm.h" | |
47 | #endif | |
45 | 48 | #if defined(MEDIAINFO_FFV1_YES) |
46 | 49 | #include "MediaInfo/Video/File_Ffv1.h" |
47 | 50 | #endif |
53 | 56 | #endif |
54 | 57 | #if defined(MEDIAINFO_MPEGV_YES) |
55 | 58 | #include "MediaInfo/Video/File_Mpegv.h" |
59 | #endif | |
60 | #if defined(MEDIAINFO_PNG_YES) | |
61 | #include "MediaInfo/Image/File_Png.h" | |
56 | 62 | #endif |
57 | 63 | #if defined(MEDIAINFO_PRORES_YES) |
58 | 64 | #include "MediaInfo/Video/File_ProRes.h" |
74 | 80 | #endif |
75 | 81 | #if defined(MEDIAINFO_SMPTEST0337_YES) |
76 | 82 | #include "MediaInfo/Audio/File_ChannelGrouping.h" |
83 | #endif | |
84 | #if defined(MEDIAINFO_SMPTEST0337_YES) | |
85 | #include "MediaInfo/Audio/File_ChannelSplitting.h" | |
77 | 86 | #endif |
78 | 87 | #if defined(MEDIAINFO_AMR_YES) |
79 | 88 | #include "MediaInfo/Audio/File_Amr.h" |
5365 | 5374 | #endif //MEDIAINFO_DEMUX |
5366 | 5375 | Streams[moov_trak_tkhd_TrackID].Parsers.push_back(Parser); |
5367 | 5376 | } |
5377 | if (Channels>2 && SampleSize<=32 && SampleRate==48000) //Some SMPTE ST 337 streams are hidden in PCM stream | |
5378 | { | |
5379 | File_ChannelSplitting* Parser=new File_ChannelSplitting; | |
5380 | Parser->BitDepth=(int8u)SampleSize; | |
5381 | Parser->Endianness=(Flags&0x02)?'B':'L'; | |
5382 | Parser->Channel_Total=(int8u)Channels; | |
5383 | Parser->SamplingRate=SampleRate; | |
5384 | Parser->ShouldContinueParsing=true; | |
5385 | #if MEDIAINFO_DEMUX | |
5386 | if (Config->Demux_Unpacketize_Get()) | |
5387 | { | |
5388 | Parser->Demux_Level=2; //Container | |
5389 | Parser->Demux_UnpacketizeContainer=true; | |
5390 | } | |
5391 | #endif //MEDIAINFO_DEMUX | |
5392 | Streams[moov_trak_tkhd_TrackID].Parsers.push_back(Parser); | |
5393 | } | |
5368 | 5394 | #endif |
5369 | 5395 | |
5370 | 5396 | //PCM parser |
5869 | 5895 | #endif //MEDIAINFO_DEMUX |
5870 | 5896 | } |
5871 | 5897 | #endif |
5898 | #if defined(MEDIAINFO_PNG_YES) | |
5899 | if (MediaInfoLib::Config.CodecID_Get(Stream_Video, InfoCodecID_Format_Mpeg4, Codec, InfoCodecID_Format)==__T("PNG")) | |
5900 | { | |
5901 | File_Png* Parser=new File_Png; | |
5902 | Parser->StreamKind=Stream_Video; | |
5903 | Streams[moov_trak_tkhd_TrackID].Parsers.push_back(Parser); | |
5904 | } | |
5905 | #endif | |
5906 | #if defined(MEDIAINFO_CINEFORM_YES) | |
5907 | if (MediaInfoLib::Config.CodecID_Get(Stream_Video, InfoCodecID_Format_Mpeg4, Codec, InfoCodecID_Format)==__T("CineForm")) | |
5908 | { | |
5909 | File_CineForm* Parser=new File_CineForm; | |
5910 | Streams[moov_trak_tkhd_TrackID].Parsers.push_back(Parser); | |
5911 | } | |
5912 | #endif | |
5872 | 5913 | |
5873 | 5914 | #if MEDIAINFO_DEMUX |
5874 | 5915 | if (Streams[moov_trak_tkhd_TrackID].Parsers.empty() && Config_Demux) |
6822 | 6863 | FILLING_END(); |
6823 | 6864 | } |
6824 | 6865 | |
6825 | extern const size_t DolbyVision_Profiles_Size = 10; | |
6826 | extern const char* DolbyVision_Profiles [DolbyVision_Profiles_Size] = // dv[BL_codec_type].[number_of_layers][bit_depth][cross-compatibility] | |
6827 | { | |
6828 | "dvav", | |
6829 | "dvav", | |
6830 | "dvhe", | |
6831 | "dvhe", | |
6832 | "dvhe", | |
6833 | "dvhe", | |
6834 | "dvhe", | |
6835 | "dvhe", | |
6836 | "dvhe", | |
6837 | "dvav", | |
6838 | }; | |
6839 | ||
6840 | extern const size_t DolbyVision_Compatibility_Size=7; | |
6841 | extern const char* DolbyVision_Compatibility[DolbyVision_Compatibility_Size]= | |
6842 | { | |
6843 | "", | |
6844 | "HDR10", | |
6845 | "SDR", | |
6846 | NULL, | |
6847 | "HLG", | |
6848 | NULL, | |
6849 | "Blu-ray", | |
6850 | }; | |
6851 | ||
6852 | 6866 | //--------------------------------------------------------------------------- |
6853 | 6867 | void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxx_dvcC() |
6854 | 6868 | { |
6856 | 6870 | AddCodecConfigurationBoxInfo(); |
6857 | 6871 | |
6858 | 6872 | //Parsing |
6859 | int8u dv_version_major, dv_version_minor, dv_profile, dv_level, dv_bl_signal_compatibility_id; | |
6860 | bool rpu_present_flag, el_present_flag, bl_present_flag; | |
6861 | Get_B1 (dv_version_major, "dv_version_major"); | |
6862 | if (dv_version_major && dv_version_major<=2) //Spec says nothing, we hope that a minor version change means that the stream is backward compatible | |
6863 | { | |
6864 | Get_B1 (dv_version_minor, "dv_version_minor"); | |
6865 | BS_Begin(); | |
6866 | size_t End=Data_BS_Remain(); | |
6867 | if (End>=176) | |
6868 | End-=176; | |
6869 | else | |
6870 | End=0; // Not enough place for reserved bits, but we currently ignore such case, just considered as unknown | |
6871 | Get_S1 (7, dv_profile, "dv_profile"); | |
6872 | Get_S1 (6, dv_level, "dv_level"); | |
6873 | Get_SB ( rpu_present_flag, "rpu_present_flag"); | |
6874 | Get_SB ( el_present_flag, "el_present_flag"); | |
6875 | Get_SB ( bl_present_flag, "bl_present_flag"); | |
6876 | if (Data_BS_Remain()) | |
6877 | { | |
6878 | Get_S1 (4, dv_bl_signal_compatibility_id, "dv_bl_signal_compatibility_id"); // in dv_version_major 2 only if based on specs but it was confirmed to be seen in dv_version_major 1 too and it does not hurt (value 0 means no new display) | |
6879 | if (End<Data_BS_Remain()) | |
6880 | Skip_BS(Data_BS_Remain()-End, "reserved"); | |
6881 | } | |
6882 | else | |
6883 | dv_bl_signal_compatibility_id=0; | |
6884 | BS_End(); | |
6885 | } | |
6886 | Skip_XX(Element_Size-Element_Offset, "Unknown"); | |
6887 | ||
6888 | FILLING_BEGIN(); | |
6889 | Fill(Stream_Video, StreamPos_Last, "HDR_Format", "Dolby Vision"); | |
6890 | if (dv_version_major && dv_version_major<=2) | |
6891 | { | |
6892 | Ztring Summary=Ztring::ToZtring(dv_version_major)+__T('.')+Ztring::ToZtring(dv_version_minor); | |
6893 | Fill(Stream_Video, StreamPos_Last, "HDR_Format_Version", Summary); | |
6894 | string Profile, Level; | |
6895 | if (dv_profile<DolbyVision_Profiles_Size) | |
6896 | Profile+=DolbyVision_Profiles[dv_profile]; | |
6897 | else | |
6898 | Profile+=Ztring().From_CC1(dv_profile).To_UTF8(); | |
6899 | Profile+=__T('.'); | |
6900 | Profile+=Ztring().From_CC1(dv_profile).To_UTF8(); | |
6901 | Level+=Ztring().From_CC1(dv_level).To_UTF8(); | |
6902 | Fill(Stream_Video, StreamPos_Last, "HDR_Format_Profile", Profile); | |
6903 | Fill(Stream_Video, StreamPos_Last, "HDR_Format_Level", Level); | |
6904 | Summary+=__T(','); | |
6905 | Summary+=__T(' '); | |
6906 | Summary+=Ztring().From_UTF8(Profile); | |
6907 | Summary+=__T('.'); | |
6908 | Summary+=Ztring().From_UTF8(Level); | |
6909 | ||
6910 | string Layers; | |
6911 | if (rpu_present_flag|el_present_flag|bl_present_flag) | |
6912 | { | |
6913 | Summary+=','; | |
6914 | Summary+=' '; | |
6915 | if (bl_present_flag) | |
6916 | Layers +="BL+"; | |
6917 | if (el_present_flag) | |
6918 | Layers +="EL+"; | |
6919 | if (rpu_present_flag) | |
6920 | Layers +="RPU+"; | |
6921 | Layers.resize(Layers.size()-1); | |
6922 | Summary+=Ztring().From_UTF8(Layers); | |
6923 | } | |
6924 | Fill(Stream_Video, StreamPos_Last, "HDR_Format_Settings", Layers); | |
6925 | if (dv_bl_signal_compatibility_id) | |
6926 | { | |
6927 | string Compatibility; | |
6928 | if (dv_bl_signal_compatibility_id<DolbyVision_Compatibility_Size && DolbyVision_Compatibility[dv_bl_signal_compatibility_id]) | |
6929 | Compatibility=DolbyVision_Compatibility[dv_bl_signal_compatibility_id]; | |
6930 | else | |
6931 | Compatibility=Ztring().From_Number(dv_bl_signal_compatibility_id).To_UTF8(); | |
6932 | Fill(Stream_Video, StreamPos_Last, Video_HDR_Format_Compatibility, Compatibility); | |
6933 | } | |
6934 | } | |
6935 | else | |
6936 | Fill(Stream_Video, StreamPos_Last, "HDR_Format_Version", dv_version_major); | |
6937 | FILLING_END(); | |
6873 | dvcC(); | |
6938 | 6874 | } |
6939 | 6875 | |
6940 | 6876 | //--------------------------------------------------------------------------- |
404 | 404 | Fill(Stream_Audio, StreamPos_Last, Audio_MuxingMode, "SL"); |
405 | 405 | #endif //MEDIAINFO_MPEG4_YES |
406 | 406 | |
407 | if (Counts[StreamKind_Last]+Count==Count_Get(StreamKind_Last)) //Old method | |
407 | if (StreamKind_Last<Stream_Max && Counts[StreamKind_Last]+Count==Count_Get(StreamKind_Last)) //Old method | |
408 | 408 | Streams_Fill_PerStream_PerKind(StreamID, Temp, KindOfStream, Count); |
409 | 409 | else |
410 | 410 | { |
3431 | 3431 | } |
3432 | 3432 | |
3433 | 3433 | //--------------------------------------------------------------------------- |
3434 | extern const size_t DolbyVision_Profiles_Size; | |
3435 | extern const char* DolbyVision_Profiles[]; | |
3436 | 3434 | void File_Mpeg_Descriptors::Descriptor_B0() |
3437 | 3435 | { |
3438 | 3436 | //Parsing |
3439 | int8u dv_version_major, dv_version_minor, dv_profile, dv_level, dv_bl_signal_compatibility_id; | |
3440 | bool rpu_present_flag, el_present_flag, bl_present_flag; | |
3441 | Get_B1 (dv_version_major, "dv_version_major"); | |
3442 | if (dv_version_major && dv_version_major<=2) //Spec says nothing, we hope that a minor version change means that the stream is backward compatible | |
3443 | { | |
3444 | Get_B1 (dv_version_minor, "dv_version_minor"); | |
3445 | BS_Begin(); | |
3446 | size_t End=Data_BS_Remain(); | |
3447 | if (End>=176) | |
3448 | End-=176; | |
3449 | else | |
3450 | End=0; // Not enough place for reserved bits, but we currently ignore such case, just considered as unknown | |
3451 | Get_S1 (7, dv_profile, "dv_profile"); | |
3452 | Get_S1 (6, dv_level, "dv_level"); | |
3453 | Get_SB ( rpu_present_flag, "rpu_present_flag"); | |
3454 | Get_SB ( el_present_flag, "el_present_flag"); | |
3455 | Get_SB ( bl_present_flag, "bl_present_flag"); | |
3456 | if (Data_BS_Remain()) | |
3457 | { | |
3458 | Get_S1 (4, dv_bl_signal_compatibility_id, "dv_bl_signal_compatibility_id"); // in dv_version_major 2 only if based on specs but it was confirmed to be seen in dv_version_major 1 too and it does not hurt (value 0 means no new display) | |
3459 | if (End<Data_BS_Remain()) | |
3460 | Skip_BS(Data_BS_Remain()-End, "reserved"); | |
3461 | } | |
3462 | else | |
3463 | dv_bl_signal_compatibility_id=0; | |
3464 | BS_End(); | |
3465 | } | |
3466 | Skip_XX(Element_Size-Element_Offset, "Unknown"); | |
3467 | ||
3468 | FILLING_BEGIN(); | |
3469 | Complete_Stream->Streams[elementary_PID]->Infos["HDR_Format"].From_UTF8("Dolby Vision"); | |
3470 | if (dv_version_major && dv_version_major<=2) | |
3471 | { | |
3472 | Ztring Summary=Ztring::ToZtring(dv_version_major)+__T('.')+Ztring::ToZtring(dv_version_minor); | |
3473 | Complete_Stream->Streams[elementary_PID]->Infos["HDR_Format_Version"]=Summary; | |
3474 | string Profile, Level; | |
3475 | if (dv_profile<DolbyVision_Profiles_Size) | |
3476 | Profile+=DolbyVision_Profiles[dv_profile]; | |
3477 | else | |
3478 | Profile+=Ztring().From_CC1(dv_profile).To_UTF8(); | |
3479 | Profile+=__T('.'); | |
3480 | Profile+=Ztring().From_CC1(dv_profile).To_UTF8(); | |
3481 | Level+=Ztring().From_CC1(dv_level).To_UTF8(); | |
3482 | Complete_Stream->Streams[elementary_PID]->Infos["HDR_Format_Profile"].From_UTF8(Profile); | |
3483 | Complete_Stream->Streams[elementary_PID]->Infos["HDR_Format_Level"].From_UTF8(Level); | |
3484 | Summary+=__T(','); | |
3485 | Summary+=__T(' '); | |
3486 | Summary+=Ztring().From_UTF8(Profile); | |
3487 | Summary+=__T('.'); | |
3488 | Summary+=Ztring().From_UTF8(Level); | |
3489 | ||
3490 | string Layers; | |
3491 | if (rpu_present_flag|el_present_flag|bl_present_flag) | |
3492 | { | |
3493 | Summary+=','; | |
3494 | Summary+=' '; | |
3495 | if (bl_present_flag) | |
3496 | Layers +="BL+"; | |
3497 | if (el_present_flag) | |
3498 | Layers +="EL+"; | |
3499 | if (rpu_present_flag) | |
3500 | Layers +="RPU+"; | |
3501 | Layers.resize(Layers.size()-1); | |
3502 | Summary+=Ztring().From_UTF8(Layers); | |
3503 | } | |
3504 | Complete_Stream->Streams[elementary_PID]->Infos["HDR_Format_Settings"].From_UTF8(Layers); | |
3505 | if (dv_bl_signal_compatibility_id) | |
3506 | { | |
3507 | string Compatibility; | |
3508 | if (dv_bl_signal_compatibility_id<DolbyVision_Compatibility_Size && DolbyVision_Compatibility[dv_bl_signal_compatibility_id]) | |
3509 | Compatibility=DolbyVision_Compatibility[dv_bl_signal_compatibility_id]; | |
3510 | else | |
3511 | Compatibility=Ztring().From_Number(dv_bl_signal_compatibility_id).To_UTF8(); | |
3512 | Complete_Stream->Streams[elementary_PID]->Infos["HDR_Format_Compatibility"].From_UTF8(Compatibility); | |
3513 | } | |
3514 | } | |
3515 | else | |
3516 | Complete_Stream->Streams[elementary_PID]->Infos["HDR_Format_Version"]=Ztring::ToZtring(dv_version_major); | |
3517 | FILLING_END(); | |
3437 | std::map<std::string, Ztring>& Infos=Complete_Stream->Streams[elementary_PID]->Infos; | |
3438 | dvcC(true, &Infos); | |
3518 | 3439 | } |
3519 | 3440 | |
3520 | 3441 | //--------------------------------------------------------------------------- |
54 | 54 | #endif |
55 | 55 | #if defined(MEDIAINFO_SMPTEST0337_YES) |
56 | 56 | #include "MediaInfo/Audio/File_ChannelGrouping.h" |
57 | #endif | |
58 | #if defined(MEDIAINFO_SMPTEST0337_YES) | |
59 | #include "MediaInfo/Audio/File_ChannelSplitting.h" | |
57 | 60 | #endif |
58 | 61 | #if defined(MEDIAINFO_MPEGA_YES) |
59 | 62 | #include "MediaInfo/Audio/File_Mpega.h" |
3030 | 3033 | } |
3031 | 3034 | |
3032 | 3035 | //Removing the 2 corresponding streams |
3033 | NewPos1=(Essence->second.StreamPos_Initial/2)*2+StreamPos_Difference; | |
3034 | size_t NewPos2=NewPos1+1; | |
3036 | NewPos1=Essence->second.StreamPos_Initial-1+StreamPos_Difference; | |
3035 | 3037 | ID=Ztring::ToZtring(Essence1->second.TrackID)+__T(" / ")+Ztring::ToZtring(Essence->second.TrackID); |
3036 | 3038 | |
3037 | Stream_Erase(NewKind, NewPos2); | |
3039 | Stream_Erase(NewKind, NewPos1+1); | |
3038 | 3040 | Stream_Erase(NewKind, NewPos1); |
3041 | ||
3042 | essences::iterator NextStream=Essence1; | |
3043 | ++NextStream; | |
3044 | size_t NewAudio_Count=Essence->second.Parsers[0]->Count_Get(Stream_Audio); | |
3045 | while (NextStream!=Essences.end()) | |
3046 | { | |
3047 | if (NextStream->second.StreamKind==Stream_Audio) | |
3048 | { | |
3049 | NextStream->second.StreamPos-=2; | |
3050 | NextStream->second.StreamPos+=NewAudio_Count; | |
3051 | NextStream->second.StreamPos_Initial-=2; | |
3052 | NextStream->second.StreamPos_Initial+=NewAudio_Count; | |
3053 | } | |
3054 | ++NextStream; | |
3055 | } | |
3039 | 3056 | } |
3040 | 3057 | else |
3041 | 3058 | { |
3054 | 3071 | for (size_t Pos=0; Pos<StreamSave.size(); Pos++) |
3055 | 3072 | { |
3056 | 3073 | if (Pos==Fill_Parameter(StreamKind_Last, Generic_BitRate) && (*Parser)->Count_Get(NewKind)>1 && (!StreamSave[Pos].empty() || StreamPos)) |
3057 | Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_BitRate_Encoded), StreamPos?0:(StreamSave[Pos].To_int64u()*2)); | |
3074 | Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_BitRate_Encoded), StreamPos?0:(StreamSave[Pos].To_int64u()*2), 10, true); | |
3058 | 3075 | else if (Pos==Fill_Parameter(StreamKind_Last, Generic_StreamSize) && (*Parser)->Count_Get(NewKind)>1 && (!StreamSave[Pos].empty() || StreamPos)) |
3059 | Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_StreamSize_Encoded), StreamPos?0:(StreamSave[Pos].To_int64u()*2)); | |
3076 | Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_StreamSize_Encoded), StreamPos?0:(StreamSave[Pos].To_int64u()*2), 10, true); | |
3060 | 3077 | else if (Retrieve(StreamKind_Last, StreamPos_Last, Pos).empty()) |
3061 | 3078 | Fill(StreamKind_Last, StreamPos_Last, Pos, StreamSave[Pos]); |
3062 | 3079 | } |
3078 | 3095 | } |
3079 | 3096 | } |
3080 | 3097 | } |
3081 | ||
3082 | //Positioning other streams | |
3083 | for (essences::iterator Essence_Temp=Essence; Essence_Temp!=Essences.end(); ++Essence_Temp) | |
3084 | if (!Essence_Temp->second.Parsers.empty() && Essence_Temp->second.Parsers[0]->Count_Get(Stream_Audio)) | |
3085 | { | |
3086 | Essence_Temp->second.StreamPos-=2; //ChannelGrouping | |
3087 | Essence_Temp->second.StreamPos+=(*(Essence_Temp->second.Parsers.begin()))->Count_Get(Stream_Audio); | |
3088 | } | |
3089 | 3098 | } |
3090 | 3099 | else //Normal |
3091 | 3100 | { |
3895 | 3904 | } |
3896 | 3905 | |
3897 | 3906 | for (std::map<std::string, Ztring>::iterator Info=SubDescriptor->second.Infos.begin(); Info!=SubDescriptor->second.Infos.end(); ++Info) |
3898 | if (Retrieve(StreamKind_Last, StreamPos_Last, Info->first.c_str()).empty()) | |
3907 | if (Info->first=="ComponentCount") | |
3908 | { | |
3909 | if (Info->second==__T("4") && !Retrieve(StreamKind_Last, StreamPos_Last, "ColorSpace").empty()) | |
3910 | Fill(StreamKind_Last, StreamPos_Last, "ColorSpace", Retrieve(StreamKind_Last, StreamPos_Last, "ColorSpace")+__T('A'), true); // Descriptor name is "RGBA"... | |
3911 | } | |
3912 | else if (Retrieve(StreamKind_Last, StreamPos_Last, Info->first.c_str()).empty()) | |
3899 | 3913 | Fill(StreamKind_Last, StreamPos_Last, Info->first.c_str(), Info->second); |
3900 | 3914 | else if (Retrieve(StreamKind_Last, StreamPos_Last, Info->first.c_str()) != Info->second) |
3901 | 3915 | { |
10420 | 10434 | void File_Mxf::JPEG2000PictureSubDescriptor_Csiz() |
10421 | 10435 | { |
10422 | 10436 | //Parsing |
10423 | Info_B2(Data, "Data"); Element_Info1(Data); | |
10437 | int16u Data; | |
10438 | Get_B2 (Data, "Data"); Element_Info1(Data); | |
10439 | ||
10440 | FILLING_BEGIN() | |
10441 | Descriptor_Fill("ComponentCount", Ztring::ToZtring(Data)); | |
10442 | FILLING_END() | |
10443 | ||
10424 | 10444 | } |
10425 | 10445 | |
10426 | 10446 | //--------------------------------------------------------------------------- |
16392 | 16412 | switch (Code5) |
16393 | 16413 | { |
16394 | 16414 | case 0x01 : |
16415 | case 0x7E : | |
16395 | 16416 | case 0x7F : if (Descriptor->second.ChannelCount==1) //PCM, but one file is found with Dolby E in it |
16396 | 16417 | ChooseParser_ChannelGrouping(Essence, Descriptor); |
16397 | 16418 | if (Descriptor->second.ChannelCount==2) //PCM, but one file is found with Dolby E in it |
16398 | 16419 | ChooseParser_SmpteSt0337(Essence, Descriptor); |
16420 | if (Descriptor->second.ChannelCount>2 && Descriptor->second.ChannelCount!=(int32u)-1) //PCM, but one file is found with Dolby E in it | |
16421 | ChooseParser_ChannelSplitting(Essence, Descriptor); | |
16399 | 16422 | default : return ChooseParser_Pcm(Essence, Descriptor); |
16400 | 16423 | } |
16401 | 16424 | case 0x02 : //Compressed coding |
16504 | 16527 | ChooseParser_ChannelGrouping(Essence, Descriptor); |
16505 | 16528 | if (Descriptor->second.ChannelCount==2) //PCM, but one file is found with Dolby E in it |
16506 | 16529 | ChooseParser_SmpteSt0337(Essence, Descriptor); |
16530 | if (Descriptor->second.ChannelCount>2 && Descriptor->second.ChannelCount!=(int32u)-1) //PCM, but one file is found with Dolby E in it | |
16531 | ChooseParser_ChannelSplitting(Essence, Descriptor); | |
16507 | 16532 | return ChooseParser_Pcm(Essence, Descriptor); |
16508 | 16533 | case 0x04 : return; //MPEG ES mappings with Stream ID |
16509 | 16534 | case 0x0A : return ChooseParser_Alaw(Essence, Descriptor); |
17173 | 17198 | } |
17174 | 17199 | |
17175 | 17200 | //--------------------------------------------------------------------------- |
17201 | void File_Mxf::ChooseParser_ChannelSplitting(const essences::iterator &Essence, const descriptors::iterator &Descriptor) | |
17202 | { | |
17203 | Essence->second.StreamKind=Stream_Audio; | |
17204 | ||
17205 | //Filling | |
17206 | #if defined(MEDIAINFO_SMPTEST0337_YES) | |
17207 | File_ChannelSplitting* Parser=new File_ChannelSplitting; | |
17208 | if (Descriptor!=Descriptors.end()) | |
17209 | { | |
17210 | Parser->Channel_Total=Descriptor->second.ChannelCount; | |
17211 | if (Descriptor->second.BlockAlign<64) | |
17212 | Parser->BitDepth=(int8u)(Descriptor->second.BlockAlign*8/Descriptor->second.ChannelCount); | |
17213 | else if (Descriptor->second.QuantizationBits!=(int32u)-1) | |
17214 | Parser->BitDepth=(int8u)Descriptor->second.QuantizationBits; | |
17215 | std::map<std::string, Ztring>::const_iterator i=Descriptor->second.Infos.find("SamplingRate"); | |
17216 | if (i!=Descriptor->second.Infos.end()) | |
17217 | Parser->SamplingRate=i->second.To_int16u(); | |
17218 | i=Descriptor->second.Infos.find("Format_Settings_Endianness"); | |
17219 | if (i!=Descriptor->second.Infos.end()) | |
17220 | { | |
17221 | if (i->second==__T("Big")) | |
17222 | Parser->Endianness='B'; | |
17223 | else | |
17224 | Parser->Endianness='L'; | |
17225 | } | |
17226 | else | |
17227 | Parser->Endianness='L'; | |
17228 | } | |
17229 | else | |
17230 | Parser->Endianness='L'; | |
17231 | Parser->Aligned=true; | |
17232 | ||
17233 | #if MEDIAINFO_DEMUX | |
17234 | if (Demux_UnpacketizeContainer) | |
17235 | { | |
17236 | Parser->Demux_Level=2; //Container | |
17237 | Parser->Demux_UnpacketizeContainer=true; | |
17238 | } | |
17239 | #endif //MEDIAINFO_DEMUX | |
17240 | ||
17241 | Essence->second.Parsers.push_back(Parser); | |
17242 | #endif //defined(MEDIAINFO_SMPTEST0337_YES) | |
17243 | ||
17244 | //Adding PCM | |
17245 | ChooseParser_Pcm(Essence, Descriptor); | |
17246 | } | |
17247 | //--------------------------------------------------------------------------- | |
17176 | 17248 | void File_Mxf::ChooseParser_Mpega(const essences::iterator &Essence, const descriptors::iterator &Descriptor) |
17177 | 17249 | { |
17178 | 17250 | Essence->second.StreamKind=Stream_Audio; |
17265 | 17337 | } |
17266 | 17338 | #endif //MEDIAINFO_DEMUX |
17267 | 17339 | |
17340 | if (Essence->second.Parsers.empty()) | |
17341 | Parser->Frame_Count_Valid=1; | |
17268 | 17342 | Essence->second.Parsers.push_back(Parser); |
17269 | 17343 | #endif |
17270 | 17344 | } |
1157 | 1157 | void ChooseParser_Ac3(const essences::iterator &Essence, const descriptors::iterator &Descriptor); |
1158 | 1158 | void ChooseParser_Alaw(const essences::iterator &Essence, const descriptors::iterator &Descriptor); |
1159 | 1159 | void ChooseParser_ChannelGrouping(const essences::iterator &Essence, const descriptors::iterator &Descriptor); |
1160 | void ChooseParser_ChannelSplitting(const essences::iterator& Essence, const descriptors::iterator& Descriptor); | |
1160 | 1161 | void ChooseParser_Mpega(const essences::iterator &Essence, const descriptors::iterator &Descriptor); |
1161 | 1162 | void ChooseParser_Pcm(const essences::iterator &Essence, const descriptors::iterator &Descriptor); |
1162 | 1163 | void ChooseParser_SmpteSt0331(const essences::iterator &Essence, const descriptors::iterator &Descriptor); |
104 | 104 | Interleaved1_10=0; |
105 | 105 | |
106 | 106 | //Temp |
107 | WAVE_data_Size=0xFFFFFFFF; | |
108 | WAVE_fact_samplesCount=0xFFFFFFFF; | |
107 | WAVE_data_Size=(int64u)-1; | |
108 | WAVE_fact_samplesCount=(int64u)-1; | |
109 | 109 | Buffer_DataToParse_Begin=(int64u)-1; |
110 | 110 | Buffer_DataToParse_End=0; |
111 | 111 | #if MEDIAINFO_DEMUX |
120 | 120 | SMV_BlockSize=0; |
121 | 121 | SamplesPerSec=0; |
122 | 122 | stream_Count=0; |
123 | BlockAlign=0; | |
123 | 124 | rec__Present=false; |
124 | 125 | NeedOldIndex=true; |
125 | 126 | IsBigEndian=false; |
240 | 241 | Clear(Stream_Audio, 0, Audio_Channel_s_); |
241 | 242 | |
242 | 243 | size_t StreamPos_Base=StreamPos_Last; |
244 | if (StreamKind_Last==Stream_Audio && (Temp->second.Parsers[0]->Count_Get(Stream_Audio)>1 || (!Temp->second.Parsers[0]->Get(Stream_Audio, 0, Audio_MuxingMode).empty() && Temp->second.Parsers[0]->Get(Stream_Audio, 0, Audio_MuxingMode)!=__T("ADTS")))) | |
245 | { | |
246 | //Content from underlying format is preffered | |
247 | Clear(Stream_Audio, StreamPos_Last, Audio_Channel_s_); | |
248 | Fill(Stream_Audio, StreamPos_Last, Audio_BitRate_Encoded, Retrieve(Stream_Audio, StreamPos_Last, Audio_BitRate), true); | |
249 | Clear(Stream_Audio, StreamPos_Last, Audio_BitRate); | |
250 | Clear(Stream_Audio, StreamPos_Last, Audio_SamplingRate); | |
251 | Fill(Stream_Audio, StreamPos_Last, Audio_StreamSize_Encoded, Retrieve(Stream_Audio, StreamPos_Last, Audio_StreamSize), true); | |
252 | Clear(Stream_Audio, StreamPos_Last, Audio_StreamSize); | |
253 | } | |
243 | 254 | for (size_t Pos=0; Pos<Temp->second.Parsers[0]->Count_Get(StreamKind_Last); Pos++) |
244 | 255 | { |
245 | 256 | Ztring Temp_ID=ID; |
283 | 294 | StreamPos_Last=Count_Get(Stream_Video)-1; |
284 | 295 | } |
285 | 296 | } |
297 | ||
298 | //Special case - Multiple Audio | |
299 | if (StreamKind_Last==Stream_Audio) | |
300 | { | |
301 | for (size_t Pos=0; Pos<Temp->second.Parsers[0]->Count_Get(Stream_Audio); Pos++) | |
302 | { | |
303 | if (Retrieve(Stream_Audio, StreamPos_Base+Pos, Audio_CodecID).empty()) | |
304 | Fill(Stream_Audio, StreamPos_Base+Pos, Audio_CodecID, Retrieve(Stream_Audio, StreamPos_Base, Audio_CodecID)); | |
305 | if (Retrieve(Stream_Audio, StreamPos_Base+Pos, Audio_Duration).empty()) | |
306 | Fill(Stream_Audio, StreamPos_Base+Pos, Audio_Duration, Retrieve(Stream_Audio, StreamPos_Base, Audio_Duration)); | |
307 | if (Pos) | |
308 | Fill(Stream_Audio, StreamPos_Base+Pos, Audio_StreamSize_Encoded, 0, 10, true); | |
309 | } | |
310 | } | |
286 | 311 | } |
287 | 312 | else |
288 | 313 | { |
291 | 316 | } |
292 | 317 | |
293 | 318 | //Hacks - After |
294 | Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_StreamSize), StreamSize, true); | |
319 | if (!Temp->second.Parsers.empty() && Temp->second.Parsers[0]->Count_Get(StreamKind_Last)==1) | |
320 | Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Retrieve(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_StreamSize_Encoded)).empty()?Generic_StreamSize:Generic_StreamSize_Encoded), StreamSize, true); | |
295 | 321 | if (StreamKind_Last==Stream_Video) |
296 | 322 | { |
297 | 323 | if (!Codec_Temp.empty()) |
771 | 797 | default : AVI__movi_xxxx(); |
772 | 798 | } |
773 | 799 | |
800 | bool ShouldStop=false; | |
774 | 801 | if (Config->ParseSpeed<1.0 && File_Offset+Buffer_Offset+Element_Offset-Buffer_DataToParse_Begin>=256*1024) |
802 | { | |
803 | ShouldStop=true; | |
804 | for (std::map<int32u, stream>::iterator StreamItem=Stream.begin(); StreamItem!=Stream.end(); ++StreamItem) | |
805 | if (StreamItem->second.Parsers.size()>1 || (!StreamItem->second.Parsers.empty() && !StreamItem->second.Parsers[0]->Status[IsFilled])) | |
806 | ShouldStop=false; | |
807 | } | |
808 | if (ShouldStop) | |
775 | 809 | { |
776 | 810 | File_GoTo=Buffer_DataToParse_End; |
777 | 811 | Buffer_Offset=Buffer_Size; |
117 | 117 | std::map<int32u, stream> Stream; |
118 | 118 | int32u Stream_ID; |
119 | 119 | void Open_Buffer_Init_All(); |
120 | void Parser_Pcm(stream& StreamItem, int16u Channels, int16u BitsPerSample, int16u ValidBitsPerSample, int32u SamplesPerSec, char Endianness='\0'); | |
120 | 121 | struct stream_structure |
121 | 122 | { |
122 | 123 | int64u Name; |
23 | 23 | #include "MediaInfo/Setup.h" |
24 | 24 | #include <ZenLib/Ztring.h> |
25 | 25 | #include <string> |
26 | #include <algorithm> | |
26 | 27 | using namespace std; |
27 | 28 | using namespace ZenLib; |
28 | 29 | //--------------------------------------------------------------------------- |
165 | 166 | #if defined(MEDIAINFO_OGG_YES) |
166 | 167 | #include "MediaInfo/Multiple/File_Ogg.h" |
167 | 168 | #include "MediaInfo/Multiple/File_Ogg_SubElement.h" |
169 | #endif | |
170 | #if defined(MEDIAINFO_CINEFORM_YES) | |
171 | #include "MediaInfo/Video/File_CineForm.h" | |
168 | 172 | #endif |
169 | 173 | #if defined(MEDIAINFO_FFV1_YES) |
170 | 174 | #include "MediaInfo/Video/File_Ffv1.h" |
222 | 226 | #endif |
223 | 227 | #if defined(MEDIAINFO_SMPTEST0337_YES) |
224 | 228 | #include "MediaInfo/Audio/File_SmpteSt0337.h" |
229 | #include "MediaInfo/Audio/File_ChannelSplitting.h" | |
225 | 230 | #endif |
226 | 231 | #if defined(MEDIAINFO_ID3_YES) |
227 | 232 | #include "MediaInfo/Tag/File_Id3.h" |
746 | 751 | Fill(Stream_Audio, StreamPos_Last, Audio_Channel_s_, numChannels); |
747 | 752 | Fill(Stream_Audio, StreamPos_Last, Audio_BitDepth, sampleSize); |
748 | 753 | if (sampleRate) |
749 | Fill(Stream_Audio, StreamPos_Last, Audio_Duration, numSampleFrames/sampleRate*1000); | |
754 | Fill(Stream_Audio, StreamPos_Last, Audio_Duration, numSampleFrames/sampleRate*1000, 0); | |
750 | 755 | Fill(Stream_Audio, StreamPos_Last, Audio_SamplingRate, sampleRate, 0); |
751 | 756 | |
752 | 757 | //Compute the current codec ID |
755 | 760 | stream_Count=1; |
756 | 761 | |
757 | 762 | //Specific cases |
758 | #if defined(MEDIAINFO_SMPTEST0337_YES) | |
759 | if (Retrieve(Stream_Audio, 0, Audio_CodecID).empty() && numChannels==2 && sampleSize<=32 && sampleRate==48000) //Some SMPTE ST 337 streams are hidden in PCM stream | |
760 | { | |
761 | File_SmpteSt0337* Parser=new File_SmpteSt0337; | |
762 | Parser->Endianness='B'; | |
763 | Parser->Container_Bits=(int8u)sampleSize; | |
764 | Parser->ShouldContinueParsing=true; | |
765 | #if MEDIAINFO_DEMUX | |
766 | if (Config->Demux_Unpacketize_Get()) | |
767 | { | |
768 | Parser->Demux_Level=2; //Container | |
769 | Parser->Demux_UnpacketizeContainer=true; | |
770 | Demux_Level=4; //Intermediate | |
771 | } | |
772 | #endif //MEDIAINFO_DEMUX | |
773 | Stream[Stream_ID].Parsers.push_back(Parser); | |
774 | } | |
763 | #if defined(MEDIAINFO_PCM_YES) || defined(MEDIAINFO_DTS_YES) || defined(MEDIAINFO_SMPTEST0337_YES) | |
764 | stream& StreamItem=Stream[Stream_ID]; | |
765 | Ztring Codec=Retrieve(Stream_Audio, StreamPos_Last, Audio_CodecID); | |
766 | Parser_Pcm(StreamItem, numChannels, sampleSize, sampleSize, sampleRate, (Codec.empty() || Codec==__T("NONE"))?'B':'\0'); | |
775 | 767 | #endif |
776 | 768 | |
777 | stream& StreamItem = Stream[Stream_ID]; | |
778 | #if defined(MEDIAINFO_PCM_YES) | |
779 | File_Pcm* Parser=new File_Pcm; | |
780 | Parser->Codec=Retrieve(Stream_Audio, StreamPos_Last, Audio_CodecID); | |
781 | if (Parser->Codec.empty() || Parser->Codec==__T("NONE")) | |
782 | Parser->Endianness='B'; | |
783 | Parser->BitDepth=(int8u)sampleSize; | |
784 | #if MEDIAINFO_DEMUX | |
785 | if (Demux_Rate) | |
786 | Parser->Frame_Count_Valid = float64_int64s(Demux_Rate); | |
787 | if (Config->Demux_Unpacketize_Get()) | |
788 | { | |
789 | Parser->Demux_Level=2; //Container | |
790 | Parser->Demux_UnpacketizeContainer=true; | |
791 | Demux_Level=4; //Intermediate | |
792 | } | |
793 | #else //MEDIAINFO_DEMUX | |
794 | Parser->Frame_Count_Valid=(int64u)-1; //Disabling it, waiting for SMPTE ST 337 parser reject | |
795 | #endif //MEDIAINFO_DEMUX | |
796 | StreamItem.Parsers.push_back(Parser); | |
797 | StreamItem.IsPcm=true; | |
798 | StreamItem.StreamKind=Stream_Audio; | |
799 | #endif | |
800 | 769 | #if MEDIAINFO_DEMUX |
801 | BlockAlign=numChannels*sampleSize/8; | |
802 | AvgBytesPerSec=(int32u)float64_int64s(BlockAlign*(float64)sampleRate); | |
770 | unsigned int ComputedBlockAlign=numChannels*sampleSize/8; | |
771 | if (ComputedBlockAlign<0x10000) | |
772 | { | |
773 | BlockAlign=(int16u)ComputedBlockAlign; | |
774 | AvgBytesPerSec=(int32u)float64_int64s(ComputedBlockAlign*sampleRate); | |
775 | } | |
803 | 776 | #endif //MEDIAINFO_DEMUX |
804 | 777 | |
805 | 778 | Element_Code=(int64u)-1; |
1273 | 1246 | Get_L2 (Channels, "Channels"); |
1274 | 1247 | Get_L4 (SamplesPerSec, "SamplesPerSec"); |
1275 | 1248 | Get_L4 (AvgBytesPerSec, "AvgBytesPerSec"); |
1276 | #if MEDIAINFO_DEMUX | |
1277 | Get_L2 (BlockAlign, "BlockAlign"); | |
1278 | #else //MEDIAINFO_DEMUX | |
1279 | Skip_L2( "BlockAlign"); | |
1280 | #endif //MEDIAINFO_DEMUX | |
1249 | Get_L2 (BlockAlign, "BlockAlign"); | |
1281 | 1250 | if (Element_Offset+2<=Element_Size) |
1282 | 1251 | Get_L2 (BitsPerSample, "BitsPerSample"); |
1283 | 1252 | |
1320 | 1289 | Fill(Stream_Audio, 0, Audio_Delay_Source, "Container (bext)"); |
1321 | 1290 | } |
1322 | 1291 | |
1323 | //Specific cases | |
1324 | #if defined(MEDIAINFO_DTS_YES) || defined(MEDIAINFO_SMPTEST0337_YES) | |
1325 | if (FormatTag==0x1 && Retrieve(Stream_General, 0, General_Format)==__T("Wave")) //Some DTS or SMPTE ST 337 streams are coded "1" | |
1326 | { | |
1327 | #if defined(MEDIAINFO_DTS_YES) | |
1328 | { | |
1329 | File_Dts* Parser=new File_Dts; | |
1330 | Parser->Frame_Count_Valid=2; | |
1331 | Parser->ShouldContinueParsing=true; | |
1332 | #if MEDIAINFO_DEMUX | |
1333 | if (Config->Demux_Unpacketize_Get() && Retrieve(Stream_General, 0, General_Format)==__T("Wave")) | |
1334 | { | |
1335 | Parser->Demux_Level=2; //Container | |
1336 | Parser->Demux_UnpacketizeContainer=true; | |
1337 | Demux_Level=4; //Intermediate | |
1338 | } | |
1339 | #endif //MEDIAINFO_DEMUX | |
1340 | StreamItem.Parsers.push_back(Parser); | |
1341 | } | |
1342 | #endif | |
1343 | ||
1344 | #if defined(MEDIAINFO_SMPTEST0337_YES) | |
1345 | { | |
1346 | File_SmpteSt0337* Parser=new File_SmpteSt0337; | |
1347 | Parser->Container_Bits=(int8u)BitsPerSample; | |
1348 | Parser->Aligned=true; | |
1349 | Parser->ShouldContinueParsing=true; | |
1350 | #if MEDIAINFO_DEMUX | |
1351 | if (Config->Demux_Unpacketize_Get() && Retrieve(Stream_General, 0, General_Format)==__T("Wave")) | |
1352 | { | |
1353 | Parser->Demux_Level=2; //Container | |
1354 | Parser->Demux_UnpacketizeContainer=true; | |
1355 | Demux_Level=4; //Intermediate | |
1356 | } | |
1357 | #endif //MEDIAINFO_DEMUX | |
1358 | StreamItem.Parsers.push_back(Parser); | |
1359 | } | |
1360 | #endif | |
1361 | } | |
1362 | #endif | |
1363 | ||
1364 | 1292 | //Creating the parser |
1365 | 1293 | if (0); |
1366 | 1294 | #if defined(MEDIAINFO_MPEGA_YES) |
1401 | 1329 | StreamItem.Parsers.push_back(Parser); |
1402 | 1330 | } |
1403 | 1331 | #endif |
1404 | #if defined(MEDIAINFO_PCM_YES) | |
1405 | else if (MediaInfoLib::Config.CodecID_Get(Stream_Audio, InfoCodecID_Format_Riff, Codec)==__T("PCM")) | |
1406 | { | |
1407 | File_Pcm* Parser=new File_Pcm; | |
1408 | Parser->Codec=Codec; | |
1409 | Parser->BitDepth=(int8u)BitsPerSample; | |
1410 | #if MEDIAINFO_DEMUX | |
1411 | if (Demux_Rate) | |
1412 | Parser->Frame_Count_Valid = float64_int64s(Demux_Rate); | |
1413 | if (Config->Demux_Unpacketize_Get() && Retrieve(Stream_General, 0, General_Format)==__T("Wave")) | |
1414 | { | |
1415 | Parser->Demux_Level=2; //Container | |
1416 | Parser->Demux_UnpacketizeContainer=true; | |
1417 | Demux_Level=4; //Intermediate | |
1418 | } | |
1419 | #else //MEDIAINFO_DEMUX | |
1420 | Parser->Frame_Count_Valid=(int64u)-1; //Disabling it, waiting for SMPTE ST 337 parser reject | |
1421 | #endif //MEDIAINFO_DEMUX | |
1422 | stream& StreamItem = Stream[Stream_ID]; | |
1423 | StreamItem.Parsers.push_back(Parser); | |
1424 | StreamItem.IsPcm=true; | |
1332 | #if defined(MEDIAINFO_PCM_YES) || defined(MEDIAINFO_DTS_YES) || defined(MEDIAINFO_SMPTEST0337_YES) | |
1333 | if (MediaInfoLib::Config.CodecID_Get(Stream_Audio, InfoCodecID_Format_Riff, Codec) == __T("PCM")) | |
1334 | { | |
1335 | Parser_Pcm(StreamItem, Channels, BitsPerSample, BitsPerSample, SamplesPerSec); | |
1425 | 1336 | } |
1426 | 1337 | #endif |
1427 | 1338 | #if defined(MEDIAINFO_ADPCM_YES) |
1482 | 1393 | Skip_XX(Option_Size, "Unknown"); |
1483 | 1394 | else if (Element_Offset!=Element_Size) |
1484 | 1395 | Skip_XX(Element_Size-Element_Offset, "Error"); |
1396 | } | |
1397 | ||
1398 | if (Retrieve(Stream_Audio, 0, Audio_Format)==__T("PCM")) | |
1399 | { | |
1400 | //BlockAlign | |
1401 | int32u ComputedBlockAlign=Channels*BitsPerSample/8; | |
1402 | if (BlockAlign && BlockAlign==(int16u)-1) | |
1403 | { | |
1404 | if (BlockAlign!=ComputedBlockAlign) | |
1405 | Fill(Stream_Audio, StreamKind_Last, "BlockAlignIssue", Ztring::ToZtring(BlockAlign)+__T(", expected ")+Ztring::ToZtring(ComputedBlockAlign)); | |
1406 | } | |
1407 | else // For WAVE data | |
1408 | BlockAlign=ComputedBlockAlign; | |
1485 | 1409 | } |
1486 | 1410 | } |
1487 | 1411 | |
1602 | 1526 | Fill(Stream_Audio, StreamPos_Last, Audio_Codec, MediaInfoLib::Config.Codec_Get(Ztring().From_Number(LegacyCodecID, 16)), true); |
1603 | 1527 | |
1604 | 1528 | //Creating the parser |
1529 | stream& StreamItem=Stream[Stream_ID]; | |
1605 | 1530 | if (0); |
1606 | #if defined(MEDIAINFO_PCM_YES) | |
1531 | #if defined(MEDIAINFO_PCM_YES) || defined(MEDIAINFO_DTS_YES) || defined(MEDIAINFO_SMPTEST0337_YES) | |
1607 | 1532 | else if (MediaInfoLib::Config.CodecID_Get(Stream_Audio, InfoCodecID_Format_Riff, Ztring().From_Number(LegacyCodecID, 16))==__T("PCM")) |
1608 | 1533 | { |
1609 | //Creating the parser | |
1610 | File_Pcm* Parser=new File_Pcm; | |
1611 | Parser->Codec=Ztring().From_GUID(SubFormat); | |
1612 | Parser->BitDepth=(int8u)BitsPerSample; | |
1613 | if (ValidBitsPerSample!=BitsPerSample) | |
1614 | Parser->BitDepth_Significant=(int8u)ValidBitsPerSample; | |
1615 | #if MEDIAINFO_DEMUX | |
1616 | if (Config->Demux_Unpacketize_Get() && Retrieve(Stream_General, 0, General_Format)==__T("Wave")) | |
1617 | { | |
1618 | Parser->Demux_Level=2; //Container | |
1619 | Parser->Demux_UnpacketizeContainer=true; | |
1620 | Demux_Level=4; //Intermediate | |
1621 | } | |
1622 | #endif //MEDIAINFO_DEMUX | |
1623 | stream& StreamItem = Stream[Stream_ID]; | |
1624 | StreamItem.Parsers.push_back(Parser); | |
1625 | StreamItem.IsPcm=true; | |
1534 | int16u Channels=Retrieve(Stream_Audio, StreamPos_Last, "Channel(s)").To_int16u(); | |
1535 | Parser_Pcm(StreamItem, Channels, BitsPerSample, ValidBitsPerSample, SamplesPerSec); | |
1626 | 1536 | } |
1627 | 1537 | #endif |
1628 | 1538 | Open_Buffer_Init_All(); |
1781 | 1691 | Element_Info1("Video"); |
1782 | 1692 | |
1783 | 1693 | //Parsing |
1784 | int32u Compression, Width, Height; | |
1694 | int32u Size, Compression, Width, Height; | |
1785 | 1695 | int16u Resolution; |
1786 | Skip_L4( "Size"); | |
1696 | Get_L4 (Size, "Size"); | |
1787 | 1697 | Get_L4 (Width, "Width"); |
1788 | 1698 | Get_L4 (Height, "Height"); |
1789 | 1699 | Skip_L2( "Planes"); |
1829 | 1739 | if (Resolution==32) |
1830 | 1740 | { |
1831 | 1741 | Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_Format), "RGBA", Unlimited, true, true); |
1742 | if (StreamKind_Last==Stream_Video) | |
1743 | Fill(Stream_Video, StreamPos_Last, Video_ColorSpace, "RGBA", Unlimited, true, true); | |
1832 | 1744 | Fill(StreamKind_Last, StreamPos_Last, "BitDepth", Resolution/4); //With Alpha |
1833 | 1745 | } |
1834 | 1746 | else |
1747 | { | |
1748 | Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_Format), "RGB", Unlimited, true, true); | |
1749 | if (StreamKind_Last==Stream_Video) | |
1750 | Fill(Stream_Video, StreamPos_Last, Video_ColorSpace, "RGB", Unlimited, true, true); | |
1835 | 1751 | Fill(StreamKind_Last, StreamPos_Last, "BitDepth", Resolution<=16?8:(Resolution/3)); //indexed or normal |
1752 | } | |
1836 | 1753 | } |
1837 | 1754 | else if (Compression==0x56503632 //VP62 |
1838 | 1755 | || MediaInfoLib::Config.CodecID_Get(StreamKind_Last, InfoCodecID_Format_Riff, Ztring().From_CC4(Compression), InfoCodecID_Format)==__T("H.263") //H.263 |
1848 | 1765 | File_Ffv1* Parser=new File_Ffv1; |
1849 | 1766 | Parser->Width=Width; |
1850 | 1767 | Parser->Height=Height; |
1768 | Stream[Stream_ID].Parsers.push_back(Parser); | |
1769 | } | |
1770 | #endif | |
1771 | #if defined(MEDIAINFO_CINEFORM_YES) | |
1772 | else if (MediaInfoLib::Config.CodecID_Get(Stream_Video, InfoCodecID_Format_Riff, Ztring().From_CC4(Compression), InfoCodecID_Format)==__T("CineForm")) | |
1773 | { | |
1774 | File_CineForm* Parser=new File_CineForm; | |
1851 | 1775 | Stream[Stream_ID].Parsers.push_back(Parser); |
1852 | 1776 | } |
1853 | 1777 | #endif |
1947 | 1871 | return; //No options |
1948 | 1872 | |
1949 | 1873 | //Filling |
1874 | int32u Element_Size_Save=0; | |
1875 | if (Size<Element_Size) | |
1876 | { | |
1877 | Element_Size_Save=Element_Size; | |
1878 | Element_Size=Size; | |
1879 | } | |
1950 | 1880 | if (0); |
1951 | 1881 | else if (MediaInfoLib::Config.CodecID_Get(Stream_Video, InfoCodecID_Format_Riff, Ztring().From_CC4(Compression))==__T("AVC")) |
1952 | 1882 | AVI__hdlr_strl_strf_vids_Avc(); |
1955 | 1885 | else if (MediaInfoLib::Config.CodecID_Get(Stream_Video, InfoCodecID_Format_Riff, Ztring().From_CC4(Compression))==__T("HuffYUV")) |
1956 | 1886 | AVI__hdlr_strl_strf_vids_HuffYUV(Resolution, Height); |
1957 | 1887 | else Skip_XX(Element_Size-Element_Offset, "Unknown"); |
1888 | if (Element_Size_Save) | |
1889 | Element_Size=Element_Size_Save; | |
1890 | Skip_XX(Element_Size-Element_Offset, "Unknown"); | |
1958 | 1891 | } |
1959 | 1892 | |
1960 | 1893 | //--------------------------------------------------------------------------- |
3800 | 3733 | return; //This is maybe embeded in another container, and there is only the header (What is the junk?) |
3801 | 3734 | } |
3802 | 3735 | |
3736 | //Parsing | |
3737 | Element_Code=(int64u)-1; | |
3738 | ||
3803 | 3739 | FILLING_BEGIN(); |
3804 | Fill(Stream_Audio, 0, Audio_StreamSize, Buffer_DataToParse_End-Buffer_DataToParse_Begin); | |
3805 | FILLING_END(); | |
3806 | ||
3807 | //Parsing | |
3808 | Element_Code=(int64u)-1; | |
3809 | ||
3810 | FILLING_BEGIN(); | |
3811 | int64u Duration=Retrieve(Stream_Audio, 0, Audio_Duration).To_int64u(); | |
3812 | int64u BitRate=Retrieve(Stream_Audio, 0, Audio_BitRate).To_int64u(); | |
3740 | int64u StreamSize=Buffer_DataToParse_End-Buffer_DataToParse_Begin; | |
3741 | Fill(Stream_Audio, 0, Audio_StreamSize, StreamSize, 10, true); | |
3742 | if (Retrieve(Stream_Audio, 0, Audio_Format)==__T("PCM") && BlockAlign) | |
3743 | Fill(Stream_Audio, 0, Audio_SamplingCount, StreamSize/BlockAlign, 10, true); | |
3744 | float64 Duration=Retrieve(Stream_Audio, 0, Audio_Duration).To_float64(); | |
3745 | float64 BitRate=Retrieve(Stream_Audio, 0, Audio_BitRate).To_float64(); | |
3813 | 3746 | if (Duration) |
3814 | 3747 | { |
3815 | int64u BitRate_New=(Buffer_DataToParse_End-Buffer_DataToParse_Begin)*8*1000/Duration; | |
3748 | float64 BitRate_New=((float64)StreamSize)*8*1000/Duration; | |
3816 | 3749 | if (BitRate_New<BitRate*0.95 || BitRate_New>BitRate*1.05) |
3817 | 3750 | Fill(Stream_Audio, 0, Audio_BitRate, BitRate_New, 10, true); //Correcting the bitrate, it was false in the header |
3818 | 3751 | } |
3820 | 3753 | { |
3821 | 3754 | if (IsSub) |
3822 | 3755 | //Retrieving "data" real size, in case of truncated files and/or wave header in another container |
3823 | Duration=((int64u)LittleEndian2int32u(Buffer+Buffer_Offset-4))*8*1000/BitRate; //TODO: RF64 is not handled | |
3756 | Duration=((float64)LittleEndian2int32u(Buffer+Buffer_Offset-4))*8*1000/BitRate; //TODO: RF64 is not handled | |
3824 | 3757 | else |
3825 | Duration=(Buffer_DataToParse_End-Buffer_DataToParse_Begin)*8*1000/BitRate; | |
3826 | Fill(Stream_General, 0, General_Duration, Duration, 10, true); | |
3827 | Fill(Stream_Audio, 0, Audio_Duration, Duration, 10, true); | |
3758 | Duration=((float64)StreamSize)*8*1000/BitRate; | |
3759 | Fill(Stream_General, 0, General_Duration, Duration, 0, true); | |
3760 | Fill(Stream_Audio, 0, Audio_Duration, Duration, 0, true); | |
3828 | 3761 | } |
3829 | 3762 | FILLING_END(); |
3830 | 3763 | } |
3855 | 3788 | Element_Name("DataSize64"); |
3856 | 3789 | |
3857 | 3790 | //Parsing |
3791 | int64u dataSize, sampleCount; | |
3858 | 3792 | int32u tableLength; |
3859 | 3793 | Skip_L8( "riffSize"); //Is directly read from the header parser |
3860 | Get_L8 (WAVE_data_Size, "dataSize"); | |
3861 | Get_L8 (WAVE_fact_samplesCount, "sampleCount"); | |
3794 | Get_L8 (dataSize, "dataSize"); | |
3795 | Get_L8 (sampleCount, "sampleCount"); | |
3862 | 3796 | Get_L4 (tableLength, "tableLength"); |
3863 | 3797 | for (int32u Pos=0; Pos<tableLength; Pos++) |
3864 | 3798 | Skip_L8( "table[]"); |
3799 | ||
3800 | FILLING_BEGIN(); | |
3801 | if (dataSize && dataSize<File_Size) | |
3802 | { | |
3803 | WAVE_data_Size=dataSize; | |
3804 | if (Retrieve(Stream_Audio, 0, Audio_StreamSize).empty()) // Not the priority | |
3805 | Fill(Stream_Audio, 0, Audio_StreamSize, WAVE_data_Size); | |
3806 | } | |
3807 | if (sampleCount && sampleCount<File_Size) | |
3808 | { | |
3809 | WAVE_fact_samplesCount=sampleCount; | |
3810 | if (WAVE_fact_samplesCount && WAVE_fact_samplesCount<File_Size && Retrieve(Stream_Audio, 0, Audio_SamplingCount).empty()) // Not the priority | |
3811 | Fill(Stream_Audio, 0, Audio_SamplingCount, WAVE_fact_samplesCount); | |
3812 | } | |
3813 | if (WAVE_data_Size && WAVE_data_Size<File_Size && WAVE_fact_samplesCount && WAVE_fact_samplesCount<File_Size) | |
3814 | { | |
3815 | int64u ComputedBlockAlign=WAVE_data_Size/WAVE_fact_samplesCount; | |
3816 | if (ComputedBlockAlign<0x10000) | |
3817 | BlockAlign=ComputedBlockAlign; | |
3818 | } | |
3819 | FILLING_END(); | |
3865 | 3820 | } |
3866 | 3821 | |
3867 | 3822 | //--------------------------------------------------------------------------- |
3870 | 3825 | Element_Name("Sample count"); |
3871 | 3826 | |
3872 | 3827 | //Parsing |
3873 | int64u SamplesCount64; | |
3874 | 3828 | int32u SamplesCount; |
3875 | 3829 | Get_L4 (SamplesCount, "SamplesCount"); |
3876 | SamplesCount64=SamplesCount; | |
3877 | if (SamplesCount64==0xFFFFFFFF) | |
3878 | SamplesCount64=WAVE_fact_samplesCount; | |
3879 | 3830 | |
3880 | 3831 | FILLING_BEGIN(); |
3881 | int32u SamplingRate=Retrieve(Stream_Audio, 0, Audio_SamplingRate).To_int32u(); | |
3882 | if (SamplingRate) | |
3832 | if (!Retrieve(Stream_Audio, 0, Audio_SamplingCount).empty()) // Not the priority | |
3833 | { | |
3834 | int64u SamplesCount64=SamplesCount==(int32u)-1?WAVE_fact_samplesCount:SamplesCount; | |
3835 | float64 SamplingRate=Retrieve(Stream_Audio, 0, Audio_SamplingRate).To_float64(); | |
3836 | if (SamplesCount64!=(int64u)-1 && SamplingRate) | |
3883 | 3837 | { |
3884 | 3838 | //Calculating |
3885 | int64u Duration=(SamplesCount64*1000)/SamplingRate; | |
3839 | float64 Duration=((float64)SamplesCount64)*1000/SamplingRate; | |
3886 | 3840 | |
3887 | 3841 | //Coherency test |
3888 | 3842 | bool IsOK=true; |
3889 | 3843 | if (File_Size!=(int64u)-1) |
3890 | 3844 | { |
3891 | int64u BitRate=Retrieve(Stream_Audio, 0, Audio_BitRate).To_int64u(); | |
3845 | float64 BitRate=Retrieve(Stream_Audio, 0, Audio_BitRate).To_float64(); | |
3892 | 3846 | if (BitRate) |
3893 | 3847 | { |
3894 | 3848 | int64u Duration_FromBitRate = File_Size * 8 * 1000 / BitRate; |
3899 | 3853 | |
3900 | 3854 | //Filling |
3901 | 3855 | if (IsOK) |
3902 | Fill(Stream_Audio, 0, Audio_Duration, Duration); | |
3856 | Fill(Stream_Audio, 0, Audio_SamplingCount, SamplesCount, 10, true); | |
3857 | } | |
3903 | 3858 | } |
3904 | 3859 | FILLING_END(); |
3905 | 3860 | } |
4032 | 3987 | for (size_t Pos = 0; Pos<StreamItem.Parsers.size(); Pos++) |
4033 | 3988 | Open_Buffer_Init(StreamItem.Parsers[Pos]); |
4034 | 3989 | } |
3990 | ||
3991 | //--------------------------------------------------------------------------- | |
3992 | void File_Riff::Parser_Pcm(stream& StreamItem, int16u Channels, int16u BitsPerSample, int16u ValidBitsPerSample, int32u SamplesPerSec, char Endianness) | |
3993 | { | |
3994 | #if defined(MEDIAINFO_DTS_YES) | |
3995 | { | |
3996 | File_Dts* Parser=new File_Dts; | |
3997 | Parser->Frame_Count_Valid=2; | |
3998 | Parser->ShouldContinueParsing=true; | |
3999 | #if MEDIAINFO_DEMUX | |
4000 | if (Config->Demux_Unpacketize_Get() && Retrieve(Stream_General, 0, General_Format)==__T("Wave")) | |
4001 | { | |
4002 | Parser->Demux_Level=2; //Container | |
4003 | Parser->Demux_UnpacketizeContainer=true; | |
4004 | Demux_Level=4; //Intermediate | |
4005 | } | |
4006 | #endif //MEDIAINFO_DEMUX | |
4007 | StreamItem.Parsers.push_back(Parser); | |
4008 | } | |
4009 | #endif | |
4010 | ||
4011 | #if defined(MEDIAINFO_SMPTEST0337_YES) | |
4012 | if (Channels==2 && BitsPerSample<=32 && SamplesPerSec==48000) //Some SMPTE ST 337 streams are hidden in PCM stream | |
4013 | { | |
4014 | File_SmpteSt0337* Parser=new File_SmpteSt0337; | |
4015 | Parser->Container_Bits=(int8u)BitsPerSample; | |
4016 | Parser->Aligned=true; | |
4017 | Parser->ShouldContinueParsing=true; | |
4018 | #if MEDIAINFO_DEMUX | |
4019 | if (Config->Demux_Unpacketize_Get() && Retrieve(Stream_General, 0, General_Format)==__T("Wave")) | |
4020 | { | |
4021 | Parser->Demux_Level=2; //Container | |
4022 | Parser->Demux_UnpacketizeContainer=true; | |
4023 | Demux_Level=4; //Intermediate | |
4024 | } | |
4025 | #endif //MEDIAINFO_DEMUX | |
4026 | StreamItem.Parsers.push_back(Parser); | |
4027 | } | |
4028 | if (Channels>2 && BitsPerSample<=32 && SamplesPerSec==48000) //Some SMPTE ST 337 streams are hidden in PCM stream | |
4029 | { | |
4030 | File_ChannelSplitting* Parser=new File_ChannelSplitting; | |
4031 | Parser->BitDepth=(int8u)BitsPerSample; | |
4032 | Parser->Endianness='B'; | |
4033 | Parser->Channel_Total=(int8u)Channels; | |
4034 | Parser->ShouldContinueParsing=true; | |
4035 | Parser->SamplingRate=48000; | |
4036 | #if MEDIAINFO_DEMUX | |
4037 | if (Config->Demux_Unpacketize_Get()) | |
4038 | { | |
4039 | Parser->Demux_Level=2; //Container | |
4040 | Parser->Demux_UnpacketizeContainer=true; | |
4041 | Demux_Level=4; //Intermediate | |
4042 | } | |
4043 | #endif //MEDIAINFO_DEMUX | |
4044 | Stream[Stream_ID].Parsers.push_back(Parser); | |
4045 | } | |
4046 | #endif | |
4047 | ||
4048 | #if defined(MEDIAINFO_PCM_YES) | |
4049 | File_Pcm* Parser=new File_Pcm; | |
4050 | Parser->Codec=Retrieve(Stream_Audio, StreamPos_Last, Audio_CodecID); | |
4051 | if (Endianness) | |
4052 | Parser->Endianness=Endianness; | |
4053 | Parser->BitDepth=(int8u)BitsPerSample; | |
4054 | if (ValidBitsPerSample!=BitsPerSample) | |
4055 | Parser->BitDepth_Significant=(int8u)ValidBitsPerSample; | |
4056 | #if MEDIAINFO_DEMUX | |
4057 | if (Config->Demux_Unpacketize_Get()) | |
4058 | { | |
4059 | Parser->Demux_Level=2; //Container | |
4060 | Parser->Demux_UnpacketizeContainer=true; | |
4061 | Demux_Level=4; //Intermediate | |
4062 | } | |
4063 | #else //MEDIAINFO_DEMUX | |
4064 | Parser->Frame_Count_Valid=(int64u)-1; //Disabling it, waiting for SMPTE ST 337 parser reject | |
4065 | #endif //MEDIAINFO_DEMUX | |
4066 | StreamItem.Parsers.push_back(Parser); | |
4067 | StreamItem.IsPcm=true; | |
4068 | StreamItem.StreamKind=Stream_Audio; | |
4069 | #endif | |
4070 | } | |
4071 | ||
4035 | 4072 | //*************************************************************************** |
4036 | 4073 | // C++ |
4037 | 4074 | //*************************************************************************** |
1419 | 1419 | CodecID+=MI->Retrieve(StreamKind_Last, StreamPos_To, MI->Fill_Parameter(StreamKind_Last, Generic_CodecID)); |
1420 | 1420 | MI->Fill(StreamKind_Last, StreamPos_To, MI->Fill_Parameter(StreamKind_Last, Generic_CodecID), CodecID, true); |
1421 | 1421 | } |
1422 | if (!Sequences[Sequences_Current]->IsMain && Sequences[Sequences_Current]->MI->Count_Get(Stream_Video)+Sequences[Sequences_Current]->MI->Count_Get(Stream_Audio)>1 && Sequences[Sequences_Current]->MI->Get(Stream_Video, 0, Video_Format)!=__T("DV")) | |
1422 | if (!Sequences[Sequences_Current]->IsMain && Sequences[Sequences_Current]->MI->Count_Get(Stream_Video)+Sequences[Sequences_Current]->MI->Count_Get(Stream_Audio)>1 && Sequences[Sequences_Current]->MI->Get(Stream_Video, 0, Video_Format)!=__T("DV") && Sequences[Sequences_Current]->MI->Get(Stream_Audio, 0, Audio_Format)!=__T("Dolby E")) | |
1423 | 1423 | { |
1424 | 1424 | if (StreamKind_Last==Stream_Menu) |
1425 | 1425 | { |
607 | 607 | #if !defined(MEDIAINFO_VIDEO_NO) && !defined(MEDIAINFO_CANOPUS_NO) && !defined(MEDIAINFO_CANOPUS_YES) |
608 | 608 | #define MEDIAINFO_CANOPUS_YES |
609 | 609 | #endif |
610 | #if !defined(MEDIAINFO_VIDEO_NO) && !defined(MEDIAINFO_CINEFORM_NO) && !defined(MEDIAINFO_CINEFORM_YES) | |
611 | #define MEDIAINFO_CINEFORM_YES | |
612 | #endif | |
610 | 613 | #if !defined(MEDIAINFO_VIDEO_NO) && !defined(MEDIAINFO_DIRAC_NO) && !defined(MEDIAINFO_DIRAC_YES) |
611 | 614 | #define MEDIAINFO_DIRAC_YES |
612 | 615 | #endif |
229 | 229 | else if (Key==__T("DATE")) Fill(StreamKind_Common, 0, "Recorded_Date", Value, true); |
230 | 230 | else if (Key==__T("DESCRIPTION")) Fill(StreamKind_Common, 0, "Description", Value); |
231 | 231 | else if (Key==__T("DISC")) Fill(StreamKind_Common, 0, "Part", Value, true); |
232 | else if (Key==__T("DISCID")) {} | |
233 | 232 | else if (Key==__T("DISCNUMBER")) Fill(StreamKind_Common, 0, "Part", Value, true); |
234 | 233 | else if (Key==__T("DISCTOTAL")) {if (Value!=Retrieve(StreamKind_Common, 0, "Part/Position_Total")) Fill(StreamKind_Common, 0, "Part/Position_Total", Value);} |
235 | 234 | else if (Key==__T("ENCODEDBY")) Fill(StreamKind_Common, 0, "EncodedBy", Value); |
4326 | 4326 | //Parsing |
4327 | 4327 | int8u Profile, Level, seq_parameter_set_count, pic_parameter_set_count; |
4328 | 4328 | if (SizedBlocks) |
4329 | Skip_B1( "Version"); | |
4330 | Get_B1 (Profile, "Profile"); | |
4331 | Skip_B1( "Compatible profile"); | |
4332 | Get_B1 (Level, "Level"); | |
4329 | Skip_B1( "configurationVersion"); | |
4330 | Get_B1 (Profile, "AVCProfileIndication"); | |
4331 | Skip_B1( "profile_compatibility"); | |
4332 | Get_B1 (Level, "AVCLevelIndication"); | |
4333 | 4333 | BS_Begin(); |
4334 | Skip_S1(6, "Reserved"); | |
4335 | Get_S1 (2, SizeOfNALU_Minus1, "Size of NALU length minus 1"); | |
4336 | Skip_S1(3, "Reserved"); | |
4337 | Get_S1 (5, seq_parameter_set_count, "seq_parameter_set count"); | |
4334 | Skip_S1(6, "reserved"); | |
4335 | Get_S1 (2, SizeOfNALU_Minus1, "lengthSizeMinusOne"); | |
4336 | Skip_S1(3, "reserved"); | |
4337 | Get_S1 (5, seq_parameter_set_count, "numOfSequenceParameterSets"); | |
4338 | 4338 | BS_End(); |
4339 | 4339 | for (int8u Pos=0; Pos<seq_parameter_set_count; Pos++) |
4340 | 4340 | { |
4341 | 4341 | Element_Begin1("seq_parameter_set"); |
4342 | 4342 | int16u Size; |
4343 | Get_B2 (Size, "Size"); | |
4343 | Get_B2 (Size, "sequenceParameterSetLength"); | |
4344 | 4344 | BS_Begin(); |
4345 | 4345 | Mark_0 (); |
4346 | 4346 | Skip_S1( 2, "nal_ref_idc"); |
4363 | 4363 | Element_Size=Element_Size_Save; |
4364 | 4364 | Element_End0(); |
4365 | 4365 | } |
4366 | Get_B1 (pic_parameter_set_count, "pic_parameter_set count"); | |
4366 | Get_B1 (pic_parameter_set_count, "numOfPictureParameterSets"); | |
4367 | 4367 | for (int8u Pos=0; Pos<pic_parameter_set_count; Pos++) |
4368 | 4368 | { |
4369 | 4369 | Element_Begin1("pic_parameter_set"); |
4370 | 4370 | int16u Size; |
4371 | Get_B2 (Size, "Size"); | |
4371 | Get_B2 (Size, "pictureParameterSetLength"); | |
4372 | 4372 | BS_Begin(); |
4373 | 4373 | Mark_0 (); |
4374 | 4374 | Skip_S1( 2, "nal_ref_idc"); |
4389 | 4389 | Element_End0(); |
4390 | 4390 | } |
4391 | 4391 | if (Element_Offset<Element_Size) |
4392 | Skip_XX(Element_Size-Element_Offset, "Padding?"); | |
4392 | { | |
4393 | switch (Profile) | |
4394 | { | |
4395 | case 100: | |
4396 | case 110: | |
4397 | case 122: | |
4398 | case 144: | |
4399 | { | |
4400 | int8u numOfSequenceParameterSetExt; | |
4401 | BS_Begin(); | |
4402 | Skip_S1( 6, "reserved"); | |
4403 | Skip_S1( 2, "chroma_format"); | |
4404 | Skip_S1( 5, "reserved"); | |
4405 | Skip_S1( 3, "bit_depth_luma_minus8"); | |
4406 | Skip_S1( 5, "reserved"); | |
4407 | Skip_S1( 3, "bit_depth_chroma_minus8"); | |
4408 | BS_End(); | |
4409 | Get_B1 (numOfSequenceParameterSetExt, "numOfSequenceParameterSetExt"); | |
4410 | for (int8u Pos=0; Pos<numOfSequenceParameterSetExt; Pos++) | |
4411 | { | |
4412 | Element_Begin1("sequenceParameterSetExtNALUnit"); | |
4413 | int16u Size; | |
4414 | Get_B2 (Size, "sequenceParameterSetExtLength"); | |
4415 | BS_Begin(); | |
4416 | Mark_0 (); | |
4417 | Skip_S1( 2, "nal_ref_idc"); | |
4418 | Skip_S1( 5, "nal_unit_type"); | |
4419 | BS_End(); | |
4420 | int64u Element_Offset_Save=Element_Offset; | |
4421 | int64u Element_Size_Save=Element_Size; | |
4422 | Buffer_Offset+=(size_t)Element_Offset_Save; | |
4423 | Element_Offset=0; | |
4424 | Element_Size=Size-1; | |
4425 | if (Element_Size>Element_Size_Save-Element_Offset_Save) | |
4426 | break; //There is an error | |
4427 | Element_Code=0x0F; //subset_seq_parameter_set | |
4428 | Data_Parse(); | |
4429 | Buffer_Offset-=(size_t)Element_Offset_Save; | |
4430 | Element_Offset=Element_Offset_Save+Size-1; | |
4431 | Element_Size=Element_Size_Save; | |
4432 | Element_End0(); | |
4433 | } | |
4434 | } | |
4435 | default:; | |
4436 | } | |
4437 | } | |
4438 | if (Element_Offset<Element_Size) | |
4439 | Skip_XX(Element_Size-Element_Offset, "Padding?"); | |
4393 | 4440 | |
4394 | 4441 | //Filling |
4395 | 4442 | FILLING_BEGIN_PRECISE(); |
0 | /* Copyright (c) MediaArea.net SARL. All Rights Reserved. | |
1 | * | |
2 | * Use of this source code is governed by a BSD-style license that can | |
3 | * be found in the License.html file in the root of the source tree. | |
4 | */ | |
5 | ||
6 | //--------------------------------------------------------------------------- | |
7 | // Pre-compilation | |
8 | #include "MediaInfo/PreComp.h" | |
9 | #ifdef __BORLANDC__ | |
10 | #pragma hdrstop | |
11 | #endif | |
12 | //--------------------------------------------------------------------------- | |
13 | ||
14 | //--------------------------------------------------------------------------- | |
15 | #include "MediaInfo/Setup.h" | |
16 | //--------------------------------------------------------------------------- | |
17 | ||
18 | //--------------------------------------------------------------------------- | |
19 | #if defined(MEDIAINFO_CINEFORM_YES) | |
20 | //--------------------------------------------------------------------------- | |
21 | ||
22 | //--------------------------------------------------------------------------- | |
23 | #include "MediaInfo/MediaInfo_Config_MediaInfo.h" | |
24 | #include "MediaInfo/Video/File_CineForm.h" | |
25 | //--------------------------------------------------------------------------- | |
26 | ||
27 | namespace MediaInfoLib | |
28 | { | |
29 | ||
30 | //*************************************************************************** | |
31 | // Infos | |
32 | //*************************************************************************** | |
33 | ||
34 | //--------------------------------------------------------------------------- | |
35 | static const char* Tags[]= | |
36 | { | |
37 | "Padding", | |
38 | "SampleType", | |
39 | "SampleIndexTable", | |
40 | "SampleIndexEntry", | |
41 | "BitstreamMarker", | |
42 | "VersionMajor", | |
43 | "VersionMinor", | |
44 | "VersionRevision", | |
45 | "VersionEdit", | |
46 | "SequenceFlags", | |
47 | "TransformType", | |
48 | "NumFrames", | |
49 | "NumChannels", | |
50 | "NumWavelets", | |
51 | "NumSubbands", | |
52 | "NumSpatial", | |
53 | "FirstWavelet", | |
54 | "ChannelByteSize", | |
55 | "GroupTrailer", | |
56 | "ImageType", | |
57 | "ImageWidth", | |
58 | "ImageHeight", | |
59 | "ImageFormat", | |
60 | "ImageIndex", | |
61 | "ImageTrailer", | |
62 | "LowpassSubband", | |
63 | "NumLevels", | |
64 | "LowpassWidth", | |
65 | "LowpassHeight", | |
66 | "MarginTop", | |
67 | "MarginBottom", | |
68 | "MarginLeft", | |
69 | "MarginRight", | |
70 | "PixelOffset", | |
71 | "Quantization", | |
72 | "PixelDepth", | |
73 | "LowpassTrailer", | |
74 | "WaveletType", | |
75 | "WaveletNumber", | |
76 | "WaveletLevel", | |
77 | "NumBands", | |
78 | "HighpassWidth", | |
79 | "HighpassHeight", | |
80 | "LowpassBorder", | |
81 | "HighpassBorder", | |
82 | "LowpassScale", | |
83 | "LowpassDivisor", | |
84 | "HighpassTrailer", | |
85 | "BandNum", | |
86 | "BandWidth", | |
87 | "BandHeight", | |
88 | "BandSubband", | |
89 | "BandEncoding", | |
90 | "BandQuantization", | |
91 | "BandScale", | |
92 | "BandHeader", | |
93 | "BandTrailer", | |
94 | "NumZeroValues", | |
95 | "NumZeroTrees", | |
96 | "NumPositives", | |
97 | "NumNegative", | |
98 | "ZeroNodes", | |
99 | "ChannelNumber", | |
100 | "InterlacedFlags", | |
101 | "ProtectionFlags", | |
102 | "PixtureAspectRatioX", | |
103 | "PixtureAspectRatioY", | |
104 | "SubBand", //Unused | |
105 | "SampleFlags", | |
106 | "FrameNumber", | |
107 | "Precision", | |
108 | "InputFormat", | |
109 | "BandCodingFlags", | |
110 | "InputColorspace", | |
111 | "PeakLevel", | |
112 | "PeakTableOffsetLow", | |
113 | "PeakTableOffsetHigh", | |
114 | "TagSampleEnd", | |
115 | "TagCount", | |
116 | "TagVersion", // 4 version, 4 subversion, 8 subsubversion | |
117 | "QualityLow", | |
118 | "QualityHigh", | |
119 | "BandSecondPass", | |
120 | "PrescaleTable", | |
121 | "EncodedFormat", | |
122 | "DisplayHeight", | |
123 | "DisplayWidth", | |
124 | "DisplayOffsetX", | |
125 | "DisplayOffsetY", | |
126 | "ColorSpaceOld", | |
127 | "ColorSpaceOld3pt3", | |
128 | "EncodedChannels", | |
129 | "EncodedChannelNum", | |
130 | "EncodedChannelQuality", | |
131 | "Skip", | |
132 | "PresentationHeight", | |
133 | "PresentationWidth", | |
134 | NULL, | |
135 | NULL, | |
136 | NULL, | |
137 | NULL, | |
138 | "BitsPerComponent", | |
139 | "MaxBitsPerComponent", | |
140 | NULL, | |
141 | "ChannelWidth?", | |
142 | "ChannelHeight?", | |
143 | "PatternWidth", | |
144 | "PatternHeight", | |
145 | "ComponentsPerSample", | |
146 | "PrescaleShift/AlphaSampling", | |
147 | NULL, | |
148 | NULL, | |
149 | NULL, | |
150 | NULL, | |
151 | NULL, | |
152 | NULL, | |
153 | NULL, | |
154 | NULL, | |
155 | NULL, | |
156 | NULL, | |
157 | "LayerCount", | |
158 | "LayerNumber", | |
159 | "LayerPattern", | |
160 | NULL, | |
161 | NULL, | |
162 | NULL, | |
163 | NULL, | |
164 | NULL, | |
165 | "NOP", | |
166 | }; | |
167 | ||
168 | static Ztring Tag_String(int16u Value) | |
169 | { | |
170 | if (Value>=sizeof(Tags)/sizeof(const char*) || !Tags[Value]) | |
171 | return Ztring::ToZtring(Value); | |
172 | return Ztring().From_UTF8(Tags[Value]); | |
173 | } | |
174 | ||
175 | //--------------------------------------------------------------------------- | |
176 | static const char* color_spaces[] = | |
177 | { | |
178 | "RGB", | |
179 | "YUV", | |
180 | "RGGB", | |
181 | }; | |
182 | enum color_space_enum | |
183 | { | |
184 | ColorSpace_Unkn, // Unknown | |
185 | ColorSpace_RGB, | |
186 | ColorSpace_YUV, | |
187 | ColorSpace_RGGB, | |
188 | }; | |
189 | enum pattern_enum | |
190 | { | |
191 | Pattern_Unk = 0x00, // Unknown | |
192 | Pattern_422 = 0x21, | |
193 | Pattern_420 = 0x22, | |
194 | Pattern_411 = 0x41, | |
195 | Pattern_410 = 0x44, | |
196 | }; | |
197 | ||
198 | struct input_format | |
199 | { | |
200 | int16u InputFormat; | |
201 | int8u ColorSpace; // color_space_enum | |
202 | int8u Pattern; // (PatternWidth<<4)|PatternHeight | |
203 | int16u ChannelCount; | |
204 | int16u BitsPerComponent; | |
205 | }; | |
206 | static const input_format InputFormatInfo[] = | |
207 | { | |
208 | { 0, ColorSpace_Unkn, Pattern_Unk, 0, 0}, | |
209 | { 1, ColorSpace_YUV , Pattern_422, 3, 8}, | |
210 | { 2, ColorSpace_YUV , Pattern_422, 3, 8}, | |
211 | { 3, ColorSpace_YUV , Pattern_422, 3, 8}, | |
212 | { 7, ColorSpace_RGB , Pattern_Unk, 3, 8}, | |
213 | { 8, ColorSpace_RGB , Pattern_Unk, 3, 8}, | |
214 | { 9, ColorSpace_RGB , Pattern_Unk, 3, 8}, | |
215 | { 10, ColorSpace_YUV , Pattern_422, 3, 10}, | |
216 | { 16, ColorSpace_YUV , Pattern_420, 3, 8}, | |
217 | { 17, ColorSpace_YUV , Pattern_420, 3, 8}, | |
218 | { 30, ColorSpace_RGB , Pattern_Unk, 4, 16}, | |
219 | { 32, ColorSpace_RGB , Pattern_Unk, 4, 8}, | |
220 | { 33, ColorSpace_YUV , Pattern_422, 3, 8}, | |
221 | { 35, ColorSpace_YUV , Pattern_Unk, 4, 8}, | |
222 | { 36, ColorSpace_YUV , Pattern_Unk, 4, 8}, | |
223 | {100, ColorSpace_RGGB, Pattern_Unk, 4, 0}, | |
224 | {101, ColorSpace_RGGB, Pattern_Unk, 4, 8}, | |
225 | {102, ColorSpace_RGGB, Pattern_Unk, 4, 10}, | |
226 | {103, ColorSpace_RGGB, Pattern_Unk, 4, 10}, | |
227 | {104, ColorSpace_RGGB, Pattern_Unk, 4, 16}, | |
228 | {105, ColorSpace_RGGB, Pattern_Unk, 4, 12}, | |
229 | {120, ColorSpace_RGB , Pattern_Unk, 3, 16}, | |
230 | {121, ColorSpace_RGB , Pattern_Unk, 4, 16}, | |
231 | {122, ColorSpace_RGB , Pattern_Unk, 3, 10}, | |
232 | {123, ColorSpace_RGB , Pattern_Unk, 3, 10}, | |
233 | {128, ColorSpace_RGB , Pattern_Unk, 3, 10}, | |
234 | {129, ColorSpace_YUV , Pattern_422, 3, 10}, | |
235 | {130, ColorSpace_YUV , Pattern_Unk, 4, 16}, | |
236 | {131, ColorSpace_YUV , Pattern_Unk, 4, 10}, | |
237 | {132, ColorSpace_RGB , Pattern_Unk, 4, 16}, | |
238 | }; | |
239 | ||
240 | static void InputFormat_Fill(input_format& ToFill) | |
241 | { | |
242 | if (!ToFill.InputFormat) | |
243 | return; | |
244 | ||
245 | const size_t Size=sizeof(InputFormatInfo)/sizeof(InputFormatInfo[0]); | |
246 | for (size_t i=0; i<Size; i++) | |
247 | if (ToFill.InputFormat==InputFormatInfo[i].InputFormat) | |
248 | { | |
249 | if (!ToFill.ColorSpace) | |
250 | ToFill.ColorSpace=InputFormatInfo[i].ColorSpace; | |
251 | if (!ToFill.Pattern) | |
252 | ToFill.Pattern=InputFormatInfo[i].Pattern; | |
253 | if (!ToFill.ChannelCount) | |
254 | ToFill.ChannelCount=InputFormatInfo[i].ChannelCount; | |
255 | if (!ToFill.BitsPerComponent) | |
256 | ToFill.BitsPerComponent=InputFormatInfo[i].BitsPerComponent; | |
257 | return; | |
258 | } | |
259 | } | |
260 | ||
261 | //*************************************************************************** | |
262 | // Constructor/Destructor | |
263 | //*************************************************************************** | |
264 | ||
265 | //--------------------------------------------------------------------------- | |
266 | File_CineForm::File_CineForm() | |
267 | :File__Analyze() | |
268 | { | |
269 | } | |
270 | ||
271 | ||
272 | //*************************************************************************** | |
273 | // Streams management | |
274 | //*************************************************************************** | |
275 | ||
276 | //--------------------------------------------------------------------------- | |
277 | void File_CineForm::Streams_Fill() | |
278 | { | |
279 | //Filling | |
280 | Stream_Prepare(Stream_Video); | |
281 | Fill(Stream_Video, 0, Video_Format, "CineForm"); | |
282 | } | |
283 | ||
284 | //*************************************************************************** | |
285 | // Buffer - Global | |
286 | //*************************************************************************** | |
287 | ||
288 | //--------------------------------------------------------------------------- | |
289 | void File_CineForm::Read_Buffer_Continue() | |
290 | { | |
291 | input_format InputFormat; | |
292 | InputFormat.InputFormat=0; | |
293 | InputFormat.ColorSpace=ColorSpace_Unkn; // Does not really exist | |
294 | InputFormat.Pattern=Pattern_Unk; // Does not really exist | |
295 | InputFormat.ChannelCount=0; | |
296 | InputFormat.BitsPerComponent=0; | |
297 | int16u ImageWidth=0; | |
298 | int16u ImageHeight=0; | |
299 | int32u SampleFlags=(int32u)-1; | |
300 | int16u EncodedFormat=0; | |
301 | int16u PatternWidth=0; | |
302 | int16u PatternHeight=0; | |
303 | int16u InterlacedFlags=0; | |
304 | int16u PixtureAspectRatioX=0; | |
305 | int16u PixtureAspectRatioY=0; | |
306 | ||
307 | while (Element_Size-Element_Offset>=4)// && Mask!=Mask_Total) | |
308 | { | |
309 | // Tag | |
310 | // 0x0000 - 0x1FFF: Tag-Value (2+2) | |
311 | // 0x2000 - 0x3FFF: Large (1+3) | |
312 | // 0x4000 - 0x5FFF: Small (2+2) | |
313 | // 0x6000 - 0x7FFF: Large (1+3) | |
314 | // 0x8000 - 0xFFFF: optional values, real value is absolute of the 2-complement | |
315 | Element_Begin0(); | |
316 | int16u Tag, Value; | |
317 | Get_B2 (Tag, "Tag"); | |
318 | Get_B2 (Value, "Value"); | |
319 | if (Tag&0x8000) | |
320 | Tag=(int16u)(-((int16s)Tag)); // Optional tags are "negative" | |
321 | ||
322 | int32u Size=0; | |
323 | if (Tag&0x2000) //Large | |
324 | { | |
325 | Element_Name("Large"); | |
326 | Element_Info1(Ztring::ToZtring(Tag>>8)); | |
327 | Size=Tag&0xFF; | |
328 | Size<<=16; | |
329 | Size|=Value; | |
330 | Size*=4; | |
331 | Skip_XX(Size, "Data"); | |
332 | } | |
333 | else if (Tag&0x4000) //Small | |
334 | { | |
335 | Element_Name("Small"); | |
336 | Element_Info1(Ztring::ToZtring(Tag)); | |
337 | int32u Size=Value; | |
338 | Size*=4; | |
339 | Skip_XX(Size, "Data"); | |
340 | } | |
341 | else //Tag-Value (2+2) | |
342 | { | |
343 | Element_Name(Tag_String(Tag)); | |
344 | Element_Info1(Value); | |
345 | ||
346 | switch (Tag) | |
347 | { | |
348 | case 2: //SampleIndexTable | |
349 | for (int16u i=0; i<Value; i++) | |
350 | Skip_B4( "Offset"); | |
351 | break; | |
352 | case 12: InputFormat.ChannelCount=Value; break; | |
353 | case 20: ImageWidth=Value; break; | |
354 | case 21: if (!ImageHeight) ImageHeight=Value; break; //CroppedHeight has priority | |
355 | case 68: SampleFlags=Value; break; | |
356 | case 65: PixtureAspectRatioX=Value; break; | |
357 | case 66: PixtureAspectRatioY=Value; break; | |
358 | case 70: if (!InputFormat.BitsPerComponent) InputFormat.BitsPerComponent=Value; break; // BitsPerComponent has the priority | |
359 | case 71: InputFormat.InputFormat=Value; break; | |
360 | case 84: EncodedFormat=Value; break; | |
361 | case 85: ImageHeight=Value; break; //CroppedHeight | |
362 | case 101: InputFormat.BitsPerComponent=Value; break; | |
363 | case 106: PatternWidth=Value; break; | |
364 | case 107: PatternHeight=Value; break; | |
365 | default:; | |
366 | } | |
367 | } | |
368 | Element_End0(); | |
369 | } | |
370 | Element_Offset=Element_Size; | |
371 | ||
372 | FILLING_BEGIN(); | |
373 | Accept("CineForm"); | |
374 | if (ImageWidth) | |
375 | Fill(Stream_Video, 0, Video_Width, ImageWidth); | |
376 | if (ImageHeight) | |
377 | Fill(Stream_Video, 0, Video_Height, ImageHeight); | |
378 | if (SampleFlags!=(int32u)-1) | |
379 | Fill(Stream_Video, 0, Video_ScanType, (SampleFlags&1)?"Progressive":"Interlaced"); | |
380 | switch (EncodedFormat) | |
381 | { | |
382 | case 1: | |
383 | InputFormat.ColorSpace=ColorSpace_YUV; | |
384 | if (!PatternWidth && !PatternHeight) | |
385 | { | |
386 | PatternWidth=2; | |
387 | PatternHeight=1; | |
388 | }; | |
389 | if (!InputFormat.BitsPerComponent) | |
390 | InputFormat.BitsPerComponent=10; | |
391 | break; | |
392 | case 2: | |
393 | InputFormat.ColorSpace=ColorSpace_RGGB; | |
394 | if (!InputFormat.BitsPerComponent) | |
395 | InputFormat.BitsPerComponent=16; | |
396 | break; | |
397 | case 3: | |
398 | InputFormat.ColorSpace=ColorSpace_RGB; | |
399 | if (!InputFormat.BitsPerComponent) | |
400 | InputFormat.BitsPerComponent=12; | |
401 | break; | |
402 | case 4: | |
403 | InputFormat.ColorSpace=ColorSpace_RGB; | |
404 | if (!InputFormat.ChannelCount) | |
405 | InputFormat.ChannelCount=4; | |
406 | break; | |
407 | case 5: | |
408 | InputFormat.ColorSpace=ColorSpace_YUV; | |
409 | if (!InputFormat.ChannelCount) | |
410 | InputFormat.ChannelCount=4; | |
411 | break; | |
412 | default:; | |
413 | } | |
414 | if (PatternWidth<=4 && PatternHeight<=4) | |
415 | InputFormat.Pattern=(PatternWidth<<4)|PatternHeight; | |
416 | InputFormat_Fill(InputFormat); | |
417 | string ColorSpace; | |
418 | if (InputFormat.ColorSpace) | |
419 | { | |
420 | ColorSpace=color_spaces[InputFormat.ColorSpace-1]; | |
421 | if (InputFormat.ChannelCount==4 && InputFormat.ColorSpace!=ColorSpace_RGGB) | |
422 | ColorSpace+='A'; | |
423 | } | |
424 | Fill(Stream_Video, 0, Video_ColorSpace, ColorSpace); | |
425 | if (InputFormat.BitsPerComponent) | |
426 | Fill(Stream_Video, 0, Video_BitDepth, InputFormat.BitsPerComponent); | |
427 | string ChromaSubsampling; | |
428 | switch (InputFormat.Pattern) | |
429 | { | |
430 | case 0x21:ChromaSubsampling="4:2:2"; break; | |
431 | case 0x22:ChromaSubsampling="4:2:0"; break; | |
432 | case 0x41:ChromaSubsampling="4:1:1"; break; | |
433 | case 0x44:ChromaSubsampling="4:1:0"; break; | |
434 | default:; | |
435 | } | |
436 | Fill(Stream_Video, 0, Video_ChromaSubsampling, ChromaSubsampling); | |
437 | Fill(Stream_Video, 0, Video_ScanType, (InterlacedFlags&0x01)?"Interlaced":"Progressive"); | |
438 | if (InterlacedFlags&0x01) | |
439 | Fill(Stream_Video, 0, Video_ScanType, (InterlacedFlags&0x02)?"TFF":"BFF"); | |
440 | //TODO: bit 2 field 1 only, bit 3 field 2 only, bit 4 Dominance (?) | |
441 | if (PixtureAspectRatioX && PixtureAspectRatioY) | |
442 | Fill(Stream_Video, 0, Video_DisplayAspectRatio, ((float32)PixtureAspectRatioX)/PixtureAspectRatioY); | |
443 | Fill(); | |
444 | FILLING_END(); | |
445 | Finish(); | |
446 | } | |
447 | ||
448 | //*************************************************************************** | |
449 | // C++ | |
450 | //*************************************************************************** | |
451 | ||
452 | } //NameSpace | |
453 | ||
454 | #endif //MEDIAINFO_CINEFORM_* |
0 | /* Copyright (c) MediaArea.net SARL. All Rights Reserved. | |
1 | * | |
2 | * Use of this source code is governed by a BSD-style license that can | |
3 | * be found in the License.html file in the root of the source tree. | |
4 | */ | |
5 | ||
6 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
7 | // | |
8 | // Information about CineForm video streams | |
9 | // | |
10 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
11 | ||
12 | //--------------------------------------------------------------------------- | |
13 | #ifndef MediaInfo_CineFormH | |
14 | #define MediaInfo_CineFormH | |
15 | //--------------------------------------------------------------------------- | |
16 | ||
17 | //--------------------------------------------------------------------------- | |
18 | #include "MediaInfo/File__Analyze.h" | |
19 | //--------------------------------------------------------------------------- | |
20 | ||
21 | namespace MediaInfoLib | |
22 | { | |
23 | ||
24 | //*************************************************************************** | |
25 | // Class File_CineForm | |
26 | //*************************************************************************** | |
27 | ||
28 | class File_CineForm : public File__Analyze | |
29 | { | |
30 | public : | |
31 | //constructor/Destructor | |
32 | File_CineForm(); | |
33 | ||
34 | private : | |
35 | //Streams management | |
36 | void Streams_Fill(); | |
37 | ||
38 | //Buffer - Global | |
39 | void Read_Buffer_Continue(); | |
40 | }; | |
41 | ||
42 | } //NameSpace | |
43 | ||
44 | #endif |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | VS_VERSION_INFO VERSIONINFO |
3 | FILEVERSION 20,08,0,0 | |
4 | PRODUCTVERSION 20,08,0,0 | |
3 | FILEVERSION 20,09,0,0 | |
4 | PRODUCTVERSION 20,09,0,0 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | VALUE "FileDescription", "Most relevant technical and tag data for video and audio files" |
21 | VALUE "FileVersion", "20.08.0.0" | |
21 | VALUE "FileVersion", "20.09.0.0" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "20.08.0.0" | |
24 | VALUE "ProductVersion", "20.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
33 | 33 | day1; day |
34 | 34 | day2; days |
35 | 35 | day3; days |
36 | dB0;0 dB | |
36 | 37 | dB1; dB |
37 | 38 | dB2; dB |
38 | 39 | dB3; dB |
300 | 301 | Date;Date |
301 | 302 | Debug;Debug |
302 | 303 | Decimal point;Decimal point |
304 | DefaultTargetDeviceConfig;Default target device config | |
303 | 305 | Delay;Delay |
304 | 306 | Delay_Source;Delay, origin |
305 | 307 | Delay_Source_Container;Container |
308 | 310 | Description;Description |
309 | 311 | dialnorm;Dialog Normalization |
310 | 312 | DialogueCorrected;Dialogue corrected |
311 | DialogueEnhancement;Dialogue enhancement | |
312 | 313 | DialogueEnhancement;Dialogue enhancement |
313 | 314 | DialogueNormalization;Dialogue normalization |
314 | 315 | Digitized_Date;Digitized date |
876 | 877 | Library;Muxing library |
877 | 878 | Lightness;Lightness |
878 | 879 | LineUpStart;Line Up Start |
880 | LinkedTo_Bed_Pos;Bed #s | |
879 | 881 | LinkedTo_Group_Pos;Group #s |
882 | LinkedTo_Object_Pos;Object #s | |
880 | 883 | LinkedTo_SignalGroup_Pos;Signal group #s |
881 | 884 | LinkedTo_Substream_Pos;Substream #s |
882 | 885 | List;List |
952 | 955 | NumberOfObjects;Number of objects |
953 | 956 | NumberOfPresentations;Number of presentations |
954 | 957 | NumberOfSubstreams;Number of substreams |
955 | NumberOfSubstreams;Number of substreams | |
956 | 958 | NumColors;Number of colors |
957 | ObjectCount;Object Count | |
958 | 959 | OK;OK |
959 | 960 | One output file per input file;One output file per input file |
960 | 961 | Open;Open |
1038 | 1039 | PortableHeadphones;Portable headphones |
1039 | 1040 | PortableSpeakers;Portable speakers |
1040 | 1041 | Position;Position |
1042 | Position_Cartesian;Position (cartesian) | |
1043 | Position_Polar;Position (polar) | |
1041 | 1044 | Position_Total;Total |
1042 | 1045 | Preferences;Preferences |
1043 | 1046 | PreferredDownmix;Preferred downmix |
1067 | 1070 | Recorded_Location;Recorded location |
1068 | 1071 | Released_Date;Released date |
1069 | 1072 | RemixedBy;Remixed by |
1073 | RenderMode;Render mode | |
1070 | 1074 | ReplayGain_Gain;Replay gain |
1071 | 1075 | ReplayGain_Peak;Replay gain peak |
1072 | 1076 | Resolution;Resolution |
1115 | 1119 | SigningPresent;Signing Present |
1116 | 1120 | SignLanguage;Sign Language |
1117 | 1121 | Sort;Sorted by |
1122 | SoundCategory;Sound category | |
1118 | 1123 | SoundEngineer;Sound engineer |
1119 | 1124 | Source;Source |
1120 | 1125 | Source_Duration;Source duration |
1143 | 1148 | Subject;Subject |
1144 | 1149 | Substream;Substream |
1145 | 1150 | SubTrack;SubTrack |
1151 | SubtstreamIdChannel;Substream start ID & channel index | |
1146 | 1152 | Summary;Summary |
1147 | 1153 | Supported formats;Supported formats |
1148 | 1154 | Supported?;Supported? |
1152 | 1158 | SystemId;Id |
1153 | 1159 | Tagged_Application;Tagging application |
1154 | 1160 | Tagged_Date;Tagged date |
1161 | TargetDeviceConfig;Target device config | |
1155 | 1162 | Technician;Technician |
1156 | 1163 | TermsOfUse;Terms of use |
1157 | 1164 | TertiaryAudioLanguage;Tertiary Audio Language |