Commit Graph

42836 Commits

Author SHA1 Message Date
John Stebbins
1bf0df4c4f lavc/movtextenc: simplify style record updates
Makes style update code easier to extend for style types not yet handled

Signed-off-by: Philip Langdale <philipl@overt.org>
2020-04-10 09:32:13 -07:00
John Stebbins
15b81f5e6b lavc/movtextenc: keep values in native byte order till written
Signed-off-by: Philip Langdale <philipl@overt.org>
2020-04-10 09:32:13 -07:00
John Stebbins
32cf264d8f lavc/movtextenc: use correct color component order
Signed-off-by: Philip Langdale <philipl@overt.org>
2020-04-10 09:32:13 -07:00
John Stebbins
a52eef68d4 lavc/ass_split: fix parsing utf8 scripts
The [Script Info] section was skipped if starts with UTF8 BOM

Signed-off-by: Philip Langdale <philipl@overt.org>
2020-04-10 09:32:13 -07:00
John Stebbins
b8d4a66b29 lavc/movtextdec: allow setting subtitle frame dimensions
Font sizes are relative to the subtitle frame dimensions. If the
expected frame dimensions are not known, the font sizes will most
likely be incorrect.

Signed-off-by: Philip Langdale <philipl@overt.org>
2020-04-10 09:32:13 -07:00
John Stebbins
f406dc9ceb lavc/movtextdec: restore active style color after hilite
Signed-off-by: Philip Langdale <philipl@overt.org>
2020-04-10 09:32:13 -07:00
John Stebbins
032ad7a0bb lavc/movtextdec: add color and alpha style tags
Signed-off-by: Philip Langdale <philipl@overt.org>
2020-04-10 09:32:13 -07:00
John Stebbins
91447ae3ba lavc/movtextdec: add alpha default to ass header colors
Signed-off-by: Philip Langdale <philipl@overt.org>
2020-04-10 09:32:13 -07:00
John Stebbins
c0d3fea600 lavc/movtextdec: make sure default font name is set
Signed-off-by: Philip Langdale <philipl@overt.org>
2020-04-10 09:32:13 -07:00
John Stebbins
e5b99df096 lavc/movtextdec: only write fontsize, fontID tags if not default
Signed-off-by: Philip Langdale <philipl@overt.org>
2020-04-10 09:32:13 -07:00
John Stebbins
d3c012ff42 lavc/movtextdec: handle changes to default style flags
Style flags were only being turned on.  If the default was on and style
record turned off, style flag remained on.

Signed-off-by: Philip Langdale <philipl@overt.org>
2020-04-10 09:32:13 -07:00
John Stebbins
5f39f63a65 lavc/movtextdec: fix bold, italic, underline flags
They should be 0 or 1 so that 0 or -1 is written to the ass header

Signed-off-by: Philip Langdale <philipl@overt.org>
2020-04-10 09:32:13 -07:00
John Stebbins
2949f17e99 lavc/movtextdec: simplify style record walk
It's not necessary to walk the style record list twice per subtitle
character.  style records are in order and do not overlap.

Signed-off-by: Philip Langdale <philipl@overt.org>
2020-04-10 09:32:13 -07:00
John Stebbins
47e88adc0d lavc/movtextdec: fix ass header colors
A conversion from rgb to bgr is necessary

Signed-off-by: Philip Langdale <philipl@overt.org>
2020-04-10 09:32:13 -07:00
Anton Khirnov
c3a2615bb8 lavc: install codec_desc.h
Forgotten in 672946c7fe
2020-04-10 18:18:51 +02:00
Anton Khirnov
fc12d6c258 h264dec: do not set picture_structure on init
This has been cargo culted from mpegvideo and serves no useful purpose.
It will be initialize correctly in h264_field_start()
2020-04-10 15:53:31 +02:00
Anton Khirnov
4fb05c0d5d h264dec: rename flush_dpb()
The name is misleading, this function does a lot more than just flushing
the DPB.
2020-04-10 15:53:27 +02:00
Anton Khirnov
5e316096fa h264_ps: make the PPS hold a reference to its SPS
It represents the relationship between them more naturally and will be
useful in the following commits.

