1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

98627 Commits

Author SHA1 Message Date
Paul B Mahol
05e58ce4e2 avcodec/cfhd: use LUT for 9 and 18 codebook decompanding
Also fix codebook 9 decompanding, fixing artifact with codebook 9
samples. Reused Gagandeep Singh patch.
2020-08-03 22:22:07 +02:00
Paul B Mahol
b4ae780693 avcodec/cfhdenc: fix PrescaleTable for YUV422P10 2020-08-03 19:34:23 +02:00
James Almer
08f60a35b4 avcodec/mpegaudiodec_template: disable CRC checking for layers 1 and 2
Layers 1 and 2 use lengths in bits which are not a multiple of 8,
and our CRC works on a per-byte basis.

Based on b48397e7b8

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-03 11:09:47 -03:00
James Almer
9afd1f6ff2 Revert "mpegaudiodec_template: disable CRC checking for layers 1 and 2"
This reverts commit b48397e7b8.

The change did not disable crc checks for layer 1 & 2, it removed reading
the CRC field.

Fixes decoding some mp2 samples and FATE test failures.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-03 10:37:49 -03:00
James Almer
b068cfccdd fate/aac: add missing bitexact flag to some encoder tests
Will prevet FATE from breaking once LIBAVCODEC_VERSION_MINOR is bumped to 100.

Reported-by: zane
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-03 09:50:17 -03:00
Lynne
b48397e7b8
mpegaudiodec_template: disable CRC checking for layers 1 and 2
Layers 1 and 2 use lengths in bits which are not a multiple of 8,
and our CRC works on a per-byte basis.
2020-08-02 22:51:55 +02:00
Lynne
fe3ea13131
hwcontext_vulkan: remove plane size alignment checks when host importing
The process space is guaranteed to be aligned to the page size, hence we're
never going to map outside of our address space.
There are more optimizations to do with respect to chroma plane alignment and
buffer offsets, but that can be done later.
2020-08-02 22:48:51 +02:00
Andriy Gelman
9d2ba8980b avcodec/v4l2_m2m: reindent after last commit
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-08-02 14:36:15 -04:00
Andriy Gelman
7c32e9cf93 avcodec/v4l2_m2m: adapt to call close() on init fail
This fixes several mem leaks when init of encoder/decoder failed.

Fixes ticket #8285

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-08-02 14:31:22 -04:00
Paul B Mahol
533d6030ca avcodec/cfhd: set correct bits_per_raw_sample 2020-08-02 09:33:24 +02:00
Paul B Mahol
e2b455f933 avcodec/cfhd: add more tag names 2020-08-02 09:33:24 +02:00
Paul B Mahol
4e27817629 avcodec: add CFHD encoder 2020-08-02 09:33:24 +02:00
Paul B Mahol
131d2a3e1c avcodec/cfhd: improve decompanding quality with reference implementation 2020-08-02 09:31:54 +02:00
Paul B Mahol
f7e35c8163 avcodec/cfhd: fix non-aligned to 8 height decoding 2020-08-02 09:31:54 +02:00
Paul B Mahol
fabbb680d4 avcodec/cfhd: move if/else out of loop in inverse transform 2020-08-02 09:31:54 +02:00
Jun Zhao
21e86a12e6 lavc/libkvazaar: fix framerate setting
fix framerate setting.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2020-08-02 11:24:45 +08:00
Andreas Rheinhardt
15ef16dce8 avcodec/g723_1enc: Avoid skip_put_bits()
If a bit is reserved, it matters very much what value it has, because
otherwise a decoder conforming to a future version of the standard might
interpret the output file in an unintended manner. This implies that
one must not use skip_put_bits() for it (which does not give any
guarantees wrt what ends up in the output (in case of a little-endian
bitstream writer (as here) it writes a 0 bit)); given that the reference
encoder as well as the earlier code write a zero bit at this place, the
new code does, too.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-01 19:08:11 +02:00
Andreas Rheinhardt
8129c32e48 avcodec, avfilter, avformat: Remove redundant avpriv_align_put_bits
flush_put_bits() already fills the bitstream with zeroes, so it is
unnecessary to align the bitstream before.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-01 18:56:32 +02:00
Mark Thompson
c67bdd6534 vaapi_encode: Delete unused field 2020-08-01 17:39:32 +01:00
Mark Thompson
3d19c5ee68 vaapi_encode_h265: Don't require uniform_spacing_flag
Though still use it if the tile arrangement matches.  Also try to keep the
fields in the same order as the standard.
2020-08-01 17:39:32 +01:00
Mark Thompson
bc58d1f58e vaapi_encode_h265: Fix ordering of tile dimensions
Dimensions are normally specified as width x height, and this will match
the same option to libaom-av1.

