Commit Graph

41129 Commits

Author SHA1 Message Date
Michael Niedermayer
283e751aef avcodec/mjpegbdec: Propagate error codes
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-31 02:37:08 +01:00
Michael Niedermayer
11a8d2ccab avcodec/mjpegbdec: Fix some misplaced {} and spaces
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-31 02:37:08 +01:00
Alex Mogurenko
e4788ae31b avcodec/prores_ks: Fix luma quantization if q >= MAX_STORED_Q
The problem occurs in slice quant estimation and slice encoding:

If the slice quant is larger than  MAX_STORED_Q we don't use pre-calculated
quant matrices, but generate a new one, but both qmat and qmat_chroma both
point to the same table, so the luma table ends up having chroma table
values.

Add custom_chroma_q the same way as custom_q.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2018-12-30 11:24:39 -05:00
Paul B Mahol
cfa7709d05 avcodec/wavpack: fix decoding of files with many channels
Fixes decoding of Run_The_Race_-_3rd_Order_Ambisonic_SN3D.wv
2018-12-28 12:16:39 +01:00
gxw
d86f698e38 avcodec/mips: [loongson] optimize theora decoding in vp3dsp.
Optimize theora decoding with msa in functions:
1. ff_vp3_idct_add_msa
2. ff_vp3_idct_put_msa
3. ff_vp3_idct_dc_add_msa
4. ff_vp3_v_loop_filter_msa
5. ff_vp3_h_loop_filter_msa
6. ff_put_no_rnd_pixels_l2_msa

Theora decoding speed improved about 36%(from 22fps to 30fps, Tested on loongson 2K1000).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-27 23:12:04 +01:00
Ramiro Polla
c268712895 avcodec/dnxhddec: fix block alignment
blockdsp requires 32 byte alignment.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-12-26 13:57:50 -03:00
Ramiro Polla
4d34205bec avcodec/4xm: fix block alignment
blockdsp requires 32 byte alignment.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-12-26 13:56:20 -03:00
hwrenx
7499d0b015 lavc/libdavs2: enable multithread
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: hwrenx <hwrenx@126.com>
2018-12-26 19:14:33 +08:00
Michael Niedermayer
7efe84aebd avcodec/lagarith: Remove duplicate check
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-25 00:44:17 +01:00
Rene Claus
6a8cc86963 avcodec/libvpxenc: add VP8/9 sharpness config option
This commit adds configuration options to libvpxenc.c that can be used to
tune the sharpness parameter for VP8 and VP9.

Signed-off-by: Rene Claus <rclaus@google.com>
Signed-off-by: James Zern <jzern@google.com>
2018-12-24 13:20:06 -08:00
gxw
f652c7a45c avcodec/mips: Fix failed case: hevc-conformance-AMP_A_Samsung_* when enable msa
The AV_INPUT_BUFFER_PADDING_SIZE has been increased to 64, but the value is still 32
in function ff_hevc_sao_edge_filter_8_msa. So, use AV_INPUT_BUFFER_PADDING_SIZE directly.
Also, use MAX_PB_SIZE directly instead of 64. Fate tests passed.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-24 22:16:15 +01:00
Paul B Mahol
c4a05ae65c avcodec/wmavoice: use init_get_bits8() 2018-12-23 21:16:07 +01:00
Paul B Mahol
e483606d44 avcodec/g722dec: use init_get_bits8() 2018-12-23 21:01:17 +01:00
Paul B Mahol
f89919d4fb avcodec/fic: use init_get_bits8() 2018-12-23 20:49:19 +01:00
Michael Niedermayer
30a7a81cdc avcodec/fic: Fail on invalid slice size/off
Fixes: Timeout
Fixes: 11486/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5677133863583744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-23 20:24:47 +01:00
Michael Niedermayer
80cce5998c avcodec/ivi: Avoid mbs memleak
Fixes: 11696/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5740319635668992

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-23 20:24:47 +01:00
Michael Niedermayer
fbf409cd91 avcodec/ilbcdec: fix integer overflow in energy
webrtc uses a int32_t like the existing code in ilbcdec

