Commit Graph

38055 Commits

Author SHA1 Message Date
Michael Niedermayer
fa8fd0808f avcodec/x86/vc1dsp_init: Fix build failure with --disable-optimizations and clang
compilers doing DCE at -O0 do not necessarily understand "complex" boolean expressions
Build succeeds with this change, this was the only failure

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-27 04:25:31 +02:00
Martin Vignali
e46d637452 libavcodec/exr : fix float to uint16 conversion for negative float value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-27 04:25:31 +02:00
Rostislav Pehlivanov
f16180f448 opus_pvq: merge band encoding and decoding into one function
Most code between the 2 functions was duplicated which made keeping
both in sync difficult.

This also fixes some discovered issues with encoding (incorrect
TF switching buffers) and reduces stack usage (reuse the already
allocated CeltFrame->scratch buffer for the quantized coefficients).

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-27 02:18:32 +01:00
Rostislav Pehlivanov
18a0d9d7ad opus_pvq: remove outdated/incorrect comments and redundant variables
Removes the last style issues with opus_pvq.c

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-26 23:54:21 +01:00
Rostislav Pehlivanov
4d59de3991 opus_pvq: minor cleanups
Removes unneeded variables, renames confusing and innacurate variables
and rewrites and slightly optimizes hadamard interleave/deinterleave
functions.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-26 23:22:25 +01:00
Ben Chang
8de3458a07 avcodec/nvenc: surface allocation reduction
This patch aims to reduce the number of input/output surfaces
NVENC allocates per session. Previous default sets allocated surfaces to 32
(unless there is user specified param or lookahead involved). Having large
number of surfaces consumes extra video memory (esp for higher resolution
encoding). The patch changes the surfaces calculation for default, B-frames,
lookahead scenario respectively.

The other change involves surface selection. Previously, if a session
allocates x surfaces, only x-1 surfaces are used (due to combination
of output delay and lock toggle logic). To prevent unused surfaces,
changing surface rotation to using predefined fifo.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2017-04-26 21:57:54 +02:00
Clément Bœsch
78a5fc4579 lavc/hevcdec: fix invalid use of ff_get_format()
Regression since 76cc100afb.

Spotted-by: James Almer <jamrial@gmail.com>
2017-04-26 17:35:28 +02:00
Clément Bœsch
84a368f6fe Merge commit '373fd76b4dbd9aa03ed28e502f33f2ca8c1ce19a'
* commit '373fd76b4dbd9aa03ed28e502f33f2ca8c1ce19a':
  hevcdec: do not set decoder-global SPS prematurely

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-26 17:25:54 +02:00
Clément Bœsch
0f00eb0e4e Merge commit '2425d7329fdccfa9954faba748f3865151354f0c'
* commit '2425d7329fdccfa9954faba748f3865151354f0c':
  arm64: replace 'bic' with immediate with 'and' with inverted immediate

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-26 16:28:57 +02:00
Clément Bœsch
172b0e2e88 Merge commit 'ea7ee4b4e381e0fa731458de0cbf740430eeb013'
* commit 'ea7ee4b4e381e0fa731458de0cbf740430eeb013':
  ppc: Centralize compiler-specific altivec.h #include handling in one place

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-26 16:23:28 +02:00
Clément Bœsch
3a033bc5cf Merge commit '39929e55eb13eeb8dfbe1bc99301fecf6b8942dd'
* commit '39929e55eb13eeb8dfbe1bc99301fecf6b8942dd':
  ppc: hevcdsp: Use shorthands for vector types

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-26 14:39:28 +02:00
Clément Bœsch
40cc925f93 Merge commit '554e55bbf0e4a3640a784cb512b816e776c56333'
* commit '554e55bbf0e4a3640a784cb512b816e776c56333':
  decode.h: Add missing headers to fix standalone compilation

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-26 14:38:46 +02:00
Clément Bœsch
76cc100afb Merge commit '86157e6db2c7a9222f77fa7e7f50fb9aebc3aa81'
* commit '86157e6db2c7a9222f77fa7e7f50fb9aebc3aa81':
  hevc: decouple calling get_format() from exporting the SPS parameters

See 786032cad8 (which has been reverted
and replaced with Anton's version to reduce diffs between the two
projects).

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-26 14:32:09 +02:00
Clément Bœsch
91f8ccdda0 Merge commit '730c02326094bcfb1fa67f10a7e7b22f03f5a88f'
* commit '730c02326094bcfb1fa67f10a7e7b22f03f5a88f':
  binkaudio: switch to the new send/receive API

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-25 19:12:05 +02:00
Philip Langdale
dd49eff930 avcodec/crystalhd: Another attempt at using mpeg4_unpack_bframes bsf
I tried doing this before, but it resulted in weird behaviour with
certain samples. I want to say I think I've got it sorted out now,
and the new autobsf stuff makes it trivial to turn on.

