739 Commits

Author SHA1 Message Date
Tom Finegan
125049eecd parser_tests: Add another truncated chapter string test.
Causes mkvparser to fail in a slightly different way.

Change-Id: Id60fd43e6d0ef1871842367d19db52f60a8721cc
2016-08-19 12:44:43 -07:00
Tom Finegan
1de8d4cb4f parser_tests: Add truncated chapter string test.
Change-Id: I1714fbfea5bab61cca61cd32a0a0d30315ed56fc
2016-08-19 12:13:14 -07:00
Tom Finegan
ff8c2b6af7 parser_tests: Move cue validation to test_util.
And tidy it up a bit.

Change-Id: I68e7f16ad2aa922fdb064802e8986a6955364c32
2016-08-19 11:57:08 -07:00
Tom Finegan
4b0690faa2 parser_tests: Add invalid lacing test.
Also fixes leak this test exposed in mkvparser::Cluster.

Change-Id: I06ae11b72bc89219b6b2b407b4cc215982e3ae65
2016-08-19 11:57:05 -07:00
Tom Finegan
64ae831047 Merge "mkvmuxer: Set default doc type version to 4." 2016-08-12 21:59:33 +00:00
Tom Finegan
a351196dbb Merge "webm_parser: Reference more files in CMakeLists.txt." 2016-08-11 21:52:39 +00:00
Tom Finegan
9828e39874 mkvmuxer: Set default doc type version to 4.
mkvmuxer can write matroska v4 elements in all modes, but does
not always confirm that the doc type is high enough for all
elements written. The main culprits are Colour and its
children. Avoid problems by using 4 as the default version.
This avoids problems in all cases but those where users who
know what they are doing have written the EBML header manually.

Update the test files because the new default causes the file
compare abuse in the muxer tests to fail.

Update expected doc type version in the parsing tests.

BUG=webm:1201

Change-Id: I4c69000af4c1d5efe66315c17f3953344ef04993
2016-08-11 14:20:53 -07:00
Tom Finegan
5495a59d38 webm_parser: Reference more files in CMakeLists.txt.
Some includes were missed in the first pass when webm_parser
was added to CMakeLists.txt. Add the missing includes from
webm_parser/include/webm.

Change-Id: I193debe8018155ff9f0ab1d1326330069333948e
2016-08-11 08:48:45 -07:00
Tom Finegan
0c0ecd0f24 vpxpes_parser: Add start code emulation prevention support.
Remove bytes inserted to avoid start code emulation. Operates on:
- PES optional header
- BCMV header
- payloads.

Transforms the following byte sequences as noted (left converts to
right):
  0x00 0x00 0x03 0x01  =>  0x00 0x00 0x01
  0x00 0x00 0x03 0x03  =>  0x00 0x00 0x03

Change-Id: I09ae2d5bf03dfc1ade785ee89a773509eca8330c
2016-08-11 08:45:31 -07:00
Tom Finegan
639a4bc3b1 webm2pes: Remove debug printfs().
Change-Id: I13ba6590c63e7fef14efee812095ac704ef8b69e
2016-08-10 14:56:33 -07:00
Tom Finegan
9a51102cb5 webm2pes: fflush() in the correct conversion function.
Change-Id: I79db8b24178d4e7ba205995525b74a09efef8a04
2016-08-10 14:56:33 -07:00
Tom Finegan
dc7f15559f webm2pes: Track total bytes written.
Change-Id: I78807280cbd05f642215c83d5db4d04837c06438
2016-08-10 14:56:33 -07:00
Tom Finegan
d518128266 webm_parser: Enable usage of werror.
Mass warning clean up. Mainly:
- Explicit casts of numeric literals to avoid signed/unsigned compare
  warnings.
- Commenting out of unused function arg names.

Change-Id: I0e70393a5743ae984035d43712c724d4ccd12f9d
2016-08-10 08:56:57 -07:00
Tom Finegan
e1fe7627c8 webm2pes: Add test for mux/demux of large input.
Change-Id: I253aa49aa3757682dbba83bd9ba6dd1e93d7ccce
2016-08-08 11:15:29 -07:00
Tom Finegan
1b24a792e3 vpxpes_parser: Read and store PTS when present.
Change-Id: I11acb45b26eeea6f5945c04bb447937ba2ffca9f
2016-08-08 11:15:23 -07:00
Tom Finegan
6cf0a0f400 vpxpes_parser: Store frame payloads.
libwebm_util:
- Add 90khz -> nanosecond conversion.

vpxpes_parser:
- Get rid of VpxPesParser::VpxFrame and use VideoFrame.
- Store/Accumulate (when neccessary) PES payloads in
  VideoFrames.
