Commit Graph

5079 Commits

Author SHA1 Message Date
Zane van Iperen 50d3a751aa
avcodec/adpcm_ima_amv: use coded sample count
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2020-11-09 14:58:37 +10:00
Zane van Iperen 406879f49c
avcodec/adpcm_ima_swf: fix frame size to 4096
SWF File Format Specification, Version 19 says this is 1 raw
sample + 4095 nibbles.

https://www.adobe.com/content/dam/acom/en/devnet/pdf/swf-file-format-spec.pdf

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2020-11-07 23:43:26 +10:00
Limin Wang 06aab9790d fate/filter-video: add 10bit test for unsharp filter
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-07 10:09:59 +08:00
Andreas Rheinhardt 02188639ca fate: Add test for Musepack SV8 decoding
While the FATE suite contains a sample file for Musepack 8, it did not
use it to test the decoder; it is only used in the mpc8-demux test that
tests the demuxer via streamcopy. Therefore this commit adds an actual
encoder test.

The test uses the framecrc output, because Musepack SV8 is an encoder
that returns multiple frames for a single packet, so that timing
information in the test output is valueable. Output seeking has been
used in order to limit the size of the ref file as well as to test this
codepath for the first time.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-31 12:44:16 +01:00
Jan Ekström fbb44bc51a ffmpeg: move field order decision making to encoder initialization
We now have the possibility of getting AVFrames here, and we should
not touch the muxer's codecpar after writing the header.

Results of FATE tests change as the MXF and Matroska muxers actually
write down the field/frame coding type of a stream in their
respective headers. Before this change, these values in codecpar
would only be set after the muxer was initialized. Now, the
information is also available for encoder and muxer initialization.
2020-10-29 16:59:49 +02:00
Jan Ekström 7369595c55 ffmpeg: pass decoded or filtered AVFrame to output stream initialization
Additionally, reap the first rewards by being able to set the
color related encoding values based on the passed AVFrame.

The only tests that seem to have changed their results with this
change seem to be the MXF tests. There, the muxer writes the
limited/full range flag to the output container if the encoder
is not set to "unspecified".
2020-10-29 16:59:49 +02:00
ruiquan.crq ae9a1a9698 lavf/url: fix relative url parsing when the query string or fragment has a colon
This disallows the usage of ? and # in libavformat specific scheme options
(e.g. subfile,,start,32815239,end,0,,:video.ts) but this change was considered
acceptable.

Signed-off-by: ruiquan.crq <caihaoning83@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-10-28 21:34:09 +01:00
Steven Liu bc90145fa3 tests/audiomatch: removes a warning when compiling tests/audiomatch
the warning message:
warning: using floating point absolute value function
'fabs' when argument is of integer type
use FFABS to set the absolute value.

Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
2020-10-26 11:20:17 +08:00
Zane van Iperen 86267fccc6
fate: add adpcm_ima_alp encoding test 2020-10-25 23:44:27 +10:00
Michael Niedermayer 6939174bfc tests/fate/hevc: Add test for 3fbf873792
Tested-on: x86-32/64/ARM/MIPS Linux, Mingw/WINE 32/64
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-10-25 09:48:29 +01:00
Zane van Iperen 3106db044e
fate: add test for adpcm_swf in wav
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2020-10-21 11:26:39 +10:00
Tomas Härdin 86b485b5d6 fate-mxf-probe-applehdr10: Ignore endianness 2020-10-12 20:21:36 +02:00
Michael Niedermayer 2ad9c95c26 fate: Add aa-demux test
This should help fuzzer coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-10-10 13:08:24 +02:00
Peter Ross 9553c0b46a FATE/dnn: only run unit test when CONFIG_DNN enabled
Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
2020-10-09 08:35:45 +08:00
Mark Reid a48adcd136 libswcale/input: use more accurate planer rgb16 yuv conversions
These conversion appears to be exhibiting the same rounding error as the rgbf32 formats where.
I seperated the rounding value from the 16 and 128 offsets, I think it makes it a little more clear.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-10-06 17:56:52 +02:00
James Almer 214998c55f avcodec/av1dec: avoid probing with av1dec
av1dec should no longer attempt to output empty frames if another decoder
was used for probing and it sucessfully set a pix_fmt ever since 05872c67a4,
so we can re-add the AV_CODEC_CAP_AVOID_PROBING cap.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-10-06 11:28:12 -03:00
Mark Reid 453004fde6 libswcale/input: use more accurate rgbf32 yuv conversions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-10-02 14:59:52 +02:00
Mark Reid 6bf57c6a2a libswscale/tests: add floatimg_cmp test
changes since v1:
- made into fate test
- fixed c90 warnings
- tests more intermediate formats
- tested on BE mips too

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-10-02 14:59:52 +02:00
Nicolas George 3bf5cc9c58 fate: add scale filters for big-endian architectures.
Filters mostly work in native endianness, but they must output
a specified endianness, usually little: that requires a final
conversion for big endian.

