1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

98310 Commits

Author SHA1 Message Date
Ting Fu
130c600144 dnn-layer-math-unary-test: add unit test for acos
Signed-off-by: Ting Fu <ting.fu@intel.com>
Signed-off-by: Guo Yejun <yejun.guo@intel.com>
2020-06-25 08:41:50 +08:00
Ting Fu
461485feac dnn_backend_native_layer_mathunary: add acos support
It can be tested with the model generated with below python script:

import tensorflow as tf
import numpy as np
import imageio

in_img = imageio.imread('input.jpeg')
in_img = in_img.astype(np.float32)/255.0
in_data = in_img[np.newaxis, :]

x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in')
x1 = tf.acos(x)
x2 = tf.divide(x1, 3.1416/2) # pi/2
y = tf.identity(x2, name='dnn_out')

sess=tf.Session()
sess.run(tf.global_variables_initializer())

graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out'])
tf.train.write_graph(graph_def, '.', 'image_process.pb', as_text=False)

print("image_process.pb generated, please use \
path_to_ffmpeg/tools/python/convert.py to generate image_process.model\n")

output = sess.run(y, feed_dict={x: in_data})
imageio.imsave("out.jpg", np.squeeze(output))

Signed-off-by: Ting Fu <ting.fu@intel.com>
Signed-off-by: Guo Yejun <yejun.guo@intel.com>
2020-06-25 08:41:50 +08:00
Ting Fu
057f6ee7f4 dnn-layer-math-unary-test: add unit test for asin
Signed-off-by: Ting Fu <ting.fu@intel.com>
Signed-off-by: Guo Yejun <yejun.guo@intel.com>
2020-06-25 08:41:50 +08:00
Ting Fu
486c0c419d dnn_backend_native_layer_mathunary: add asin support
It can be tested with the model generated with below python script:

import tensorflow as tf
import numpy as np
import imageio

in_img = imageio.imread('input.jpeg')
in_img = in_img.astype(np.float32)/255.0
in_data = in_img[np.newaxis, :]

x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in')
x1 = tf.asin(x)
x2 = tf.divide(x1, 3.1416/2) # pi/2
y = tf.identity(x2, name='dnn_out')

sess=tf.Session()
sess.run(tf.global_variables_initializer())

graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out'])
tf.train.write_graph(graph_def, '.', 'image_process.pb', as_text=False)

print("image_process.pb generated, please use \
path_to_ffmpeg/tools/python/convert.py to generate image_process.model\n")

output = sess.run(y, feed_dict={x: in_data})
imageio.imsave("out.jpg", np.squeeze(output))

