James Almer
016d40011a
avcodec/extract_extradata: don't uninitialize the H2645Packet on every processed packet
...
Based on hevc_parser code. This prevents repeated unnecessary allocations
and frees on every packet processed by the bsf.
Reviewed-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-22 17:13:56 -03:00
James Almer
4f2ff3a53e
avcodec/mpeg4_unpack_bframes: make sure the packet is writable when data needs to be changed
...
Nothing currently guarantees that the packet passed to the bsf will
be writable.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-22 16:41:10 -03:00
Gagandeep Singh
c64c97b972
lavc/cfhd: add alpha decompanding in rgba12
...
Alpha decompanding curve added to post process the decoded alpha channel.
Fixes ticket #6265 .
2018-03-22 19:27:22 +01:00
James Almer
59347c2474
avcodec/dxva2_vc1: add missing frame_params callback to vc1_d3d11va2 hwaccel
...
Fixes ticket #7096
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-22 11:46:32 -03:00
James Almer
f14ca60001
avcodec/avpacket: add av_packet_make_writable()
...
Useful as well to quickly make a packet reference counted when it
isn't already so.
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-21 22:17:40 -03:00
Jun Zhao
28aaed7737
lavc/remove_extradata_bsf: support dump options.
...
support dump bit stream filter options
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-21 22:00:36 -03:00
Jun Zhao
b8e406c01a
lavc/noise_bsf: support dump options.
...
support dump bit stream filter options.
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-21 22:00:32 -03:00
Jun Zhao
a4726288f8
lavc/dump_extradata_bsf: support dump options.
...
support dump bit stream filter options
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-21 22:00:28 -03:00
James Almer
7e0dc7210b
avcodec/vp9_superframe_split: fix memory leak in case of output packet creation failure
...
Some function calls may fail after the output packet is initialized.
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-21 01:38:34 -03:00
Aman Gupta
2ddc6b4392
avcodec/mediacodecdec: propagate SAR to h/w frames
...
Allows consumers who are converting hardware buffers
to OpenGL textures to render the frames at the intended
display resolution.
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2018-03-20 15:52:23 -07:00
James Almer
2aac5ad2f7
avcodec/mpeg2_metadata: unref output packet on failure
...
Move the check and unref call to the end to be consistent with other
bsfs.
Reviewed-by: jkqxz
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-20 18:26:38 -03:00
James Almer
ae36d6cdde
avcodec/h265_metadata: fix memory leak in case of output packet creation failure
...
Some function calls may fail after the output packet is initialized.
Reviewed-by: jkqxz
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-20 18:20:29 -03:00
James Almer
039be6a23f
avcodec/h264_metadata: fix memory leak in case of output packet creation failure
...
Some function calls may fail after the output packet is initialized.
Reviewed-by: jkqxz
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-20 18:19:20 -03:00
James Almer
bd60116794
avcodec/mpeg4_unpack_bframes: reduce code duplication
...
Also fixes one potential leak of side data in out if
the av_packet_from_data() call fails.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-20 17:39:04 -03:00
James Almer
f18f973469
avcodec/mp3_header_decompress: don't free the user provided packet on error
...
It's owned by the caller.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-20 17:39:00 -03:00
James Almer
e4eaaf7bf6
avcodec/vp9_superframe_split: move the reference in the bsf internal buffer
...
There's no need to allocate a new packet for it.
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-19 22:26:54 -03:00
Mark Thompson
1c49365c62
h264_metadata: Fix memory leak on multiple display orientation messages
...
Fixes CID #1430176 .
2018-03-19 23:12:01 +00:00
Jun Zhao
dd21f02a04
lavc/mpeg2_metadata_bsf: support dump options.
...
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2018-03-18 20:32:45 +00:00
Jun Zhao
2a103e12ba
lavc/h265_metadata_bsf: support dump options.
...
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2018-03-18 20:32:45 +00:00
Jun Zhao
840f5b3e5b
lavc/h264_metadata_bsf: support dump options.
...
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2018-03-18 20:32:45 +00:00
James Almer
a094e7f16a
avcodec/aac_adtstoasc: move the reference in the bsf internal buffer
...
There's no need to allocate a new packet for it.
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-18 17:30:59 -03:00
Mark Thompson
c99f837dde
lavc: Add filter_units bitstream filter
...
This can remove units with types in or not in a given set from a stream.
For example, it can be used to remove all non-VCL NAL units from an H.264 or
H.265 stream.
2018-03-18 18:23:18 +00:00
Mark Thompson
84bb8327f5
cbs: Add a table of all supported codec IDs
...
Use it as the set of codec IDs supported by the trace_headers BSF.
2018-03-18 17:55:00 +00:00
Mark Thompson
94d42cb4cc
h264_metadata: Remove unused fields
...
The SEI NAL is unused since 69062d0f9b ,
while the AUD NAL is small and would more sensibly be on the stack.
2018-03-18 17:55:00 +00:00
Mark Thompson
84c3c766d8
h264_metadata: Add support for display orientation SEI messages
2018-03-18 17:55:00 +00:00
Mark Thompson
c4eeea7633
cbs_h265: Use helper macro for maximum values of fixed-width elements
...
Apply the same logic as the previous patch to H.265. There are no cases
which currently overflow here, but this is still more consistent.
2018-03-18 17:55:00 +00:00
Mark Thompson
0e782661d6
cbs_h264: Fix overflow in shifts
...
The type of the result of a shift operation is unaffected by the type of
the right operand, so some existing code overflows with undefined behaviour
when the element length is 32. Add a helper macro to calculate the maximum
value correctly and then use it everywhere this pattern appears.
Found-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
2018-03-18 17:54:55 +00:00
James Almer
86c7d8df95
avformat/codec2: don't include avcodec objects
...
They belong in avcodec.
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-17 17:20:25 -03:00
James Almer
1410454c8b
Partially revert "avcodec/hapqa_extract: remove the AVOption flags
...
Re add AVOptions flags, using the new one meant for bsfs.
This partially reverts commit f706cdda56 .
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-17 12:16:43 -03:00
Jun Zhao
edce64c9e9
lavc/extract_extradata_bsf: support dump options.
...
support dump bit stream filter options
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-17 12:16:35 -03:00
James Almer
a7a8320c4f
avcodec/null_bsf: move the reference in the bsf internal buffer
...
There's no need to allocate a new packet for it.
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-16 19:51:08 -03:00
James Almer
f706cdda56
avcodec/hapqa_extract: remove the AVOption flags
...
These two are not used for bitstream filters.
Reviewed-by: Martin Vignali <martin.vignali@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-14 10:55:05 -03:00
James Almer
b173e03536
avcodec/hapqa_extract: fix two error return values
...
ret is 0 by default.
Reviewed-by: Martin Vignali <martin.vignali@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-13 20:49:50 -03:00
James Almer
2b6699f024
avcodec/hapqa_extract: move the reference in the bsf internal buffer
...
There's no need to allocate a new packet for it.
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-13 18:55:49 -03:00
Aman Gupta
3172b31223
avcodec/mediacodecdec: fix immediate EAGAIN with buffered packet
...
In cases where the mediacodec decoder consumed a partial packet,
receive_frame() would start returning EAGAIN if the rest of the
packet couldn't be flushed and no frames were immediately available.
This fixes receive_frame() to perform its normal blocking wait for
new frames before returning EAGAIN. Fixes an issue I could reproduce
fairly often on a FireOS 6 device, and reported to be happening
intermittently by two mpv users.
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2018-03-13 12:32:08 -07:00
Martin Vignali
7b0cb2e032
avcodec/hapqa_extract_bsf : add new bsf filter
...
convert HapQA data to HAPQ or HAPAlphaOnly
by copying the corresponding texture
2018-03-13 20:26:07 +01:00
Martin Vignali
f869e54d22
avcodec/hap : move parse_section_header to hap.c in order to be use by new bsf filter
2018-03-13 20:26:02 +01:00
Rostislav Pehlivanov
688060fbb7
vc2enc: properly promote operations to 64 bits
...
On Windows machines, the UL suffix still means 32 bits.
The only parts that need 64 bits are (1ULL << (m + 32)) and
(t*qf + qf). Hence, use the proper ULL suffix for the former
and just increase the type of the qf constant for the latter.
No overflows can happen as long as these are done in 64 bits and
the quantization table doesn't change.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-03-13 01:43:30 +00:00
Yusuke Nakamura
af7e953a59
h264_mp4toannexb_bsf: Fix start code size of parameter sets.
...
Any parameter set shall have start code of at least 4 byte size.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-13 01:34:42 +01:00
Matthieu Bouron
41d7c4d381
avcodec/mediacodecdec_common: make INFO_TRY_AGAIN trace messages more consistent
...
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2018-03-12 09:47:34 +01:00
Aman Gupta
936312d18c
avcodec/mediacodecdec: add debug logging around hw buffer lifecycle
...
Some Android devices are very finicky about how quicky output buffers
are returned back to the decoder, especially when they are associated
with a Surface.
This commit adds a new counter that keeps track of exactly how many hw
output buffers are being retained by the user, along with DEBUG level
logging that makes it easy to track the lifecycle of these buffers.
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2018-03-12 01:23:30 -07:00
Michael Niedermayer
939440ad1a
avcodec/nuv: rtjpeg with dimensions less than 16 would result in no decoded pixels thus reject it
...
Fixes: Timeout
Fixes: 6297/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NUV_fuzzer-4882404863901696
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-12 01:32:42 +01:00
Michael Niedermayer
8ee3265dbe
avcodec/nuv: Check for minimum input size for uncomprssed and rtjpeg
...
Fixes: Timeout
Fixes: 6297/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NUV_fuzzer-4882404863901696
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-12 01:32:42 +01:00
Michael Niedermayer
64c9ce0abc
avcodec/wmalosslessdec: Reset num_saved_bits on error path
...
Fixes: NULL pointer dereference
Fixes: poc-201803.wav
Found-by: GwanYeong Kim <gy741.kim@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-12 01:32:42 +01:00
James Almer
c266049191
avcodec/trace_headers: move the reference in the bsf internal buffer
...
There's no need to allocate a new packet for it.
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-11 15:42:01 -03:00
James Almer
a1a0859ad5
avcodec/remove_extradata: move the reference in the bsf internal buffer
...
There's no need to allocate a new packet for it.
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-11 15:41:15 -03:00
James Almer
11bef2fe72
avcodec/mov2textsub: move the reference in the bsf internal buffer
...
There's no need to allocate a new packet for it.
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-11 15:40:37 -03:00
James Almer
9c6dd9d624
avcodec/extract_extradata: move the reference in the bsf internal buffer
...
There's no need to allocate a new packet for it.
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-11 15:39:47 -03:00
James Almer
aba437a6d0
avcodec/dca_core: move the reference in the bsf internal buffer
...
There's no need to allocate a new packet for it.
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-11 15:38:58 -03:00
James Almer
27d4249fad
avcodec/chomp: move the reference in the bsf internal buffer
...
There's no need to allocate a new packet for it.
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-11 15:38:24 -03:00