- 26 Jan, 2020 16 commits
-
-
Gyan Doshi authored
-
James Almer authored
Signed-off-by: James Almer <jamrial@gmail.com>
-
Andreas Rheinhardt authored
Certain types of OBUs are stripped away before muxing into Matroska and ISOBMFF; there are two functions to do this: One that outputs by directly writing in an AVIOContext and one that returns a freshly allocated buffer with the units not stripped away copied into it. The latter option is bad for performance, especially when the input does already not contain any of the units intended to be stripped away (this covers typical remuxing scenarios). Therefore this commit changes this by avoiding allocating and copying when possible; it is possible if the OBUs to be retained are consecutively in the input buffer (without an OBU to be discarded between them). In this case, the caller receives the offset as well as the length of the part of the buffer that contains the units to be kept. This also avoids copying when e.g. the only unit to be discarded is a temporal delimiter at the front. For a 22.7mb/s file with average framesize 113 kB this improved the time for the calls to ff_av1_filter_obus_buf() when writing Matroska from 313319 decicycles to 2368 decicycles; for another file with 1.5mb/s (average framesize 7.3 kB) it improved from 34539 decicycles to 1922 decicyles. For these files the only units that needed to be stripped away were temporal unit delimiters at the front. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
-
Andreas Rheinhardt authored
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
-
Andreas Rheinhardt authored
ff_av1_filter_obus_buf() and ff_avc_parse_nal_units_buf() both have a pointer-to-pointer parameter which they use to pass a newly allocated buffer to the caller. And both functions freed what this pointer points to before overwriting it. But no caller of these functions used this feature, but some had to initialize the pointer just because of this. So remove it and update the documentation of ff_av1_filter_obus_buf() wrt this fact. ff_hevc_annexb2mp4_buf in contrast did not free the pointer. This has been documented, too. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
-
Andreas Rheinhardt authored
Both ISOBMFF as well as Matroska require certain OBUs to be stripped before muxing them. There are two functions for this purpose; one writes directly into an AVIOContext, the other returns a freshly allocated buffer with the undesired units stripped away. The latter one actually relies on the former by means of a dynamic buffer. This has several drawbacks: The underlying buffer might have to be reallocated multiple times; the buffer will eventually be overallocated; the data will not be directly copied into the final buffer, but rather first in the write buffer (in chunks of 1024 byte) and then written in these chunks. Moreover, the API for dynamic buffers is defective wrt error checking and as a consequence, the earlier code would indicate a length of -AV_INPUT_BUFFER_PADDING_SIZE on allocation failure, but it would not return an error; there would also be no error in case the arbitrary limit of INT_MAX/2 that is currently imposed on dynamic buffers is hit. This commit changes this: The buffer is now parsed twice, once to get the precise length which will then be allocated; and once to actually write the data. For a 22.7mb/s file with average framesize 113 kB this improved the time for the calls to ff_av1_filter_obus_buf() when writing Matroska from 753662 decicycles to 313319 decicycles (based upon 50 runs a 2048 frames each); for another 1.5mb/s file (with average framesize of 7.3 kB) it improved from 79270 decicycles to 34539 decicycles (based upon 50 runs a 4096 frames). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
-
Andreas Rheinhardt authored
If this is not done, the avio_write() calls will cause segfaults immediately afterwards on error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
-
Andreas Rheinhardt authored
The output size is already returned via a pointer argument, so there is no need to return it via the ordinary return value as well. The rationale behind this is to not poison the return value on success. It also unifies the behaviour of the *_buf-functions for AVC, AV1 and HEVC. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
-
Andreas Rheinhardt authored
ff_hevc_annexb2mp4_buf() could indicate an error, yet leave cleaning after itself to the caller, so that a caller could not simply return the error, but had to free the buffer first. (Given that all current callers have set filter_ps = 0, this error can currently not be triggered.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
-
Andreas Rheinhardt authored
Add {, } in situations like if () ... else if () /* Comment */ ... else ... Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
-
Andreas Rheinhardt authored
This is needed especially for AV1: If a reformatting error happens (e.g. if the length field of an OBU contained in the current packet indicates that said OBU extends beyond the current packet), the data pointer is still NULL, yet the size is unchanged, so that writing the data leads to a segmentation fault. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
-
Gyan Doshi authored
Due to conditional expressions, it is possible for them to be resolved successfully. A warning is still printed.
-
Paul B Mahol authored
-
Carl Eugen Hoyos authored
Fixes ticket #8498.
-
Zane van Iperen authored
Adds support for the custom ASF container used by some Argonaut Games' games, such as 'Croc! Legend of the Gobbos', and 'Croc 2'. Can also handle the sample files in: https://samples.ffmpeg.org/game-formats/brender/part2.zipSigned-off-by: Zane van Iperen <zane@zanevaniperen.com>
-
Zane van Iperen authored
Adds support for the ADPCM variant used by some Argonaut Games' games, such as 'Croc! Legend of the Gobbos', and 'Croc 2'. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
-
- 25 Jan, 2020 9 commits
-
-
Marton Balint authored
It is a common mistake that people only increase fifo_size when they experience drops, unfortunately this does not help for higher bitrate (> 100 Mbps) streams when the reader thread simply might not receive the packets in time (especially under high CPU load) if the default 64 KB of kernel buffer size is used. New default is determined so that common linux systems can set this buffer size without tuning kernel parameters. Signed-off-by: Marton Balint <cus@passwd.hu>
-
Marton Balint authored
Signed-off-by: Marton Balint <cus@passwd.hu>
-
Marton Balint authored
Signed-off-by: Marton Balint <cus@passwd.hu>
-
Marton Balint authored
Timeout error was assumed to be fatal which it is not. Signed-off-by: Marton Balint <cus@passwd.hu>
-
Paul B Mahol authored
-
Gyan Doshi authored
As per the PIFF standard, the timescale of 10000000 is recommended but not mandatory, so don't override the user-set value. A warning is shown for non-recommended values.
-
Paul B Mahol authored
-
Paul B Mahol authored
-
Paul B Mahol authored
-
- 24 Jan, 2020 6 commits
-
-
Andreas Rheinhardt authored
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
-
James Almer authored
This allows the user enable the realtime encoding speed mode Reviewed-by: James Zern <jzern@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
-
Paul B Mahol authored
-
Martin Storsjö authored
This was missed in 63418e37. Signed-off-by: Martin Storsjö <martin@martin.st>
-
Marton Balint authored
Also fixes a possible overflow and sets stream bitrate. Signed-off-by: Marton Balint <cus@passwd.hu>
-
Marton Balint authored
Signed-off-by: Marton Balint <cus@passwd.hu>
-
- 23 Jan, 2020 7 commits
-
-
Marton Balint authored
This was missed in d7e2a2bb. Signed-off-by: Marton Balint <cus@passwd.hu>
-
Martin Storsjö authored
When clang works in MSVC mode, it does have the _byteswap_ulong builtin, but one has to include stdlib.h before using it. Signed-off-by: Martin Storsjö <martin@martin.st>
-
Martin Storsjö authored
SetConsoleTextAttribute used to be unavailable for Windows Store apps, but is available to them now. But GetStdHandle still is unavailable, thus make sure to check for both functions before using code that requires both. Signed-off-by: Martin Storsjö <martin@martin.st>
-
Andreas Rheinhardt authored
by replacing it with a multiplication. Said multiplication can't overflow an int32_t because lpc_coefs is limited to 16 bit precision. Fixes the FACE-test acodec-ra144 as well as part of #8217. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-
Paul B Mahol authored
-
Paul B Mahol authored
-
Gyan Doshi authored
-
- 22 Jan, 2020 2 commits
-
-
Paul B Mahol authored
-
Michael Niedermayer authored
This should make it much quicker for the fuzzer to test real relevant codec_tags Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-