- Change type of size constants from int to size_t.
- Return offset accounting for origin from FindStartCode().
- Check all PTS marker bits (instead of checking the second
  marker twice).

video_frame:
- Add nanosecond_pts mutator.

webm2pes:
- Write DTS/PTS presence flag correctly when PTS is not
  present.

Change-Id: I10f16cd03bb3a51205a25331527ddceb3769ba03
2016-08-08 11:14:03 -07:00
Tom Finegan
25d26028c1 webm_parser: Convert style to match the rest of libwebm
Remove webm_parser/clang-format-style.
Run clang-format -style=file -i for each source file.

Change-Id: Ieaf44bd323375cbcfec67014e94b7742d6bda14a
2016-07-27 14:31:28 -07:00
Tom Finegan
24be76dcb2 webm2pes: Replace VpxFrame with VideoFrame.
VideoFrame was created in order to get rid of the two
slightly different VpxFrame implementations. This patch
gets rid of Webm2Pes's version.

Change-Id: I5af29d5ca717121ee7ab30f28e42d2a43ea5abb0
2016-07-22 15:07:42 -07:00
Tom Finegan
b451c3ba96 Add a basic video frame storage class.
Includes simple tests.

Change-Id: I52276686d6c2bc7b62d260af37affe78aa4dcf50
2016-07-22 15:07:33 -07:00
Tom Finegan
05c90ebccc libwebm_util: Clarify error text in superframe parser.
Change-Id: Icb478d58306bc5e501df9585ece35c9747dd640d
2016-07-22 11:34:18 -07:00
Tom Finegan
e6415af941 webm2pes: Make WritePesPacket() a public method.
WritePesPacket() now takes a VpxFrame as input and a
PacketDataBuffer* as an output  parameter, and avoids
using members entirely. This facilitates deeper testing
of Webm2Pes without requiring friendship with test
classes and methods.

Change-Id: I076db8900cc1a5c864b54f5fe3403fb05b4bd835
2016-07-20 17:36:46 -07:00
Tom Finegan
8f840ddaa3 webm2pes: Move frame read out of PES packet write method.
Makes writing tests easier by allowing caller to pass data
for packetizing directly into the method.

Change-Id: I553fa8c1636041c4a5ff043862918a5cdc9163ba
2016-07-20 14:00:36 -07:00
Tom Finegan
448af971d2 webm2pes: Restore frame fragmentation support.
Cap packet payload at 32 kB. Update test to expect non-zero
packet length.

Change-Id: Ibb68a4ef8d32c049c492ae546c631ef6376e3ffd
2016-07-18 14:32:02 -07:00
Tom Finegan
f8bb7149f5 cmake: Integrate new parsing API and tests.
Change-Id: I11e32bfffda12fa910c06bf7b8e3a0efbccf6054
2016-07-14 11:11:59 -07:00
Michael Bradshaw
cb8ce0b4b5 Add a new incremental parsing API
Change-Id: I6b921766836d58df0281fb23b2add3f62a478e14
2016-06-15 12:39:58 -07:00
Tom Finegan
900d322cc8 vpxpes_parser/webm2pes: BCMV and PTS fixes.
- Write BCMV length value big endian and include BCMV header
  size.
- Write PTS bits big endian.

Change-Id: I8cd72c233c21f5909438f5a3bb817e9477bdfcfb
2016-06-02 17:05:09 -07:00
Tom Finegan
4b735452bb webm2pes: Add start code emulation prevention.
- Make start codes reliable for VPx in PES.
- Stop setting the PES size field and stop splitting packets when
  larger than UINT16_MAX (always set 0; rely on start codes to find
  packet boundaries).

Change-Id: I402e91c26562e930f61543ca59223b83cc92be29
2016-06-02 17:05:07 -07:00
Frank Galligan
82903f36fa Add column tiles and frame parallel to webm_info
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1227

Change-Id: I23b1611a91074bfa0cff3b788baeff71bc68d034
2016-05-17 09:00:41 -07:00
Vignesh Venkatasubramanian
5d91edf9f1 style_clean_up: Remove unnecessary parentheses
Change-Id: Ie3645319fa4d5a1fd254b4511a60ef6f6036afe5
2016-05-13 10:41:16 -07:00
hui su
a95aa4b294 vp9_level_stats: correct total_uncompressed_bits_ calculation
Only consider display frames.

Change-Id: I9061ad90775f0467a661b0ac5d11dc22e477a7c3
2016-05-06 15:37:09 -07:00
Tom Finegan
f46566f19a mkvreader: Fix shorten-64-to-32 warning in 32 bit builds.
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1207

