1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

21190 Commits

Author SHA1 Message Date
Diego Biurrun
92c5755a18 hpeldsp: arm: Update comments left behind in 25841dfe80 2016-09-29 14:48:03 +02:00
Diego Biurrun
009adfd4fb x86: fpel: Remove unnecessary sign extend 2016-09-29 14:47:41 +02:00
Mark Thompson
956a54129d vaapi_h264: Set max_num_ref_frames to 1 when not using B frames 2016-09-28 22:54:11 +01:00
Mark Thompson
086e4b58b5 vaapi_encode: Sync to input surface rather than output
While outwardly bizarre, this change makes the behaviour consistent
with other VAAPI encoders which sync to the encode /input/ picture in
order to wait for /output/ from the encoder.  It is not harmful on
i965 (because synchronisation already happens in vaRenderPicture(),
so it has no effect there), and it allows the encoder to work on
mesa/gallium which assumes this behaviour.
2016-09-28 22:54:11 +01:00
Mark Thompson
892bbbcdc1 vaapi_encode: Check packed header capabilities
This improves behaviour with drivers which do not support packed
headers, such as AMD VCE on mesa/gallium.
2016-09-28 22:54:11 +01:00
Mark Thompson
80a5d05108 vaapi_encode: Refactor initialisation
This allows better checking of capabilities and will make it easier
to add more functionality later.

It also commonises some duplicated code around rate control setup
and adds more comments explaining the internals.
2016-09-28 22:54:10 +01:00
Anton Khirnov
7bf8db4db6 tdsc: use the new decoding API 2016-09-28 10:01:52 +02:00
Anton Khirnov
de2ae3c1fa lavc: add clobber tests for the new encoding/decoding API 2016-09-28 10:01:52 +02:00
Anton Khirnov
68811a41c7 mpegvideo_enc: use the new encoding API for b_strategy=2 2016-09-28 10:01:52 +02:00
Anton Khirnov
f03f78bc1c mpegvideo_enc: handle encoding errors with b_strategy=2 2016-09-28 10:01:52 +02:00
Anton Khirnov
6f733ecab6 mpegvideo_enc: add const to the AVCodec instance 2016-09-28 10:01:52 +02:00
Yogender Gupta
70de2ea426 nvenc: Extended rate-control support as provided by SDK 7
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-09-24 19:03:10 +02:00
Yogender Gupta
358c887a9f nvenc: Add support for high bitdepth
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-09-24 19:02:31 +02:00
Yogender Gupta
e02e2515b2 nvenc: Add some easier to understand presets that match x264 terminology
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-09-24 18:08:54 +02:00
Luca Barbato
352741b5ea nvenc: Make sure that enum and array index match
And use a macro to reduce the boilerplate.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-09-24 18:08:54 +02:00
Anton Khirnov
12004a9a7f audiodsp/x86: yasmify vector_clipf_sse 2016-09-22 09:47:52 +02:00
Anton Khirnov
683da86aab audiodsp: reorder arguments for vector_clipf
This will make the x86 asm simpler.

ARM conversion by Martin Storsjö <martin@martin.st> and Janne Grunau
<janne-libav@jannau.net>
2016-09-22 09:47:52 +02:00
Anton Khirnov
bf58545aac audiodsp: fix vector_clipf documentation
The x86 version processes 16 floats per iteration, so len must be a
multiple of 16.
2016-09-22 09:47:52 +02:00
Anton Khirnov
eea9857bfd blockdsp: drop the high_bit_depth parameter
It has no effect, since the code is supposed to operate the same way for
any bit depth.
2016-09-22 09:47:52 +02:00
Anton Khirnov
75d98e30af audiodsp/x86: clear the high bits of the order parameter on 64bit
Also change shl to add, since it can be faster on some CPUs.

CC: libav-stable@libav.org
2016-09-19 19:18:07 +02:00
Anton Khirnov
1d6c76e11f audiodsp/x86: fix ff_vector_clip_int32_sse2
This version, which is the only one doing two processing cycles per loop
iteration, computes the load/store indices incorrectly for the second
cycle.

CC: libav-stable@libav.org
2016-09-19 19:18:07 +02:00
Yogender Gupta
de64dd13cb avcodec: Add the extended pixel format profile for HEVC
It is supported by the NVIDIA video SDK 7.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-09-19 10:02:43 +02:00
Michael Niedermayer
136f552075 mpegvideo_motion: Handle edge emulation even without unrestricted_mv
Fix out of bounds read.

Bug-Id: 962
Found by: F4B3CD@STARLAB and Agostino Sarubbo
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-09-16 16:28:07 +02:00
Mark Thompson
3a9662af6c vaapi_h264: Fix HRD bit_rate/cpb_size scaling
There should be an extra offset of 6 on bit_rate_scale and of 4 on
cpb_size_scale which were not accounted for here.
2016-09-14 20:48:36 +01:00
Diego Biurrun
de452e5037 pixblockdsp: Change type of stride parameters to ptrdiff_t
This avoids SIMD-optimized functions having to sign-extend their
line size argument manually to be able to do pointer arithmetic.