The native support for packed bframes is buggy and I think buggy
in ways beyond what I already try to account for, so this should be
a net improvements.
2017-04-23 15:33:36 -07:00
Philip Langdale
181aa1be49 avcodec/crystalhd: Explicitly set frame pts at all times
Previously, the pts value was initialised to AV_NOPTS_VALUE and so
it was not necessary to always set it. Now, with the new-new decode
API, this is no longer true. I'm not sure why I avoided setting the
pts when the decoder value was also AV_NOPTS_VALUE - it clearly
wouldn't have changed anything previously, but here we are.

Failing to do this, means the frame pts will be some random uninitalised
value.
2017-04-23 15:33:36 -07:00
Vittorio Giovara
960b4d4761 decode: Initialize ret before using it
libavcodec/decode.c:608:9: warning: variable 'ret' is
      used uninitialized whenever 'if' condition is false

(cherry picked from libav commit efddf2c09a)
2017-04-23 19:29:12 -03:00
Philip Langdale
f95c81ce10 avcodec/movtextenc: Ignore unmatched closing style tags
The existing code will segfault if a closing tag shows up when there
was never an opening tag. This isn't a well formed style, but it's also
not a reason to crash.

Fixes: https://trac.ffmpeg.org/ticket/6303
2017-04-23 10:46:11 -07:00
Philip Langdale
41b0561dc7 avcodec/crystalhd: Switch to the new generic filtering mechanism
This lets us drop all the code for handling the mp4toannexb
conversion.
2017-04-23 09:45:46 -07:00
James Almer
16c88465a1 avcodec/decode: also update consumed bytes on last_pkt_props->size 2017-04-23 12:52:48 -03:00
Paul B Mahol
ac30754a14 avcodec/dnxhd_parser: fix parsing interlaced video, simplify code
There appears to be no need to treat interlaced videos differently,
also that code is flawed, as for at least one input cur_field would
be always 0.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-23 12:00:22 +02:00
Muhammad Faiz
31f61b0d4f avcodec: do not use AVFrame accessor
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-04-23 14:27:47 +07:00
James Almer
fdeab95a82 Merge commit '03a80925effc2698d21dc0b00290eecf42dd9e68'
* commit '03a80925effc2698d21dc0b00290eecf42dd9e68':
  lavc: add a bitstream filter for splitting VP9 superframes

Merged-by: James Almer <jamrial@gmail.com>
2017-04-22 23:27:05 -03:00
James Almer
58ed9deec8 Merge commit '8fb4210ad8785c01fccf2fc59af6a6fa2892b6b2'
* commit '8fb4210ad8785c01fccf2fc59af6a6fa2892b6b2':
  qsvdec_h2645: switch to the new generic filtering mechanism

Merged-by: James Almer <jamrial@gmail.com>
2017-04-22 23:02:02 -03:00
James Almer
79778bb9b0 Merge commit '972c71e9cb63e24f57ee481e413199c7d88a8813'
* commit '972c71e9cb63e24f57ee481e413199c7d88a8813':
  lavc: add support for filtering packets before decoding

Merged-by: James Almer <jamrial@gmail.com>
2017-04-22 22:35:27 -03:00
Jan Sebechlebsky
f92e1af844 avcodec/bsf: Check for packet payload when setting BSF EOF flag.
Set BSF EOF flag only if pkt == NULL or both data and
side data are not present in packet.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-22 22:32:24 -03:00
James Almer
844a115cd3 Revert "avcodec/bsf: Forbid packet without payload in av_bsf_send_packet"
This reverts commit bfdca87ab5.

Packets with no data or side data will be valid EOF signal in an
upcoming merge.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-22 21:52:06 -03:00
Philip Langdale
3148387086 avcodec/crystalhd: Adapt to new new decode API
The new new decode API requires the decoder to ask for the next input
packet, and it cannot just return EAGAIN if that packet cannot be
processed yet. This means we must finally confront how we get this
decoder to block when the input buffer is full and no output frames
are ready yet.

In the end, that isn't too hard to achieve - the main trick seems to
be that you have to aggressively poll the hardware - it doesn't seem
to make any forward progress if you sleep.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-22 20:31:18 -03:00
James Almer
bddb2343b6 Merge commit '061a0c14bb5767bca72e3a7227ca400de439ba09'
* commit '061a0c14bb5767bca72e3a7227ca400de439ba09':
  decode: restructure the core decoding code

CUVID decoder adapted by wm4.

Merged-by: James Almer <jamrial@gmail.com>
2017-04-22 20:08:42 -03:00
James Almer
1fd7627770 Merge commit '549d0bdca53af7a6e0c612ab4b03baecf3a5878f'
* commit '549d0bdca53af7a6e0c612ab4b03baecf3a5878f':
  decode: be more explicit about storing the last packet properties

Also copy pkt->size in extract_packet_props(), as it's needed for
AVFrame.pkt_size