Change-Id: Ie1c97a314fefdf14dce455da16f5a29218ba4cf8
2016-05-06 11:40:48 -07:00
Tom Finegan
76630ca4a3 mkvwriter: Fix shorten-64-to-32 warning in 32 bit builds.
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1207

Change-Id: I2dc1ce59ebf8051c9661b919813d5ab7cb115da0
2016-05-06 11:40:44 -07:00
Tom Finegan
a8ffbd4ed2 webm2pes: Fix format specifier warnings.
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1207

Change-Id: If60866f8e60969bc6cbaef8eee72a805270bf65d
2016-05-06 11:40:38 -07:00
Frank Galligan
21015480f6 Merge "Add MaxLumaSampleRate grace percent to stats." 2016-05-02 22:00:22 +00:00
Frank Galligan
faf89d4ed1 Add MaxLumaSampleRate grace percent to stats.
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1206

Change-Id: I29a956871bd5aa0c7b493601ed23b44a08414d32
2016-04-30 16:59:42 -07:00
Frank Galligan
d31e6c970d Fix profile 2 in vp9_header_parser.
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1208

Change-Id: Ie31adef15eac965e3fb587825f63ff320c1d59fe
2016-04-29 17:11:29 -07:00
Frank Galligan
4fc66dab83 Merge "Add flag to estimate last frame's duration to stats." 2016-04-29 22:30:12 +00:00
Frank Galligan
bd3ab3abe6 Add flag to estimate last frame's duration to stats.
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1204

Change-Id: Ie73e2981951f9eb6140bdfb0a6839320e009b7fe
2016-04-29 14:19:58 -07:00
Vignesh Venkatasubramanian
c89b968ce5 Merge "Fix lint issue in hdr_util.h" 2016-04-29 19:31:52 +00:00
Vignesh Venkatasubramanian
db5693d96b Merge "Add test for Cluster memory leak" 2016-04-29 19:31:40 +00:00
Vignesh Venkatasubramanian
c182ed97d1 Fix lint issue in hdr_util.h
Change-Id: Iba19ad153f9187c3942d406e41da04703f7dd5c7
2016-04-29 11:47:04 -07:00
Vignesh Venkatasubramanian
cc62ecd23f Add test for Cluster memory leak
Tests the scenario described in this CL:
https://chromium-review.googlesource.com/#/c/341251/

Change-Id: I4d732eebc11140691ed516321cf490905991720b
2016-04-29 11:42:36 -07:00
Frank Galligan
196708a95f Change MaxLumaSampleRate to be based on frame resolution.
MaxLumaSampleRate generation code now takes into account the frame
resolution of every frame.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1203

Change-Id: I666fa2f21971ff4fb80219ef29dee3254cbb370c
2016-04-29 08:15:37 -07:00
Vignesh Venkatasubramanian
26d673e737 Merge "mkvmuxer: Fix leak when a Cluster isn't finalized" 2016-04-29 02:17:33 +00:00
Frank Galligan
eacb314525 Merge "Add parsing support for new features in CodecPrivate." 2016-04-29 00:17:28 +00:00
Vignesh Venkatasubramanian
cbd676bb66 mkvmuxer: Fix leak when a Cluster isn't finalized
There's a leak in the following scenario:
  * AccurateClusterDuration is set to true.
  * Add a few frames.
  * An error is encountered while adding a frame and the
    application bails without calling Cluster::Finalize
  * All the frames we queues in QueueOrWriteFrames now leak.

This patch fixes this scenario by delete'ing any left over frames
in the Cluster's destructor.

Change-Id: I104f6814db18a86fae9877decfe6cc75b8937fcb
2016-04-28 12:30:29 -07:00
Tom Finegan
9a235e0bc9 mkvmuxer: Set doctype to matroska when muxing non-WebM codecs.
Also, add some constants for WebVTT codec ID strings so they
won't cause doctype to incorrectly change to matroska.

Change-Id: I4740a3e45b28a22e462601b9ce051aa01817dace
2016-04-28 08:44:14 -07:00
Frank Galligan
47f2843e79 Add parsing support for new features in CodecPrivate.
Adds support for parsing bit depth and chroma subsampling features.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1198

Change-Id: I8d11829f5d43a518cbe0e5c0bdd4fd37db7b6266
2016-04-27 09:27:24 -07:00
Frank Galligan
e3c9576716 Add VP9 level output to webm_info.
Removed building webm_info from Makefile.unix as it now requires c++11.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1188

Change-Id: Ia142f0c3cd580f397449d2ffa8788f78fb7faff0
2016-04-26 22:16:31 -07:00
Frank Galligan
de3234a87f Merge "Add class to gather VP9 level stats." 2016-04-26 15:29:49 +00:00