Commit Graph

37671 Commits

Author SHA1 Message Date
wm4
4cf1f68903 pthread_frame: minor simplification to error handling
Get rid of the "ret" variable, and always use err. Report the packet as
consumed if err is unset. This should be equivalent to the old code,
which obviously required err=0 for p->result>=0 (and otherwise,
p->result must have had the value err was last set to). The code block
added by commit 32a5b63126 is also not needed anymore, because the new
code strictly returns err if it's >=0.

Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
2017-03-29 12:17:40 +02:00
James Almer
91ccd38c0b avcodec/ac3dsp: add special-case handling for the C downmix_fixed function
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-03-28 23:09:17 -03:00
James Almer
c31cbeef58 aarch64/vp9dsp: add missing header includes 2017-03-28 23:02:09 -03:00
Ronald S. Bultje
027ee9b3ed pthread_frame: don't sync items between threads for intra-only codecs.
Intra-only codecs should either be able to read these items from the
bitstream, or they should be set upon codec initialization. In both
cases, syncing these items at runtime is unnecessary.

In practice, this fixes race conditions for decoders that read these
values from the bitstream.
2017-03-28 18:04:27 -04:00
Ronald S. Bultje
bddabfaab6 hevc: initialize no_rasl_output_flag in hevc_frame_start().
This prevents a race condition in files with multiple slices per frame.
2017-03-28 18:04:27 -04:00
Ronald S. Bultje
8c2aa45d4a h264: revert 1189af4292.
The patch introduces race conditions.
2017-03-28 18:04:27 -04:00
Ronald S. Bultje
0c46641784 vp9: split out generic decoding skeleton interface API from VP9 types.
This allows vp9dsp.h to only include the VP9 types header, and not the
decoder skeleton interface which is for hardware decoders (dxva2/vaapi).
2017-03-28 18:04:27 -04:00
Ronald S. Bultje
6d0d1c4a43 vp9: split out reconstruction functions in their own source file. 2017-03-28 18:04:26 -04:00
Ronald S. Bultje
b823bbc10c vp9: split out loopfilter functions in their own source file. 2017-03-28 18:04:26 -04:00
Ronald S. Bultje
f8c019944d vp9: re-split the decoder/format/dsp interface header files.
The advantage here is that the internal software decoder interface is
not exposed to the DSP functions or the hardware accelerations.
2017-03-28 18:04:26 -04:00
Ronald S. Bultje
5ba8c3a0ed dirac: make initialization of arithmetic coder tables threadsafe. 2017-03-28 11:21:27 -04:00
James Almer
3fe7bb2bcf avcodec/extract_extradata_bsf: add missing break statement to extract_extradata_vc1 2017-03-28 01:14:17 -03:00
Clément Bœsch
e59a4d1df7 Merge commit '801ac7156d3efb8e088fb6024f568eb36a293887'
* commit '801ac7156d3efb8e088fb6024f568eb36a293887':
  qsv: Be informative when reporting that no data has been consumed

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-27 22:19:09 +02:00
Clément Bœsch
fa85d8dbb4 Merge commit '30015305f3b523ed7640f2c3c58b017140533c58'
* commit '30015305f3b523ed7640f2c3c58b017140533c58':
  Use avpriv_request_sample() where appropriate

