Commit Graph

79128 Commits

Author SHA1 Message Date
Petru Rares Sincraian
f707042c93 Added more tests to libavutil/parseutils.c
- Added tests for av_find_info_tag().
    - Added test for av_get_known_color_name()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-24 19:29:43 +01:00
Ico Doornekamp
e3e6a2cff4 avformat/rtpdec_jpeg: fix low contrast image on low quality setting
Original mail and my own followup on ffmpeg-user earlier today:

I have a device sending out a MJPEG/RTP stream on a low quality setting.
Decoding and displaying the video with libavformat results in a washed
out, low contrast, greyish image. Playing the same stream with VLC results
in proper color representation.

Screenshots for comparison:

  http://zevv.nl/div/libav/shot-ffplay.jpg
  http://zevv.nl/div/libav/shot-vlc.jpg

A pcap capture of a few seconds of video and SDP file for playing the
stream are available at

  http://zevv.nl/div/libav/mjpeg.pcap
  http://zevv.nl/div/libav/mjpeg.sdp

I believe the problem might be in the calculation of the quantization
tables in the function create_default_qtables(), the attached patch
solves the issue for me.

The problem is that the argument 'q' is of the type uint8_t. According to the
JPEG standard, if 1 <= q <= 50, the scale factor 'S' should be 5000 / Q.
Because the create_default_qtables() reuses the variable 'q' to store the
result of this calculation, for small values of q < 19, q wil subsequently
overflow and give wrong results in the calculated quantization tables. The
patch below uses a new variable 'S' (same name as in RFC2435) with the proper
range to store the result of the division.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-24 15:40:10 +01:00
Rostislav Pehlivanov
72e1360007 vc2enc: optimize and simplify quantization
Everything except ORing the sign is now done in the LUT.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-24 13:04:59 +00:00
Michael Niedermayer
26811fd946 avformat/mpegtsenc: Fix used service
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-24 12:35:19 +01:00
Michael Niedermayer
50d017a281 avformat/mpegtsenc: Keep track of the program for each service
Simplifies code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-24 12:27:23 +01:00
Petru Rares Sincraian
68e5976543 Refactor libavutil/parseutils.c
All tests were in the main method which produces a long main. Now, each test
is in his own method.

I think this produces a more clear code and follows more with the main
priority of FFmpeg "simplicity and small code size"

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-24 03:38:12 +01:00
Michael Niedermayer
fe3de6bc62 fate: Add test that also decodes packed_bframes.avi
No new reference samples are needed for this as the file already exists
for testing the bitstream filter

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-23 20:28:28 +01:00
Rostislav Pehlivanov
a14d4c076d vc2enc: simplify calc_slice_sizes()
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-23 18:04:05 +00:00
Rostislav Pehlivanov
a010e36f23 vc2enc: correctly zero out the slice size cache
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-23 17:52:53 +00:00
Rostislav Pehlivanov
14b41e061d vc2enc: macro out slice size rounding
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-23 17:52:53 +00:00
Ganesh Ajjanagadde
8dbffda0f9 lavc/psymodel: check for av_malloc failure
No idea why in commit 01ecb7172b the
checks were removed; this can lead to NULL pointer dereferences. This
effectively reverts that portion of the commit.

Reviewed-by: Benoit Fouet <benoit.fouet@free.fr>
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
2016-03-23 08:22:22 -07:00
Paul B Mahol
b098e1a469 avcodec/dvaudiodec: now that we got samples, fix 12bit case
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-03-23 09:32:34 +01:00
Rodger Combs
65cff81453 lavc: add AudioToolbox encoders
Fixes trac #4828
2016-03-22 12:43:14 -05:00
Rodger Combs
d5d328059e lavc: add AudioToolbox decoders
Part of trac #4828
2016-03-22 12:43:14 -05:00
Ganesh Ajjanagadde
db1a642cd2 all: move ff_exp10, ff_exp10f, ff_fast_powf to lavu/ffmath.h
The idea is to use ffmath.h for internal implementations of math functions.
Currently, it is used for variants of libm functions, but is by no means
limited to such things.