Fixes: signed integer overflow: 2080245063 + 257939661 cannot be represented in type 'int'
Fixes: 11037/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ILBC_fuzzer-5682976612941824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-23 20:24:47 +01:00
Paul B Mahol
f52dd8a55a avcodec/g723_1dec: use init_get_bits8() 2018-12-23 15:40:47 +01:00
Paul B Mahol
3601eb0474 avcodec: add g732_1 parser 2018-12-23 15:30:13 +01:00
Mark Thompson
b97a4b6588 cbs_av1: Fix reading of overlong uvlc codes
The specification allows 2^32-1 to be encoded as any number of zeroes
greater than 31, followed by a one.  This previously failed because the
trace code would overflow the array containing the string representation
of the bits if there were more than 63 zeroes.  Fix that by splitting the
trace output into batches, and at the same time move it out of the default
path.

(While this seems likely to be a specification error, libaom does support
it so we probably should as well.)

From a test case by keval shah <skeval65@gmail.com>.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-22 18:17:03 +00:00
Carl Eugen Hoyos
6a87729e9d lavc/opus_rc: Cast a const pointer to uint8_t *.
Silences a warning with clang on arm:
libavcodec/opus_rc.c:170:17: warning: passing 'const uint8_t *' (aka 'const unsigned char *') to parameter of type 'void *' discards qualifiers
2018-12-22 00:15:16 +01:00
James Almer
064f9505f4 avcodec/cbs_av1: fix parsing delta_frame_id_minus1
delta_frame_id_minus1 is not a single value in the bitstream, and can
store values up to 17 bits wide.

Fixes parsing files with frame ids.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-12-20 17:57:10 -03:00
Paul B Mahol
1b4c01631b avcodec/vc1_parser: use init_get_bits8() 2018-12-20 21:19:56 +01:00
Jun Zhao
3f08ed3920 lavc/libkvazaar: indent the code
indent the code to follow FFmpeg's coding style

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-12-20 18:40:41 +08:00
Jun Zhao
59deae5d1c lavc/libkvazaar: Use avctx->frame_rate first for framerate setting
perfer avctx->frame_rate first than use avctx->time_base when setting
the frame rate to encoder.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-12-20 18:40:41 +08:00
Jun Zhao
90c4534206 lavc/options_table: Change some options location in opt table.
Change the some options location in avcodec_options to make code more
readable. And update the fate test with this change.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-12-20 18:40:41 +08:00
Michael Niedermayer
e63517e00a avcodec/rpza: Check that there is enough data for all the blocks
Fixes: Timeout
Fixes: 11547/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RPZA_fuzzer-5678435842654208

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-19 20:09:03 +01:00
Michael Niedermayer
8a708aa99c avcodec/rpza: Move frame allocation to a later point
This will allow performing some fast checks before the slow allocation

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-19 20:09:03 +01:00
Michael Niedermayer
68e011e410 avcodec/avcodec: Document the data type for AV_PKT_DATA_MPEGTS_STREAM_ID
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-19 20:09:03 +01:00
Helmut K. C. Tessarek
aaf9171574 libavcodec/libaomenc: fix breakage from upstream
commit https://aomedia.googlesource.com/aom/+/4667aa1a373566e9c124afcd58c71731ab0d7377
changed parts of the code that broke compilation of libavcodec/libaomenc.c

Signed-off-by: James Almer <jamrial@gmail.com>
2018-12-19 15:31:28 -03:00
Michael Niedermayer
ea30ac1e40 avcodec/mjpegdec: Fix indention of ljpeg_decode_yuv_scan()
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-19 10:01:08 +01:00
Michael Niedermayer
dfb5046cf3 avcodec/mjpegdec: verify SOF len field validity
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-19 10:01:00 +01:00
Paul B Mahol
d283ee085f avcodec/g723_1dec: improve stereo support 2018-12-18 18:58:35 +01:00
Paul B Mahol
7a124138a7 avcodec/g723_1dec: reindent after last commit 2018-12-18 18:52:39 +01:00
Paul B Mahol
62dbcb7ddf avcodec/g723_1: add support for stereo files 2018-12-18 18:52:39 +01:00
Carl Eugen Hoyos
06a436a224 lavc/mjpegdec: Interpret three-component Adobe transform 0 also as RGB.
While there, make a comparison with "RGB" more readable.