Only the roqvideo chunk is merged because we actually support 24bpp
flic, see 5781c983d8.

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-27 22:18:26 +02:00
Clément Bœsch
349a26f509 Merge commit '7a2b2b6a92c4b528ecb640790eca0aa790d858f4'
* commit '7a2b2b6a92c4b528ecb640790eca0aa790d858f4':
  dxtory: Drop nonsense ISO C printf conversion specifiers for standard types

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-27 22:05:50 +02:00
Clément Bœsch
5dd37c6847 lavc/vp9: clarify inv_recenter_nonneg
Ends up identical to Libav.
2017-03-27 21:38:21 +02:00
Clément Bœsch
e6ffdc9582 lavc/vp9: shuffle header declaration
This reduces diff with Libav.
2017-03-27 21:38:21 +02:00
Clément Bœsch
37814a21cb lavc/vp9: consistent use of typedef instead of struct 2017-03-27 21:38:21 +02:00
Clément Bœsch
875f695576 lavc/vp9: misc cosmetics
Imported from Libav
2017-03-27 21:38:21 +02:00
Clément Bœsch
ff8436ba76 lavc/vp9: rename res to ret 2017-03-27 21:38:21 +02:00
Clément Bœsch
0f8ae9d7b2 lavc/vp9: split a few assignment out of ifs 2017-03-27 21:38:21 +02:00
Clément Bœsch
f4d95e0949 lavc/vp9: rename {ref,unref,alloc}_frame to frame_{ref,unref,alloc}
For consistency with Libav.
2017-03-27 21:38:21 +02:00
Clément Bœsch
12c44d6373 lavc/vp9: rename ctx to avctx
This reduces diff with Libav. It also prevents a potential confusion
between the private context and the AVCodecContext.
2017-03-27 21:38:21 +02:00
Clément Bœsch
1c9f4b5078 lavc/vp9: split into vp9{block,data,mvs}
This is following Libav layout to ease merges.
2017-03-27 21:38:21 +02:00
wm4
d7896e9b42 pthread_frame: fix uninitialized variable read
Could lead to random behavior. This possibly happened due to commit
32a5b63126. This should/could probably be simplified, but for no apply
a minimal fix to quell the errors.

Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2017-03-27 13:21:20 +02:00
wm4
9e703ae30f pthread_frame: do not attempt to unlock a mutex on the wrong thread
async_mutex has is used in a very strange but intentional way: it is
locked by default, and unlocked only in regions that can be run
concurrently.

If the user was calling API functions to the same context from different
threads (in a safe way), this could unintentionally unlock the mutex on
a different thread than the previous lock operation. It's not allowed by
the pthread API.

Fix this by emulating a binary semaphore using a mutex and condition
variable. (Posix semaphores are not available on all platforms.)

Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2017-03-27 13:21:15 +02:00
Kyle Swanson
b12693facf libavcodec/opusenc: use correct format specifiers
Squelches the following compiler warnings:

libavcodec/opusenc.c:1051:16: warning: format specifies type 'long' but
the argument has type 'long long' [-Wformat]
               avctx->bit_rate/1000, clipped_rate/1000);
               ^~~~~~~~~~~~~~~~~~~~
libavcodec/opusenc.c:1051:38: warning: format specifies type 'long' but
the argument has type 'long long' [-Wformat]
               avctx->bit_rate/1000, clipped_rate/1000);
                                     ^~~~~~~~~~~~~~~~~
