Commit Graph

21362 Commits

Author SHA1 Message Date
Luca Barbato
f8f7ad758d qsv: Set the correct range for la_depth
Setting an invalid range for it makes the encoder behave inconsistently.
2017-01-13 08:42:10 +01:00
Anton Khirnov
1202b71269 theora: export cropping information instead of handling it internally 2017-01-12 16:29:17 +01:00
Anton Khirnov
c3e84820d6 h264dec: export cropping information instead of handling it internally 2017-01-12 16:29:12 +01:00
Anton Khirnov
4fded0480f 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.
2017-01-12 16:28:05 +01:00
Anton Khirnov
a02ae1c683 hevcdec: export cropping information instead of handling it internally 2017-01-12 16:27:56 +01:00
Anton Khirnov
019ab88a95 lavc: add an option for exporting cropping information to the caller
Also, add generic code for handling cropping, so the decoders can export
just the cropping size and not bother with the rest.
2017-01-12 16:24:15 +01:00
Anton Khirnov
b68e353136 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.
2017-01-12 16:21:39 +01:00
Steve Lhomme
ac3c3ee678 dxva2: allow an empty array of ID3D11VideoDecoderOutputView
We can pick the correct slice index directly from the ID3D11VideoDecoderOutputView
casted from data[3].

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-01-12 16:19:13 +01:00
Steve Lhomme
f67235a28c dxva2: get the slice number directly from the surface in D3D11VA
No need to loop through the known surfaces, we'll use the requested surface
anyway.

The loop is only done for DXVA2.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-01-12 16:09:41 +01:00
Mark Thompson
89725a8512 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.
2017-01-11 23:03:58 +00:00
Mark Thompson
a3c3a5eac2 vaapi_encode: Support forcing IDR frames via AVFrame.pict_type 2017-01-11 23:03:58 +00:00
Mark Thompson
37fab0661a 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.
2017-01-11 23:03:58 +00:00
Alexandra Hájková
bd6496fa07 interplayvideo: Convert to the new bitstream reader 2017-01-09 15:21:47 +01:00
Alexandra Hájková
4e25051031 adx: Convert to the new bitstream reader 2017-01-09 15:21:47 +01:00
Alexandra Hájková
9aec009f65 dvbsubdec: Convert to the new bitstream reader 2017-01-09 15:21:47 +01:00
Alexandra Hájková
d7fe11634c motionpixels: Convert to the new bitstream reader 2017-01-09 15:18:16 +01:00
Anton Khirnov
f1af37b510 h264dec: make ff_h264_decode_init() static
It is not called from outside h264dec.c anymore.
2017-01-09 13:21:13 +01:00
Anton Khirnov
e7de05f98f h264dec: drop a redundant check
Cropping parameters are already checked for validity during SPS parsing,
no need to check them again.
2017-01-09 13:21:13 +01:00
Steve Lhomme
2835e9a9fd hevcdec: add P010 support for D3D11VA
Given it's the same API than DVXA2 I don't know why the same output was not
enabled for both.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-01-09 10:48:54 +01:00
Steve Lhomme
0ac2d86c47 dxva2: Factorize DXVA context validity test into a single macro
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-01-08 16:41:24 +01:00
Steve Lhomme
f8a42d4f26 dxva2: Make ff_dxva2_get_surface() static and drop its name prefix
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-01-08 16:41:07 +01:00
Jun Zhao
9b1db2d338 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.

Signed-off-by: Mark Thompson <sw@jkqxz.net>
2017-01-04 21:52:06 +00:00
Mark Thompson
d08e02d929 vaapi_h265: Fix build failure with old libva without 10-bit surfaces
10-bit surface support was added in libva 1.6.2, earlier versions
support H.265 encoding in 8-bit only.
2017-01-04 21:49:41 +00:00
Martin Storsjö
85ad5ea72c aarch64: vp9mc: Fix a comment to refer to a register with the right name
Signed-off-by: Martin Storsjö <martin@martin.st>
2017-01-03 14:16:10 +02:00
Martin Storsjö
65074791e8 aarch64: vp9dsp: Fix vertical alignment in the init file
Signed-off-by: Martin Storsjö <martin@martin.st>
2017-01-03 14:15:58 +02:00
Martin Storsjö
c536e5e869 arm: vp9mc: Fix vertical alignment of operands
Signed-off-by: Martin Storsjö <martin@martin.st>
2017-01-03 14:15:45 +02:00
Diego Biurrun
53618054b6 parser: Add missing #include for printing ISO C99 conversion specifiers 2016-12-25 13:22:50 +01:00
Diego Biurrun
0b77a59336 Use correct printf conversion specifiers for POSIX integer types 2016-12-23 19:30:00 +01:00
Diego Biurrun
92db508307 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.

