Commit Graph

31869 Commits

Author SHA1 Message Date
Michael Niedermayer e739cbb2bb avcodec/cabac: remove START/STOP_TIMER debug/benchmark code
Found-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-18 17:42:30 +02:00
Shivraj Patil 4efc0e6451 avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for HEVC horizontal and vertical mc functions
Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
Reviewed-by: Nedeljko Babic <Nedeljko.Babic@imgtec.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 17:39:32 +02:00
Michael Niedermayer 8768f8f4b9 avcodec/mpegaudiodec_template: use double to build csa tables
Fixes rounding difference between 32bit x86 and 64bit
Fixes fate failure with gapless mp3

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 13:50:37 +02:00
Michael Niedermayer 38f6726068 avcodec/atrac3plusdsp: fix on stack alignment
Fixes fate failure on ARM
2015-04-17 12:22:04 +02:00
Andreas Cadhalpun bc4fee7f2a ac3: validate end in ff_ac3_bit_alloc_calc_mask
This fixes an invalid read if end is 0:
     band_end   = ff_ac3_bin_to_band_tab[end-1] + 1;

Depending on what is before the array, this can cause stack smashing,
when band_end becomes too large.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-16 21:37:16 +02:00
Andreas Cadhalpun e224aa4191 aacpsy: avoid psy_band->threshold becoming NaN
If band->thr is 0.0f, the division is undefined, making norm_fac not a
number or infinity, which causes psy_band->threshold to become NaN.

This is passed on to other variables until it finally reaches
sce->sf_idx and is converted to an integer (-2147483648).

This causes a segmentation fault when it is used as array index.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: Claudio Freire <klaussfreire@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-16 20:28:55 +02:00
Andreas Cadhalpun 0be54ad280 aasc: return correct buffer size from aasc_decode_frame
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-16 19:19:09 +02:00
Andreas Cadhalpun 5b75689b98 aacdec: consistently use avctx for logging in decode_eld_specific_config
ac may be NULL and then accessing ac->avctx results in a segmentation fault.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-16 18:44:18 +02:00
Andreas Cadhalpun ae6fd7300b msrledec: use signed pixel_ptr in msrle_decode_pal4
This fixes segmentation faults, when pic->linesize[0] is negative.
In that case 'line * pic->linesize[0] + pixel_ptr' is treated as
unsigned and wraps around.

This reverts commit 7d78a964.
The problem was introduced in commit f7e1367f, which should obsolete
that commit.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-16 15:52:22 +02:00
Michael Niedermayer c658269cd1 avcodec/h264_ps: Validate num_units_in_tick/time_scale before setting them in the context
This probably makes no big difference but it is more correct

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-16 03:41:41 +02:00
Vittorio Giovara 7498f2221e h264: Do not fail on unsupported timing info
The spec madandate both time_scale and num_units_in_tick greater than 0,
however since they are not essential for decoding, just ignore the whole
block and try to finish parsing the VUI.

Related to Ticket4445.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-04-16 03:41:41 +02:00
Rostislav Pehlivanov c5d4f87e81 aaccoder: Implement Perceptual Noise Substitution for AAC
This commit implements the perceptual noise substitution AAC extension. This is a proof of concept
implementation, and as such, is not enabled by default. This is the fourth revision of this patch,
made after some problems were noted out. Any changes made since the previous revisions have been indicated.

In order to extend the encoder to use an additional codebook, the array holding each codebook has been
modified with two additional entries - 13 for the NOISE_BT codebook and 12 which has a placeholder function.
The cost system was modified to skip the 12th entry using an array to map the input and outputs it has. It
also does not accept using the 13th codebook for any band which is not marked as containing noise, thereby
restricting its ability to arbitrarily choose it for bands. The use of arrays allows the system to be easily
extended to allow for intensity stereo encoding, which uses additional codebooks.

The 12th entry in the codebook function array points to a function which stops the execution of the program
by calling an assert with an always 'false' argument. It was pointed out in an email discussion with
Claudio Freire that having a 'NULL' entry can result in unexpected behaviour and could be used as
a security hole. There is no danger of this function being called during encoding due to the codebook maps introduced.