Also adjust parameter names to be "stride" everywhere.
2016-09-14 14:12:36 +02:00
Diego Biurrun
468bfe38c6 ppc: mpegvideo: Add proper runtime AltiVec detection 2016-09-11 23:30:40 +02:00
Diego Biurrun
6ce93757ee ppc: Update #endif comments 2016-09-11 19:19:41 +02:00
Luca Barbato
caccb3a0cd audiodsp: ppc: Add VSX variant
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-09-11 19:19:41 +02:00
Mark Thompson
75d642a944 vaapi_vp8: Explicitly include libva vp8 decode header
With some old libva versions <va/va.h> does not automatically include
the per-codec subsidiary headers, so we need to include the right one
explicitly ourselves.
2016-09-09 18:56:18 +01:00
Mark Thompson
11c191b52c vaapi_decode: Ignore the profile when not useful
Enables VP8 decoding - the decoder places the the bitstream version
in the profile field, which we want to ignore.
2016-09-08 21:58:22 +01:00
Mark Thompson
a9fb134730 lavc/vaapi: Add VP8 decode hwaccel 2016-09-08 21:58:22 +01:00
Mark Thompson
4e528206bc vp8: Add hwaccel hooks
Also adds some extra fields to the main context structure that may
be needed by a hwaccel decoder.
2016-09-08 21:58:22 +01:00
Diego Biurrun
131a85a1fe utvideo: Change type of array stride parameters to ptrdiff_t
ptrdiff_t is the correct type for array strides and similar.
2016-09-08 13:51:30 +02:00
Diego Biurrun
52730e0f86 iir_filter: Change type of array stride parameters to ptrdiff_t
ptrdiff_t is the correct type for array strides and similar.
2016-09-07 11:30:18 +02:00
Diego Biurrun
6b52762951 error_resilience: Change type of array stride parameters to ptrdiff_t
ptrdiff_t is the correct type for array strides and similar.
2016-09-07 11:30:17 +02:00
Diego Biurrun
5b5ed92d92 sanm: Change type of array pitch parameters to ptrdiff_t
ptrdiff_t is the correct type for array pitches and similar.
2016-09-04 12:19:58 +02:00
Diego Biurrun
73f5e17a20 copy_block: Change type of array stride parameters to ptrdiff_t
ptrdiff_t is the correct type for array strides and similar.
2016-09-04 12:19:47 +02:00
Diego Biurrun
21e500ba64 svq1dec: Change type of array pitch parameters to ptrdiff_t
ptrdiff_t is the correct type for array pitches and similar.
2016-09-04 11:57:15 +02:00
Diego Biurrun
746c56b773 indeo: Change type of array pitch parameters to ptrdiff_t
ptrdiff_t is the correct type for array pitches and similar.
2016-09-04 11:57:15 +02:00
Mark Thompson
851960f6f8 lavc: Remove old vaapi decode infrastructure
Deprecates struct vaapi_context and the installed header vaapi.h,
to be removed at the next version bump.
2016-08-30 22:16:01 +01:00
Mark Thompson
ccd0316f7c vaapi_mpeg4: Convert to use the new VAAPI hwaccel code 2016-08-30 21:45:59 +01:00
Mark Thompson
520fb77285 vaapi_vc1: Convert to use the new VAAPI hwaccel code 2016-08-30 21:45:59 +01:00
Mark Thompson
102e13c353 vaapi_mpeg2: Convert to use the new VAAPI hwaccel code 2016-08-30 21:45:59 +01:00
Mark Thompson
2fe93244ab vaapi_h264: Convert to use the new VAAPI hwaccel code 2016-08-30 21:45:59 +01:00
Mark Thompson
123ccd07c5 lavc: Rewrite VAAPI decode infrastructure
Moves much of the setup logic for VAAPI decoding into lavc; the user
now need only provide the hw_frames_ctx.
2016-08-30 21:45:59 +01:00
Diego Biurrun
72eba6558e wmavoice: Simplify GetBitContext initialization 2016-08-30 22:06:47 +02:00
Diego Biurrun
4ab496261b libvpx: Cast a pointer to const to squelch a warning
libavcodec/libvpxdec.c💯57: warning: passing argument 3 of 'av_image_copy' from incompatible pointer type
         av_image_copy(picture->data, picture->linesize, img->planes,
libavutil/imgutils.h:116:6: note: expected 'const uint8_t **' but argument is of type 'unsigned char **'
 void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
2016-08-26 13:25:59 +02:00
Diego Biurrun
721d57e608 vp56: Separate VP5 and VP6 dsp initialization
VP5 has no arch-specific optimizations (nor will it get some in the
future), so it makes no sense to try to share dsp init code with VP6.
2016-08-26 11:50:22 +02:00
Diego Biurrun
3fd22538bc prores: Change type of stride parameters to ptrdiff_t
This avoids SIMD-optimized functions having to sign-extend their
line size argument manually to be able to do pointer arithmetic.

Also adjust parameter names to be "linesize" everywhere.
2016-08-26 11:50:21 +02:00
Diego Biurrun
f81be06cf6 cavs: Change type of stride parameters to ptrdiff_t
ptrdiff_t is the correct type for array strides and similar.
2016-08-26 11:48:15 +02:00
Diego Biurrun
802727b538 vp8: Update some assembly comments left unchanged in bd66f073fe 2016-08-26 11:36:53 +02:00
Diego Biurrun
87c6c78604 vp8: Change type of stride parameters to ptrdiff_t
ptrdiff_t is the correct type for array strides and similar.
2016-08-26 11:36:53 +02:00
Diego Biurrun
d9d26a3674 vp56: Change type of stride parameters to ptrdiff_t
This avoids SIMD-optimized functions having to sign-extend their
line size argument manually to be able to do pointer arithmetic.
2016-08-26 11:36:26 +02:00
Diego Biurrun
6892df9294 vp3: Change type of stride parameters to ptrdiff_t
This avoids SIMD-optimized functions having to sign-extend their
stride argument manually to be able to do pointer arithmetic.

Also adjust parameter names to be "stride" everywhere.
2016-08-26 11:36:26 +02:00
Luca Barbato
d42809f983 av1: Add codec_id and basic demuxing support
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-08-24 14:45:08 +02:00
Anton Khirnov
6755eb5b21 mss12: validate display dimensions
The code currently reads the coded dimensions from the extradata, but
expects the display dimensions to be set by the caller, and does not
check that they are compatible (i.e. that the displayed size is smaller
than the coded size).

Make sure that when the display dimensions are set, they are also valid.
Fixes possible invalid memory access.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2016-08-18 17:06:46 +02:00
Anton Khirnov
33f10546ec vc1: check that slices have a positive height
Fixes possible invalid reads.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2016-08-18 17:06:46 +02:00
Anton Khirnov
09b23786b3 pcx: use the bytestream2 API for reading from input
Fixes possible invalid reads.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2016-08-18 17:06:46 +02:00
Anton Khirnov
221402c1c8 pcx: check that the packet is large enough before reading the header
Fixes possible invalid reads.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2016-08-18 17:06:46 +02:00
Anton Khirnov
15ee419b7a pcx: properly pad the scanline
It is passed to the get_bits API, which requires buffers to be padded.

Fixes possible invalid reads.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2016-08-18 17:06:46 +02:00
Anton Khirnov
409d1cd2c9 cook: use the bytestream2 API for reading extradata
Fixes possible invalid reads in corrupted files.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2016-08-18 17:06:46 +02:00
Anton Khirnov
bba9d8bdfb qpeg: fix an off by 1 error in the MV check
height - me_y is the line from which we read, so it must be strictly
smaller than the frame height. Fixes possible invalid reads in corrupted
files.

Also, use a proper context for logging the error.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2016-08-18 17:06:46 +02:00
Anton Khirnov
796dca027b alac: do not return success if nothing was decoded
If we encounter an END element before anything is decoded, we would
return success even though the output frame has not been allocated,
which is invalid.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2016-08-18 17:06:46 +02:00
Anton Khirnov
f5d46d3322 vmnc: check that subrectangles fit into their containing rectangles
Fixes possible invalid writes with corrupted files.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2016-08-18 17:06:46 +02:00
Diego Biurrun
83b92a855e golomb: Drop disabled cruft 2016-08-17 12:22:29 +02:00
Diego Biurrun
014852e932 simple_idct: arm: Drop disabled code variant 2016-08-17 12:21:54 +02:00
Diego Biurrun
e2b9993558 simple_idct: x86: Drop disabled IDCT implementation
This gem has been disabled since 2001.
2016-08-17 12:21:54 +02:00
Diego Biurrun
7effebde78 dvbsubdec: Remove disabled, near-duplicate debug code 2016-08-17 12:16:42 +02:00
Diego Biurrun
0e285c2f90 mpegvideo: Kill some disabled code 2016-08-17 12:16:42 +02:00
Diego Biurrun
f2f145f303 msmpeg4: Drop disabled debug cruft 2016-08-17 12:16:42 +02:00
Diego Biurrun
be1db21ba8 mathops: Drop disabled alternative mid_pred() implementation 2016-08-17 12:16:42 +02:00
Diego Biurrun
b53d8c3ccf mjpegdec: Drop disabled code 2016-08-17 12:16:42 +02:00
Diego Biurrun
34c22a9ca6 faan(i)dct: Kill some disabled code 2016-08-17 12:16:42 +02:00
Diego Biurrun
17cb56b356 ffv1: Remove broken disabled cruft 2016-08-17 12:16:42 +02:00
Diego Biurrun
b96f0ab3d2 h264: Kill broken disabled cruft 2016-08-17 12:16:42 +02:00
Diego Biurrun
42c4c2d2a6 aac: Drop broken cruft 2016-08-17 12:16:42 +02:00
Diego Biurrun
263efc095e jfdct: Kill broken cruft 2016-08-17 12:16:42 +02:00
Diego Biurrun
dab2034b86 roqvideoenc: Drop broken disabled cruft 2016-08-17 12:16:42 +02:00
Diego Biurrun
562bec0e69 pnm_parser: Drop broken disabled cruft 2016-08-17 12:16:42 +02:00
Diego Biurrun
a972fc1c0a wma: Kill non-compiling disabled cruft 2016-08-17 12:16:42 +02:00
Diego Biurrun
d5fda00efa mpeg4videoenc: Kill non-compiling disabled cruft 2016-08-17 12:16:42 +02:00
Diego Biurrun
e4d5b55193 rangecoder: Kill non-compiling disabled cruft 2016-08-17 12:16:42 +02:00
Mark Thompson
5a667322f5 vaapi_vc1: Remove redundant version check
The lowest supported VAAPI version is 0.34 (checked at configure
time), so this test is no longer needed.
2016-08-13 09:46:48 +01:00
Mark Thompson
01d6f84f49 vaapi_vc1: Constify pointers 2016-08-13 09:46:48 +01:00
Mark Thompson
ee9061293e vaapi_mpeg2: Constify pointers 2016-08-13 09:46:48 +01:00
Mark Thompson
03adfe9130 vaapi_h264: Constify pointers 2016-08-13 09:46:48 +01:00
Anton Khirnov
f2143c57b6 vp9: reindent after last commit 2016-08-11 11:02:47 +02:00
Ronald S. Bultje
1730a67ab9 vp9: add frame threading
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-08-11 10:54:44 +02:00
Ronald S. Bultje
5b995452a6 vp9: allocate 'b', 'block/uvblock' and 'eob/uveob' dynamically.
This will be needed for frame threading.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-08-11 10:54:20 +02:00
Ronald S. Bultje
bc6e0b64a9 vp9: split last/cur_frame from the reference buffers.
We need more information from last/cur_frame than from reference
buffers, so we can use a simplified structure for reference buffers,
and then store mvs and segmentation map information in last/cur.

This prepares the decoder for frame threading support.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-08-11 10:53:13 +02:00
Anton Khirnov
04763c6f87 h264_direct: use the reference mask from the actual reference
Not from the underlying frame. Fixes races with frame threading in
field-coded files, where decoding would wait for the wrong field (e.g.
random failures in mixed-nal-coding).

Bug-Id: 954
2016-08-11 10:52:54 +02:00
Anton Khirnov
e9bfff1cc6 lavc: free buffer_frame/pkt on avcodec_open2() failure
Fixes memory leaks in some FATE tests.
2016-08-11 10:52:13 +02:00
Ronald S. Bultje
0df4801105 vp9: make mv bounds 32bit.
The frame dimensions are 16bit, so the mv bounds can easily overflow
int16 for large videos.

Bug-Id: Handbrake/46
CC: libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-08-03 11:07:15 +02:00
Ronald S. Bultje
9790b44a89 vp9mc/x86: sse2 MC assembly.
Also a slight change to the ssse3 code, which prevents a theoretical
overflow in the sharp filter.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-08-03 11:04:51 +02:00
James Almer
67922b4ee4 vp9mc/x86: add AVX and AVX2 MC
Roughly 25% faster MC than ssse3 for blocksizes 32 and 64.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-08-03 11:00:08 +02:00
Clément Bœsch
3cda179f18 vp9mc/x86: rename ff_* to ff_vp9_*
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-08-03 10:57:55 +02:00
James Almer
8be8444d01 vp9mc/x86: rename ff_avg[48]_sse to ff_avg[48]_mmxext
pavgb is an sse integer instruction, so the mmxext flag is enough

Signed-off-by: James Almer <jamrial@gmail.com>
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-08-03 10:57:55 +02:00
Clément Bœsch
6ab642d69d vp9mc/x86: simplify a few inits.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-08-03 10:57:55 +02:00
Ronald S. Bultje
3a09494939 vp9mc/x86: add 16px functions (64bit only).
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-08-03 10:57:55 +02:00
Anton Khirnov
89466de4ae vp9/x86: rename vp9dsp to vp9mc
It only contains the MC SIMD, other SIMD will go into different files.
2016-08-03 10:57:50 +02:00
Anton Khirnov
89aebc5bcc lavc: align the linesize to 32 when AVX is enabled 2016-08-03 10:56:53 +02:00
Christophe Gisquet
3c504bc359 x86: deduplicate some constants
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-08-03 10:56:52 +02:00
Anton Khirnov
d3e4d406b0 h264dec: reset nb_slice_ctx_queued for hwaccel decoding
Fixes hwaccel decoding of files with multiple slices.

Found-By: Mark Thompson <sw@jkqxz.net>
2016-08-03 10:56:52 +02:00
Diego Biurrun
3ccec334b8 sbrdsp: Move a misplaced #endif directive to the right spot 2016-08-03 08:26:40 +02:00
Diego Biurrun
e723dce6f8 dvbsubdec: Use NULL instead of 0 as pointer value 2016-08-03 08:26:40 +02:00
Martin Storsjö
9806b9ab5c Revert "Don't use expressions with side effects in macro parameters"
This reverts commit 25bacd0a0c.

Since 230b1c070, the bytewise AV_W*() macros only expand their
argument once, so revert to the more readable version of these.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-08-02 21:18:12 +03:00
Martin Storsjö
25bacd0a0c Don't use expressions with side effects in macro parameters
AV_WB32 can be implemented as a macro that expands its parameters
multiple times (in case AV_HAVE_FAST_UNALIGNED isn't set and the
compiler doesn't support GCC attributes); make sure not to read
multiple times from the source in this case.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-07-31 22:50:51 +03:00
Martin Storsjö
7ebdffc353 dxv: Check to make sure we don't overrun buffers on corrupt inputs
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-07-31 22:50:47 +03:00
Anton Khirnov
e328178da9 qsvdec: only access hwaccel_context is the pixel format is QSV
We do not strictly specify that hwaccel_context must be cleared if no
hwaccel is used.

Reported-By: wm4 <nfxjfg@googlemail.com>
2016-07-31 08:19:45 +02:00
Anton Khirnov
5ebef79abe Fix instances of broken indentation found by gcc 6 2016-07-31 08:19:27 +02:00
Luca Barbato
8495d84f01 ac3dec: Add some inline hints
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-07-29 18:46:48 +02:00
Luca Barbato
3db51bf671 ac3dec: Simplify skipping
skip_bits_long() can skip up to 32-bit ranges.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-07-29 18:46:48 +02:00
Luca Barbato
f0ccc65bc9 ac3dec: Split coupling-specific code from decode_audio_block()
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-07-29 18:46:48 +02:00
Luca Barbato
a5ebe5d121 ac3dec: Split spx-specific code from decode_audio_block()
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-07-29 18:46:48 +02:00
Anton Khirnov
a115eb9e75 mimic: do not release the newly obsolete reference at the end of decoding
The reference frames are used in update_thread_context(), so modifying
them after finish_setup() is a race. The frame in question will be
released during the next decode call.

CC: libav-stable@libav.org
2016-07-29 15:59:48 +02:00
Diego Biurrun
48b80f8393 hpeldsp: Explain why put_no_rnd_pixels_tab is larger than necessary 2016-07-25 19:38:18 +02:00
Luca Barbato
b183abfb5b vpx: Support color range
The range field has been introduced in version 1.6.0
2016-07-23 08:27:29 +02:00
Anton Khirnov
8e07c22e50 qsvenc: print warnings from encode/init 2016-07-22 19:08:13 +02:00
Anton Khirnov
0956fd4606 qsvenc: do not re-execute encoding on all positive status codes
It should only be done for DEVICE_BUSY/IN_EXECUTION
2016-07-22 19:08:13 +02:00
Anton Khirnov
95414eb2dc qsv: print more complete error messages
Include the libmfx error code and its description
2016-07-22 19:08:13 +02:00
Anton Khirnov
d9ec3c6014 qsvenc: take only the allocated dimensions from the frames context
Other parameters, like the display size, should still be taken from the
codec context.
2016-07-22 19:08:13 +02:00
Anton Khirnov
37a9015ee8 qsvenc: add support for p010 2016-07-22 19:08:13 +02:00
Anton Khirnov
21962261c7 qsv: handle the semi-packed formats in map_fourcc as well
This will allow using this function for encoding as well, where the
input format is already the semi-packed version.
2016-07-22 19:08:13 +02:00
Anton Khirnov
f65285aba0 lavc: set sw_pix_fmt for hwaccel encoding 2016-07-22 19:08:13 +02:00
Anton Khirnov
d59641abfd lavc: initialize AVCodecContext.sw_pix_fmt properly
Currently it's memset to 0, which is YUV420P. It should be initialized
to none.
2016-07-22 19:08:13 +02:00
Vittorio Giovara
a1f6a2dfda ratecontrol: Reorder functions to avoid forward declarations 2016-07-20 19:03:31 +02:00
Vittorio Giovara
d639dcdae0 ratecontrol: Move Xvid-related functions to the place they are actually used
This will simplify the de-MpegEncContextualization.
2016-07-20 18:59:36 +02:00
Vittorio Giovara
44972e227d ratecontrol: Move mpegenc-only function where it is used 2016-07-20 18:59:36 +02:00
Vittorio Giovara
b4bb959383 ratecontrol: Drop commented out cruft 2016-07-20 18:59:35 +02:00
Diego Biurrun
d06dfaa5cb x86: huffyuv: Use EXTERNAL_SSSE3_FAST convenience macro where appropriate 2016-07-20 18:43:28 +02:00
Diego Biurrun
4efab89332 x86: Use *_FAST/*_SLOW CPU feature detection macros where appropriate 2016-07-20 18:43:28 +02:00
Diego Biurrun
0a39c9ac0b x86: hpeldsp: Don't check for bitexact flag when initializing VP3-specific code
That code is only ever initialized with that flag set.
2016-07-20 18:37:45 +02:00
Diego Biurrun
95c1df929b x86: hpeldsp: Drop unused function parameters 2016-07-20 18:33:26 +02:00
Diego Biurrun
c3e83ad3b7 x86: hpeldsp: Use EXTERNAL_SSE2_FAST where appropriate 2016-07-20 18:33:26 +02:00
Diego Biurrun
1dfc3cf89d x86: hpeldsp: Split off VP3-specific bits into a separate file 2016-07-20 18:33:25 +02:00
Anton Khirnov
e344e65109 h264dec: do not call finish_setup() if we have not started a frame
Found-By: Jan Ruge <jan.s.ruge@gmail.com>
Bug-Id: 952
2016-07-20 16:36:10 +02:00
Anton Khirnov
76f7e70aa0 h264dec: handle zero-sized NAL units in get_last_needed_nal()
The current code will ignore the init_get_bits() failure and do an
invalid read from the uninitialized GetBitContext.

Found-By: Jan Ruge <jan.s.ruge@gmail.com>
Bug-Id: 952
2016-07-20 16:35:55 +02:00
Anton Khirnov
1f7b4f9abc h264dec: make sure not to call finish_setup() more than once per frame
It does not break anything currently, but should not be done anyway.
2016-07-20 16:35:49 +02:00
Hendrik Leppkes
1ecb63cd1c hevc: set profile based on the profile compatibility flags if needed
This fixes retrieving a valid profile for many of the FATE conformance samples,
allowing them to be properly decoded by the HWAccel after adding a profile check.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-07-20 16:33:09 +02:00
James Almer
fca3c3b619 hevc: Add AVX2 DC IDCT
Originally written by Pierre Edouard Lepere <pierre-edouard.lepere@insa-rennes.fr>.
Integrated to Libav by Josh de Kock <josh@itanimul.li>.

Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
2016-07-18 15:27:13 +02:00
Mickaël Raulet
cc16da75c2 hevc: Add coefficient limiting to speed up IDCT
Integrated to libav by Josh de Kock <josh@itanimul.li>.

Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
2016-07-18 15:27:13 +02:00
Mickaël Raulet
a92fd8a062 hevc: Add DC IDCT
Integrated to Libav by Josh de Kock <josh@itanimul.li>.

Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
2016-07-18 15:27:13 +02:00
Mickaël Raulet
4f247de3b7 hevcdsp_template: Templatize IDCT
Integrated to Libav by Josh de Kock <josh@itanimul.li>.

Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
2016-07-18 15:27:13 +02:00
Alexandra Hájková
1bd890ad17 hevc: Separate adding residual to prediction from IDCT
Based on patch 250430bf28
by Mickaël Raulet <mraulet@insa-rennes.fr>, integrated
to Libav by Josh de Kock <josh@itanimul.li>.

Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
2016-07-18 15:27:13 +02:00
Anton Khirnov
33f6690eb4 hevc: offer DXVA2 for 10bit 420 2016-07-15 15:35:44 +02:00
Anton Khirnov
4a9bab3db0 h264: fix decoding multiple fields per packet with slice threads
Since we only know whether a NAL unit corresponds to a new field after
parsing the slice header, this requires reorganizing the calls to slice
parsing, per-slice/field/frame init and actual decoding.

In the previous code, the function for slice header decoding also
immediately started a new field/frame as necessary, so any slices
already queued for decoding would no longer be decodable.

After this patch, we first parse the slice header, and if we determine
that a new field needs to be started we decode all the queued slices.
2016-07-15 15:33:54 +02:00
Anton Khirnov
f450cc7bc5 h264: eliminate decode_postinit()
This function's purpose is not very well defined. Currently it does two
(only marginally related) things: selecting the next output frame and
calling ff_thread_finish_setup() for frame threading. The first of those
more properly belongs under field_start(), while the second can be
called directly from decode_nal_units().
2016-07-15 15:33:28 +02:00
Martin Storsjö
7a76371437 libopenh264enc: Simplify init by setting FF_CODEC_CAP_INIT_CLEANUP
Also set FF_CODEC_CAP_INIT_THREADSAFE while adding internal capabilities.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-07-15 13:36:23 +03:00
Martin Storsjö
2d097c16b8 libopenh264enc: Return a more sensible error code in some init failure paths
Previously they returned the default AVERROR_UNKNOWN.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-07-15 13:36:22 +03:00
Martin Storsjö
36b380dcd5 libopenh264dec: Simplify the init thanks to FF_CODEC_CAP_INIT_CLEANUP being set
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-07-15 13:36:21 +03:00
Martin Storsjö
d0b1e6049b libopenh264dec: Fix cleanup if the init failed early
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-07-15 13:36:20 +03:00
Vittorio Giovara
61bd0ed781 h264: Log more information about invalid NALu size 2016-07-13 18:18:46 -04:00
Janne Grunau
17c99b6158 h2645_parse: handle embedded Annex B NAL units in size prefixed NAL units
Fixes a regression in ca2f19b9cc with some mov/mp4 files. The files have
several NAL units in the supposed single NAL unit after the size field.
Annex B start code prefixes are used to separate them. The first NAL unit
is correctly parsed but the buffer does not point to the next size field.
Instead semi random data (it seems to be the rbsp_stop_one_bit and the
start code prefix) is then parsed as length and will exceed the
remaining length of the buffer.

Patch based on the code in h264's decode_nal_units() and a similar
patch by Hendrik Leppkes in FFmpeg (a9bb4cf87d).

Bug-Id: ffmpeg/trac5529
Reported-By: Vittorio Giovara
2016-07-13 22:18:52 +02:00
Anton Khirnov
a8cbe5a0cc h264_ps: export actual height in MBs as SPS.mb_height
Currently, SPS.mb_height is actually what the spec calls
PicHeightInMapUnits, which is half the frame height when interlacing is
allowed. Calling this 'mb_height' is quite confusing, and there are at
least two associated bugs where this field is treated as the actual
frame height - in the h264 parser and in the code computing maximum
reordering buffer size for a given level.

Fix those issues (and avoid possible future ones) by exporting the real
frame height in this field.
2016-07-11 16:29:57 +02:00
Steve Lhomme
99cf943339 d3d11va: don't keep the context lock while waiting for a frame
also fixes a deadlock found by Денис Кулаков <kudesnik33ra@gmail.com>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-07-11 16:27:30 +02:00
Martin Storsjö
2866d108c9 vp8dsp: Remove the comment saying that the height is equal to the width
This comment isn't true, the height can be different from the width
for these functions (which is why the height is passed as a parameter
to them).

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-07-10 14:52:16 +03:00
Janne Grunau
5f74bd31a9 vp8/armv6: mc: avoid boolean expression in calculation
GNU as evaluates true as '-1' while Apple's variant and llvm's internal
assembler evaluate it as '1'. The best way to avoid this madness is to
eliminate boolean expressions instead of trying to fix it with
preprocessor directives. Use a direct formula to calculate the
required temporary space on the stack in
ff_put_vp8_{epel,bilin}{4,8,16}_h[246]v[246]_armv6().

Fixes a checkasm segfault in vp8dsp.mc when using llvm's internal
assembler for a non-Apple target.
2016-07-10 13:35:41 +02:00
Martin Storsjö
d825b1a530 libopenh264: Support building with the 1.6 release
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-07-09 22:33:58 +03:00
Martin Storsjö
e8b96a7701 arm: Fix a typo in a comment
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-07-06 22:58:51 +03:00
Martin Storsjö
dc08bbf63a vp8dsp: Clarify the first dimension of the mc function tables
Index 0 is w=16, 1 is wd=8, 2 is wd=4.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-07-06 22:45:29 +03:00
Anton Khirnov
924e2ecd2b qsvdec: when a frames ctx is supplied, use its frame dimensions
The allocated frame size may be larger than the coded dimensions.
2016-07-03 09:13:29 +02:00
Anton Khirnov
92736c74fb qsvdec: add support for P010 (10-bit 420) decoding 2016-07-03 09:13:29 +02:00
Anton Khirnov
ce320cf1c4 qsvdec: use the same mfxFrameInfo for allocating frames that was passed to DECODE_Init
Stop duplicating this information.
2016-07-03 09:13:29 +02:00
Anton Khirnov
536bb17e96 qsvdec: make ff_qsv_map_pixfmt() return a MFX fourcc as well
Stop hardcoding NV12.

Also, move this function to the shared code, it will be used by the
encoder as well.
2016-07-03 09:13:29 +02:00
Mark Thompson
221ffca631 vaapi_encode: Respect driver quirks around buffer destruction
No longer leaks memory when used with a driver with the "render does
not destroy param buffers" quirk (i.e. Intel i965).
2016-07-02 14:09:58 +01:00
Vittorio Giovara
6c445990e6 tiffenc: Check zlib support for deflate option during initialization
This converts a misleading error about an option not found to a more
meaningful one.
2016-06-29 15:25:42 -04:00
Vittorio Giovara
9f732e4c99 tiffenc: Check av_pix_fmt_desc_get() return value 2016-06-29 15:25:42 -04:00
Vittorio Giovara
d8f3b0fb58 targaenc: Move size check to initialization function
In case of bogus input, fail early at codec initialization, rather than
at the encode function.
2016-06-29 15:25:42 -04:00
Vittorio Giovara
eeb6849ced rle: K&R formatting cosmetics 2016-06-29 15:25:42 -04:00
Diego Biurrun
326d911693 build: Drop unnecessary libavcodec <-> libavformat object dependencies 2016-06-29 20:24:10 +02:00
Diego Biurrun
e72d6fa08a build: Move MP2 muxer declaration away from MP3 muxer code
The MP2 muxer uses none of the code of the MP3 muxer.
2016-06-29 20:24:10 +02:00
Diego Biurrun
fe27792fd7 build: Move ff_mpeg12_frame_rate_tab to a separate file
It is also used by the Dirac parsing code.
2016-06-29 12:31:03 +02:00
Diego Biurrun
8c929037ec build: Add a new component for H.264 parsing code
This fixes standalone compilation of the SVQ3 decoder, which had
incomplete dependencies related to H.264 parsing.
2016-06-29 12:31:03 +02:00
Luca Barbato
3c08b7bc76 ffv1: Report additional bitstream information in verbose mode
Useful to inspect samples.
2016-06-29 07:21:07 +02:00
Luca Barbato
fe6e5cbea7 ffv1: Remove version 2 and mark version 3 as non-experimental
The encoder produces bitstream compatible with the current specification
and version 2 is set as reserved (non-standardizable).
2016-06-29 07:21:07 +02:00
Martin Storsjö
82b7525173 Add an OpenH264 decoder wrapper
While it is less featureful (and slower) than the built-in H264
decoder, one could potentially want to use it to take advantage
of the cisco patent license offer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-06-28 14:17:43 +03:00
Anton Khirnov
eccfb9778a qsvdec_hevc: add the UID of the HEVC HW decoder plugin 2016-06-28 08:33:27 +02:00
Anton Khirnov
c67594a2c7 qsvdec_hevc: fix a variable name
hevcenc -> hevcdec, this is a _decoder_ plugin.
2016-06-28 08:33:13 +02:00
Vittorio Giovara
7a745f014f options_table: Add aliases for color properties
All option names now match the ones provided by the av_color_*_name().
2016-06-27 12:29:04 -04:00
Vittorio Giovara
f172e22d6a pixdesc: Add aliases to SMPTE color properties
Drop ST from names and symbols, it does not add anything distinctive or
descriptive.
2016-06-27 12:27:13 -04:00
Mark Thompson
8a62d2c28f vaapi_encode: Maintain a pool of bitstream output buffers
Previously we would allocate a new one for every frame.  This instead
maintains an AVBufferPool of them to use as-needed.

Also makes the maximum size of an output buffer adapt to the frame
size - the fixed upper bound was a bit too easy to hit when encoding
large pictures at high quality.
2016-06-26 19:40:56 +01:00
Clément Bœsch
4a081f224e libavcodec: fix constness in clobber test avcodec_open2() wrappers
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-06-26 21:34:04 +03:00
Martin Storsjö
0c9c4004ed omx: Don't return > 0 from omx_encode_frame
The encode function is supposed to just return 0 on success.
This stems from a mixup with the return value of decode functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-06-24 22:30:54 +03:00
Martin Storsjö
31aa5335c3 libopenh264enc: Fix inconsistent whitespace
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-06-24 22:30:46 +03:00
Diego Biurrun
4f98bb7b6d msmpeg4: Remove commented-out debug logging code 2016-06-24 13:25:36 +02:00
Diego Biurrun
eedbeb4c27 msmpeg4: Remove some broken, commented-out cruft 2016-06-24 13:25:36 +02:00
Diego Biurrun
3c84eaae9d h264: Eliminate unused but set variable
libavcodec/h264_slice.c:1384:9: warning: variable 'droppable' set but not used
2016-06-23 14:16:14 +02:00
Mark Thompson
11b8030309 vaapi_encode: Fix fallback when input does not match any format
Just a typo.  Add a comment to make it clearer what it's doing.
2016-06-21 20:42:22 +01:00
Martin Storsjö
8c3c7b8920 dxva2_h264: Remove an unused variable
This was introduced by mistake in 39cdbb12aa (only one of the
added variables were really needed).

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-06-21 22:09:35 +03:00
Anton Khirnov
32c8359093 lavc: export the timestamps when decoding in AVFrame.pts
Currently it's exported as AVFrame.pkt_pts, which is also the only use
for that field. The reason it is done like this is that lavc used to
export various codec-specific "timing" information in AVFrame.pts, which
is not done anymore.

Since it is confusing to the callers to have a separate field which is
used only for decoder timestamps and nothing else, deprecate pkt_pts and
use just AVFrame.pts everywhere.
2016-06-21 19:54:42 +02:00
Anton Khirnov
ad9c9440d5 qsvenc: support getting the session from an AVHWFramesContext 2016-06-21 19:53:38 +02:00
Anton Khirnov
a0524d9b1e qsvdec: support getting the session from an AVHWFramesContext 2016-06-21 19:53:38 +02:00
Anton Khirnov
6f19bbcf85 qsvdec: move reading the user-provided session to qsv_decode_init()
This is a more appropriate place for it.
2016-06-21 19:52:19 +02:00
Anton Khirnov
e85f6f7f8d lavc: allow using AVCodecContext.hw_frames_ctx for decoding
For now it will only be used by the default get_buffer2 callback for
allocating hw frames.
2016-06-21 19:52:17 +02:00
Vittorio Giovara
40dd5166d2 truemotion2rt: Use ff_set_dimensions 2016-06-21 09:38:56 -04:00
Vittorio Giovara
a816432337 pixdesc: Add new SMPTE 431, 432, and 2085 color properties
Appeared in H.264 2016/02.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-06-21 09:29:04 -04:00
Neil Birkbeck
5d560d38de pixfmt: Add ARIB STD-B76 color transfer characteristic
Adding hybrid log-gamma (https://en.wikipedia.org/wiki/Hybrid_Log-Gamma)
based on the standardization in ARIB STD-B67:
http://www.arib.or.jp/english/html/overview/doc/2-STD-B67v1_0.pdf

The choice of enum value of 18 is consistent with HEVC:
http://phenix.it-sudparis.eu/jct/doc_end_user/current_document.php?id=10481

And also with latest proposal for color format in mkv:
https://mailarchive.ietf.org/arch/search/?email_list=cellar&gbt=1&q=Colour+Format+proposal

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-06-21 09:02:46 -04:00
Anton Khirnov
58640fe89e h264: handle frame recovery in h264_field_start()
This is a more appropriate place for this. H264Context.recovery_frame is
shared between frame threads, so modifying it where it is right now is
invalid.
2016-06-21 11:20:51 +02:00
Anton Khirnov
e26c64148b h264: discard slices of redundant pictures right after parsing the slice header
Going through the whole decoder initialization process for a slice we
are not going to decode is unnecessary and potentially dangerous.
2016-06-21 11:20:26 +02:00
Anton Khirnov
6efc463858 h264: always set redundant_pic_count during slice header parsing
It is always checked in the surrounding code, so this make sure we don't
see a value from an old slice.
2016-06-21 11:20:20 +02:00