Anton Khirnov [Wed, 18 May 2016 07:16:35 +0000 (09:16 +0200)]
h264: create a new header for common h264 definitions
Move the NAL unit types into it. This will allow to stop including the
whole decoder-specific h264dec.h in some code that is unrelated to the
decoder and only needs some enum values.
Anton Khirnov [Wed, 18 May 2016 05:27:32 +0000 (07:27 +0200)]
h264: factor out setting frame properties / side data
Right now this code is mixed with selecting the next output frame. Move
it to a separate function called from h264_field_start(), which is a
more appropriate place for this.
Anton Khirnov [Tue, 17 May 2016 14:45:15 +0000 (16:45 +0200)]
h264: store {curr,max}_pic_num in the per-slice context
While the value of those variables will be constant for the whole frame,
they are only used in two functions called from slice header decoding.
Moving them to the per-slice context allows us to make the H264Context
passed to slice_header_parse() constant.
Anton Khirnov [Tue, 17 May 2016 12:51:01 +0000 (14:51 +0200)]
h264: move the block starting a new field out of slice_header_parse()
There is no bitstream parsing in that block and messing with
decoder-global state is not something that belongs into header parsing.
Nothing else in this function depends on the value of current_slice,
except for two validity checks. Those checks are also moved out of
slice_header_parse().
Anton Khirnov [Mon, 16 May 2016 07:34:44 +0000 (09:34 +0200)]
h264: pass a H2645NAL to slice header decoding
Replace the decoder-global nal_unit_type/nal_ref_idc variables with the
per-NAL ones. The decoder-global ones still cannot be removed because
they are used by hwaccels.
This function needs to return false, or data in the additional tables
will be skipped, and the decoder will not be able to decode frames
associated with them.
Vittorio Giovara [Wed, 15 Jun 2016 19:24:30 +0000 (15:24 -0400)]
mov: Implement support for multiple sample description tables
Store data from each stsd in a separate extradata buffer, keep track of
the stsc index for read and seek operations, switch buffers when the
index differs. Decoder is notified with an AV_PKT_DATA_NEW_EXTRADATA
packet side data.
Since H264 supports this notification, and can be reset midstream, enable
this feature only for multiple avcC's. All other stsd types (such as
hvc1 and hev1) need decoder-side changes, so they are left disabled for
now.
Anton Khirnov [Tue, 10 May 2016 11:34:59 +0000 (13:34 +0200)]
h264: merge the two reinit blocks in slice_header_parse()
The only difference is that the first of them contains a
ff_h264_flush_change() call. While that is not necessary in the second
block, it should cause no problems either.
Reduce the verbosity of the reinit log message from info to verbose,
since now it will be displayed during every decode session.
Anton Khirnov [Mon, 9 May 2016 12:25:56 +0000 (14:25 +0200)]
h264: postpone generating the implicit MMCOs
Do it right before the MMCOs are applied to the DPB. This will allow
moving the frame_start() call out of the slice header parsing, since
generating the implicit MMCOs needs to be done after frame_start().
Anton Khirnov [Mon, 9 May 2016 11:48:01 +0000 (13:48 +0200)]
h264: decode the MMCOs into per-slice contexts
They are stored in the slice header, so technically they are per-slice
(though they must be the same in every slice). This will simplify the
following commits.
Anton Khirnov [Thu, 14 Apr 2016 18:53:59 +0000 (20:53 +0200)]
h264: move calculating the POC out of h264_slice_header_parse()
This function does not do any bitstream parsing and it depends on the
current frame being allocated, so this will allow the frame_start() to
be moved out eventually.
Anton Khirnov [Fri, 15 Apr 2016 14:10:21 +0000 (16:10 +0200)]
h264: split reading the ref list modifications and actually building the ref list
This will allow postponing the reference list construction (and by
consequence some other functions, like frame_start) until the whole
slice header has been parsed.
Anton Khirnov [Fri, 15 Apr 2016 12:45:48 +0000 (14:45 +0200)]
h264: move initialising the explicit pred weight table for MBAFF
Currently it's done in the code that initialises the ref list for
MBAFF, which is not a logical place for it. Move it to the function that
parses the pred table from the bitstream, which is analogous to what is
done for the implicit weight table as well.
Anton Khirnov [Wed, 13 Apr 2016 15:53:50 +0000 (17:53 +0200)]
h264: start splitting decode_slice_header()
That function is currently very long and entangles bitstream parsing and
decoder configuration. This makes the code much harder to read than
necessary.
Begin splitting the code that configures the decoder state based on the
slice header information from the parsing of the slice header.
Diego Biurrun [Fri, 27 May 2016 18:14:21 +0000 (20:14 +0200)]
build: Only enable symbol reduction if the compiler does proper DCE
With compilers that do not support proper dead code elimination, like
Sun C 5.12, linking fails due to missing references to unavailable,
but also unused, symbols.
Diego Biurrun [Tue, 24 May 2016 00:18:40 +0000 (02:18 +0200)]
build: Change structure of the linker version script templates
Split version files into one line per symbol/directive to allow compatibility
with the Solaris linker without preprocessing and eliminate $ from version file
templates to simplify the postprocessing shell command.
Mark Thompson [Tue, 17 May 2016 22:08:57 +0000 (23:08 +0100)]
vaapi_h264: Add trivial support for low-power encoding
Experimental; requires Skylake and VAAPI 0.39.1 (not yet released).
Also increases the allowed range of the quality option - in low-power
mode, the Intel driver supports levels 1-8 (and 0 meaning default).
Mark Thompson [Mon, 16 May 2016 13:01:31 +0000 (14:01 +0100)]
vaapi_h264: Fix frame_num after non-reference frames
Non-reference frames (nal_ref_idc == 0) should be discardable, so
frame_num does not advance after them. Before this change, a stream
containing unreferenced B-frames would be rejected by the reference
decoder.
Mark Thompson [Wed, 18 May 2016 09:58:56 +0000 (10:58 +0100)]
vaapi_encode: Check config attributes before creating config
This prevents attempts to use unsupported modes, such as low-power
H.264 mode on non-Skylake targets. Also fixes a crash on invalid
configuration, when trying to destroy an invalid VA config/context.
Anton Khirnov [Tue, 24 May 2016 14:49:19 +0000 (16:49 +0200)]
avconv: fix parsing bitstream filters
The current code modifies the user-supplied string, which is shared for
the whole output file. So a bitstream filter specification applied to
multiple streams would not work correctly.