Allows significantly more frames in fate-h264-attachment-631 to be
decoded.
2020-04-10 15:52:41 +02:00
Anton Khirnov
ec7f33a38e h264_sei: parse the picture timing SEIs correctly
Those SEIs refer to the currently active SPS. However, since the SEI
NALUs precede the coded picture data in the bitstream, the active SPS is
in general not known when we are decoding the SEI.

Therefore, store the content of the picture timing SEIs and actually
parse it when the active SPS is known.
2020-04-10 15:52:22 +02:00
Anton Khirnov
1e9615c5d4 h264_sei: use a separate reader for the individual SEI messages
This tells the parsing functions the payload size and prevents them from
overreading.
2020-04-10 15:50:26 +02:00
Anton Khirnov
d41faffb53 h264dec: do not abort if decoding extradata fails
Such errors are not necessarily fatal and decoding might still be
possible, e.g. it happens for MVC streams where we do not handle the
subset SPS thus failing to parse its corresponding PPS.
2020-04-10 15:49:27 +02:00
Anton Khirnov
9d6785d426 lavc: do not implicitly share the frame pool between threads
Currently the frame pool used by the default get_buffer2()
implementation is a single struct, allocated when opening the decoder.
A pointer to it is simply copied to each frame thread and we assume that
no thread attempts to modify it at an unexpected time. This is rather
fragile and potentially dangerous.

With this commit, the frame pool is made refcounted, with the reference
being propagated across threads along with other context variables. The
frame pool is now also immutable - when the stream parameters change we
drop the old reference and create a new one.
2020-04-10 15:47:30 +02:00
Anton Khirnov
2944537430 pthread_frame: do not copy a range of AVCodecContext fields at once
This is extremely fragile against reordering and hides what is actually
being copied. Copy all the fields manually instead.
2020-04-10 15:46:09 +02:00
Anton Khirnov
b630a270f5 pthread_frame: do not embed full AVFrame structs into per-thread contexts
Use the AVFrame API to properly allocate and free frames for delayed
release.
2020-04-10 15:45:16 +02:00
Anton Khirnov
e40107c1ad pthread_frame: do not share priv_data between multiple codec contexts
Specifically, between the user-facing one and the first frame thread
one.

This is fragile and dangerous, allocate separate private data for each
per-thread context.
2020-04-10 15:44:15 +02:00
Anton Khirnov
1f4cf92cfb pthread_frame: merge the functionality for normal decoder init and init_thread_copy
The current design, where
- proper init is called for the first per-thread context
- first thread's private data is copied into private data for all the
  other threads
- a "fixup" function is called for all the other threads to e.g.
  allocate dynamically allocated data
