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

77826 Commits

Author SHA1 Message Date
Clément Bœsch
77eeaa2c3d lavf/srtdec: rewrite parsing logic
Fixes Ticket #5032

The samples in Ticket #5032 is using \r\r\n as line breaks.  Since we
already are handling \r, or \n, or \r\n as line breaks, \r\n\n will be
considered as a double line breaks. This is an issue because
ff_subtitles_read_text_chunk() will as a result stop extracting a chunk
after just one line.

So instead of parsing the SRT by "chunks" (which means splitting every
double LB), this new parser is detecting timing lines, and split the
events on this basis. While this sounds safe and simple, it needs to
take into account the event number preceding the timing line while
handling situations such as:

 - event number starting at 0 or actually any number instead of 1
 - event numbers not being ordered at all
 - event number being followed by text garbage (this really happened,
   see Ticket #4898)
 - event payload containing one or multiple number (a protagonist saying
   a count-down, a date or whatever) which could be confused with a
   chapter number
 - event number being empty (see Ticket #2167)
 - all kind of weird line breaks can appear randomly like wild pokémons
 - untrustable line breaks (Ticket #5032)

The sample madness.srt tries to sum up most of this into one sample,
ticket5032-rrn.srt is the file containing \r\r\n line breaks. and
empty-events-2167.srt contains empty events.
2016-01-01 18:31:49 +01:00
Hendrik Leppkes
5236cf8718 Merge commit '5bc223b15d064e328ff90b0241fa1191f1d2786d'
* commit '5bc223b15d064e328ff90b0241fa1191f1d2786d':
  r3d: fix an invalid read introduced in 6bf4c1d

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 17:22:25 +01:00
Hendrik Leppkes
99f2a56388 Merge commit '64f8c439fd663fec4d57ac21af572d498fe21f7a'
* commit '64f8c439fd663fec4d57ac21af572d498fe21f7a':
  rtmpproto: Include the full path as app when "slist=" is found

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 17:21:32 +01:00
Hendrik Leppkes
a240aefc7a Merge commit '9f0b6e6827e21e3477abe1199dc2728e30b8c061'
* commit '9f0b6e6827e21e3477abe1199dc2728e30b8c061':
  vocdec: do not create the stream in read_header()

Not merged as it breaks FATE.

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 17:21:04 +01:00
Hendrik Leppkes
5c06fc4bd8 Merge commit '2d0432d918a71468419b7ac1e543ab3b399d3d37'
* commit '2d0432d918a71468419b7ac1e543ab3b399d3d37':
  vocdec: put the code not shared with other demuxers under appropriate ifdef

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 17:14:46 +01:00
Hendrik Leppkes
95daa9e09a Merge commit '09ae7b81ea2051eec2be9964296bd6ef492c6622'
* commit '09ae7b81ea2051eec2be9964296bd6ef492c6622':
  flvdec: do not create any streams in read_header()

Not merged. The demuxer issues warnings when a new stream is encountered
and reading the metadata requires that streams already exist.

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 17:13:28 +01:00
Michael Niedermayer
0b1e94c50a Revert "Merge commit '9f1eccb97bf8894cb18b14f642500686505ef186'"
This unbreaks muxing-encoding
Example:
ffmpeg -i matrixbench_mpeg2.mpg new.avi

-rw-r----- 1 michael michael 226035354 Jan  1 16:27 new.avi
-rw-r----- 1 michael michael  10016802 Jan  1 16:28 ref.avi

Also av_get_audio_frame_duration() itself uses frame_size

This reverts commit 29e6606e9b, reversing
changes made to 53448461a7.
2016-01-01 17:05:46 +01:00
Hendrik Leppkes
92fe2adc1b Merge commit 'de9e199a039473ebe4b1b87382e3064d0ea2cf02'
* commit 'de9e199a039473ebe4b1b87382e3064d0ea2cf02':
  lavc: make avpriv_mpa_decode_header private on next bump

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 17:05:37 +01:00
Hendrik Leppkes
a78d9abee0 Merge commit '72d658766e6ccf198317dffd6499c5e288847a1c'
* commit '72d658766e6ccf198317dffd6499c5e288847a1c':
  mp3dec: replace avpriv_mpa_decode_header with avpriv_mpegaudio_decode_header

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 16:57:40 +01:00
Hendrik Leppkes
42ff56e362 lavc: fix profile declarations for vdpau decoders 2016-01-01 16:48:47 +01:00
Hendrik Leppkes
1e96b151fa Merge commit '955aec3c7c7be39b659197e1ec379a09f2b7c41c'
* commit '955aec3c7c7be39b659197e1ec379a09f2b7c41c':
  mpegaudiodecheader: check the header in avpriv_mpegaudio_decode_header

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 16:47:27 +01:00
Hendrik Leppkes
15c60c8af2 Merge commit 'cea1eef25c3310a68dd327eb74aae14ad3c2ddef'
* commit 'cea1eef25c3310a68dd327eb74aae14ad3c2ddef':
  lavc: get the profile name through the codec descriptor in avcodec_string()

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 16:29:28 +01:00
Hendrik Leppkes
e760641720 lavc: add vp9 profiles to AVCodecDescriptor 2016-01-01 16:25:50 +01:00
Hendrik Leppkes
5e8b053452 Merge commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6'
* commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6':
  lavc: add profiles to AVCodecDescriptor

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 16:20:39 +01:00
Maxym Dmytrychenko
3b6473b43e qsvdec: properly handle the warning from MFXVideoCORE_SyncOperation
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-01 16:09:14 +01:00
Maxym Dmytrychenko
a43905f4ae qsvenc_hevc: improve the default settings
Use 8 B-frames and modify the GOP size to be a multiple of the B-frame
count.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-01 16:09:14 +01:00
Anton Khirnov
9d74012761 h264: improve behaviour with invalid reference lists
Before 741b494fa8, when the reference list
modification description was invalid, the code would substitute the
corresponding reference from the initial ("default") reference list.
After that commit, it will just return an error.

Since there are apparently invalid samples in the wild that used to play
fine with the old code, it is a good idea to re-add some sort of error
resilience here. So, when the reference list modification results in a
missing frame, substitute a previous reference frame for it. The
relevant sample again decodes fine with the same output as previously.
2016-01-01 16:09:14 +01:00
Hendrik Leppkes
5f2d12b824 Merge commit 'cdc9ce098e8d101b43b8f68dd35ba7226f4a728c'
* commit 'cdc9ce098e8d101b43b8f68dd35ba7226f4a728c':
  lavc: print the name of the codec, not its implementation, in avcodec_string

FFmpeg has already done this.

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 16:02:42 +01:00
Hendrik Leppkes
f6728a3ea2 Merge commit '6bf4c1d71199b92894f24db6386ed5070e590a16'
* commit '6bf4c1d71199b92894f24db6386ed5070e590a16':
  r3d: do not create the audio stream until we know the sample rate

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 15:59:30 +01:00
Hendrik Leppkes
29e6606e9b Merge commit '9f1eccb97bf8894cb18b14f642500686505ef186'
* commit '9f1eccb97bf8894cb18b14f642500686505ef186':
  ff_parse_specific_params: do not use AVCodecContext.frame_size

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 15:52:18 +01:00
Hendrik Leppkes
53448461a7 Merge commit '1f008f34d5b2b5f6217521747e7acfe3efc0e666'
* commit '1f008f34d5b2b5f6217521747e7acfe3efc0e666':
  rmenc: do not use AVCodecContext.frame_size

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 15:51:58 +01:00
Lou Logan
b47111b657 doc/filters: add showwavespic colorize example
Signed-off-by: Lou Logan <lou@lrcd.com>
2015-12-31 16:40:20 -09:00
Michael Niedermayer
3843e52cb4 avcodec/ffv1enc: Support AV_PIX_FMT_YA8
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-01 01:32:07 +01:00
Michael Niedermayer
48985576b1 avcodec/ffv1dec: Support AV_PIX_FMT_YA8
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-01 01:32:06 +01:00
Andreas Cadhalpun
7ea2db6eaf mjpegdec: extend check for incompatible values of s->rgb and s->ls
This can happen if s->ls changes from 0 to 1, but picture allocation is
skipped due to s->interlaced.

In that case ff_jpegls_decode_picture could be called even though the
s->picture_ptr frame has the wrong pixel format and thus a wrong
linesize, which results in a too small zero buffer being allocated.

This fixes an out-of-bounds read in ls_decode_line.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-31 17:30:25 +01:00
erankor
3f8564fe3c avformat/mov: support cenc (common encryption)
support reading encrypted mp4 using aes-ctr, conforming to ISO/IEC
23001-7.

a new parameter was added:
- decryption_key - 128 bit decryption key (hex)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-31 16:46:36 +01:00
Paul B Mahol
15e1fd9883 avfilter/avf_showspectrum: add window overlap support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-12-31 12:29:58 +01:00
Paul B Mahol
b98c58573b avfilter/avf_showspectrum: add fire color map
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-12-31 11:44:18 +01:00
Alexandra Hájková
40d9496773 dca: use defines for subband related constants
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2015-12-31 11:40:32 +01:00
Paul B Mahol
4160900899 avfilter/trim: support all channel numbers in atrim filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-12-31 09:14:17 +01:00
Ganesh Ajjanagadde
b492fbcc6e lavc/dsd_tablegen: always generate tables at runtime
Commit b272c3a5aa has sped up dsd_tablegen, and now table generation takes
~ 40k cycles. Thus, these tables can always be generated at runtime.

Tested with/without --enable-hardcoded-tables.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-30 20:37:13 -08:00
Thomas Mundt
73ce8162f3 avfilter/vf_scale: set proper out frame color range
Prevents that following scalers in the filter chain will do unintentional color range conversions.
Fixes Ticket #5096

Signed-off-by: Thomas Mundt <loudmax@yahoo.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-31 02:08:20 +01:00
Rostislav Pehlivanov
8de5b0d966 dirac_dwt: remove unnecessary undefs
They're all undefined within the template file.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-12-31 00:35:06 +00:00
yukari yakumo
f87e29a615 configure: support --cpu=host and Clang
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-30 23:14:31 +01:00
Paul B Mahol
0f387f2b62 avfilter/avf_showspectrum: add nebulae color map
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-12-30 21:28:52 +01:00
Vicente Olivert Riera
dde994751b mips: put "disable mipsfpu" in a better place for loongson
Let's disable the ISAs first, and then the core capabilities, as we do
for the rest of the cores. This way the code is better organized.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-30 20:21:57 +01:00
Vicente Olivert Riera
6a7e94cb14 mips: add mips32r6 architecture variant
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-30 20:21:45 +01:00
Michael Niedermayer
389ce22b5f avformat/movenc: Use strict_std_compliance from the muxer layer instead of the encoder layer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-12-30 20:06:04 +01:00
Paul B Mahol
2893dbfe2c avfilter/avf_showspectrum: add moreland color map
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-12-30 18:53:24 +01:00
Ganesh Ajjanagadde
05434b0eea lavc/cook: get rid of wasteful pow in init_pow2table
The table is highly structured, so pow (or exp2 for that matter) can entirely
be avoided, yielding a ~ 40x speedup with no loss of accuracy.

sample benchmark (Haswell, GNU/Linux):
new:
4449 decicycles in init_pow2table(loop 1000),     254 runs,      2 skips
4411 decicycles in init_pow2table(loop 1000),     510 runs,      2 skips
4391 decicycles in init_pow2table(loop 1000),    1022 runs,      2 skips

old:
183673 decicycles in init_pow2table(loop 1000),     256 runs,      0 skips
182142 decicycles in init_pow2table(loop 1000),     512 runs,      0 skips
182104 decicycles in init_pow2table(loop 1000),    1024 runs,      0 skips

Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-30 08:52:19 -08:00
Ganesh Ajjanagadde
b272c3a5aa lavc/dsd_tablegen: speed up table generation
Tables are bit identical.
Sample benchmark (Haswell, GNU/Linux+gcc):
old:
 814485 decicycles in dsd_ctables_tableinit,     512 runs,      0 skips

new:
 356808 decicycles in dsd_ctable_tableinit,     512 runs,      0 skips

Binary size should essentially be identical, and is in fact identical on
the configuration I tested on.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-30 08:45:19 -08:00
Ganesh Ajjanagadde
29bc293297 configure: make gcc 2 detection more robust
Solves an issue that will get triggered when gcc 20 rolls in.

Found-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-30 08:45:02 -08:00
Janne Grunau
8563f98871 x86: use emms after ff_int32_to_float_fmul_scalar_sse
Intel's Instruction Set Reference (as of September 2015) clearly states
that cvtpi2ps switches to MMX state. Actual CPUs do not switch if the
source is a memory location. The Instruction Set Reference from 1999
(Order Number 243191) describes this behaviour but all later versions
I've seen have make no distinction whether MMX registers or memory is
used as source.
The documentation for the matching SSE2 instruction to convert to double
(cvtpi2pd) was fixed (see the valgrind bug
https://bugs.kde.org/show_bug.cgi?id=210264).

It will take time to get a clarification and fixes in place. In the
meantime it makes sense to change ff_int32_to_float_fmul_scalar_sse to
be correct according to the documentation. The vast majority of users
will have SSE2 so a change to the SSE version has little effect.

Fixes fate-checkasm on x86 valgrind targets.

Valgrind 'bug' reported as https://bugs.kde.org/show_bug.cgi?id=357059
2015-12-30 13:37:57 +01:00
Paul B Mahol
b0e23f2a37 avfilter/avf_showspectrum: add rainbow colormap
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-12-29 19:53:38 +01:00
Andreas Cadhalpun
b4466c9c1a oggparsedaala: check number of planes in pixel format map
This fixes crashes caused by out-of-bounds writes.

Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-29 18:42:14 +01:00
Ganesh Ajjanagadde
4a44bc5588 ffprobe: avoid unnecessary pow and exp2 calls
These are just for prefixes and may be hardcoded easily; see lavu/eval
for this approach.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-29 08:59:16 -08:00
Carl Eugen Hoyos
e5c16e38fe ffserver: Cast time_t value when using it in a format string.
Fixes ticket #5103.
2015-12-29 16:00:34 +01:00
Mats Peterson
bd03ee1184 lavf/qtpalette: Treat 1-bit video as palettized
This commit for qtpalette.c and qtpalette.h adds 1-bit video to the
"palettized video" category, since if the video sample description
contains a palette, the two colors in the palette can be any color, not
necessarily black & white.

Unfortunately, I've noticed that the qtrle (QuickTime Animation) decoder
blindly assumes that 1-bit video is black & white. I don't have enough
knowledge about the decoder to fix this, though.

Below is a link to a sample 1-bit QuickTime Animation clip of a rotating
earth that uses blueish colors, and they will be correctly rendered in
QuickTime, but not in FFmpeg (which will use black & white).

https://drive.google.com/open?id=0B3_pEBoLs0faUlItWm9KaGJSTEE

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-29 13:12:18 +01:00
Mark Harris
c51c08e0e7 avcodec: Use get_ue_golomb_long() when needed
get_ue_golomb() cannot decode values larger than 8190 (the maximum
value that can be golomb encoded in 25 bits) and produces the error
"Invalid UE golomb code" if a larger value is encountered.  Use
get_ue_golomb_long() instead (which supports 63 bits, up to 4294967294)
when valid h264/hevc values can exceed 8190.

This updates decoding of the following values:   (maximum)
  first_mb_in_slice                                36863* for level 5.2
  abs_diff_pic_num_minus1                         131071
  difference_of_pic_nums_minus1                   131071
  idr_pic_id                                       65535
  recovery_frame_cnt                               65535
  frame_packing_arrangement_id                4294967294
  frame_packing_arrangement_repetition_period      16384
  display_orientation_repetition_period            16384

An alternative would be to modify get_ue_golomb() to handle encoded
values of up to 49 bits as was done for get_se_golomb() in a92816c.
In that case get_ue_golomb() could continue to be used for all of
these except frame_packing_arrangement_id.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-29 13:11:51 +01:00
Janne Grunau
f0f54117c8 checkasm: x86: post commit review fixes
Check the full FPU tag word instead of only the lower half and simplify
the comparison.
Use upper-case function base name as macro name to instantiate both
checked_call variants.
2015-12-29 12:50:38 +01:00