This moves all VP3-specific function pointers from dsputil to a
new vp3dsp context. There is no reason to ever use the VP3 IDCT
where an MPEG2 IDCT is expected or vice versa.
Signed-off-by: Mans Rullgard <mans@mansr.com>
It turns out that the reference decoder subtracts 128 from DC during block
decode but adds it back during reordering block with zigzag pattern.
Transforming block with incorrect DC caused heavy visual artifacts for
many quantisers.
This is only used for checking for a certain library, but the code
doesn't need to know whether the function was found.
Signed-off-by: Martin Storsjö <martin@martin.st>
Passing a cutoff value < sample_rate/256 will cause a crash.
Also, values >20000 will have no effect and 20000 will be used anyway.
Signed-off-by: Mohammad Alsaleh <msal@tormail.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
Even if linking directly to getaddrinfo, use our version of
gai_strerror instead of the system's version. Microsoft explicitly
documents that their version of gai_strerror is thread-unsafe.
Signed-off-by: Martin Storsjö <martin@martin.st>
This avoids warnings if there already exists a definition.
This is the case on windows, where the getaddrinfo isn't available
and linked to (and we use our fallbacks instead, which actually
try to use the proper getaddrinfo version if found at runtime),
but gai_strerror still exists as a define.
Signed-off-by: Martin Storsjö <martin@martin.st>
This is useful if a proper getaddrinfo is loaded dynamically on
windows, while using the fallback implementation of gai_strerror.
Signed-off-by: Martin Storsjö <martin@martin.st>
The actual result of the check isn't used anywhere (since we
use this function unconditionally within #ifdef _WIN32), but it
makes sure we explicitly link to shell32 (which is linked in
implictly on mingw).
Signed-off-by: Martin Storsjö <martin@martin.st>
This was unnoticed on linux, since stdlib.h apparently includes
files declaring the pthread_mutex_t and pthread_cond_t types.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This function is only available in the headers if unconditionally
targeting a version >= XP. It is not strictly necessary, since we
try loading these functions dynamically at runtime on windows in
the fallback, but this makes things a bit faster and more
straightforward.
On mingw32, this function isn't visible by default, while it is
on mingw64 (on both 32 and 64 bit).
Signed-off-by: Martin Storsjö <martin@martin.st>
Testing gives 25-30% gain on HD clips with two threads and
up to 50% gain with eight threads.
Sliced threading uses more memory than single or frame threading.
Frame threading and single threading keep the previous memory
layout.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
The number of pixel formats outgrew the number of available bits in
the bitmask used in avcodec_find_best_pix_fmt().
avcodec_find_best_pix_fmt2() uses a PIX_FMT_NONE terminated list
of pixel formats instead.