[libav-devel] [PATCH] cbs_h264: Fix writing streams with auxiliary pictures

2017-09-23 Thread Mark Thompson
Tested with the alphaconformanceG test sample. --- On 22/09/17 15:24, James Almer wrote: > On 9/21/2017 8:51 AM, Vittorio Giovara wrote: >> --- >> This is to silence this warning (which, admittedly, could also be ignored) >> >> cbs_h2645.c:1007:58: warning: variable 'sps_ext' is uninitialized when

Re: [libav-devel] [PATCH 09/11] cbs: Add some read/write tests

2017-09-20 Thread Mark Thompson
On 20/09/17 19:48, Diego Biurrun wrote: > On Sun, Sep 10, 2017 at 12:09:13AM +0100, Mark Thompson wrote: >> --- /dev/null >> +++ b/tests/fate/cbs.mak >> @@ -0,0 +1,74 @@ >> + >> +define FATE_CBS_TEST >> +# (codec, test_name, sample_file, output_format)

Re: [libav-devel] [PATCH 7/9] cbs: Add some read/write tests

2017-09-19 Thread Mark Thompson
On 19/09/17 14:51, Diego Biurrun wrote: > On Mon, Aug 28, 2017 at 06:08:53PM +0100, Mark Thompson wrote: >> --- /dev/null >> +++ b/tests/fate/cbs.mak >> @@ -0,0 +1,76 @@ >> + >> +define FATE_CBS_SAMPLE_TEST >> +FATE_CBS_$(1) += fate-cbs-$(1)-$(

[libav-devel] [PATCH 01/11] cbs: Always check for bitstream end before reading

2017-09-09 Thread Mark Thompson
--- libavcodec/cbs.c | 6 +++ libavcodec/cbs_h2645.c | 118 - libavcodec/cbs_mpeg2.c | 5 ++- 3 files changed, 67 insertions(+), 62 deletions(-) diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c index 10943164d..744091493 100644 ---

[libav-devel] [PATCH 05/11] vaapi_h264: Fix CPB/DPB delays

2017-09-09 Thread Mark Thompson
This should be ticks, not time_scale steps - it was wrong for all framerates not a multiple of 1/2. --- Apparently I only encode things with framerate a multiple of 1/2. The CBS writer catches this immediately for NTSC video - the values are out of range when multiplied by 1001.

[libav-devel] [PATCH 06/11] cbs_h265: Fix reading of unknown parameter set extension data

2017-09-09 Thread Mark Thompson
--- libavcodec/cbs_h265_syntax_template.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c index 40fdaf8a9..8564220d5 100644 --- a/libavcodec/cbs_h265_syntax_template.c +++

[libav-devel] [PATCH 11/11] vaapi_mpeg2: Convert to use coded bitstream infrastructure

2017-09-09 Thread Mark Thompson
--- configure | 2 +- libavcodec/vaapi_encode_mpeg2.c | 638 ++-- 2 files changed, 424 insertions(+), 216 deletions(-) diff --git a/configure b/configure index c24cdd4f7..7728cd6de 100755 --- a/configure +++ b/configure @@ -2301,7

[libav-devel] [PATCH 08/11] cbs_mpeg2: Add support for picture display extension

2017-09-09 Thread Mark Thompson
--- Many of the conformance test files have it. libavcodec/cbs_mpeg2.h | 8 +++ libavcodec/cbs_mpeg2_syntax_template.c | 44 ++ 2 files changed, 52 insertions(+) diff --git a/libavcodec/cbs_mpeg2.h b/libavcodec/cbs_mpeg2.h index

[libav-devel] [PATCH 03/11] h264_metadata: Fix double-free

2017-09-09 Thread Mark Thompson
Whether the udu string should be freed depends on whether the SEI it gets added to was created internally by cbs or externally by the bsf. The current code frees it twice in the former case. --- libavcodec/h264_metadata_bsf.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff

[libav-devel] [PATCH 04/11] Revert "vaapi_h265: Reduce the amount of padding in the stream"

2017-09-09 Thread Mark Thompson
This reverts commit a14a12ca137bf1526452b97bedfc9f7b301d4e04. The CTU size is always 32x32; the surface size is what actually sets the desired property, and it is already correct. --- libavcodec/vaapi_encode_h265.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

[libav-devel] [PATCH 09/11] cbs: Add some read/write tests

2017-09-09 Thread Mark Thompson
Use the appropriate metadata filter for each codec - in the absence of any options to modify the stream, the output bitstream should be identical to the input (though the output file may differ in padding). All tests use conformance bitstreams, the MPEG-2 streams are newly added from the

[libav-devel] [PATCH 10/11] mpeg12: Move finding the best frame rate to common code

2017-09-09 Thread Mark Thompson
Previously in the mpeg2_metadata filter. Also adds a test. --- libavcodec/Makefile| 1 + libavcodec/mpeg12.h| 4 ++ libavcodec/mpeg12framerate.c | 64 libavcodec/mpeg2_metadata_bsf.c| 58 +++--

[libav-devel] [PATCH 07/11] cbs_h265: Fix ranges of prediction weight offsets

2017-09-09 Thread Mark Thompson
The bracketing was wrong - '-' binds before '<<'. This would previously incorrectly reject the streams in the WP_A and WP_B conformance tests. --- libavcodec/cbs_h265_syntax_template.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git

[libav-devel] [PATCH 02/11] cbs: Add buffer padding when splitting fragments

2017-09-09 Thread Mark Thompson
Remove any trailing zeroes from H.26[45] NAL units at the same time. --- libavcodec/cbs_h2645.c | 11 +-- libavcodec/cbs_mpeg2.c | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c index c8a13f167..50a227da7 100644 ---

Re: [libav-devel] [PATCH 1/6] lavc: Add codec metadata to indicate hardware support

2017-09-07 Thread Mark Thompson
On 07/09/17 21:47, wm4 wrote: > On Thu, 7 Sep 2017 20:49:04 +0100 > Mark Thompson <s...@jkqxz.net> wrote: > >> --- >> (Also version bump.) >> >> Written intending to also be useful for encoders, but there won't actually >> be any impleme

Re: [libav-devel] [PATCH] qsv: Load the hw hevc plugin by default on Linux

2017-09-07 Thread Mark Thompson
On 06/09/17 14:07, Luca Barbato wrote: > Only on Windows the software plugin is available. > --- > > libavcodec/qsvenc_hevc.c | 8 +++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c > index 27ff0c6feb..efed4d98f4 100644

Re: [libav-devel] [PATCH 11/14] lavc/vaapi: Support context reuse

2017-09-07 Thread Mark Thompson
On 06/09/17 21:28, wm4 wrote: > On Wed, 6 Sep 2017 21:07:53 +0100 > Mark Thompson <s...@jkqxz.net> wrote: > >> On 06/09/17 17:27, wm4 wrote: >>> On Wed, 6 Sep 2017 16:49:11 +0100 >>> Mark Thompson <s...@jkqxz.net> wrote: >>> >>>&g

[libav-devel] [PATCH 5/6] lavc: Delete all fake hwaccels

2017-09-07 Thread Mark Thompson
They are now unused. --- They are technically externally visible (via av_hwaccel_next()), but hopefully noone is insane enough to actually use that. If it is decided that they do actually need to persist, they should probably all get moved into a separate file to separate them from

[libav-devel] [PATCH 4/6] lavc: Use hardware config information in ff_get_format()

2017-09-07 Thread Mark Thompson
This removes the dependency that hardware pixel formats previously had on AVHWAccel instances, meaning only those which actually do something need exist after this patch. Also updates avcodec_default_get_format() to be able to choose hardware formats if either a matching device has been supplied

[libav-devel] [PATCH 6/6] avconv: Use codec hardware config to configure hwaccels

2017-09-07 Thread Mark Thompson
Removes specific support for all hwaccels supported by the generic code (CUVID, DXVA2, D3D11VA, VAAPI and VDPAU). --- Also restores "-hwaccel auto" support. avtools/avconv.c | 77 +++- avtools/avconv.h | 9 +- avtools/avconv_hw.c | 245

[libav-devel] [PATCH 2/6] lavc: Add hardware config metadata for decoders supporting hardware output

2017-09-07 Thread Mark Thompson
--- Mostly mechanical to define the possible configurations. Patch could also be split if that is preferred. libavcodec/h263dec.c | 10 ++ libavcodec/h264dec.c | 19 +++ libavcodec/hevcdec.c | 19 +++ libavcodec/hwaccel.h | 26

[libav-devel] [PATCH 3/6] webp: Fix alpha initialisation

2017-09-07 Thread Mark Thompson
ff_get_format() in the next patch will reject formats which aren't in the offered list, so the hack in 7cb9296db872c4221453e5411f242ebcfca62664 is no longer valid. Change the hack by adding a new field in the VP8 decoder context to indicate that it's actually WebP and don't call ff_get_format()

[libav-devel] [PATCH 1/6] lavc: Add codec metadata to indicate hardware support

2017-09-07 Thread Mark Thompson
--- (Also version bump.) Written intending to also be useful for encoders, but there won't actually be any implementations. doc/APIchanges | 3 +++ libavcodec/avcodec.h | 69 2 files changed, 72 insertions(+) diff --git

Re: [libav-devel] [PATCH 11/14] lavc/vaapi: Support context reuse

2017-09-06 Thread Mark Thompson
On 06/09/17 17:27, wm4 wrote: > On Wed, 6 Sep 2017 16:49:11 +0100 > Mark Thompson <s...@jkqxz.net> wrote: > >> On 06/09/17 15:33, wm4 wrote: >>> On Tue, 5 Sep 2017 23:59:30 +0100 >>> Mark Thompson <s...@jkqxz.net> wrote: >>> >>

Re: [libav-devel] [PATCH 12/14] lavc: Add codec metadata to indicate hardware support

2017-09-06 Thread Mark Thompson
On 06/09/17 20:52, wm4 wrote: > On Wed, 6 Sep 2017 20:18:19 +0100 > Mark Thompson <s...@jkqxz.net> wrote: > >> On 06/09/17 19:14, wm4 wrote: >>> On Wed, 6 Sep 2017 18:55:46 +0100 >>> Mark Thompson <s...@jkqxz.net> wrote: >>> >>>&

Re: [libav-devel] [PATCH 12/14] lavc: Add codec metadata to indicate hardware support

2017-09-06 Thread Mark Thompson
On 06/09/17 19:14, wm4 wrote: > On Wed, 6 Sep 2017 18:55:46 +0100 > Mark Thompson <s...@jkqxz.net> wrote: > >> On 06/09/17 17:29, wm4 wrote: >>> On Wed, 6 Sep 2017 16:53:04 +0100 >>> Mark Thompson <s...@jkqxz.net> wrote: >>> >>>&g

Re: [libav-devel] [PATCH 12/14] lavc: Add codec metadata to indicate hardware support

2017-09-06 Thread Mark Thompson
On 06/09/17 17:29, wm4 wrote: > On Wed, 6 Sep 2017 16:53:04 +0100 > Mark Thompson <s...@jkqxz.net> wrote: > >> On 06/09/17 15:37, wm4 wrote: >>> On Tue, 5 Sep 2017 23:59:31 +0100 >>> Mark Thompson <s...@jkqxz.net> wrote: >>> >>

Re: [libav-devel] [PATCH 12/14] lavc: Add codec metadata to indicate hardware support

2017-09-06 Thread Mark Thompson
On 06/09/17 15:37, wm4 wrote: > On Tue, 5 Sep 2017 23:59:31 +0100 > Mark Thompson <s...@jkqxz.net> wrote: > >> --- >> doc/APIchanges | 3 +++ >> libavcodec/avcodec.h | 23 +++ >> 2 files changed, 26 insertions(+) >> &g

Re: [libav-devel] [PATCH 11/14] lavc/vaapi: Support context reuse

2017-09-06 Thread Mark Thompson
On 06/09/17 15:33, wm4 wrote: > On Tue, 5 Sep 2017 23:59:30 +0100 > Mark Thompson <s...@jkqxz.net> wrote: > >> --- >> Saves the VA config, the frame pool, and the VA context (in that order). >> The device reference is held so that freeing the persistent da

Re: [libav-devel] [PATCH 03/14] lavc/vaapi: Support external hardware frame pool initialisation

2017-09-06 Thread Mark Thompson
On 06/09/17 15:27, wm4 wrote: > On Tue, 5 Sep 2017 23:59:22 +0100 > Mark Thompson <s...@jkqxz.net> wrote: > >> --- >> libavcodec/vaapi_decode.c | 8 >> 1 file changed, 8 insertions(+) >> >> diff --git a/libavcodec/vaapi_decode.c b/libavcodec

Re: [libav-devel] [PATCH 13/14] lavc: Add hardware config metadata for all device-supporting hwaccels

2017-09-06 Thread Mark Thompson
On 05/09/17 23:59, Mark Thompson wrote: > --- > Only VAAPI and VDPAU tested, but hopefully mechanical. > > > ... > --- a/libavcodec/h264dec.c > +++ b/libavcodec/h264dec.c > @@ -786,6 +786,24 @@ AVCodec ff_h264_decoder = { > .capabilities = /*A

[libav-devel] [PATCH 10/14] lavc: Add ability to reuse hwaccel context and frames

2017-09-05 Thread Mark Thompson
Adds a new hwaccel flag REUSE_CONTEXT for the user to indicate that this is desired, and adds an additional refcounted state structure hwaccel_priv_persistent which persists across hwaccel reinitialisation and can be used to store context information for reuse. --- doc/APIchanges | 3

[libav-devel] [PATCH 06/14] lavfi: Add support for modifying hardware frame pool sizes

2017-09-05 Thread Mark Thompson
AVFilterContext.extra_hw_frames functions identically to the field of the same name in AVCodecContext. --- (This part all unchanged.) doc/APIchanges | 3 +++ libavfilter/avfilter.c | 23 +++ libavfilter/avfilter.h | 13 + libavfilter/internal.h | 16

[libav-devel] [PATCH 14/14] avconv: Use codec hardware config to configure hwaccels

2017-09-05 Thread Mark Thompson
Removes specific support for all hwaccels supported by the generic code (CUVID, DXVA2, D3D11VA, VAAPI and VDPAU). --- Also make -hwaccel auto work again. Tested with VAAPI and VDPAU. avtools/avconv.c | 76 +++- avtools/avconv.h | 9 +- avtools/avconv_hw.c | 243

[libav-devel] [PATCH 08/14] vf_scale_qsv: Support modifying hardware frame pool sizes

2017-09-05 Thread Mark Thompson
The deinterlacer does not change, because it does not allocate any new frames (for output it uses the same pool as the input). --- libavfilter/vf_scale_qsv.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/libavfilter/vf_scale_qsv.c

[libav-devel] [PATCH 11/14] lavc/vaapi: Support context reuse

2017-09-05 Thread Mark Thompson
--- Saves the VA config, the frame pool, and the VA context (in that order). The device reference is held so that freeing the persistent data is possible (the transient context is already gone when it happens). libavcodec/vaapi_decode.c | 241 +-

[libav-devel] [PATCH 09/14] vf_hwupload/hwmap: Support setting a fixed pool size

2017-09-05 Thread Mark Thompson
These filters do not directly know whether the API they are using will support dynamic frame pools, so this is somewhat tricky. If the user set extra_hw_frames, we assume that they are aware of the problem and set a fixed size based on that. If not, most cases use dynamic sizing just like they

[libav-devel] [PATCH 04/14] lavc/vdpau: Support external hardware frame pool initialisation

2017-09-05 Thread Mark Thompson
--- libavcodec/vdpau.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c index 68d0813f6..aff989f58 100644 --- a/libavcodec/vdpau.c +++ b/libavcodec/vdpau.c @@ -24,6 +24,7 @@ #include #include "avcodec.h" +#include "hwaccel.h" #include

[libav-devel] [PATCH 01/14] lavc: Add support for external hardware frame pool initialisation

2017-09-05 Thread Mark Thompson
This can be used to refine the parameters of lavc-created hardware frames contexts - this is useful for APIs which require some use information to to be supplied at create time, such as DXVA2 and D3D11VA. (Suggested by wm4 ). Also adds a field extra_hw_frames, which

[libav-devel] [PATCH 13/14] lavc: Add hardware config metadata for all device-supporting hwaccels

2017-09-05 Thread Mark Thompson
--- Only VAAPI and VDPAU tested, but hopefully mechanical. libavcodec/h263dec.c | 9 + libavcodec/h264dec.c | 18 ++ libavcodec/hevcdec.c | 18 ++ libavcodec/mpeg12dec.c | 23 ++- libavcodec/mpeg4videodec.c | 9

[libav-devel] [PATCH 02/14] lavc/dxva2: Support external hardware frame pool initialisation

2017-09-05 Thread Mark Thompson
--- libavcodec/dxva2.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index 9ceb6236d..e4ec61cec 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -30,6 +30,7 @@ #include "avcodec.h" #include "dxva2_internal.h" +#include "hwaccel.h"

[libav-devel] [PATCH 12/14] lavc: Add codec metadata to indicate hardware support

2017-09-05 Thread Mark Thompson
--- doc/APIchanges | 3 +++ libavcodec/avcodec.h | 23 +++ 2 files changed, 26 insertions(+) diff --git a/doc/APIchanges b/doc/APIchanges index 6f70f3c96..f21dc4db0 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -14,6 +14,9 @@ libavutil: 2017-03-23 API

[libav-devel] [PATCH 05/14] avconv/qsv: Use extra_hw_frames setting when allocating decoder frames

2017-09-05 Thread Mark Thompson
--- avtools/avconv_qsv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/avtools/avconv_qsv.c b/avtools/avconv_qsv.c index 723c6e022..de0269040 100644 --- a/avtools/avconv_qsv.c +++ b/avtools/avconv_qsv.c @@ -83,6 +83,9 @@ int qsv_init(AVCodecContext *s) frames_ctx->initial_pool_size

[libav-devel] [PATCH 07/14] vf_*_vaapi: Support modifying hardware frame pool sizes

2017-09-05 Thread Mark Thompson
Defaults to 10 frames to preserve compatibility, but can allocate fewer if extra_hw_frames is set explicitly. --- libavfilter/vf_deinterlace_vaapi.c | 39 +++ libavfilter/vf_scale_vaapi.c | 42 +++--- 2 files changed, 33

[libav-devel] [PATCH 03/14] lavc/vaapi: Support external hardware frame pool initialisation

2017-09-05 Thread Mark Thompson
--- libavcodec/vaapi_decode.c | 8 1 file changed, 8 insertions(+) diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c index a63c4c62e..847db1a42 100644 --- a/libavcodec/vaapi_decode.c +++ b/libavcodec/vaapi_decode.c @@ -21,6 +21,7 @@ #include "libavutil/pixdesc.h"

Re: [libav-devel] [PATCH 7/9] cbs: Add some read/write tests

2017-08-28 Thread Mark Thompson
On 28/08/17 18:08, Mark Thompson wrote: > Use the appropriate metadata filter for each codec - in the absence of any > options to modify the stream, the output bitstream should be identical to > the input (though the output file may differ in padding). > > H.264 and H.265 tests

[libav-devel] [PATCH 8/9] mpeg12: Move finding the best frame rate to common code

2017-08-28 Thread Mark Thompson
Previously in the mpeg2_metadata filter. Also adds a test. --- libavcodec/Makefile| 1 + libavcodec/mpeg12.h| 4 ++ libavcodec/mpeg12framerate.c | 64 libavcodec/mpeg2_metadata_bsf.c| 58 +++--

[libav-devel] [PATCH 9/9] vaapi_mpeg2: Convert to use coded bitstream infrastructure

2017-08-28 Thread Mark Thompson
--- Updated to use ff_mpeg12_find_best_frame_rate(). configure | 2 +- libavcodec/vaapi_encode_mpeg2.c | 638 ++-- 2 files changed, 424 insertions(+), 216 deletions(-) diff --git a/configure b/configure index 6bbde1e74..876e6215d

[libav-devel] [PATCH 7/9] cbs: Add some read/write tests

2017-08-28 Thread Mark Thompson
Use the appropriate metadata filter for each codec - in the absence of any options to modify the stream, the output bitstream should be identical to the input (though the output file may differ in padding). H.264 and H.265 tests use conformance bitstreams to attempt to cover all header features.

[libav-devel] [PATCH 5/9] cbs_h265: Fix reading of unknown parameter set extension data

2017-08-28 Thread Mark Thompson
--- Actually running on all the conformance test streams hits this. libavcodec/cbs_h265_syntax_template.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c index 40fdaf8a9..8564220d5 100644 ---

[libav-devel] [PATCH 3/9] h264_metadata: Fix double-free

2017-08-28 Thread Mark Thompson
Whether the udu string should be freed depends on whether the SEI it gets added to was created internally by cbs or externally by the bsf. The current code frees it twice in the former case. --- Starting to think that refcounting everything might be a good plan... libavcodec/h264_metadata_bsf.c

[libav-devel] [PATCH 1/9] cbs: Always check for bitstream end before reading

2017-08-28 Thread Mark Thompson
--- Overreads are always errors, so it is better to check for them in advance. libavcodec/cbs.c | 6 +++ libavcodec/cbs_h2645.c | 118 - libavcodec/cbs_mpeg2.c | 5 ++- 3 files changed, 67 insertions(+), 62 deletions(-) diff --git

[libav-devel] [PATCH 2/9] cbs: Add buffer padding when splitting fragments

2017-08-28 Thread Mark Thompson
Remove any trailing zeroes from H.26[45] NAL units at the same time. --- libavcodec/cbs_h2645.c | 11 +-- libavcodec/cbs_mpeg2.c | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c index c8a13f167..50a227da7 100644 ---

[libav-devel] [PATCH 6/9] cbs_h265: Fix ranges of prediction weight offsets

2017-08-28 Thread Mark Thompson
The bracketing was wrong - '-' binds before '<<'. This would previously incorrectly reject the streams in the WP_A and WP_B conformance tests. --- libavcodec/cbs_h265_syntax_template.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git

[libav-devel] [PATCH 4/9] Revert "vaapi_h265: Reduce the amount of padding in the stream"

2017-08-28 Thread Mark Thompson
This reverts commit a14a12ca137bf1526452b97bedfc9f7b301d4e04. The CTU size is always 32x32; the surface size is what actually sets the desired property, and it is already correct. --- I have no idea why I thought this change was right. libavcodec/vaapi_encode_h265.c | 7 ++- 1 file

[libav-devel] [PATCH 2/5] lavc: Add coded bitstream read/write support for MPEG-2

2017-08-14 Thread Mark Thompson
Also enable MPEG-2 support in the trace_headers filter. --- * Updated to add build system. * Writing support is redone to not have a huge buffer. * Cleaned the tricky part of the split setup a bit. * Unit free actually implemented so it doesn't leak all the memory. configure

[libav-devel] [PATCH 3/5] lavc: Add mpeg2_metadata bitstream filter

2017-08-14 Thread Mark Thompson
--- configure | 1 + doc/bitstream_filters.texi | 36 libavcodec/Makefile | 1 + libavcodec/bitstream_filters.c | 1 + libavcodec/mpeg2_metadata_bsf.c | 356 5 files changed, 395 insertions(+) create

[libav-devel] [PATCH 1/5] cbs_h2645: Return error if writing fails

2017-08-14 Thread Mark Thompson
--- The non-overflow case (noticed while writing similar code for MPEG-2). libavcodec/cbs_h2645.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c index 23556f47f..4d8ba99b3 100644 --- a/libavcodec/cbs_h2645.c +++ b/libavcodec/cbs_h2645.c

[libav-devel] [PATCH 4/5] vaapi_mpeg2: Convert to use coded bitstream infrastructure

2017-08-14 Thread Mark Thompson
--- configure | 2 +- libavcodec/vaapi_encode_mpeg2.c | 683 2 files changed, 475 insertions(+), 210 deletions(-) diff --git a/configure b/configure index 3e5784f85..49db3fb3a 100755 --- a/configure +++ b/configure @@ -2301,7

[libav-devel] [PATCH 5/5] mpeg2enc: Don't mark all streams as component video

2017-08-14 Thread Mark Thompson
Since there is no information about the source format, "unspecified" is the correct value to write here. All tests using the MPEG-2 encoder are updated, as this changes the header on all outputs. --- The actual diffs are all trivial, e.g. for fate-lavf-mxf: # $ diff -u <(hd before.mxf) <(hd

Re: [libav-devel] [PATCH] mpeg2enc: Don't mark all streams as component video

2017-08-13 Thread Mark Thompson
On 13/08/17 09:07, Anton Khirnov wrote: > Quoting Mark Thompson (2017-08-12 23:16:13) >> Since there is no information about the source format, "unspecified" >> is the correct value to write here. >> --- >> libavcodec/mpeg12enc.c | 2 +- >> 1 file change

Re: [libav-devel] [PATCH 02/14] lavc: Add coded bitstream read/write support for H.264

2017-08-12 Thread Mark Thompson
On 12/08/17 19:45, Diego Biurrun wrote: > On Sat, Aug 12, 2017 at 07:23:50PM +0100, Mark Thompson wrote: >> On 12/08/17 09:44, Diego Biurrun wrote: >>> On Fri, Aug 11, 2017 at 12:36:57AM +0100, Mark Thompson wrote: >>>> --- /dev/null >>>> +++ b/

[libav-devel] [PATCH] mpeg2enc: Don't mark all streams as component video

2017-08-12 Thread Mark Thompson
Since there is no information about the source format, "unspecified" is the correct value to write here. --- libavcodec/mpeg12enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 103f3aaa7..406950901 100644 ---

[libav-devel] [PATCH 13/21] vaapi_h265: Reduce the amount of padding in the stream

2017-08-12 Thread Mark Thompson
It is not necessary to pad to the CTU size. The CB size of 8x8 should be sufficient, but due to constraints in the Intel driver (the one usable implementation of this) it has to be padded to 16x16 like in H.264. --- On 12/08/17 17:02, Anton Khirnov wrote: > Quoting Mark Thompson (2017-08-11 01

Re: [libav-devel] [PATCH 02/14] lavc: Add coded bitstream read/write support for H.264

2017-08-12 Thread Mark Thompson
On 12/08/17 09:44, Diego Biurrun wrote: > On Fri, Aug 11, 2017 at 12:36:57AM +0100, Mark Thompson wrote: >> --- /dev/null >> +++ b/libavcodec/cbs_h2645.c >> @@ -0,0 +1,997 @@ >> + >> +#define FUNC(name) FUNC_H264(READWRITE, name) >> +#include "cbs_h26

Re: [libav-devel] [PATCH 01/14] lavc: Add coded bitstream read/write API

2017-08-12 Thread Mark Thompson
On 12/08/17 09:40, Diego Biurrun wrote: > On Fri, Aug 11, 2017 at 12:36:56AM +0100, Mark Thompson wrote: >> --- /dev/null >> +++ b/libavcodec/cbs.h >> @@ -0,0 +1,274 @@ >> + >> +/** >> + * Write the content of the fragment to its own internal buffer. >&g

[libav-devel] [PATCH 08/14] vaapi_h264: Convert to use coded bitstream infrastructure

2017-08-10 Thread Mark Thompson
--- Just updated build system. configure |2 +- libavcodec/Makefile|2 +- libavcodec/vaapi_encode_h264.c | 1421 3 files changed, 549 insertions(+), 876 deletions(-) diff --git a/configure b/configure index

[libav-devel] [PATCH 14/14] hevc: Remove unused hevc_ps_enc.c

2017-08-10 Thread Mark Thompson
Replaced with more complete implementation via coded bitstream infrastructure. --- Unchanged. libavcodec/hevc_ps.h | 3 -- libavcodec/hevc_ps_enc.c | 118 --- 2 files changed, 121 deletions(-) delete mode 100644 libavcodec/hevc_ps_enc.c diff

[libav-devel] [PATCH 10/14] vaapi_h264: Add support for SEI recovery points

2017-08-10 Thread Mark Thompson
Included by default with non-IDR intra frames. --- Unchanged. libavcodec/vaapi_encode_h264.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index 4f0e879e9..271644ebb 100644 ---

[libav-devel] [PATCH 11/14] vaapi_h265: Convert to use coded bitstream infrastructure

2017-08-10 Thread Mark Thompson
Also improves the metadata and generally makes the configuration a bit cleaner. --- Build system; also fix a silly bug with num_ticks_poc_diff noticed by hevc_metadata testing. configure |2 +- libavcodec/Makefile|2 +- libavcodec/vaapi_encode_h265.c |

[libav-devel] [PATCH 12/14] vaapi_h265: Add support for AUD NAL units

2017-08-10 Thread Mark Thompson
Matching the H.264 encoder. --- Unchanged. libavcodec/vaapi_encode_h265.c | 39 +++ 1 file changed, 39 insertions(+) diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c index f441e0370..0ebeeb693 100644 ---

[libav-devel] [PATCH 13/14] qsvenc_hevc: Replace ad-hoc VPS writing with CBS implementation

2017-08-10 Thread Mark Thompson
This copies more information which should be present from the SPS. It also fixes the value of vps_temporal_id_nesting_flag, which was previously incorrect for a single-layer stream (the standard states that it must be 1, and the reference decoder barfs if it isn't). --- Build system change only.

[libav-devel] [PATCH 06/14] lavc: Add h264_redundant_pps bitstream filter

2017-08-10 Thread Mark Thompson
This applies a specific fixup to some Bluray streams which contain redundant PPSs modifying irrelevant parameters of the stream which confuse other transformations which require correct extradata. A new single global PPS is created, and all of the redundant PPSs within the stream are removed. ---

[libav-devel] [PATCH 09/14] vaapi_h264: Add support for AUD NAL units

2017-08-10 Thread Mark Thompson
Adds a new private option to enable them (off by default). --- Unchanged. libavcodec/vaapi_encode_h264.c | 33 + 1 file changed, 33 insertions(+) diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index b48070c95..4f0e879e9 100644 ---

[libav-devel] [PATCH 02/14] lavc: Add coded bitstream read/write support for H.264

2017-08-10 Thread Mark Thompson
--- The golomb read/write functions are now local to cbs_h2645.c. configure|2 + libavcodec/Makefile |1 + libavcodec/cbs.c |3 + libavcodec/cbs_h264.h| 427 +++ libavcodec/cbs_h2645.c | 997

[libav-devel] [PATCH 05/14] lavc: Add h264_metadata bitstream filter

2017-08-10 Thread Mark Thompson
This is able to modify some header metadata found in the SPS/VUI, and can also add/remove AUDs and insert user data in SEI NAL units. --- The frame_rate option is renamed tick_rate to be more consistent with what is actually in the stream. Crop unit has been changed to pixels rather than the

[libav-devel] [PATCH 03/14] lavc: Add coded bitstream read/write support for H.265

2017-08-10 Thread Mark Thompson
--- Build system changes only. configure|2 + libavcodec/Makefile |1 + libavcodec/cbs.c |3 + libavcodec/cbs_h2645.c | 410 +++- libavcodec/cbs_h265.h| 537 +++ libavcodec/cbs_h265_syntax.c | 1502

[libav-devel] [PATCH 04/14] lavc: Add trace_headers bitstream filter

2017-08-10 Thread Mark Thompson
Supports all streams that the coded bitstream infrastructure does (currently H.264 and H.265). --- Removed MPEG-2 from this patch; will add it again later when it is complete. configure | 1 + doc/bitstream_filters.texi | 8 +++ libavcodec/Makefile| 1

[libav-devel] [PATCH 07/14] lavc: Add hevc_metadata bitstream filter

2017-08-10 Thread Mark Thompson
This is able to modify some header metadata found in the VPS/SPS/VUI, and can also add/remove AUDs. --- Crop unit has been changed to pixels rather than the subsample units used in the stream. Fixed updating the VPS in extradata and some failure cases. configure | 1 +

[libav-devel] [PATCH 00/14] Coded bitstream editing (v6)

2017-08-10 Thread Mark Thompson
The main change here is to make cbs and cbs_codec subsystems for configure, plus miscellaneous minor fixes reflecting review comments. This is H.264/5 only to make it a bit more cohesive. I have some further changes to make to MPEG-2, and that can follow later. The build system changes want

[libav-devel] [PATCH 01/14] lavc: Add coded bitstream read/write API

2017-08-10 Thread Mark Thompson
--- The golomb read/write functions have moved to the following patch to make the dependencies work out sensibly. configure | 1 + libavcodec/Makefile | 1 + libavcodec/cbs.c | 461 ++ libavcodec/cbs.h |

Re: [libav-devel] [PATCH] vaapi_encode: Move quality option in common code

2017-08-06 Thread Mark Thompson
On 12/05/17 16:59, Anton Khirnov wrote: > Quoting Mark Thompson (2017-04-30 20:43:34) >> Use AVCodecContext.compression_level rather than a private option, >> replacing the H.264-specific quality option (which stays only for >> compatibility). >> >> This

[libav-devel] [PATCH 09/10] vf_hwupload/hwmap: Support setting a fixed pool size

2017-08-05 Thread Mark Thompson
These filters do not directly know whether the API they are using will support dynamic frame pools, so this is somewhat tricky. If the user set extra_hw_frames, we assume that they are aware of the problem and set a fixed size based on that. If not, most cases use dynamic sizing just like they

[libav-devel] [PATCH 01/10] lavc: Add support for external hardware frame pool initialisation

2017-08-05 Thread Mark Thompson
This can be used to refine the parameters of lavc-created hardware frames contexts - this is useful for APIs which require some use information to to be supplied at create time, such as DXVA2 and D3D11VA. (Suggested by wm4 ). Also adds a field extra_hw_frames, which

[libav-devel] [PATCH 07/10] vf_*_vaapi: Support modifying hardware frame pool sizes

2017-08-05 Thread Mark Thompson
Defaults to 10 frames to preserve compatibility, but can allocate fewer if extra_hw_frames is set explicitly. --- libavfilter/vf_deinterlace_vaapi.c | 39 +++ libavfilter/vf_scale_vaapi.c | 42 +++--- 2 files changed, 33

[libav-devel] [PATCH 06/10] lavfi: Add support for modifying hardware frame pool sizes

2017-08-05 Thread Mark Thompson
AVFilterContext.extra_hw_frames functions identically to the field of the same name in AVCodecContext. --- Implemented in such a way that an init_hw_frames callback could be added here as well, if anyone had a use-case for it. doc/APIchanges | 3 +++ libavfilter/avfilter.c | 23

[libav-devel] [PATCH 03/10] lavc/vaapi: Support external hardware frame pool initialisation

2017-08-05 Thread Mark Thompson
--- libavcodec/vaapi_decode.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c index a63c4c62e..572969057 100644 --- a/libavcodec/vaapi_decode.c +++ b/libavcodec/vaapi_decode.c @@ -562,6 +562,13 @@ int

[libav-devel] [PATCH 10/10] RFC: generic hwaccel everywhere

2017-08-05 Thread Mark Thompson
--- This is several patches squashed together to invite thoughts. The idea here is that we add a new array of possible hardware configurations to codec definitions, expressed as a hardware device type and the matching pixel format. We can then use that to set up hwaccels without any additional

[libav-devel] [PATCH 02/10] lavc/dxva2: Support external hardware frame pool initialisation

2017-08-05 Thread Mark Thompson
--- libavcodec/dxva2.c | 4 1 file changed, 4 insertions(+) diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index 9ceb6236d..f7d8c1842 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -658,6 +658,10 @@ int ff_dxva2_decode_init(AVCodecContext *avctx)

[libav-devel] [PATCH 04/10] lavc/vdpau: Support external hardware frame pool initialisation

2017-08-05 Thread Mark Thompson
--- libavcodec/vdpau.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c index 68d0813f6..da131a9fe 100644 --- a/libavcodec/vdpau.c +++ b/libavcodec/vdpau.c @@ -164,6 +164,12 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile

[libav-devel] [PATCH 05/10] avconv/qsv: Use extra_hw_frames setting when allocating decoder frames

2017-08-05 Thread Mark Thompson
--- A bit hacky, but allows the common way to fix running out of frames (decode->encode with lots of lookahead doesn't currently work). avtools/avconv_qsv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/avtools/avconv_qsv.c b/avtools/avconv_qsv.c index 723c6e022..de0269040 100644 ---

[libav-devel] [PATCH 08/10] vf_scale_qsv: Support modifying hardware frame pool sizes

2017-08-05 Thread Mark Thompson
The deinterlacer does not change, because it does not allocate any new frames (for output it uses the same pool as the input). --- libavfilter/vf_scale_qsv.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/libavfilter/vf_scale_qsv.c

[libav-devel] [PATCH] lavc: Add mpeg2_metadata bitstream filter

2017-08-01 Thread Mark Thompson
--- To go between patches 12 and 13. doc/bitstream_filters.texi | 36 libavcodec/Makefile | 2 + libavcodec/bitstream_filters.c | 1 + libavcodec/mpeg2_metadata_bsf.c | 358 4 files changed, 397 insertions(+) create mode

Re: [libav-devel] [PATCH 01/15] h264: Add stream constraint values to the common header

2017-07-29 Thread Mark Thompson
On 29/07/17 23:12, Hendrik Leppkes wrote: > On Sat, Jun 24, 2017 at 5:48 PM, Diego Biurrun <di...@biurrun.de> wrote: >> On Sat, Jun 24, 2017 at 11:56:07AM -0300, James Almer wrote: >>> On 6/23/2017 8:39 PM, Mark Thompson wrote: >>>> --- a/libavcodec

[libav-devel] [PATCH 19/22] hevc: Remove unused hevc_ps_enc.c

2017-07-29 Thread Mark Thompson
Replaced with more complete implementation via coded bitstream infrastructure. --- libavcodec/hevc_ps.h | 3 -- libavcodec/hevc_ps_enc.c | 118 --- 2 files changed, 121 deletions(-) delete mode 100644 libavcodec/hevc_ps_enc.c diff --git

[libav-devel] [PATCH 08/22] lavc: Add trace_headers bitstream filter

2017-07-29 Thread Mark Thompson
Supports all streams that the coded bitstream infrastructure does (currently H.264, H.265 and MPEG-2). --- * Header now contains all of pts, dts, size and packet flags. doc/bitstream_filters.texi | 8 +++ libavcodec/Makefile| 2 + libavcodec/bitstream_filters.c | 1 +

[libav-devel] [PATCH 18/22] qsvenc_hevc: Replace ad-hoc VPS writing with CBS implementation

2017-07-29 Thread Mark Thompson
This copies more information which should be present from the SPS. It also fixes the value of vps_temporal_id_nesting_flag, which was previously incorrect for a single-layer stream (the standard states that it must be 1, and the reference decoder barfs if it isn't). --- Tested on Linux / Skylake.

[libav-devel] [PATCH 13/22] vaapi_h264: Add support for AUD NAL units

2017-07-29 Thread Mark Thompson
Adds a new private option to enable them (off by default). --- libavcodec/vaapi_encode_h264.c | 33 + 1 file changed, 33 insertions(+) diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index 8d9b1c6f7..ff73922ab 100644 ---

[libav-devel] [PATCH 17/22] vaapi_mpeg2: Convert to use coded bitstream infrastructure

2017-07-29 Thread Mark Thompson
--- libavcodec/vaapi_encode_mpeg2.c | 670 +++- 1 file changed, 462 insertions(+), 208 deletions(-) diff --git a/libavcodec/vaapi_encode_mpeg2.c b/libavcodec/vaapi_encode_mpeg2.c index 634178521..67ac9d25a 100644 --- a/libavcodec/vaapi_encode_mpeg2.c +++

[libav-devel] [PATCH 00/22] Coded bitstream editing (v5)

2017-07-29 Thread Mark Thompson
Mainly minor updates. Significant additions: * H.265 metadata bitstream filter * H.265 in VAAPI is generally improved - more metadata, AUDs are added. * The VPS writing code in qsvenc is replaced, and the old code removed. * Use of anonymous unions removed. Thanks, - Mark

<    1   2   3   4   5   6   7   8   9   10   >