Another change from version 1 of the patch is the addition of an argument to the encoder, '-aac_pns' to
enable and disable the PNS. This currently defaults to disable the PNS, as it is experimental.
The switch will be removed in the future, when the algorithm to select noise bands has been improved.
The current algorithm simply compares the energy to the threshold (multiplied by a constant) to determine
noise, however the FFPsyBand structure contains other useful figures to determine which bands carry noise more accurately.

Some of the sample files provided triggered an assertion when the parameter to tune the threshold was set to
a value of '2.2'. Claudio Freire reported the problem's source could be in the range of the scalefactor
indices for noise and advised to measure the minimal index and clip anything above the maximum allowed
value. This has been implemented and all the files which used to trigger the asserion now encode without error.

The third revision of the problem also removes unneded variabes and comparisons. All of them were
redundant and were of little use for when the PNS implementation would be extended.

The fourth revision moved the clipping of the noise scalefactors outside the second loop of the two-loop
algorithm in order to prevent their redundant calculations. Also, freq_mult has been changed to a float
variable due to the fact that rounding errors can prove to be a problem at low frequencies.
Considerations were taken whether the entire expression could be evaluated inside the expression
, but in the end it was decided that it would be for the best if just the type of the variable were
to change. Claudio Freire reported the two problems. There is no change of functionality
(except for low sampling frequencies) so the spectral demonstrations at the end of this commit's message were not updated.

Finally, the way energy values are converted to scalefactor indices has changed since the first commit,
as per the suggestion of Claudio Freire. This may still have some drawbacks, but unlike the first commit
it works without having redundant offsets and outputs what the decoder expects to have, in terms of the
ranges of the scalefactor indices.

Some spectral comparisons: https://trac.ffmpeg.org/attachment/wiki/Encode/AAC/Original.png (original),
https://trac.ffmpeg.org/attachment/wiki/Encode/AAC/PNS_NO.png (encoded without PNS),
https://trac.ffmpeg.org/attachment/wiki/Encode/AAC/PNS1.2.png (encoded with PNS, const = 1.2),
https://trac.ffmpeg.org/attachment/wiki/Encode/AAC/Difference1.png (spectral difference).
The constant is the value which multiplies the threshold when it gets compared to the energy, larger
values means more noise will be substituded by PNS values. Example when const = 2.2:
https://trac.ffmpeg.org/attachment/wiki/Encode/AAC/PNS_2.2.png

Reviewed-by: Claudio Freire <klaussfreire@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-15 19:59:44 +02:00
Michael Niedermayer 574978d2bd avcodec/intelh263dec: Use check_marker()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-15 18:53:55 +02:00
Michael Niedermayer 0842df2619 Merge commit 'ec89f35e3e5eb9ec5221266e801efeee7ecab4df'
* commit 'ec89f35e3e5eb9ec5221266e801efeee7ecab4df':
  x265: Map color parameters

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-15 11:57:38 +02:00
Luca Barbato ec89f35e3e x265: Map color parameters 2015-04-15 09:48:48 +02:00
Luca Barbato 0cbb147317 x264: Map color parameters 2015-04-15 09:48:47 +02:00
Michael Niedermayer fbdaebb298 avcodec/ituh263dec: Use check_marker()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-15 03:22:27 +02:00
wm4 95f524aff5 lavc: use correct type for printf() argument
This was passing uint32_t for %d.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-14 21:45:07 +02:00
wm4 2b5f34f788 avformat, avcodec: log discard padding
Useful for debugging.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-14 21:37:46 +02:00
Rostislav Pehlivanov a61c75e9f7 aacdec: Use macros for constants
This commit replaces the previous hardcoded constants with both new and previously
defined macros from aac.h. This change makes it easy for anyone reading the code
to know how encoding and decoding scalefactors works. It's also possibly
a step in unifying some of the code across both the encoder and decoder.