I do not know what's the deal with gif-deal: inserting explicitly
the filters that are implicitly inserted result in less frames in
output. Probably a strange problem of duration.
2020-09-30 16:39:34 +02:00
Mingyu Yin ad2546e3b3 dnn/native: add native support for dense
Signed-off-by: Mingyu Yin <mingyu.yin@intel.com>
2020-09-29 14:19:55 +08:00
Andreas Rheinhardt e575d59afe tests/fate-run: Always overwrite output files for md5 tests
Otherwise the result of such tests will not accurately reflect the
current state.

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-27 09:51:31 +02:00
Jan Ekström 308882d9f2 avformat/movenc: use more fall-back values for average bit rate fields
If the average bit rate cannot be calculated, such as in the case
of streamed fragmented mp4, utilize various available parameters
in priority order.

Tests are updated where the esds or btrt or ISML manifest boxes'
output changes.
2020-09-22 18:25:44 +03:00
Jan Ekström 3838e8fc21 avformat/movenc: implement writing of the btrt box
This is utilized by various media ingests to figure out the bit
rate of the content you are pushing towards it, so write it for
video, audio and subtitle tracks in case at least one nonzero value
is available. It is only mentioned for timed metadata sample
descriptions in QTFF, so limit it only to ISOBMFF (MODE_MP4) mode.

Updates the FATE tests which have their results changed due to the
20 extra bytes being written per track.
2020-09-22 18:21:31 +03:00
Harry Mallon fe3a57f4ca avformat/mxfdec: Read Apple private Content Light Level from MXF
* As embedded by Apple Compressor

Signed-off-by: Harry Mallon <harry.mallon@codex.online>
2020-09-17 21:40:25 +02:00
Mark Reid 8ddcbebc3f libavcodec/exr: fix incorrect translation of denorm mantissa 2020-09-15 19:22:18 +02:00
Marton Balint 00117e28c1 avutil/timecode: fix av_timecode_get_smpte_from_framenum with 50/60 fps
SMPTE 12M timecode can only count frames up to 39, because the tens-of-frames
value is stored in 2 bit. In order to resolve this 50/60 fps SMPTE timecode is
using the field bit (which is the same bit as the phase correction bit) to
signal the least significant bit of a 50/60 fps timecode. See SMPTE ST
12-1:2014 section 12.1.

Therefore we slightly change the format of the return value of
av_timecode_get_smpte_from_framenum and AV_FRAME_DATA_S12M_TIMECODE and start
using the previously unused Phase Correction bit as Field bit. (As the SMPTE
standard suggests)

We add 50/60 fps support to av_timecode_get_smpte_from_framenum by calling the
recently added av_timecode_get_smpte function in it which already handles this
properly.

This change affects the decklink indev and the DV and MXF muxers. MXF has no
fate test for 50/60fps content, DV does, therefore the changes.

MediaInfo (a recent version) confirms that half-frame timecode must be inserted
to DV. MXFInspect confirms valid timecode insertion to the System Item of MXF
files. For MXF, also see EBU R122.

Note that for DV the field flag is not used because in the HDV specs (SMPTE
370M) it is still defined as biphase mark polarity correction flag. So it
should not matter that the DV muxer overrides the field bit.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-09-13 17:51:57 +02:00
Fei Wang 47be5a5056 avcodec: add AV1 hardware accelerated decoder
This AV1 decoder is currently only used for hardware accelerated decoding.
It can be extended into a native decoder in the future, so set its name to
"av1" and temporarily give it the lowest priority in the codec list.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-09-12 13:08:34 -03:00
Mark Reid 61d767f3a3 fate: use correct uint32 layer 2020-09-12 14:52:31 +02:00
Mark Reid 1c094563fe avcodec/exr: add support data windows larger or outside display window 2020-09-12 01:34:51 +02:00
Limin Wang c748bd77dc tests: fix warning ISO C90 forbids mixed declarations and code
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-09-10 20:34:51 +08:00
Xu Jun 3c7cad69f2 dnn_backend_native_layer_conv2d.c:Add mutithread function
Use pthread to multithread dnn_execute_layer_conv2d.
Can be tested with command "./ffmpeg_g -i input.png -vf \
format=yuvj420p,dnn_processing=dnn_backend=native:model= \
espcn.model:input=x:output=y:options=conv2d_threads=23 \
 -y sr_native.jpg -benchmark"

before patch: utime=11.238s stime=0.005s rtime=11.248s
after patch:  utime=20.817s stime=0.047s rtime=1.051s
on my 3900X 12c24t @4.2GHz

About the increase of utime, it's because that CPU HyperThreading
technology makes logical cores twice of physical cores while cpu's
counting performance improves less than double. And utime sums
all cpu's logical cores' runtime. As a result, using threads num
near cpu's logical core's number will double utime, while reduce
rtime less than half for HyperThreading CPUs.