Bug-Id: 449
2016-12-22 12:30:54 +01:00
Diego Biurrun
f9edc734e0 ratecontrol: Drop xvid-rc-related struct members unused after a6901b9c6 2016-12-21 11:13:20 +01:00
Ruta Gadkari
5b26d3b789 nvenc: Update check for lookahead
By default it is -1.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-12-21 06:16:52 +01:00
Martin Storsjö
a0c443a398 aarch64: vp9itxfm: Use the offset parameter to movrel
This fixes build failures for iOS, broken since cad42fadcd.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-12-19 22:49:51 +02:00
Alexandra Hájková
fc322d6a70 tta: Convert to the new bitstream reader 2016-12-19 13:52:36 +01:00
Alexandra Hájková
00c72a1e01 mlp: Convert to the new bitstream reader 2016-12-19 13:22:29 +01:00
Alexandra Hájková
fa64aea12e unary: Convert to the new bitstream reader 2016-12-19 12:35:05 +01:00
Anton Khirnov
45286a625c h264dec: make sure to only end a field if it has been started
Calling ff_h264_field_end() when the per-field state is not properly
initialized leads to all kinds of undefined behaviour.

CC: libav-stable@libav.org
Bug-Id: 977 978 992
2016-12-19 08:15:58 +01:00
Anton Khirnov
c2fa6bb0e8 mpeg12dec: move setting first_field to mpeg_field_start()
For field picture, the first_field is set based on its previous value.
Before this commit, first_field is set when reading the picture
coding extension. However, in corrupted files there may be multiple
picture coding extension headers, so the final value of first_field that
is actually used during decoding can be wrong. That can lead to various
undefined behaviour, like predicting from a non-existing field.

Fix this problem, by setting first_field in mpeg_field_start(), which
should be called exactly once per field.

CC: libav-stable@libav.org
Bug-ID: 999
2016-12-19 08:15:49 +01:00
Anton Khirnov
e807491fc6 mpeg12dec: avoid signed overflow in bitrate calculation
CC: libav-stable@libav.org
Bug-Id: 981
Found-By: Agostino Sarubbo
2016-12-19 08:15:42 +01:00
Anton Khirnov
58405de095 mpegvideo_parser: avoid signed overflow in bitrate calculation
CC: libav-stable@libav.org
Bug-Id: 981
Found-By: Agostino Sarubbo
2016-12-19 08:15:07 +01:00
Anton Khirnov
cfa4eb4fba vaapi_decode: use the correct logging context 2016-12-19 08:13:28 +01:00
Anton Khirnov
ea8b730d8e hevcdec: add a VAAPI hwaccel
Partially based on a patch by Timo Rothenpieler <timo@rothenpieler.org>.
Additional scaling list handling fix by Jun Zhao <mypopydev@gmail.com>.
2016-12-19 08:13:08 +01:00
Anton Khirnov
d4a91e6534 pthread_frame: do not run hwaccel decoding asynchronously unless it's safe
Certain hardware decoding APIs are not guaranteed to be thread-safe, so
having the user access decoded hardware surfaces while the decoder is
running in another thread can cause failures (this is mainly known to
happen with DXVA2).

For such hwaccels, only allow the decoding thread to run while the user
is inside a lavc decode call (avcodec_send_packet/receive_frame).
2016-12-19 08:10:22 +01:00
Anton Khirnov
8dfba25ce8 pthread_frame: ensure the threads don't run simultaneously with hwaccel 2016-12-19 08:09:19 +01:00
Anton Khirnov
373fd76b4d hevcdec: do not set decoder-global SPS prematurely
It should only be set after the decoder state has been fully initialized
for using that SPS.
Fixes possible invalid reads on get_format() failure.

CC: libav-stable@libav.org
2016-12-19 08:07:15 +01:00
Janne Grunau
2425d7329f arm64: replace 'bic' with immediate with 'and' with inverted immediate
The former is not an official pseudo instruction although gas and llvm's
internal assembler support it. Fixes a build error with xcode 6.2
reported by Memphiz on github.
2016-12-14 21:53:05 +01:00
Diego Biurrun
ea7ee4b4e3 ppc: Centralize compiler-specific altivec.h #include handling in one place
Also move #includes into canonical order where appropriate.
2016-12-14 14:08:43 +01:00
Diego Biurrun
39929e55eb ppc: hevcdsp: Use shorthands for vector types
This is more consistent and fixes compilation with clang.
2016-12-14 14:08:43 +01:00
Diego Biurrun
554e55bbf0 decode.h: Add missing headers to fix standalone compilation 2016-12-14 14:08:43 +01:00
Wan-Teh Chang
343e283399 pthread_frame: use better memory orders for frame progress
This improves commit 59c7022740.

In ff_thread_report_progress(), the fast code path can load
progress[field] with the relaxed memory order, and the slow code path
can store progress[field] with the release memory order. These changes
are mainly intended to avoid confusion when one inspects the source code.
They are unlikely to have measurable performance improvement.

ff_thread_report_progress() and ff_thread_await_progress() form a pair.
ff_thread_await_progress() reads progress[field] with the acquire memory
order (in the fast code path). Therefore, one expects to see
ff_thread_report_progress() write progress[field] with the matching
release memory order.

In the fast code path in ff_thread_report_progress(), the atomic load of
progress[field] doesn't need the acquire memory order because the
calling thread is trying to make the data it just decoded visible to the
other threads, rather than trying to read the data decoded by other
threads.

In ff_thread_get_buffer(), initialize progress[0] and progress[1] using
atomic_init().

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-12-14 11:16:51 +01:00
Derek Buitenhuis
5c7f2cf81d h264_slice: Wait for refs to be available before we use them in error concealment
This could happen when there was a frame number gap and frame threading was used.

Debugging-by: Ronald S. Bultje <rsbultje@gmail.com>
Debugging-by: Justin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>

CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-12-14 10:38:15 +01:00