Reviewed-by: Claudio Freire <klaussfreire@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-14 18:04:02 +02:00
Michael Niedermayer 37d93fdbf0 avcodec/mpeg12dec: Use check_marker()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-14 15:30:39 +02:00
Michael Niedermayer 343f34c0b8 avcodec/get_bits: print details of the location of the missing bit in check_marker()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-14 15:30:39 +02:00
Paul B Mahol c2fc466351 avcodec/alsdec: use av_malloc(z)_array()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-04-14 13:06:15 +00:00
Michael Niedermayer 4ba662b032 avcodec/mpeg4videodec: Improve wording of the missing header warning messages
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-14 14:41:11 +02:00
Michael Niedermayer bca1577ed3 avcodec/mpeg4videodec: change log level to waning for incomplete header messages
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-14 14:12:38 +02:00
Michael Niedermayer 6e86ee97c8 Merge commit '49e531ff4706279c7eed774f2c8b896942924ce2'
* commit '49e531ff4706279c7eed774f2c8b896942924ce2':
  mmal: Reference MMAL VC lib explicitly

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-14 13:40:58 +02:00
Michael Niedermayer 7c521d4528 Merge commit '2de7650451d90520135d8cf6f96caa0658824208'
* commit '2de7650451d90520135d8cf6f96caa0658824208':
  mmal: Move system headers before local headers

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-14 13:28:29 +02:00
wm4 13e4f2c7f7 mpeg4videodec: Remove useless messages
They seem to sometimes trigger with old AVI files. They are just
confusing, do not help anyone, and use sloppy language.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2015-04-14 12:32:43 +02:00
wm4 49e531ff47 mmal: Reference MMAL VC lib explicitly
This is optional, but ensures that linking with -Wl,--as-needed does not
drop the library containing the MMAL VC driver. The driver normally
"registers" itself in the library constructor, but since no symbols are
explicitly referenced, the linker could remove it with --as-needed
enabled.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2015-04-14 12:32:13 +02:00
wm4 2de7650451 mmal: Move system headers before local headers
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2015-04-14 12:32:10 +02:00
Rostislav Pehlivanov 013498ba15 aacenc: Adjust the initial offset for PNS values
This commit adjusts the intial offset for PNS values, introduced
with commit f7f71b5795 earlier. This
commit shifts the value in such a way that no further offsets are
required in the aaccoder.c file. Earlier version of the PNS patch had 2 offsets in both the aaccoder and aacenc.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-14 03:42:57 +02:00
Michael Niedermayer 89b3c5215a avcodec/atrac3plusdec: Free mdct contexts at the end
Fixes memleak

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-14 02:31:37 +02:00
Michael Niedermayer 4d74c8d550 avcodec/ffv1: dont leave stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-13 20:08:42 +02:00
Michael Niedermayer d19fc69f15 avcodec/ffv1: remove unneeded variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-13 20:07:45 +02:00
Michael Niedermayer a3963cc8ec avcodec/ffv1: use av_freep()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-13 20:05:56 +02:00
Michael Niedermayer fb6dd77000 Merge commit '73dacabfc9b9ef1fd2c08105fdab6238ee29c2fc'
* commit '73dacabfc9b9ef1fd2c08105fdab6238ee29c2fc':
  ffv1: Check memory allocations

Conflicts:
	libavcodec/ffv1.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-13 19:59:41 +02:00
Vittorio Giovara 73dacabfc9 ffv1: Check memory allocations
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2015-04-13 17:51:31 +02:00
wm4 f4f3065c69 h264: remove bogus YCgCo warning message
YCgCo decoding works just fine. It depends on the API user what is done
with the output. Some API users might support it, some not. Some users
might support it under certain circumstances only.

It is not the job of the decoder to print this message. If the API user
supports it, this message is extremely unhelpful.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-13 13:46:38 +02:00
Rostislav Pehlivanov f7f71b5795 aacenc: Add support for Perceptual Noise Substitution energy values
This commit implements support for writing the noise energy values used in PNS.
The difference between regular scalefactors and noise energy values is that the latter
require a small preamble (NOISE_PRE + energy_value_diff) to be written as the first
noise-containing band. Any following noise energy values use the previous one to
base their "diff" on. Ordinary scalefactors remain unchanged other than that they ignore the noise values.