2017-03-27 09:35:48 +02:00
Michael Niedermayer
d65b59550b avcodec/avcodec: Correct and make consistent AVERROR() in comments
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-03-27 01:48:39 +02:00
Michael Niedermayer
0ba22831e1 avcodec/h264idct_template: Fix multiple runtime error: signed integer overflow
Fixes: 712/clusterfuzz-testcase-6647676227551232

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-03-26 19:17:30 +02:00
Michael Niedermayer
73fb40dc87 avcodec/x86/idctdsp: Remove duplicate include
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-03-26 19:17:30 +02:00
James Almer
b53ac2a528 avcodec/extract_extradata_bsf: use the parsing code from mpeg4video_split()
It's a simplifaction of the same code, originally commited as 3b5ad8fbf7.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-03-25 22:38:13 -03:00
James Almer
173fdc4dea avcodec/extract_extradata_bsf: use the parsing code from vc1_split()
It's a simplifaction of the same code, originally commited as b4b9a64bdb.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-03-25 22:38:13 -03:00
James Almer
ec996163c8 avcodec/extract_extradata_bsf: use the parsing code from mpegvideo_split()
Changes to the parsing code originally committed to mpegvideo_parser.c
in 73fb23dc5a.
Required by some samples, like PVA_test-partial.pva

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-03-25 22:38:13 -03:00
James Almer
f5c8d004c2 avcodec: stop using deprecated codec flags
Signed-off-by: James Almer <jamrial@gmail.com>
2017-03-25 21:37:05 -03:00
Carl Eugen Hoyos
66c1c9b277 lavc/xface: Reorder conditions to silence a gcc warning.
libavcodec/xface.c:318:27: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
2017-03-24 19:51:36 +01:00
Michael Niedermayer
d92ad42fb3 avcodec/tests/celp_math: Change IsAlmostEqual() to a function
Fixes empty statement, found by ubitux

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-03-24 18:18:57 +01:00
Thomas Turner
824fe914fe avcodec/tests: added test for celp_math.c
Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-03-24 17:31:38 +01:00
Paul B Mahol
e1940d2458 avcodec/dnxhd_parser: take into account compressed frame size and skip it
Fixes #6214 and vsynth1-dnxhd-720p-hr-lb.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-03-24 15:44:01 +01:00
James Almer
ac42f08099 x86/hevc_add_res: merge missing changes from 3d65359832
Unrolling the loops triplicates the size of the assembled output
while not generating any gain in performance.
2017-03-24 11:24:18 -03:00
Clément Bœsch
46f4f8ad86 Merge commit '1263b2039eb5aaf1522e9de9f07c787ab30a5f50'
* commit '1263b2039eb5aaf1522e9de9f07c787ab30a5f50':
  Adjust printf conversion specifiers to match variable signedness

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-24 13:34:39 +01:00
Clément Bœsch
e809c2e40d Merge commit '47756f51fe836959ffa5c6e2baeacbd71e150069'
* commit '47756f51fe836959ffa5c6e2baeacbd71e150069':
  dnxhdenc: Drop pointless, commented-out debug output

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-24 13:18:24 +01:00
Clément Bœsch
4c840c249d Merge commit '0574780d7a196f87ddd89d6362f4c47f3532b4c4'
* commit '0574780d7a196f87ddd89d6362f4c47f3532b4c4':
  h264_loopfilter: Do not print value of uninitialized variable

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-24 13:15:15 +01:00
Clément Bœsch
fe7cae3880 Merge commit '255526998501f0040ae43fe4848c817a97fc578a'
* commit '255526998501f0040ae43fe4848c817a97fc578a':
  mpegaudio: Do not print value of uninitialized variable

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-24 13:14:03 +01:00
Clément Bœsch
3d65359832 Merge commit '6d5636ad9ab6bd9bedf902051d88b7044385f88b'
* commit '6d5636ad9ab6bd9bedf902051d88b7044385f88b':
  hevc: x86: Add add_residual() SIMD optimizations

See a6af4bf64d

This merge is only cosmetics (renames, space shuffling, etc).

The functionnal changes in the ASM are *not* merged:
- unrolling with %rep is kept
- ADD_RES_MMX_4_8 is left untouched: this needs investigation

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-24 12:33:25 +01:00
Clément Bœsch
40ac226014 lavc/x86/hevc: rename hevc_res_add to hevc_add_res
This will simplify incoming merge.
2017-03-24 11:45:23 +01:00
Clément Bœsch
0b3decc596 Merge commit '0d9b9bd37f43ee29ad9f709d85c8f3be9db71104'
* commit '0d9b9bd37f43ee29ad9f709d85c8f3be9db71104':
  lavu: Add JEDEC P22 color primaries

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-24 11:21:46 +01:00
James Almer
dc39ccdc3b Merge commit '0bfdcce4d42a6e654c00ea5f9237dc987626457f'
* commit '0bfdcce4d42a6e654c00ea5f9237dc987626457f':
  hevc: move the SliceType enum to hevc.h

Merged-by: James Almer <jamrial@gmail.com>
2017-03-23 20:02:11 -03:00
James Almer
bac44a5020 Merge commit 'b89804da9bad2d94dd95bf20ac6187447e9c17e9'
* commit 'b89804da9bad2d94dd95bf20ac6187447e9c17e9':
  x86: videodsp: Add parentheses to expression to work around warning

Merged-by: James Almer <jamrial@gmail.com>
2017-03-23 18:35:49 -03:00
James Almer
09a80419b7 Merge commit '58224dc5f3d4fea40a8d55cca87291a960c11622'
* commit '58224dc5f3d4fea40a8d55cca87291a960c11622':
  ppc: avcodec: Drop silly "_ppc" suffixes from files in ppc subdirectories

Merged-by: James Almer <jamrial@gmail.com>
2017-03-23 18:17:45 -03:00
James Almer
c43fd1f279 Merge commit 'f9bb356e0eb38ab4df32df8276b71a0b2626538f'
* commit 'f9bb356e0eb38ab4df32df8276b71a0b2626538f':
  vaapi_h265: Include header for slice types

Merged-by: James Almer <jamrial@gmail.com>
2017-03-23 18:08:41 -03:00