is very fragile and hard to follow, so it is abandoned. Instead, the
same init function is used to init each per-thread context. Where
necessary, AVCodecInternal.is_copy can be used to differentiate between
the first thread and the other ones (e.g. for decoding the extradata
just once).
2020-04-10 15:24:54 +02:00
Anton Khirnov
665e5b0fba lavc: replace AVCodecInternal.allocate_progress with an internal cap
This is a constant codec property, so a capability flag is more appropriate.
2020-04-10 14:16:39 +02:00
Anton Khirnov
7385ffbd31 mpeg4videodec: do not copy a range of fields at once
This is extremely fragile against reordering and hides what is actually
being copied. Copy all the fields manually instead.
2020-04-10 14:16:22 +02:00
Anton Khirnov
672946c7fe avcodec.h: split AVCodecDescriptor API into its own header 2020-04-10 14:15:14 +02:00
Anton Khirnov
c6978418b8 avcodec.h: split codec IDs into their own header 2020-04-10 13:57:21 +02:00
Anton Khirnov
9875fd24ce avcodec.h: split AVPacket API into its own header 2020-04-10 13:54:03 +02:00
Anton Khirnov
f1e3e9e204 wavpack: fully support stream parameter changes
Fix invalid memory access on DSD streams with changing channel count.
2020-04-10 13:52:15 +02:00
Anton Khirnov
a1133db30e decode: make sure ff_get_buffer() cleans the frame on failure
Merge ff_get_buffer() and get_buffer_internal() to simplify the code.
2020-04-10 13:52:06 +02:00
Anton Khirnov
e923a35988 pthread_frame: make sure ff_thread_release_buffer always cleans the frame 2020-04-10 13:51:23 +02:00
Linjie Fu
917d28d5ff lavc/libopenh264enc: fix the if-else coding style
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-04-10 13:50:47 +02:00
Paul B Mahol
932493f9c2 avcodec/zerocodec: use init cleanup internal cap 2020-04-10 12:22:09 +02:00
Paul B Mahol
05e04e821d avcodec/zerocodec: implement flushing 2020-04-10 12:22:09 +02:00
Paul B Mahol
481ebb1c8b avcodec: add MV30 decoder 2020-04-10 12:22:09 +02:00
Andreas Rheinhardt
7104c4dd88 avcodec/jpeg2000dec: Fix mixed declaration and code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-04-09 18:19:04 +02:00
Gautam Ramakrishnan
e531891f3d libavcodec/jpeg2000dec.c: Add support for PPT marker
This patch adds functional changes to support the
PPT marker. This patch fixes bug ticket #4610.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-09 13:43:15 +02:00
Andriy Gelman
cd04bb4afe avcodec/v4l2_context: Use av_freep()
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-04-08 21:41:52 -04:00
Michael Niedermayer
3935c891e9 avcodec/flacdsp_template: Fix invalid shifts in decorrelate
Fixes: left shift of negative value -2
Fixes: 20303/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-5096829297623040

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-07 18:29:20 +02:00
Michael Niedermayer
7ccb576191 avcodec/xvididct: Fix integer overflow in MULT()
Fixes: signed integer overflow: 23170 * 95058 cannot be represented in type 'int'
Fixes: 20295/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5800212870463488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-07 18:24:14 +02:00
Michael Niedermayer
187161d62f avcodec/ffwavesynth: Correct undefined overflow of PINK_UNIT
Fixes: signed integer overflow: 9223372036854775775 + 128 cannot be represented in type 'long'
Fixes: 20054/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5686385113825280

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-07 18:21:28 +02:00
Peter Ross
31c4fe177d avcodec/vp3: propagate error codes
throughout vp3_decode_frame the error code was being captured (ret) but never returned.

Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: Anton Khirnov <anton@khirnov.net>
2020-04-07 20:59:15 +10:00
Michael Niedermayer
741565a1e6 avcodec/cbs_h264_syntax_template: fix off by 1 error with slice_group_change_cycle
Fixes: assertion failure
Fixes: 20390/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_REDUNDANT_PPS_fuzzer-5683400772157440

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-05 23:18:55 +02:00
Carl Eugen Hoyos
559c2e96e3 lavc/amrwbdec: Use av_samples_set_silence().
Suggested-by: James Almer
2020-04-05 17:24:57 +02:00
Carl Eugen Hoyos
bef3c14dd1 lavc/amrwbdec: Do not ignore NO_DATA frames.
Fixes the actual output duration of the sample in ticket #7113.
2020-04-05 01:55:34 +02:00
Carl Eugen Hoyos
4d9b9c5e46 lavc/aacdec_template: Only warn once about unusual 7.1 encoding. 2020-04-04 23:56:51 +02:00
Carl Eugen Hoyos
c59233d503 lavc/sbc: Remove bool usage. 2020-04-04 23:26:15 +02:00
Carl Eugen Hoyos
d46a91b7f3 lavc/qsvenc: Fix format specifiers for two variables of type int. 2020-04-04 23:18:08 +02:00
Carl Eugen Hoyos
4679a474f0 lavc: Use supported_samplerates for Dolby Digital encoders.
Fixes ticket #8518.
2020-04-04 23:12:27 +02:00
Gautam Ramakrishnan
88f95253e1 libavcodec/jpeg2000dec.c: Fix indentation
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-04 18:04:21 +02:00
Gautam Ramakrishnan
e116cb45c2 libavcodec/jpeg2000dec.c: Handle non EOC streams
This patch allows decoding of j2k streams which do
not have an EOC marker.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-04 18:04:21 +02:00
Andriy Gelman
b343eca8d5 avcodec/v4l2_m2m_dec: Init reserved bytes to zero before ioctl call
struct v4l2_selection contains reserved bytes which should be set to
zero before the ioctl call.