This commit should not change anything by itself, the following commits will bring it in use.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-13 04:14:27 +02:00
James Almer bbdb50d7a8 libx265: print supported presets and tunes on error
Based on code from libavcodec/libx264.c

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-04-11 11:13:28 -04:00
Timothy Gu 744594685e cabac-test: Return 1 if there are any errors
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-10 21:49:37 +02:00
James Almer 61090db29a avcodec/libx265: print supported presets and tunes on error
Based on code from libavcodec/libx264.c

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-04-10 16:47:29 -03:00
Michael Niedermayer bc48c88918 avcodec/h264: Do not fail with randomly truncated VUIs
Fixes Ticket4445

Tested-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-10 18:35:07 +02:00
Michael Niedermayer 599dc8fee1 avcodec/hqx: Use av_clip_uintp2()
Suggested-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-10 12:38:03 +02:00
James Almer 3553b815f6 avcodec/libdcadec: honor AVCodecContext bitexact flag
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-04-09 22:37:39 -03:00
Ferdinand Oeinck eff72a6c73 libavcodec/hqx: multi threading support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-10 03:11:40 +02:00
Michael Niedermayer 72a580268f Merge commit '5980c924e309ae1dde8bd52d9938f94ff02602eb'
* commit '5980c924e309ae1dde8bd52d9938f94ff02602eb':
  dnxhd: Log the selected profile id

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-09 20:26:18 +02:00
Michael Niedermayer 9fd3d9acf7 Merge commit 'f8fd0c29ce5dc7d4be13e7e89d0f1e8a035ae71b'
* commit 'f8fd0c29ce5dc7d4be13e7e89d0f1e8a035ae71b':
  v210: Fix typo in header guards

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-09 20:09:10 +02:00
Timo Rothenpieler 7b0689c55f avcodec/nvenc: Add options for level and tier
Previous version reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-09 18:20:26 +02:00
Michael Niedermayer 7be2d2a70c avcodec/h264: Use only one ERContext
This fixes slice threads with error concealment

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-09 17:42:04 +02:00
Ferdinand Oeinck 0266988ccd hqx: Fix clipping error in idct put function
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-04-09 13:52:04 +02:00
Vittorio Giovara 5980c924e3 dnxhd: Log the selected profile id 2015-04-09 13:51:58 +02:00
Michael Niedermayer 98d0c4236c avcodec/h264: Be more tolerant to changing pps id between slices
Fixes Ticket4446

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-09 13:50:07 +02:00
Vittorio Giovara f8fd0c29ce v210: Fix typo in header guards 2015-04-09 13:40:44 +02:00
Michael Niedermayer e88b3852ae avcodec/aacdec: Fix storing state before PCE decode
Fixes Ticket4460

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-09 00:42:25 +02:00
Michael Niedermayer 32e06c485b avcodec/h264_ps: Move truncation check from VUI to SPS
This more completely checks for truncation

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-08 22:19:56 +02:00
Michael Niedermayer edaca0812a Merge commit 'bb815dfc38b8ef7a89d6b9684ce0cdc296385d6d'
* commit 'bb815dfc38b8ef7a89d6b9684ce0cdc296385d6d':
  g2meet: K&R formatting cosmetics

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-08 20:48:44 +02:00
Diego Biurrun bb815dfc38 g2meet: K&R formatting cosmetics 2015-04-08 14:23:36 +02:00
Michael Niedermayer 845ab37b05 avcodec/h264_slice: Fix uninitialized variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-08 13:05:38 +02:00
Michael Niedermayer 386601286f avcodec/h264_slice: Dont reset mb_aff_frame per slice
Fixes null pointer dereference
Fixes Ticket4440

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-08 12:29:47 +02:00
Michael Niedermayer 795199fca4 avcodec/h264: use consistent argument name in MB_FIELD() macro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-08 12:29:17 +02:00
ferdo@bigroses.nl 92f94fd5dd libavcodec/hqx: correct clipping error
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-08 09:53:59 +02:00
Michael Niedermayer c4b2017ba6 avcodec/h264: finish previous slices before switching to single thread mode
Fixes null pointer dereference
Fixes Ticket4438

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-07 02:47:36 +02:00
Michael Niedermayer 43b434210e avcodec/h264: Fix race between slices where one overwrites data from the next
Fixes non deterministic crash in ticket4408/fuzz2.264
Likely fixes other samples as well

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-07 00:40:21 +02:00
Michael Niedermayer 7ddbb4e23a avcodec/pthread_frame: Fix memleak with frame threads and allocated AVOptions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-06 18:43:38 +02:00
Michael Niedermayer a66dcfeedc avcodec/vc1dec: Check buf2 for malloc failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-06 15:06:42 +02:00
Michael Niedermayer 99a567cbe2 Merge commit '249796e2560c2cce1add722c3e873de96b17be74'
* commit '249796e2560c2cce1add722c3e873de96b17be74':
  svq3: initialize some required H264Context fields.