Signed-off-by: Xu Jun <xujunzz@sjtu.edu.cn>
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2020-09-09 14:24:36 +08:00
Nicolas George ddba05afe4 lavfi/vsrc_testsrc: switch to activate.
Allow to set the EOF timestamp.

Also: doc/filters/testsrc*: specify the rounding of the duration option.

The changes in the ref files are right.

For filter-fps-down, the graph is testsrc2=r=7:d=3.5,fps=3.
3.5=24.5/7, so the EOF of testsrc2 will have PTS 25/7.
25/7=(10+5/7)/3, so the EOF PTS for fps should be 11/7,
and the output should contain a frame at PTS 10.

For filter-fps-up, the graph is testsrc2=r=3:d=2,fps=7,
for filter-fps-up-round-down and filter-fps-up-round-up
it is the same with explicit rounding options.
But there is no rounding: testsrc2 produces exactly 6 frames
and 2 seconds, fps converts it into exactly 14 frames.

The tests should probably be adjusted to restore them to
a useful coverage.
2020-09-08 14:39:43 +02:00
Nicolas George f08e024ac7 fate: disable automatic conversions on many tests.
Explicitly insert the scale or aresample filter where it would
have been inserted by the negotiation.
Re-enable conversions if it cannot be done easily.

If a conversion is needed in a test, we want to know about it.
If the negotiation changes and makes new conversion necessary,
we want to know about it even more.
2020-09-08 14:16:08 +02:00
Paul B Mahol 03415f25d2 fate: add wav chapters test 2020-09-07 19:04:09 +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
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
Ting Fu c8ba0daf8d dnn/native: add log error message
Signed-off-by: Ting Fu <ting.fu@intel.com>
2020-08-25 13:03:46 +08:00
Carl Eugen Hoyos b61376bdee lavfi/hflip: Support Bayer pixel formats.
Fixes part of ticket #8819.
2020-08-25 01:29:24 +02:00
Nicolas George 7969551a22 fate: remove "-v 0" from ffprobe tests. 2020-08-24 14:30:18 +02:00
Mingyu Yin 3477feb643 dnn_backend_native_layer_mathbinary: add floormod support
Signed-off-by: Mingyu Yin <mingyu.yin@intel.com>
2020-08-24 09:09:11 +08:00
Clément Bœsch 7d8eafab91 fate: add fate-sub-dvb test
The dvbsubtest_filter.ts sample is a filtered version of the Videolan
sample database (samples/sub/dvbsub/dvbsubtest.ts) using Project X. It
originates from ticket #8844.
2020-08-22 19:02:01 +02:00
Michael Bradshaw c5b20cfe19 avformat/movenc: write the colr atom by default
The write_colr flag has been marked as experimental for over 5 years.
It should be safe to enable its behavior by default as follows:

  - Write the colr atom by default for mp4/mov if any of the following:
     - The primaries/trc/matrix are all specified, OR
     - There is an ICC profile, OR
     - The user specified +write_colr
  - Keep the write_colr flag for situations where the user wants to
    write the colr atom even if the color info is unspecified (e.g.,
    http://ffmpeg.org/pipermail/ffmpeg-devel/2020-March/259334.html)

This fixes https://trac.ffmpeg.org/ticket/7961

Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
2020-08-21 10:01:58 -07:00
Limin Wang ab384d289d FATE: fix copy & paste for minterpolate test
Reported-by: Nicolas George <george@nsup.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-08-18 08:32:02 +08:00
Alexander Strasser ecd71916d1 lavc/aac_ac3_parser: fix potential overflow when averaging bitrate
The new code is analog to how it's done in our mpegaudio parser.

Acked-by: Jun Zhao <barryjzhao@tencent.com>
Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
2020-08-12 17:35:38 +02:00
Nicolas George 1201687da2 lavf/url: rewrite ff_make_absolute_url() using ff_url_decompose().
Also add and update some tests.

Change the semantic a little, because for filesytem paths
symlinks complicate things.
See the comments in the code for detail.

Fix trac tickets #8813 and 8814.
2020-08-12 16:45:21 +02:00
Nicolas George d853293679 lavf/url: add ff_url_decompose(). 2020-08-12 16:33:09 +02:00
Mingyu Yin 4ed6bca4ae dnn_backend_native_layer_mathunary: add round support
Signed-off-by: Mingyu Yin <mingyu.yin@intel.com>
Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
2020-08-12 10:30:46 +08:00
Ting Fu de5cb6c060 FATE/dnn: add unit test for dnn avgpool layer
'make fate-dnn-layer-avgpool' to run the test

Signed-off-by: Ting Fu <ting.fu@intel.com>
Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
2020-08-10 16:37:43 +08:00
Zane van Iperen 6fdf3cc53b
fate: cosmetics
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2020-08-07 23:14:29 +10:00