Fixes valgrind error:
Syscall param ioctl(VKI_V4L2_S_SELECTION) points to uninitialised byte(s)

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-03-31 23:41:37 -04:00
Ming Qian
edee0d0104 avcodec/v4l2_m2m: fix setting frame period
Currently the driver's frame period is incorrectly set to the frame
rate. This is fixed in the commit.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-03-31 17:24:42 -04:00
Michael Niedermayer
67de1865b1 avcodec/hcadec: Check scale_factors
Fixes: out of array read
Fixes: 21286/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HCA_fuzzer-5683183715876864

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>
2020-03-31 20:12:15 +02:00
Timo Rothenpieler
767f53533a nvdec: attach real hw_frames to post-processed frames 2020-03-28 17:58:54 +01:00
Andreas Rheinhardt
3362330741 ffplay, avcodec, avformat: Don't initialize before av_packet_ref()
It already initializes the packet.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-28 04:17:20 +01:00
Andreas Rheinhardt
c52ec0367d avcodec/avcodec, avpacket: Return blank packet on av_packet_ref() failure
Up until now, it was completely unspecified what the content of the
destination packet dst was on error. Depending upon where the error
happened calling av_packet_unref() on dst might be dangerous.

This commit changes this by making sure that dst is blank on error, so
unreferencing it again is safe (and still pointless). This behaviour is
documented.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-28 03:59:15 +01:00
Andreas Rheinhardt
e621f2b6cd avcodec/avpacket: Always treat dst in av_packet_ref as uninitialized
av_packet_ref() mostly treated the destination packet dst as uninitialized,
i.e. the destination fields were simply overwritten. But if the source
packet was not reference-counted, dst->buf was treated as if it pointed
to an already allocated buffer (if != NULL) to be reallocated to the
desired size.

The documentation did not explicitly state whether the dst will be treated
as uninitialized, but it stated that if the source packet is not refcounted,
a new buffer in dst will be allocated. This and the fact that the side-data
as well as the codepath taken in case src is refcounted always treated the
packet as uninitialized means that dst should always be treated as
uninitialized for the sake of consistency. And this behaviour has been
explicitly documented.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-28 03:54:48 +01:00
Gautam Ramakrishnan
26a36801c0 avcodec/jpeg2000dec: error check when processing tlm marker
Validate the value of ST field in the TLM marker of JPEG2000.
Throw an error when ST takes value of 0b11.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-27 21:36:06 +01:00
Anton Khirnov
ad9052c4f8 h264_ps: pass AVCodecContext as void* where possible
Makes sure it is only used for logging and nothing else.
2020-03-27 13:43:40 +01:00
Linjie Fu
8b8492452d lavc/x86/hevc_add_res: Fix coeff overflow in ADD_RES_SSE_16_32_8
Fix overflow for coeff -32768 in function ADD_RES_SSE_16_32_8 with no
performance drop.(SSE2/AVX/AVX2)

./checkasm --test=hevc_add_res --bench

Mainline:
  - hevc_add_res.add_residual [OK]
    hevc_add_res_32x32_8_sse2: 127.5
    hevc_add_res_32x32_8_avx: 127.0
    hevc_add_res_32x32_8_avx2: 86.5

Add overflow test case:
  - hevc_add_res.add_residual [FAILED]

After:
  - hevc_add_res.add_residual [OK]
    hevc_add_res_32x32_8_sse2: 126.8
    hevc_add_res_32x32_8_avx: 128.3
    hevc_add_res_32x32_8_avx2: 86.8

Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-03-27 10:57:40 +01:00
Linjie Fu
e9abef437f lavc/x86/hevc_add_res: Fix overflow in ADD_RES_SSE_8_8
Fix overflow for coeff -32768 in function ADD_RES_SSE_8_8 with
no performance drop.

./checkasm --test=hevc_add_res --bench

Mainline:
  - hevc_add_res.add_residual [OK]
    hevc_add_res_8x8_8_sse2: 15.5

Add overflow test case:
  - hevc_add_res.add_residual [FAILED]

After:
  - hevc_add_res.add_residual [OK]
    hevc_add_res_8x8_8_sse2: 15.5

Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-03-27 10:57:40 +01:00
Linjie Fu
0da14ed09e lavc/x86/hevc_add_res: Fix overflow in ADD_RES_MMX_4_8
Fix overflow for coeff -32768 in function ADD_RES_MMX_4_8 with no
performance drop.