Note that this is not exported; use lavu/mathematics for such purposes.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
2016-03-22 10:15:31 -07:00
Petru Rares Sincraian
124526ba1a Added a selftest to libavutil/display.c
- Check if av_display_rotation_get() gets the correct degrees
    - Check if av_display_rotation_set() sets the correct matrix
    - Check if av_display_matrix_flip() changes correct the matrix

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-22 17:24:55 +01:00
Rostislav Pehlivanov
2aebdfb451 vc2enc: add non-experimental support for all video formats from spec
Until now, for formats which were in the spec but not in the encoder's
list of supported formats required the -strict -1 flag. This enables
support for all video formats which are specified, all the way from
QSIF525 to 8K.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-22 14:07:56 +00:00
Michael Niedermayer
914ad90edd swresample/swresample: Remove "less than" comparissions of enums
Found-by: wm4
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-22 14:20:12 +01:00
Carl Eugen Hoyos
ef888de1c1 lavf/img2dec: Skip COM when auto-detecting jpeg.
It could theoretically contain invalid data that gets ignored by decoders.
2016-03-22 11:13:24 +01:00
Michael Niedermayer
14478b6c38 fate: add audiomatch
Testset provided by Justin Greer <justin@zencoder.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-22 09:42:05 +01:00
Carl Eugen Hoyos
30d1213ecd configure: Remove (b)zlib and iconv dependencies for videoltoolbox encoder. 2016-03-22 01:30:33 +01:00
Thomas Volkert
b4f32c42ab rtpdec: support for VC-2 HQ RTP payload format (draft v1) 2016-03-22 00:17:12 +01:00
Lukasz Marek
df34b70098 ffplay: remove redundant silence buffer
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2016-03-22 00:04:21 +01:00
Michael Niedermayer
6e65b9bb1f avformat/utils: scan a bit farther for a keyframe in mpeg/mpegts (7 sec instead of 5, we already scan 90sec in some cases by default)
Fixes Ticket5305

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-21 20:46:29 +01:00
Rostislav Pehlivanov
d4773c94a6 vc2enc: simplify count_hq_slice() and caching
The count_hq_slice() function is always used with a SliceArgs struct

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-21 11:04:49 +00:00
Rostislav Pehlivanov
500dc20dee vc2enc: fix segfault
Fixes trac bug #5353

Uninitialized memory for the initial quantization index

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-21 11:01:01 +00:00
Neil Birkbeck
e7e5c5e6c4 lavf/matroskaenc.c: add early support for colour elements
Adding early support for a subset of the proposed colour elements
according to the latest version of spec:
https://mailarchive.ietf.org/arch/search/?email_list=cellar&gbt=1&index=hIKLhMdgTMTEwUTeA4ct38h0tmE

Like matroskadec, I've left out elements for pix_fmt related things
 as there still seems to be some discussion around these.

The new elements are exposed under strict experimental mode.

Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-21 00:10:18 +01:00
Paul B Mahol
8f66a2da38 avfilter/vf_vectorscope: always flip output vertically
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-03-20 21:10:45 +01:00
Marton Balint
65efcaeb84 avformat/mov: read start_pad from edit list start time if codec is aac
Related to ticket #2324, #2325.

Stream duration still need to be fixed...

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-03-20 19:51:28 +01:00
Marton Balint
25f707694c avformat/utils: increase detected start_time with skip_samples
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-03-20 19:51:05 +01:00
Marton Balint
48a96383fa tests/gapless: add gapless aac tests
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-03-20 19:50:15 +01:00
Clément Bœsch
8284a4ba11 lavf/dv: use c->sys->frame_size in dv_frame_offset()
dv_frame_offset() is static and called only from dv_read_seek(), where
c->sys->frame_size is already used.

