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

99096 Commits

Author SHA1 Message Date
Aman Verma
e4389ba075 doc/decoders: Document default value of ac3's drc_scale option
Signed-off-by: Aman Verma <amanraoverma@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-31 23:43:06 +02:00
Chris Miceli
4136652289 libavformat/dashenc: Reduce confusion in par error message
In ticket #8754 there is discourse surrounding the error
message which is printed upon a mismatched aspect ratio in
derived encodings. This should make it clearer to the user
as to the issues which they are experiencing.

Reviewed-by: "Jeyapal, Karthick" <kjeyapal@akamai.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-31 23:43:06 +02:00
Mark Thompson
303d252a4b hwcontext_vaapi: Don't require a render node when deriving from DRM
The V4L2 driver does not actually have an associated DRM device at all, so
users work around the requirement by giving libva an unrelated display-only
device instead (which is fine, because it doesn't actually do anything with
that device).  This was broken by bc9b6358fb
forcing a render node, because the display-only device did not have an
associated render node to use.  Fix that by just passing through the
original non-render DRM fd if we can't find a render node.

Reported-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Tested-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2020-08-31 21:42:14 +01:00
Paul B Mahol
04d335e436 avcodec/sheervideo: use cached bitstream reader except for x32 2020-08-31 20:10:24 +02:00
Paul B Mahol
e417f84003 avfilter/f_graphmonitor: also show link EOF status in blue 2020-08-31 19:59:35 +02:00
Paul B Mahol
57915df230 avcodec/magicyuv: change bits used by 12bit tables
Higher number slows decoder.
2020-08-31 19:56:22 +02:00
Paul B Mahol
276d86a8b8 avcodec/magicyuv: use cached bitstream reader except for x32 2020-08-31 16:31:25 +02:00
Paul B Mahol
445e5fb67a avcodec/magicyuv: invert symbols when building vlc
Instead at every decoded symbol.
2020-08-31 16:31:10 +02:00
Paul B Mahol
eb9fa00bcc avfilter/vsrc_gradients: add speed option 2020-08-31 11:09:53 +02:00
Paul B Mahol
823eb009cb avfilter/vsrc_gradients: do not use (l)lrint variants for double 2020-08-31 11:09:53 +02:00
Paul B Mahol
64e93025f0 avfilter/vsrc_gradients: add duration option 2020-08-31 11:09:53 +02:00
Ting Fu
4a11a6f4cc dnn/tensorflow: add log error message
Signed-off-by: Ting Fu <ting.fu@intel.com>
2020-08-31 13:12:10 +08:00
Ting Fu
74358ff4a4 dnn/openvino: add log error message
Signed-off-by: Ting Fu <ting.fu@intel.com>
2020-08-31 13:12:10 +08:00
Andreas Rheinhardt
a97d8469a6 avfilter/src_movie: Avoid intermediate buffer for writing string
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-31 03:41:38 +02:00
Andreas Rheinhardt
e6c5102fb4 avcodec/roqvideodec: Remove set-but-unused frame stats
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-31 03:00:09 +02:00
Andreas Rheinhardt
a067d44955 avcodec/roqvideodec: Move transient GetByteContext to the stack
This avoids keeping potentially dangling pointers in the context,
beautifies the code (by replacing "&ri->gb" by gb for every access to
the GetByteContext) and also highlights the GetByteContext's short-lived
nature better.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-31 02:59:36 +02:00
Paul B Mahol
72942ad6d4 avcodec/cdxl: also mark decoded frame as keyframe 2020-08-31 00:15:22 +02:00
Paul B Mahol
ef46de695f avcodec/qpeg: reduce unnecessary size of tables 2020-08-30 23:52:21 +02:00
Gautam Ramakrishnan
341064d68a libavcodec/jpeg2000: fix tag tree reset
The implementation of the tag tree did not
set the correct reset value for the encoder.
This lead to inefficent tag tree being encoded.
This patch fixes the implementation of the
ff_tag_tree_zero() function.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-30 16:18:37 +02:00
Gautam Ramakrishnan
f0e33119e4 libavcodec/j2kenc: Support for multiple layers
This patch allows setting a compression ratio and to
set multiple layers. The user has to input a compression
ratio for each layer.
The per layer compression ration can be set as follows:
-layer_rates "r1,r2,...rn"
for to create 'n' layers.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-30 16:18:37 +02:00
Gautam Ramakrishnan
3c06045a8b libavcodec/j2kenc: Fix tag tree coding
The implementation of tag tree encoding was incorrect.
However, this error was not visible as the current j2k
encoder encodes only 1 layer.
This patch fixes tag tree coding for JPEG2000 such tag
tree coding would work for multi layer encoding.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-30 16:18:37 +02:00
Gautam Ramakrishnan
87567fc398 libavcodec/jpeg2000: Make tag tree functions non static
This patch makes the tag_tree_zero() and tag_tree_size()
functions non static and callable from other files.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-30 16:18:37 +02:00
Michael Niedermayer
659658d08b avcodec/cfhd: Check transform type
Fixes: out of array access
Fixes: 24823/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-4855119863349248

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-30 16:18:37 +02:00
Xiaohan Wang
b54c7797c5 avcodec/aacdec_template: Initialize layout_map on declaration
Without this change, it'll cause use-of-uninitialized-variable error.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-30 16:18:37 +02:00
Michael Niedermayer
a0f20c3b3f avcodec/mpegvideo_enc: Replace some s->avctx by avctx
Fixes issue reported by: Xu Guangxin <guangxin.xu@intel.com>
Original report:
Steps to reproduce:
1. ./configure --enable-debug=3 --disable-libx264 && make install
2. ffmpeg -i input.mp4 -profile:v baseline output.mp4 -y