./checkasm --test=hevc_add_res --bench

Mainline:
  - hevc_add_res.add_residual [OK]
    hevc_add_res_4x4_8_mmxext: 15.5

Add overflow test case:
  - hevc_add_res.add_residual [FAILED]

After:
  - hevc_add_res.add_residual [OK]
    hevc_add_res_4x4_8_mmxext: 15.0

Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-03-27 10:57:40 +01:00
Linjie Fu
091341f2ab lavc/pthread_frame: Update user context in ff_frame_thread_free
Resolution/format changes lead to re-initialization of hardware
accelerations(vaapi/dxva2/..) with new hwaccel_priv_data in
the worker-thread. But hwaccel_priv_data in user context won't
be updated until the resolution changing frame is output.

A termination with "-vframes" just after the reinit will lead to:
    1. memory leak in worker-thread.
    2. double free in user-thread.

Update user context in ff_frame_thread_free with the last thread
submit_packet() was called on.

To reproduce:
ffmpeg -hwaccel vaapi(dxva2) -v verbose -i
    fate-suite/h264/reinit-large_420_8-to-small_420_8.h264 -pix_fmt nv12
    -f rawvideo -vsync passthrough -vframes 47 -y out.yuv

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-03-27 10:57:40 +01:00
Gautam Ramakrishnan
e34157f6ea libavcodec/jpeg2000.h: fix comments for JPEG2000 markers
The comments for some of the markers were incorrect.
This patch fixes the comments associated with the markers.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-27 01:42:16 +01:00
James Almer
e4dd8ee323 avcodec/vp9: use a buffer pool to allocate VP9Frame extradata
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-03-26 11:45:12 -03:00
Limin Wang
157873623f avcodec/dvbsubdec: replace data_size with got_sub_ptr for better readability
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-25 18:41:21 +01:00
Limin Wang
8ea4efffdb avcodec/libzvbi-teletextdec: replace data_size with got_sub_ptr for better readability
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-25 18:41:21 +01:00
Limin Wang
766888e519 avcodec/pgssubdec: replace data_size with got_sub_ptr for better readability
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-25 18:41:21 +01:00
Limin Wang
2d244c9a00 avcodec/xsubdec: replace data_size with got_sub_ptr for better readability
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-25 18:41:21 +01:00
Andreas Rheinhardt
e5d25d1147 avcodec/hevc: Cosmetics: Realign after last commit
Suggested-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-24 23:47:00 +01:00
Andreas Rheinhardt
7272d0c0a9 avcodec/hevc, h2645_parse: Fix HEVC NAL unit names and constants
This commit fixes the names and constants of the reserved NAL units
with nal_unit_type 22 resp. 23. They were "IRAP_IRAP_VLC2x", but are
actually "RSV_IRAP_VLC2x".

This also required a change to cbs_h265_syntax_template.c.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-24 23:33:24 +01:00
Andreas Rheinhardt
3ab16d091e avcodec/dfa: Use array of fixed-sized strings for fixed-sized strings
Surprisingly neither GCC nor Clang did this transformation on their own.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-24 22:02:13 +01:00
Ramiro Polla
c455a28a9e avcodec/wmadec: cosmetics
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-03-22 11:55:44 -03:00
Ramiro Polla
c2b540d0c7 avcodec/get_bits: cosmetics
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-03-22 11:55:44 -03:00
Limin Wang
a289cc5643 avcodec/decode: increase nb_bsfs after av_bsf_alloc in case alloc failed
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-22 13:00:19 +01:00
Andreas Rheinhardt
ea46b45e9c avcodec/bsf: Beautify log messages from bitstream filters
Up until now, the name of every AVBSFContext for logging purposes was
"AVBSFContext", so that the default logging callback produced output
like "[AVBSFContext @ 0x55813bae92c0] Extradata". This has been changed
to "[trace_headers @ 0x60a000000700] Extradata" by adding an item_name-
function to the AVClass for bitstream filters.