This simplifies the incoming codecpar merge where
avctx->{coded_width,coded_height,time_base} are not accessible anymore.
2016-03-20 19:28:15 +01:00
Clément Bœsch
6c0cf11f38 lavf/dv: reindent after previous commit 2016-03-20 19:28:15 +01:00
Clément Bœsch
35ba5c424b lavf/dv: do not check for c->sys
dv_extract_video_info() is a static function called only from
avpriv_dv_produce_packet(), where c->sys is made sure to be set.
2016-03-20 14:25:16 +01:00
Michael Niedermayer
7916f04b89 ffplay: Remove "&& 0" from already disabled debug code
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-20 11:22:53 +01:00
Paul B Mahol
50f4b64c54 avfilter/vf_waveform: set color range for output frames
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-03-20 10:00:53 +01:00
Michael Niedermayer
0ffa9e6eba avformat/utils: Do not wait for more than 1 frame on attachments
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-19 22:58:34 +01:00
Michael Niedermayer
92dfeb5c31 avformat/wtvdec: Set AVFMTCTX_NOHEADER
Needed for noStreams.wtv unless something else forces continued parsing (like looking for more than 1
frame in attachments)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-19 22:58:34 +01:00
Paul B Mahol
959c7dad88 avfilter/vf_waveform: add graticule to aflat filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-03-19 21:47:15 +01:00
Paul B Mahol
c91b20c464 avfilter/vf_waveform: add subsampling input support for remaining filters
Remove achroma filter, as same output can be done with lowpass filter
and multiple components with overlay display.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-03-19 21:18:35 +01:00
Michael Niedermayer
efa98cdc2f avformat/file: Add crypto to default whitelist
Fixes Ticket5287

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-19 18:56:59 +01:00
Michael Niedermayer
068026b0f7 avcodec/mjpegenc_common: Store approximate aspect if exact cannot be stored
Fixes Ticket5244

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-19 16:00:11 +01:00
Michael Niedermayer
48bda6c5f7 avfilter/vf_detelecine: Remove redundant declaration
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-19 12:26:14 +01:00
Mark Thompson
fbec157ea0 lavc/hevc: Allow arbitrary garbage in bytestream as long as at least one NAL unit is found.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-19 12:25:24 +01:00
Benjamin Steffes
c411e90bc3 Fix start_frame handling in detelecine filter
Signed-off-by: Benjamin Steffes <benjaminst123@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-19 03:58:47 +01:00
Benjamin Steffes
be482e5165 Fix detelecine filter for patterns containing 1
Signed-off-by: Benjamin Steffes <benjaminst123@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-19 03:58:47 +01:00
Clément Bœsch
7af3f27008 lavf/srtdec: do not be strict wrt timing digit lengths
Fixes a sample with 3-length digits for the seconds reported by wm4.
2016-03-18 16:42:07 +01:00
Ganesh Ajjanagadde
bccc81dfa0 lavc/aacenc_utils: replace powf(x,y) by expf(logf(x), y)
This is ~2x faster for y not an integer on Haswell+GCC, and should
generally be faster due to the fact that anyway powf essentially does
this under the hood. Made an inline function in lavu/internal.h for this
purpose.

Note that there are some accuracy differences, that should generally be
negligible. In particular, FATE still passes on this platform.

Results in ~ 7% speedup in aac encoding with -march=native, Haswell+GCC.
before:
ffmpeg -i sin.flac -acodec aac -y sin_new.aac  6.05s user 0.06s system 104% cpu 5.821 total

after:
ffmpeg -i sin.flac -acodec aac -y sin_new.aac  5.67s user 0.03s system 105% cpu 5.416 total

This is also faster than an alternative approach that pulls in powf, gets rid of
the crufty NaN checks and other special cases, exploits knowledge about the intervals, etc.
This of course does not exclude smarter approaches; just suggests that
there would need to be significant work on this front of lower utility than
searches for hotspots elsewhere.

Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
2016-03-18 07:47:25 -07:00
Rostislav Pehlivanov
d6e76dd132 vc2enc_dwt: remove outdated comment
Support for Haar was added a month or so ago.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-18 14:42:33 +00:00
Mats Peterson
d8a1633ee4 lavf/avidec: Add blurb regarding the skipping of xxpc entries in the index
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-18 13:47:43 +01:00