you will see a crash like this:
[mpeg4 @ 0x5555575854c0] [Eval @ 0x7fffffffbf80] Undefined constant or missing '(' in 'baseline'
[mpeg4 @ 0x5555575854c0] Unable to parse option value "baseline"
[mpeg4 @ 0x5555575854c0] Error setting option profile to value baseline.
Thread 1 "ffmpeg" received signal SIGSEGV, Segmentation fault.

root cause:
If the codec has FF_CODEC_CAP_INIT_CLEANUP flag, and avcodec_open2 got an error before avctx->codec->init,
the ff_mpv_encode_end will face a null s->avctx.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-30 16:18:37 +02:00
Marvin Scholz
ff4cc8c654 adtsenc: Add ability to write MPEG2 ID
Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-30 16:18:37 +02:00
Michael Niedermayer
2359656da2 avcodec/cfhd: Replace a few literal numbers by named constants
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-30 16:18:37 +02:00
Paul B Mahol
60796d22f9 avfilter/vf_xfade: fix excessive number of queued frames
Also do not abort in some cases too early when transition is over.

Fixes #8823.
2020-08-30 11:28:28 +02:00
Andreas Rheinhardt
9372eb00c8 avcodec/truemotion1: Cleanup generically after init failure
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-30 03:07:33 +02:00
Andreas Rheinhardt
c767af97f8 avcodec/y41penc: Remove empty close function
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-30 03:06:50 +02:00
Andreas Rheinhardt
beca89ed28 avcodec/yuv4enc: Remove empty functions
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-30 03:06:18 +02:00
Andreas Rheinhardt
099bc252c6 avcodec/wnv1: Move temporary variables from context to stack
Here it even leads to the complete removal of the context.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-30 03:05:03 +02:00
Andreas Rheinhardt
0166b1d1a6 avcodec/wnv1: Use LE bitstream reader, avoid copying packet, fix memleak
The Winnov WNV1 format is designed for a little-endian bitstream reader;
yet our decoder reversed every byte bitwise (in a buffer only
allocated for this purpose) to use a big-endian bitstream reader. This
commit stops this.

Two things needed to be done to achieve this: The codes in the table used
to initialize a VLC reader needed to be reversed bitwise (when
initializing a VLC in LE mode, it is expected that the first bit to be
read is in the least significant bit; with BE codes the first bit to be
read is the most significant bit of the code) and the following
expression needed to be adapted:

ff_reverse[get_bits(&w->gb, 8 - w->shift)]

But this is easy: When only the bits read are reversed, they coincide
with what a little-endian bitstream reader reads that reads the
original, not-reversed data. But ff_reverse always reverses the full
eight bits and this also performs a shift by (8 - (8 - w->shift)) on top
of reversing the bits read. So the above line needs to be changed to

get_bits(&w->gb, 8 - w->shift) << w->shift