Merged-by: James Almer <jamrial@gmail.com>
2017-04-22 20:06:47 -03:00
Michael Niedermayer
fc8cff96ed avcodec/h264_cavlc: Fix undefined behavior on qscale overflow
Fixes: 1214/clusterfuzz-testcase-minimized-6130606599569408

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-22 22:26:00 +02:00
Paul B Mahol
4925537004 avcodec/utvideodec: fix gradient prediction when stride does not match width
Fixes #6340.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-21 21:46:00 +02:00
Paul B Mahol
9ef21a897c avcodec/utvideodec: fix decoding odd sizes with interlaced video with some formats
Fixes #6316.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-21 12:55:30 +02:00
James Almer
0f05f2c7e6 avcodec/aac_adtstoasc: fix ASC passthrough on small frames
ASC frames smaller than AAC_ADTS_HEADER_SIZE were being discarded.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-19 23:44:07 -03:00
Carl Eugen Hoyos
b6a8396245 lavc/motion_est: Fix undefined negative left shifts. 2017-04-19 23:33:33 +02:00
Paul B Mahol
61088051bd avcodec: add Screen Recorder Gold Codec decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-18 15:04:12 +02:00
Paul B Mahol
a96db6be06 avcodec: add Mandsoft Screen Capture Codec decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-18 15:03:12 +02:00
Clément Bœsch
e22d495538 Merge commit '47e547b321338c73c21fa623789f1efbd80a297a'
* commit '47e547b321338c73c21fa623789f1efbd80a297a':
  lavc: add a null bitstream filter

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-17 14:01:57 +02:00
Clément Bœsch
b5a42c7f09 Merge commit '0309ddcfb25fd44883bfcdb07509eb4907576b97'
* commit '0309ddcfb25fd44883bfcdb07509eb4907576b97':
  lavc: handle MP3 in get_audio_frame_duration()

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-17 13:57:08 +02:00
Clément Bœsch
5eba94a8c3 Merge commit '6aa4ba7131b6e8668e33430e18101a051fe492eb'
* commit '6aa4ba7131b6e8668e33430e18101a051fe492eb':
  dxva2: Keep code shared between dxva2 and d3d11va under the correct #if

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-17 13:55:50 +02:00
Clément Bœsch
f6e8d54fcc Merge commit 'b0e6b3f4777910d61083976aa9fc78a1e0731aae'
* commit 'b0e6b3f4777910d61083976aa9fc78a1e0731aae':
  hevc: ppc: Add HEVC 4x4 IDCT for PowerPC

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-17 13:54:51 +02:00
Clément Bœsch
bb71eb944c Merge commit 'ac648bb835edd3f67bda2267d0e72e5e582eb5a1'
* commit 'ac648bb835edd3f67bda2267d0e72e5e582eb5a1':
  dxva2: Simplify some ifdefs

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-17 10:32:45 +02:00
Clément Bœsch
d40e181bec Merge commit '932cc6496ef6ab0e589ea51d3adefe5b7d7f1e2a'
* commit '932cc6496ef6ab0e589ea51d3adefe5b7d7f1e2a':
  vdpau: Do not #include vdpau_x11.h from the main vdpau header

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-15 18:36:30 +02:00
Paul B Mahol
f6b5a5c7d0 avcodec/dnxhdenc: fix recent regression
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-15 09:23:43 +02:00
Carl Eugen Hoyos
b9e4bbc686 lavc/opus_pvq: Add missing copyright notices from libopus.
The file is based on libopus, analyzed by Rostislav Pehlivanov.
2017-04-15 07:45:17 +02:00
Paul B Mahol
5dedb2afd6 avcodec/dnxhd*: add ff_dnxhd_get_hr_frame_size()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-14 16:09:07 +02:00
Paul B Mahol
34c2eea3d8 avcodec/dnxhdenc: make sure that mb_height > 255 can be stored
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-14 16:00:35 +02:00
Rostislav Pehlivanov
3f1c527bf5 opus_pvq: add resynth support and band encoding cost function
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-14 12:12:43 +01:00
James Almer
c5fd47fa8a Merge commit 'fc85646ad495f3418042468da415af73a7a07334'
* commit 'fc85646ad495f3418042468da415af73a7a07334':
  libopusdec: fix out-of-bounds read
  libschroedingerdec: fix leaking of framewithpts
  libschroedingerdec: don't produce empty frames

This commit is a noop, see

a86ebbf7f6
3c0328d58d
8c8f543b81

Merged-by: James Almer <jamrial@gmail.com>
2017-04-13 19:07:14 -03:00
James Almer
f416a8d66a Merge commit 'd5759701a82926059ae3e2530805e900041a5419'
* commit 'd5759701a82926059ae3e2530805e900041a5419':
  libkvazaar: Add missing header #includes

Merged-by: James Almer <jamrial@gmail.com>
2017-04-13 18:18:54 -03:00