Furthermore, the correct category has been set so that the introductory
part before the actual message (everything before "Extradata" in the
above examples) are displayed in a different colour than the rest.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-03-21 18:52:45 -03:00
Andreas Rheinhardt
d0ba6715d2 avcodec/bsf: Don't set defaults for AVClass without options
This happened for AVBSFContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-03-21 18:52:10 -03:00
Anton Khirnov
6eae7e5644 h264dec: do not export the chroma sample location immediately on parsing the SPS
This SPS is not necessarily the one that will be used. Export the chroma
location along with all the other SPS properties.
2020-03-20 09:16:05 +01:00
Anton Khirnov
bdd31feec9 sbcdec: do not unnecessarily set frame properties
Decoders are supposed to export stream properties in AVCodecContext, the
AVFrame properties are set from those in ff_get_buffer().
2020-03-20 09:16:05 +01:00
Nicolas Gaullier
1ec86be79b avcodec/mpeg12dec: Add CPB coded side data
This fixes mpeg2video stream copies to mpeg muxer like this:
  ffmpeg -i xdcamhd.mxf -c:v copy output.mpg

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-03-20 09:16:05 +01:00
Nicolas Gaullier
42271f8e18 avcodec/utils: Fix ff_add_cpb_side_data() add twice
Makes it behave similarly to av_stream_add_side_data().

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-03-20 09:16:05 +01:00
Nicolas Gaullier
eb88ccb92e avcodec/mpeg12dec: Do not alter avctx->rc_buffer_size
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-03-20 09:16:05 +01:00
Michael Niedermayer
3197b0099b avcodec/siren: Fix integer overflow in get_dw()
Fixes: signed integer overflow: 685813396 + 1803454769 cannot be represented in type 'int'
Fixes: 21073/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SIREN_fuzzer-5744900508483584

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>
2020-03-19 02:19:25 +01:00
Michael Niedermayer
c85bf16318 avcodec/ffwavesynth: Fix integer overflow in computation of ddphi
Fixes: signed integer overflow: 1302123111085380114 - -8319005078741256972 cannot be represented in type 'long'
Fixes: 20991/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5148554161291264

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-18 20:23:15 +01:00
Andriy Gelman
1e3d4fa0fb avcodec/avcodec: Fix typos
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-03-18 00:58:07 -03:00
Paul B Mahol
d64cbd4fda remove CHAR_MIN/CHAR_MAX usage
It is not needed at all.
2020-03-17 22:46:36 +01:00
Paul B Mahol
fed0de3728 avcodec: add CRI HCA decoder 2020-03-17 16:07:25 +01:00
Paul B Mahol
0bbc4914da avcodec/allcodecs: move sdx2 to correct place 2020-03-17 16:05:49 +01:00
Paul B Mahol
c6bbdba9cd avcodec: add derf dpcm decoder 2020-03-17 16:05:15 +01:00
Paul B Mahol
230703a9fa avcodec: add ADPCM IMA MTF decoder 2020-03-17 16:03:39 +01:00
Anton Khirnov
e38b8b0dc6 h264dec: do not return a value from init_dimensions()
There are no failure cases left in this function.
2020-03-16 09:27:48 +01:00
Anton Khirnov
1b17988cb5 vp3: eliminate copy_fields
It is very fragile against fields being moved and hides what is actually
being copied. Copy all the fields explicitly instead.
2020-03-16 09:27:17 +01:00
Anton Khirnov
7f0a7e3e63 mpegvideo: drop an unnecessary function parameter
It is always 0.
2020-03-16 09:21:03 +01:00
Anton Khirnov
2e53b7eea1 mpegvideodata: drop useless comments 2020-03-16 09:20:57 +01:00
Andreas Rheinhardt
cc2a9509ce libavcodec, libpostproc: Remove outcommented START/STOP_TIMER
as well as includes of libavutil/timer.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-14 18:24:04 +01:00
Lynne
675bb1f4f9 diracdec: rewrite golomb reader
This version is able to output multiple coefficients at a time and
is able to altogether remove actual golomb code parsing.
Its also able to partially recover the last coefficient in case
the packet is incomplete.

Total decoder performance gain for 8bit 420 1080p lossless: 40%.
Total decoder performance gain for 10bit 420 1080p lossless: 40%.

clang was able to vectorize the loop much better than
my handwritten assembly, but gcc was very naive and didn't.

Lookup table is a rewritten version of vc2hqdecode.
2020-03-12 20:26:48 +00:00