and this also shows why the variable shift is named the way it is.

Finally, this also fixes a hypothetical memleak: For gigantic packets,
initializing a GetBitContext can fail and in this case, the buffer
containing the reversed data would leak.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-30 03:02:13 +02:00
Andreas Rheinhardt
7c8cf40adc avcodec/roqvideoenc: Cleanup generically after init failure
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-30 03:00:42 +02:00
Andreas Rheinhardt
c38405c149 avcodec/roqvideodec: Cleanup generically after init failure
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-30 03:00:13 +02:00
Andreas Rheinhardt
3a76076513 avcodec/mss3: Cleanup generically after init failure
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-30 02:59:08 +02:00
Andreas Rheinhardt
c1d3b4705e avcodec/mss3: Remove unnecessary free of unallocated frame
The frame will only be allocated a few lines below.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-30 02:58:52 +02:00
Andreas Rheinhardt
35b478de5b avcodec/interplayvideo: Cleanup generically after init failure
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-30 02:57:37 +02:00
Andreas Rheinhardt
3c7ca68eeb avcodec/eacmv: Cleanup generically after init failure
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-30 02:57:06 +02:00
Andreas Rheinhardt
fea984d5c7 avcodec/cinepakenc: Cleanup generically after init failure
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-30 02:55:43 +02:00
Andreas Rheinhardt
5ff2ff6bd9 avcodec/truemotion2: Avoid duplicating array, fix memleak
TrueMotion 2.0 uses Huffmann trees. To parse them, the decoder allocates
arrays for the codes, their lengths and their value; afterwards a VLC
table is initialized using these values. If everything up to this point
succeeds, a new buffer of the same size as the already allocated arrays
for the values is allocated and upon success the values are copied into
the new array; all the old arrays are then freed. Yet if allocating the
new array fails, the old arrays get freed, but the VLC table doesn't.

This leak is fixed by not allocating a new array at all; instead the old
array is simply reused, ensuring that nothing can fail after the
creation of the VLC table.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-29 18:49:51 +02:00
Harry Mallon
abd58a4192 libavformat/mxfenc: color_range should be inclusive
MXF CDCI color range was being set to (1<<sc->component_depth) - 1
for full range but it should be (1<<sc->component_depth) as 0 is
a valid value.

Signed-off-by: Harry Mallon <harry.mallon@codex.online>
2020-08-29 11:02:35 +02:00
Harry Mallon
719eb8a2e4 avformat/mxfdec: Read video range from CDCIEssenceDescriptor
* Capture black_ref, white_ref and color_range and recognise
  full and narrow range.

Signed-off-by: Harry Mallon <harry.mallon@codex.online>
2020-08-29 11:02:35 +02:00
James Almer
1a35fffaf2 x86/cfhddsp: zero extend int arguments
if taken from stack, they may have garbage in the upper bits otherwise.
Also, there are only 8 arguments, so don't attempt to load 11.

Fixes SIGSEV crashes in some targets.

Reviewed-by: durandal_1707
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-28 20:09:25 -03:00
Dale Curtis
2ff3c466ec avformat/mov: See if mfra makes up the difference for an incomplete sidx.
A few popular sites have started generating MP4 files which have a
sidx plus an mfra. The sidx accounts for all size except the mfra,
so the old code did not mark the fragment index as complete.

Instead we can just check if there's an mfra and if its size makes
up the difference we can mark the index as complete.

Bug: https://crbug.com/1107130
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2020-08-28 15:58:47 +01:00
Paul B Mahol
ccc7120ee7 avcodec/flacdec: use designated initializers for AVClass 2020-08-28 01:16:55 +02:00
Andreas Rheinhardt
5c923ce668 avcodec/cfhd: Remove unused-but-set variable
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-28 00:43:28 +02:00
Paul B Mahol
f7deae7215 avfilter/af_arnndn: use memcpy for copying in compute_rnn() 2020-08-27 20:39:33 +02:00
Paul B Mahol
ace1cc6163 avfilter/af_arnndn: use scalarproduct_float() in dct function 2020-08-27 20:39:33 +02:00
Paul B Mahol
0d46043619 avfilter/af_compensationdelay: always initialize w_ptr with 0
It will be changed later anyway, and in case inlink have 0 channels
(should never happen) it will not pick some random value.
2020-08-27 18:10:24 +02:00