Signed-off-by: Ting Fu <ting.fu@intel.com>
Signed-off-by: Guo Yejun <yejun.guo@intel.com>
2020-06-25 08:41:50 +08:00
Andreas Rheinhardt
6c777a6688 avformat/smoothstreaming: Forward errors from copying white/blacklists
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-24 16:07:38 +02:00
Andreas Rheinhardt
9fe30bd9a9 avcodec/cbs_av1: Simplify writing uvlc elements
There is no reason to special-case writing a value of zero as uvlc
element as the generic code is perfectly capable of doing so.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-24 15:56:24 +02:00
Andreas Rheinhardt
6f06c17a55 avcodec/cbs_av1: Fix writing uvlc numbers >= INT_MAX
Fixes: assertion failure
Fixes: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 23264/clusterfuzz-testcase-minimized-ffmpeg_BSF_AV1_METADATA_fuzzer-6308429248593920

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-24 15:56:24 +02:00
Hendrik Leppkes
8ee6557c2e avcodec/hevc: export chroma sample location 2020-06-24 12:02:13 +02:00
Paul B Mahol
ce297b44d3 avfilter/vf_v360: do not ignore return value of allocate_plane() 2020-06-23 21:55:40 +02:00
Paul B Mahol
001748b326 avcodec/ccaption_dec: add support for background colors 2020-06-23 21:55:40 +02:00
Carl Eugen Hoyos
13db5061ff lavc: Lower MediaFoundation audio encoder priority.
The actual encoders may not be available.
Fixes ticket #8699.
2020-06-23 20:41:46 +02:00
Paul B Mahol
f719cacbd9 doc/general: mention BT20 decoder 2020-06-23 16:04:31 +02:00
Paul B Mahol
c949de2449 doc/general: merge dupe ProRes entries
While here add missing fourcc.
2020-06-23 16:00:02 +02:00
Paul B Mahol
eef0765236 doc/general: mention NotchLC 2020-06-23 16:00:02 +02:00
Paul B Mahol
00a5df71ad avfilter/vf_v360: add orthographic projection support 2020-06-23 16:00:02 +02:00
Paul B Mahol
44ce333f03 avfilters/vf_v360: add equisolid projection support 2020-06-22 14:41:36 +02:00
Andreas Rheinhardt
3f2be5372e avfilter/vf_showpalette: Don't pretend disp_palette can fail
It can't fail, yet it returns an int and other code checks whether it
failed; yet if it did fail, an AVFrame would leak. One could of course
add an av_frame_free for this (that compilers could optimize away), yet
it is easier to simply stop pretending that disp_palette could fail.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 13:52:01 +02:00
Andreas Rheinhardt
05475ad26b avformat/sccdec: Avoid variable that is always zero
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 13:17:02 +02:00
Andreas Rheinhardt
a7b82fe52b avformat/pjsdec: Avoid variable that is always zero
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 13:16:58 +02:00
Andreas Rheinhardt
dc4af87d2f avformat/mpl2dec: Avoid variable that is always zero
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 13:16:53 +02:00
Andreas Rheinhardt
7256c363a0 avformat/mov: Cosmetics
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 13:16:01 +02:00
Andreas Rheinhardt
9ce1eb5eb0 avformat/mov: Avoid allocation when reading ddts atom
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 13:14:52 +02:00
Andreas Rheinhardt
316a3e91be avformat/mov: Use ffio_read_size where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 13:13:48 +02:00
Andreas Rheinhardt
526f5f59df avformat/mov: Avoid allocation+copy when moving extradata
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 13:12:49 +02:00
Andreas Rheinhardt
88dc77e243 avformat/mov: Read attached pics directly into st->attached_pic
Given that av_get_packet returns a blank packet on error, the only
difference to the current approach (that uses intermediate AVPackets on
the stack) is that st->attached_pic will be properly initialized on error
(i.e. the timestamps are AV_NOPTS_VALUE) whereas right now st->attached_pic
is only zeroed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 13:10:58 +02:00
Andreas Rheinhardt
ddd6274944 avformat/mov: Check earlier whether reel_name string is empty
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 12:41:20 +02:00
Andreas Rheinhardt
c3cd6b765b avcodec, avformat: Remove unnecessary initializations of side data size
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 12:20:37 +02:00
Andreas Rheinhardt
b8c6aae575 avformat/avformat: Improve documentation of av_stream_get_side_data
Document that it also sets the size in case the desired side data is
absent (if the pointer has been supplied).

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 12:20:23 +02:00
Andreas Rheinhardt
45ddf06f54 avcodec/packet: Improve documentation of av_packet_get_side_data
Document that it also sets the size in case the desired side data is
absent (if the pointer has been supplied).

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 12:20:12 +02:00
Andreas Rheinhardt
b054a3a216 avformat/flvdec: Cosmetics
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 12:19:56 +02:00
Andreas Rheinhardt
55c7bb0665 avcodec/nellymoserdec: Don't use invalid AVPacketSideDataType
Commits 957a593cd9 and
11828b8885 made the flv demuxer export
a certain flag as side data to be used by the nellymoser decoder for
mid-stream sample rate changes. It used a custom side data type 'F' that
was never officially documented.