Remove the indirection through the private context at the same time.
2020-08-01 17:39:13 +01:00
Mark Thompson
e80fe32943 vaapi_encode_h265: Remove confusing and redundant tile options
The tile_rows/cols options currently do a confusingly different thing to
the options of the same name on other encoders like libvpx and libaom.
There is no backward-compatibility reason to implement the log2 behaviour
as there was for libaom, so just get rid of them entirely.
2020-08-01 17:18:30 +01:00
Mark Thompson
11a2d05b3f libsvtav1: Fix the documentation to match the actual options 2020-07-31 22:30:41 +01:00
Mark Thompson
ad7aa1e8e7 libsvtav1: Use _ rather than - in options 2020-07-31 22:30:41 +01:00
Mark Thompson
30a4bdbc1f libsvtav1: Rename without a _
The external library is called libsvtav1, so use this name everywhere.
2020-07-31 22:30:35 +01:00
James Almer
134a48a880 tests/imgutils: test the output of av_image_fill_* functions
Signed-off-by: James Almer <jamrial@gmail.com>
2020-07-30 19:33:09 -03:00
Zane van Iperen
be3c10d551
avformat/apm: fix APM_FILE_HEADER_SIZE value
Value was incorrectly changed in 3bf1be2101.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2020-07-30 11:48:28 +10:00
James Almer
8a3f561c34 avcodec/options_table: make AVCodecContext->level search for child constants
This change makes it possible for child encoders to define custom level
option names which can be used for setting the AVCodecContext->level.

Based on 337fe4bcc2

Reviewed-by: jkqxz
Signed-off-by: James Almer <jamrial@gmail.com>
2020-07-29 19:34:39 -03:00
Gautam Ramakrishnan
8821df6fcf libavcodec/pgxdec Fix pix format selection error
This patch makes the pgx decoder select the correct
byte order instead of selecting big endian format for
16 bit images.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-30 00:23:45 +02:00
Gautam Ramakrishnan
9d302efdf2 libavcodec/j2kenc: Encoding up to 16 bits
This patch allows the JPEG2000 encoder to
encode images to up to 16 bits.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-30 00:23:45 +02:00
Shiyou Yin
bd4f37f2eb avcodec/mips: Fix segfault in imdct36_mips_float.
'li.s' is a synthesized instruction, it does not work properly
when compiled with clang on mips, and A segfault occurred.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-30 00:23:45 +02:00
Shiyou Yin
1563b4b4c6 avcodec/mips/cabac: Fix a bug in get_cabac_inline_mips.
Failed fate case: fate-h264-conformance-caba2_sony_e
Clang is more strict in the use of register constraint.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-30 00:23:45 +02:00
Shiyou Yin
0e0a9ca048 avutil/mips/generic_macros_msa: Fix prob that 'ulw' and 'uld' unsupported by clang.
GCC support these two synthesized instruction, but clang does not yet.
Use machine instruction instead to adapt clang compiler.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-30 00:23:45 +02:00
Shiyou Yin
44699db6db avcodec/mips: Fix register constraint error reported by clang.
Clang report following error in aacsbr_mips.c,ac3dsp_mips.c and aacdec_mips.c:
"couldn't allocate output register for constraint 'r'"

Use 'f' constraint for float variable.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-30 00:23:45 +02:00
Marton Balint
b2318c1e53 avformat/hlsenc: increase initial program date time precision
Also query time only once, not for every variant stream, otherwise variant
streams might get a slightly different initial program date time. And we can
set this unconditionally because HLS_PROGRAM_DATE_TIME flag is checked
elsewhere.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-07-29 23:10:12 +02:00
Marton Balint
53a4620fba fftools/ffmpeg: make specifying thread_queue_size turn on threaded input
Threaded input can increase smoothness of e.g. x11grab significantly. Before
this patch, in order to activate threaded input the user had to specify a
"dummy" additional input, with this change it is no longer required.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-07-29 23:10:12 +02:00
Lynne
6ceaeecaf5 avcodec/libsvt_av1: remove forced-idr option
This option is directly copy-pasted from the SVT1-HEVC wrapper and has
no place in the options for an AV1 encoder.

