Mark Thompson [Sun, 29 Jan 2017 19:45:59 +0000 (19:45 +0000)]
mov: Avoid memcmp of uninitialised data
The string codec name need not be as long as the value we are
comparing it to, so memcmp may make decisions derived from
uninitialised data that valgrind then complains about (though the
overall result of the function will always be the same). Use
strncmp instead, which will stop at the first zero byte and
therefore not encounter this issue.
Mark Thompson [Tue, 29 Nov 2016 22:12:46 +0000 (22:12 +0000)]
vaapi_encode: Pass framerate parameters to driver
Only do this when building for a recent VAAPI version - initial
driver implementations were confused about the interpretation of the
framerate field, but hopefully this will be consistent everywhere
once 0.40.0 is released.
Mark Thompson [Sun, 29 Jan 2017 14:12:20 +0000 (14:12 +0000)]
vaapi_h264: Enable VBR mode
Default to using VBR when a target bitrate is set, unless the max rate
is also set and matches the target. Changes to the Intel driver mean
that min_qp is also respected in this case, so set a codec default to
unset the value rather than using the current default inherited from
the MPEG-4 part 2 encoder.
Mark Thompson [Sun, 29 Jan 2017 14:11:03 +0000 (14:11 +0000)]
vaapi_encode: Support VBR mode
This includes a backward-compatibility hack to choose CBR anyway on
old drivers which have no CBR support, so that existing programs will
continue to work their options now map to VBR.
Peter Große [Sun, 29 Jan 2017 14:26:31 +0000 (15:26 +0100)]
dashenc: use avio_dynbuf instead of packet_write callback
The dash_write function drops data, if no IOContext is initialized.
Since the mp4 muxer is used in "frag_custom" mode, data is only
written when calling av_write_frame(NULL) explicitly and thus
there will be no data loss.
To add support for webm as subordinate muxer, which doesn't have
such a mode, a dynamic buffer is required to provide an always
initialized IOContext.
Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
Peter Große [Sun, 29 Jan 2017 14:26:29 +0000 (15:26 +0100)]
dashenc: default to one AdaptationSet per stream
Previously all mapped streams of a media type (video, audio) where assigned
to a single AdaptationSet. Using the DASH live profile it is mandatory, that
the segments of all representations are aligned, which is currently not
enforced. This leads to problems when using video streams with different
key frame intervals. So to play safe, default to one AdaptationSet per stream,
unless overwritten by explicit assignment.
To get the old assignment scheme, use
-adaptation_sets "id=0,streams=v id=1,streams=a"
Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
Peter Große [Sun, 29 Jan 2017 14:26:28 +0000 (15:26 +0100)]
dashenc: allow assigning all streams of a media type to an AdaptationSet
Using the characters "v" or "a" instead of stream index numbers for assigning
streams in the adaption_set option, all streams matching that given type will
be added to the AdaptationSet.
Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
Peter Große [Mon, 30 Jan 2017 12:49:44 +0000 (13:49 +0100)]
dashenc: calculate stream bitrate from first segment if not available
Bandwidth information is required in the manifest, but not always
provided by the demuxer. In that case calculate the bandwith based
on the size and duration of the first segment.
Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
Peter Große [Sun, 29 Jan 2017 19:41:22 +0000 (20:41 +0100)]
dashenc: add option to provide UTC timing source
If set, adds a UTCTiming tag in the manifest.
This is part of the recommendations listed in the "Guidelines for
Implementations: DASH-IF Interoperability Points" [1][2]
Section 4.7 describes means for the Availability Time Synchronization.
A usable default is "https://time.akamai.com/?iso"
[1] http://dashif.org/guidelines/
[2] http://dashif.org/wp-content/uploads/2016/12/DASH-IF-IOP-v4.0-clean.pdf
(current version as of writing)
Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
Michał Górny [Sun, 21 Sep 2014 09:38:25 +0000 (11:38 +0200)]
configure: Place all temporary files in one separate directory
Place all temporary files within a single, quasi-atomically created
temporary directory rather than relying on unsafe 'mktemp -u'. This
prevents possible race conditions in case two parallel 'mktemp -u' calls
returned the same path. Additionally, it reduces TMPDIR pollution by
keeping all test files in a single subdirectory.
Anton Schubert [Thu, 26 Jan 2017 23:25:07 +0000 (00:25 +0100)]
dashenc: fix ISO8601 UTC parsing
Appends Z to timestamp to force ISO8601 datetime parsing as UTC.
Without Z, some browsers (Chrome) interpret the timestamp as
localtime and others (Firefox) interpret it as UTC.
Signed-off-by: Anton Schubert <ischluff@mailbox.org> Signed-off-by: Martin Storsjö <martin@martin.st>
Diego Biurrun [Wed, 25 Jan 2017 17:40:51 +0000 (18:40 +0100)]
build: Detect blocks C language extension and add it as VDA dependency
Newer versions of OS X use the blocks extension in VDA-related headers.
Some compilers, like current gcc, do not support the blocks extension
and fail to compile code using those headers.
Martin Storsjö [Wed, 25 Jan 2017 13:11:23 +0000 (15:11 +0200)]
configure: Add quotes around a variable which might be empty
If we only have a target compiler but no host compiler, the $type
variable will be empty once.
(Currently we fail to do a cross build if no host compiler is available
due to using the host compiler for processing option lists though.
But despite that, this comparison in configure needs quotes.)
Anton Khirnov [Tue, 27 Dec 2016 18:07:18 +0000 (19:07 +0100)]
h264dec: be more explicit in handling container cropping
The current condition can trigger in cases where it shouldn't, with
unexpected results.
Make sure that:
- container cropping is really based on the original dimensions from the
caller
- those dimenions are discarded on size change
The code is still quite hacky and eventually should be deprecated and
removed, with the decision about which cropping is used delegated to the
caller.
Anton Khirnov [Sat, 7 Jan 2017 20:06:16 +0000 (21:06 +0100)]
qsvdec: do not sync PIX_FMT_QSV surfaces
Introducing enforced sync points in arbitrary places is bad for
performance. Since the vast majority of receiving code (QSV VPP or
encoders, retrieving frames through hwcontext) will do the syncing, this
change should not be visible to most callers. But bumping micro just in
case.
This is also consistent with what VAAPI hwaccel does.
Mark Thompson [Wed, 4 Jan 2017 23:05:10 +0000 (23:05 +0000)]
vaapi_h264: Scale log2_max_pic_order_cnt_lsb with max_b_frames
Before this change, it was possible to overflow pic_order_cnt_lsb and
generate a stream with invalid POC numbering. This makes sure that
the field is large enough that a single IDR B* P sequence uses fewer
than half the available POC lsb values.
Mark Thompson [Wed, 4 Jan 2017 23:17:23 +0000 (23:17 +0000)]
vaapi_encode: Fix GOP sizing
This change makes the configured GOP size be respected exactly -
previously the value could be exceeded slightly due to flaws in the
frame type selection logic.
Henrik Gramner [Sun, 25 Dec 2016 19:24:59 +0000 (20:24 +0100)]
x86inc: Avoid using eax/rax for storing the stack pointer
When allocating stack space with an alignment requirement that is larger
than the current stack alignment we need to store a copy of the original
stack pointer in order to be able to restore it later.
If we chose to use another register for this purpose we should not pick
eax/rax since it can be overwritten as a return value.
Martin Storsjö [Fri, 30 Dec 2016 19:45:51 +0000 (21:45 +0200)]
fate: Skip the checkasm test if CONFIG_STATIC is disabled
When building DLLs with MSVC, CONFIG_STATIC is disabled (see d66c52c2b3694 for a more verbose explanation) since the built
object files can't be linked statically (which checkasm does).
Jun Zhao [Fri, 11 Nov 2016 06:53:49 +0000 (14:53 +0800)]
vaapi_h264: Fix POC on IDR frames
In H.264 section 8.2.1, we have that "The bitstream shall not contain
data that result in Min(TopFieldOrderCnt, BottomFieldOrderCnt) not
equal to 0 for a coded IDR frame". This fixes the encoder to always
conform to this - previously the POC values formed an unbroken
sequence, not resetting to zero on IDR frames.
Diego Biurrun [Tue, 20 Dec 2016 13:27:19 +0000 (14:27 +0100)]
build: Generate pkg-config files from Make and not from configure
This moves work from the configure to the Make stage where it can
be parallelized and ensures that pkgconfig files are updated when
library versions change.
Diego Biurrun [Sat, 17 Dec 2016 19:01:07 +0000 (20:01 +0100)]
build: Store library version numbers in .version files
This moves work from the configure to the Make stage where it can
be parallelized and ensures that shared libraries are built with
the right version number in the filename.