Yet since 2215c39e94 (merged in commit
52c522c720) this information is exported
via the properly documented AV_PKT_DATA_PARAM_CHANGE side data.
The merge commit therefore stopped exporting the 'F' sidedata; yet the
changes in the Nellymoser decoder (which are now dead code (and would
become dangerous if lots of new side data types were added)) have not
been removed. This commit does this.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 12:19:24 +02:00
Przemysław Sobala
82352f3c1a avformat/dashenc: Calculate average bitrate for adaptation sets in static manifest
If stream's bitrate is not specified:
- for static manifest: an average bitrate will be calculated and used,
- for dynamic manifest: first segment's bitrate will be calculated and used, as before,
for bandwidth setting in adaptation sets.
2020-06-22 10:32:44 +05:30
Przemysław Sobala
19726288d8 Revert "avformat/dashenc: use AVStream timebase when computing missing bitrate"
This reverts commit 2a9ffd89fc as duration is always in AV_TIME_BASE units
2020-06-22 10:32:10 +05:30
Paul B Mahol
fdac3c80ac avfilter/af_ladspa: check return value of getenv() 2020-06-21 21:35:40 +02:00
Paul B Mahol
683a1599d4 avfilter/af_ladspa: add latency compensation 2020-06-21 21:35:40 +02:00
Paul B Mahol
842bc312ad avfilter/af_ladspa: check another directory for plugins 2020-06-21 14:48:27 +02:00
summertriangle.dev@gmail.com
9a24610bf7 avcodec/hcadec: get intensity from correct channel
Fixes an issue with one output channel being slightly louder than
the other. The output now matches other public HCA decoders.

Signed-off-by: t <summertriangle.dev@gmail.com>
2020-06-21 11:13:29 +02:00
summertriangle.dev@gmail.com
bc2dcae897 avcodec/hcadec: fix decoding of hfr channels
I suspect this was originally broken by b7e5c8f , but even
then, it only worked because it read out of bounds from
intensity_ratio_table.

Signed-off-by: t <summertriangle.dev@gmail.com>
2020-06-21 11:13:29 +02:00
Andriy Gelman
536e5dfa73 avcodec/adpcmenc: remove forward declaration
Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-06-20 23:20:27 -04:00
Paul B Mahol
29ea4e1b3c avcodec/mpeg12dec: do not discard older a53 captions
Fixes #6105.
2020-06-20 15:09:30 +02:00
Paul B Mahol
00842b3a0d avcodec/ccaption_dec: use uint8_t type for prev_cmd array
Commands are unsigned so be consistent.
2020-06-20 15:07:26 +02:00
Paul B Mahol
bd1b78e91a avcodec/ccaption_dec: do not modify packet data in case of parity error
To dissallow similar errors in future, make pointers const.
2020-06-20 15:07:26 +02:00
Paul B Mahol
bbd0be04d0 avcodec/ccaption_dec: allow selection of second field captions 2020-06-20 15:07:26 +02:00
Paul B Mahol
c6791a32b4 avcodec/ccaption_dec: rework non-real-time mode with pop-on captions by delaying
So it give similar output as visual output of real-time mode.
2020-06-20 15:07:26 +02:00
Limin Wang
251434cb97 doc/encoders: fix the misleading usage of profile
users are getting mislead by the integer, although profile
can support both const string and integer.
http://ffmpeg.org/pipermail/ffmpeg-user/2020-June/049025.html

Also fix the order of high and main, it's not my intention.

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-20 09:03:59 +08:00
Limin Wang
548ef7a12b avfilter: add D2TS, TS2D, TS2T as a common macro in internal.h
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-19 23:12:49 +08:00
Limin Wang
04172d233d avformat/dvenc: return error code of dv_assemble_frame()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-19 23:12:49 +08:00
Manoj Bonda
23d06f606e avcodec/av1_parser: initialize avctx->pix_fmt
Initialize avctx->pix_fmt in av1_parser.c
AV1 Chroma format is invalid when quering using below code if no AV1 decoder
is available:

iVideoStream = av_find_best_stream(fmtc, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);
eChromaFormat = (AVPixelFormat)fmtc->streams[iVideoStream]->codecpar->format;

Signed-off-by: James Almer <jamrial@gmail.com>
2020-06-19 11:05:30 -03:00
James Almer
af6cddae1f avcodec/av1_parser: add missing parsing for RGB pixel format signaling
Signed-off-by: James Almer <jamrial@gmail.com>
2020-06-19 11:05:30 -03:00
James Almer
634a44db5a avcodec/av1_parser: set context values outside the OBU parsing loop
Signed-off-by: James Almer <jamrial@gmail.com>
2020-06-19 11:05:30 -03:00