See: e6c710600e
See: aa000ddab2
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-06 01:41:00 +02:00
Michael Niedermayer be920e4820 Merge commit '5637ff01218a44fcc1fff9b4382a15a6470abcc9'
* commit '5637ff01218a44fcc1fff9b4382a15a6470abcc9':
  libavcodec: Clarify the documentation of the internal codec capability flags

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 22:35:19 +02:00
Michael Niedermayer 39c6834c12 Merge commit 'bd737b5178f361a9b592691848f29a7a79603a7e'
* commit 'bd737b5178f361a9b592691848f29a7a79603a7e':
  h264: reset the private data in init_thread_copy()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 22:25:29 +02:00
Michael Niedermayer 097efa4750 Merge commit 'a939e5b2527d0c4628815b1d3d8e29ee921227e8'
* commit 'a939e5b2527d0c4628815b1d3d8e29ee921227e8':
  h264: remove a commented out nonsense line

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 22:18:43 +02:00
Michael Niedermayer aa000ddab2 avcodec/svq3: add scaling matrix init that was removed from h264 init
This is needed for svq3

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 22:17:50 +02:00
Michael Niedermayer 80a76905eb Merge commit '65afa65e7393e7745427e267d6c6ca814c7c8b45'
* commit '65afa65e7393e7745427e267d6c6ca814c7c8b45':
  h264: drop redundant initialization of the scaling matrices

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 22:04:58 +02:00
Michael Niedermayer abae926ef8 Merge commit 'e1f907711a91e5ce19402a1831cfbe8f709b67f7'
* commit 'e1f907711a91e5ce19402a1831cfbe8f709b67f7':
  h264: factor out common code from init() and init_thread_copy()

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 21:56:50 +02:00
Michael Niedermayer e6c710600e avcodec/svq3: add initialization which was removed from h264 init
This is needed for the svq3 code to work

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 21:36:07 +02:00
Michael Niedermayer 14d241b19d Merge commit '43fd3dd80ca2d1c2ccf6a7b7632db544c809c690'
* commit '43fd3dd80ca2d1c2ccf6a7b7632db544c809c690':
  h264: drop redundant initialization in init()

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 21:11:25 +02:00
Anton Khirnov 249796e256 svq3: initialize some required H264Context fields.
They are no longer initialized in ff_h264_decode_init() since 43fd3dd,
so svq3 needs to initialize the manually.

Fixes svq3 decoding, broken since 43fd3dd.
2015-04-05 21:02:56 +02:00
Michael Niedermayer 68f4840606 Merge commit '050324d020f843ce333276ebb6f27cc6026f37d0'
* commit '050324d020f843ce333276ebb6f27cc6026f37d0':
  h264: initialize cur_chroma_format_idc

See: a51fbb56bb / 137df692fc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 21:02:13 +02:00
Michael Niedermayer cde98920da Merge commit '84f226a3bcd8b39801a4c9051c033ab7d61aaf76'
* commit '84f226a3bcd8b39801a4c9051c033ab7d61aaf76':
  h264: use the correct SPS during PPS parsing

Conflicts:
	libavcodec/h264_ps.c

See: dc35b77b28
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 20:48:14 +02:00
Martin Storsjö 5637ff0121 libavcodec: Clarify the documentation of the internal codec capability flags
The previous documentation was very vague and almost misleading.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-04-05 20:47:50 +03:00
Michael Niedermayer 31048d48b0 avcodec/libx265: export chosen picture types
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-04-05 12:32:07 -04:00
Andreas Cadhalpun 71fa0aa085 mpeg4: suggest mpeg4_unpack_bframes bsf instead of avidemux/VirtualDub
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 15:21:20 +02:00
Michael Niedermayer cf880ccb6a avcodec/error_resilience: Avoid race with updating the error_count
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 13:32:09 +02:00
Anton Khirnov bd737b5178 h264: reset the private data in init_thread_copy()
The generic code copies the main context's private data to all the
others. However that is quite dangerous, as it might end up copying some
pointers that are or will become invalid.