Fixes ticket #7625.
2018-12-18 18:00:31 +01:00
Shiyou Yin
76952aa461 avcodec/mips: [loongson] enable MSA optimization for loongson platform.
Set initialization order of MSA after MMI to make it work on loongson platform(msa is supported by loongson2k、3a4000 etc.).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-18 11:59:51 +01:00
Zhong Li
978c935f2f lavc/qsv_hevc: correct QSV HEVC default plugin on Windows
1. Old logic meaned: everywhere, except Windows, ffmpeg has to use HW
acceleration, but on Windows ffmpeg has to use (unavailable) software
HEVC by default
2. Software HEVC is available only if you provide corresponding
software MediaSDK library, which isn't provided with ffmpeg. More
information could be found in
https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/samples/readme-encode_linux.pdf
3. HW HEVC decoding/encoding are available on Windows in the driver by default

Note: Default case should be the most common case but this change still has potential risk
on windows if HW path is not supported(or doesn't work as expection).
(See the historical disscution: https://lists.libav.org/pipermail/libav-devel/2016-November/080419.html).
In such case, two options suggested:
1. Use the option "-load_plugin hevc_sw" to switch SW path manually.
2. Or report bug to Intel windows driver if your GPU can support HEVC HW codec.
  (HEVC decoding is supported since Braswell, and encoding supported since Skylake)

Patch started by Landgraph. Add similar change for hevc decoder and bump a new version.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Reviewed-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
Signed-off-by: Landgraph <me@landgraph.ru>
Signed-off-by: Zhong Li <zhong.li@intel.com>
2018-12-18 15:15:18 +08:00
Carl Eugen Hoyos
0b7269e62d lavc/cbs: Do not use format specifier "z" on Windows. 2018-12-17 14:39:41 +01:00
Paul B Mahol
de5e71fb1b avcodec/tiff: add support for 12bit grayscale images
Fixes #4688.
2018-12-16 22:06:08 +01:00
Michael Niedermayer
092cb17983 avcodec/rasc: Check that the number of moves is less than or equal the number of pixels
Fixes: OOM
Fixes: 10307/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5393974559244288

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-16 09:49:07 +01:00
Michael Niedermayer
b11b3d2585 avcodec/vp7: Check for end of input in vp78_decode_mv_mb_modes()
Fixes: Timeout
Fixes: 10313/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP7_fuzzer-5637719389110272

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-16 09:49:07 +01:00
Carl Eugen Hoyos
011c9112a0 lavc/g729dec: Cosmetics, fix indentation after last commit. 2018-12-15 00:55:18 +01:00
Carl Eugen Hoyos
641d52152f lavc/g729dec: Support stereo streams.
Fixes ticket #4553.
2018-12-15 00:32:31 +01:00
Michael Niedermayer
7aaab127be avcodec/clearvideo: Check remaining input bits in P macro block loop
Fixes: Timeout
Fixes: 11083/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CLEARVIDEO_fuzzer-5657180351496192

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-14 23:24:20 +01:00
Michael Niedermayer
35a603050d avcodec/dvdsubdec: discard accumulated buffer on error
Fixes: Timeout
Fixes: 10992/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVDSUB_fuzzer-5657495410835456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-14 23:24:20 +01:00
Michael Niedermayer
52ba824c65 avcodec/rasc: Check input space before reading chunk
Fixes: Timeout
Fixes: 11118/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5652564066959360

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-14 23:24:20 +01:00
Andriy Gelman
5282db5929 avcodec/mpeg: Initialize quarter_sample parameter from previous thread.
Fixes #7410.
The value of sub-pixel precision for me/mc can change during an Intra frame. In multi-threaded decoding this change is not propagated to other frame threads causing decoding artifacts. This patch initializes the sub-pixel precision parameter from previous thread, which fixes the issue.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-14 19:09:11 +01:00
Fan Gang
c6e1966c1a avcodec/ass_split: fix a memory leak defect when realloc fails
Fixes #7019.
2018-12-14 14:19:50 +01:00
Paul B Mahol
6f058b5cef avformat/nut: add support for yuva444/422p12 pixel format 2018-12-14 11:26:30 +01:00