AV1 has no H.264/5 IDR frames nor anything like them.
All this option does is change all real keyframes to an intra-only
AV1 frame, which is not seekable. Hence, any streams encoded with
this option enabled will not be seekable.
2020-07-29 17:59:15 -03:00
Daryl Seah
0e20dee5c2 avcodec: Add an SVT-AV1 encoder wrapper
Signed-off-by: Daryl Seah <daryl.seah@intel.com>
Signed-off-by: Jing SUN <jing.a.sun@intel.com>
Signed-off-by: ZhiZhen Tang <zhizhen.tang@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-07-29 17:11:26 -03:00
Andreas Rheinhardt
cbb6ba2e86 avcodec/cavsdec, h264*, hevc_parser: Use get_ue_golomb_31 where possible
instead of get_ue_golomb(). The difference between the two is that the
latter also has to take into account the case in which the read code is
more than 9 bits (four preceding zeroes + at most five value bits) long,
leading to more code.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-29 05:11:54 +02:00
Andreas Rheinhardt
2d5407d390 avcodec/golomb: Document return value of get_ue_golomb_31 on error
get_ue_golomb_31() reads nine bits and an array with 512 entries to
parse golomb codes. The longest golomb codes that fit into 9 bits use
four leading zeroes and five value bits and can encode numbers in the
0..30 range. 31 meanwhile is encoded on 11 bits and if the nine bits
read coincide with the first nine bits of the encoding of 31,
get_ue_golomb_31() returns 31 (and skips 11 bits).

But looking at the first nine bits only makes it impossible to distinguish
31 from 32..34. Therefore the documentation of get_ue_golomb_31() simply
states that the return value is undefined if the value of the encountered
exp golomb code was outside the 0..31 range.

But actually get_ue_golomb_31() does not behave that bad: If the returned
value is in the range of 0..30, then this is the actually encountered value,
so that this function can be used without any problems to parse and validate
parameters whose legal values are a subset of the 0..30 range.

This commit documents this fact.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-29 05:06:35 +02:00
Andreas Rheinhardt
69636b443c avcodec/golomb: Prevent shift by negative number
This happened in get_ue_golomb() if the cached bitstream reader was in
use, because there was no check to handle the case of the read value
not being in the supported range.
For consistency with the uncached bitstream reader and for compliance
with the documentation, every value not in the 0-8190 range is treated as
error although the cached bitstream reader could actually read values in
the range 0..65534 without problems.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-29 04:58:48 +02:00
Gautam Ramakrishnan
a45935fe05 libavcodec/jpeg2000dec: Support for PPM marker
This patch adds support for PPM marker for JPEG2000
decoder. It allows the samples p1_03.j2k and p1_05.j2k
to be decoded.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-28 21:57:50 +02:00
Michael Niedermayer
6ea8f03bf4 avcodec/jpeg2000dec: Move reslevelno check before use in case JPEG2000_PGOD_RPCL
Fixes: division by zero
Fixes: 24201/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5665813827420160
Fixes: 24245/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-6285831682392064

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Gautam Ramakrishnan <gautamramk@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-28 21:57:50 +02:00
hwren
5f8555d156 lavc/libxavs2.c: mark key-frame packets
Signed-off-by: hwren <hwrenx@126.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-28 21:57:50 +02:00
Timo Rothenpieler
466c14d107 avcodec/nvenc: fix B-Ref-Mode support check for recent HEVC 2020-07-28 21:44:11 +02:00
Andreas Rheinhardt
39c4b78829 avcodec/golomb: Don't emit error message in get_ue_golomb
Said error message is not very informative and lacked a proper logging
context; furthermore, many callers already provided more descriptive
error messages of their own. So just drop this one.

Suggested-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-28 11:34:38 +02:00
Andreas Rheinhardt
dfd12ee053 avformat/smacker: Don't return packets for streams with AVDISCARD_ALL
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-28 06:29:58 +02:00
Andreas Rheinhardt
0df4e1ff93 avformat/smacker: Fix duration for PCM audio
For non-PCM audio, a Smacker frame contains the size of the decoded
audio in the first four bytes of the audio packet data; for PCM data,
said information would be redundant and according to [1] this field does
not exist. Therefore this commit sets the duration and timestamps
properly for PCM audio.

[1]: https://wiki.multimedia.cx/index.php/Smacker#Audio_Track_Chunk

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-28 06:29:58 +02:00
Andreas Rheinhardt
40494460f5 avformat/smacker: Set audio duration
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-28 06:29:58 +02:00
Timotej Lazar
edea156579 avformat/smacker: Support seeking to first frame
Add .read_seek function to the smacker demuxer for the special case of
seeking to ts=0. This is useful because smacker – like bink, with a
similar implementation – was mostly used to encode clips in video
games, where random seeks are rare but looping media are common.

Signed-off-by: Timotej Lazar <timotej.lazar@araneo.si>
2020-07-28 06:29:58 +02:00