Since everything we actually need will be copied later in
update_thread_context(), it's safest to zero the private data in
init_thread_copy(), so it works the same way as init for the main
context.
2015-04-05 12:03:07 +02:00
Anton Khirnov a939e5b252 h264: remove a commented out nonsense line 2015-04-05 12:03:02 +02:00
Anton Khirnov 65afa65e73 h264: drop redundant initialization of the scaling matrices
It will always be initialized when actually parsing the PPS.
2015-04-05 12:02:57 +02:00
Anton Khirnov e1f907711a h264: factor out common code from init() and init_thread_copy() 2015-04-05 12:02:35 +02:00
Anton Khirnov 43fd3dd80c h264: drop redundant initialization in init()
There is no real advantage to initializing any of those in init,
assuming yuv420, before the real stream parameters are known.
2015-04-05 12:02:26 +02:00
Anton Khirnov 050324d020 h264: initialize cur_chroma_format_idc
This makes sure the various DSP contexts get properly initialized in
ff_h264_set_parameter_from_sps() whatever the value of
raw_bits_per_sample.
2015-04-05 12:02:20 +02:00
Anton Khirnov 84f226a3bc h264: use the correct SPS during PPS parsing
There is in general no reason for the currently active SPS to be the one
referenced by the PPS being parsed.
2015-04-05 12:01:34 +02:00
Andreas Cadhalpun 0224b35c89 avcodec: add unpack packed B-frames bitstream filter
Fixes Ticket #2913

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-05 02:24:56 +02:00
Michael Niedermayer aa6f58dd96 avcodec/h264_refs: More completely clear slice contexts in ff_h264_remove_all_refs()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-04 19:30:10 +02:00
Michael Niedermayer fc58d5c43b avcodec/h264: Fail for invalid mixed IDR / non IDR frames in slice threading mode
Fixes Ticket4408

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-04 19:28:33 +02:00
Michael Niedermayer 60e7d2d7b9 avcodec/h264_mb: assert that frame waiting code actually references 2 fields/1 frame
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-04 18:34:36 +02:00
Michael Niedermayer 429de04320 avcodec/h264_refs: Do not set reference to things which dont exist
Fixes deadlock
Fixes Ticket4428
Fixes Ticket4429

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-04 18:25:44 +02:00
Michael Niedermayer 98c5db89bb avcodec/h264_slice: make current_slice reset code more strict
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-04 17:00:12 +02:00
Michael Niedermayer 514d9bb55d avcodec/h264: use goto end instead of return for hwaccel fails as well
This is more correct

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-04 14:40:40 +02:00
Andreas Cadhalpun f62880bfb8 mpeg4: use a self-explanatory #define MAX_NVOP_SIZE
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-04 02:23:58 +02:00
Michael Niedermayer 333eb37a96 avcodec/h264: silence ER warning when no slice threads are used
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-04 02:15:16 +02:00
Michael Niedermayer 4b7356ce8f avcodec/h264: reenable ER except with slice threads by default
ER with slice threads is buggy and since the merge of the libav cleanup broken
as the ER context which is supposed to be per frame has been placed in
the slice context, so there are multiple per frame which does not work as is.

Theres no bug report about ER with frame threads. If someone knows of a
case where it crashes / fails without slice threads please mail me and
open a ticket on trac.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-04 01:43:14 +02:00
Michael Niedermayer 6da7625cc3 Merge commit 'a4d34e218f548d381e09c483e8dc6ad18a8d571c'
* commit 'a4d34e218f548d381e09c483e8dc6ad18a8d571c':
  h264: disable ER by default

Conflicts:
	libavcodec/h264.c
	libavcodec/h264_picture.c
	libavcodec/h264_slice.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-04 00:52:54 +02:00