summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'Michael Niedermayer2015-04-20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25': lavc: Replace av_dlog and tprintf with internal macros Conflicts: libavcodec/aacdec.c libavcodec/audio_frame_queue.c libavcodec/bitstream.c libavcodec/dcadec.c libavcodec/dnxhddec.c libavcodec/dvbsubdec.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/get_bits.h libavcodec/gifdec.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_loopfilter.c libavcodec/h264_refs.c libavcodec/imc.c libavcodec/interplayvideo.c libavcodec/jpeglsdec.c libavcodec/libopencore-amr.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_parser.c libavcodec/pngdec.c libavcodec/ratecontrol.c libavcodec/rv10.c libavcodec/svq1dec.c libavcodec/vqavideo.c libavcodec/wmadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: Replace av_dlog and tprintf with internal macrosVittorio Giovara2015-04-19
| |
* | avcodec/mpeg4videodec: Use check_marker()Michael Niedermayer2015-04-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | alsdec: validate time diff indexAndreas Cadhalpun2015-04-19
| | | | | | | | | | | | | | | | | | | | If begin is smaller than t, the subtraction 'begin -= t' wraps around, because begin is unsigned. The same applies for end < t. This causes segmentation faults. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | wavpackenc: use put_sbits()James Almer2015-04-18
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | avcodec/g729dec: support decoding packets with multiple framesPaul B Mahol2015-04-17
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | alsdec: limit avctx->bits_per_raw_sample to 32Andreas Cadhalpun2015-04-18
| | | | | | | | | | | | | | | | avctx->bits_per_raw_sample is used in get_sbits_long, which only supports up to 32 bits. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/alsdec: Use av_mallocz_array() for chan_data to ensure the arrays ↵Michael Niedermayer2015-04-18
| | | | | | | | | | | | never contain random data Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | alsdec: ensure channel reordering is reversibleAndreas Cadhalpun2015-04-18
| | | | | | | | | | | | | | | | | | | | If the same idx is used for more than one i, at least one entry in sconf->chan_pos remains uninitialized. This can cause segmentation faults. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | proresenc_anatoliy: use put_sbits()James Almer2015-04-18
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | adpcm: use av_clip_intp2()James Almer2015-04-18
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | dca_xll: use av_clip_intp2()James Almer2015-04-18
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | dcaenc: use put_sbits()James Almer2015-04-18
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | aaccoder: use put_sbits()James Almer2015-04-18
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | avcodec/cabac: remove START/STOP_TIMER debug/benchmark codeMichael Niedermayer2015-04-18
| | | | | | | | | | Found-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for HEVC horizontal and ↵Shivraj Patil2015-04-17
| | | | | | | | | | | | | | | | 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>
* | avcodec/mpegaudiodec_template: use double to build csa tablesMichael Niedermayer2015-04-17
| | | | | | | | | | | | | | Fixes rounding difference between 32bit x86 and 64bit Fixes fate failure with gapless mp3 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/atrac3plusdsp: fix on stack alignmentMichael Niedermayer2015-04-17
| | | | | | | | Fixes fate failure on ARM
* | ac3: validate end in ff_ac3_bit_alloc_calc_maskAndreas Cadhalpun2015-04-16
| | | | | | | | | | | | | | | | | | | | | | 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>
* | aacpsy: avoid psy_band->threshold becoming NaNAndreas Cadhalpun2015-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | aasc: return correct buffer size from aasc_decode_frameAndreas Cadhalpun2015-04-16
| | | | | | | | | | Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | aacdec: consistently use avctx for logging in decode_eld_specific_configAndreas Cadhalpun2015-04-16
| | | | | | | | | | | | | | 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>
* | msrledec: use signed pixel_ptr in msrle_decode_pal4Andreas Cadhalpun2015-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | avcodec/h264_ps: Validate num_units_in_tick/time_scale before setting them ↵Michael Niedermayer2015-04-16
| | | | | | | | | | | | | | | | in the context This probably makes no big difference but it is more correct Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | h264: Do not fail on unsupported timing infoVittorio Giovara2015-04-16
| | | | | | | | | | | | | | | | | | | | 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>
* | aaccoder: Implement Perceptual Noise Substitution for AACRostislav Pehlivanov2015-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | avcodec/intelh263dec: Use check_marker()Michael Niedermayer2015-04-15
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'ec89f35e3e5eb9ec5221266e801efeee7ecab4df'Michael Niedermayer2015-04-15
|\| | | | | | | | | | | | | * commit 'ec89f35e3e5eb9ec5221266e801efeee7ecab4df': x265: Map color parameters Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * x265: Map color parametersLuca Barbato2015-04-15
| |
| * x264: Map color parametersLuca Barbato2015-04-15
| |
| * mpeg4videodec: Remove useless messageswm42015-04-14
| | | | | | | | | | | | | | 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>
* | avcodec/ituh263dec: Use check_marker()Michael Niedermayer2015-04-15
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc: use correct type for printf() argumentwm42015-04-14
| | | | | | | | | | | | This was passing uint32_t for %d. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat, avcodec: log discard paddingwm42015-04-14
| | | | | | | | | | | | Useful for debugging. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | aacdec: Use macros for constantsRostislav Pehlivanov2015-04-14
| | | | | | | | | | | | | | | | | | | | 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>
* | avcodec/mpeg12dec: Use check_marker()Michael Niedermayer2015-04-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/get_bits: print details of the location of the missing bit in ↵Michael Niedermayer2015-04-14
| | | | | | | | | | | | check_marker() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/alsdec: use av_malloc(z)_array()Paul B Mahol2015-04-14
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec/mpeg4videodec: Improve wording of the missing header warning messagesMichael Niedermayer2015-04-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/mpeg4videodec: change log level to waning for incomplete header messagesMichael Niedermayer2015-04-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '49e531ff4706279c7eed774f2c8b896942924ce2'Michael Niedermayer2015-04-14
|\| | | | | | | | | | | | | * commit '49e531ff4706279c7eed774f2c8b896942924ce2': mmal: Reference MMAL VC lib explicitly Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mmal: Reference MMAL VC lib explicitlywm42015-04-14
| | | | | | | | | | | | | | | | | | | | 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>
* | Merge commit '2de7650451d90520135d8cf6f96caa0658824208'Michael Niedermayer2015-04-14
|\| | | | | | | | | | | | | * commit '2de7650451d90520135d8cf6f96caa0658824208': mmal: Move system headers before local headers Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mmal: Move system headers before local headerswm42015-04-14
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | aacenc: Adjust the initial offset for PNS valuesRostislav Pehlivanov2015-04-14
| | | | | | | | | | | | | | | | | | This commit adjusts the intial offset for PNS values, introduced with commit f7f71b5795d708763eb0c55fe5e2cb051b2b69f4 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>
* | avcodec/atrac3plusdec: Free mdct contexts at the endMichael Niedermayer2015-04-14
| | | | | | | | | | | | Fixes memleak Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/ffv1: dont leave stale pointers in memoryMichael Niedermayer2015-04-13
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/ffv1: remove unneeded variableMichael Niedermayer2015-04-13
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/ffv1: use av_freep()Michael Niedermayer2015-04-13
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '73dacabfc9b9ef1fd2c08105fdab6238ee29c2fc'Michael Niedermayer2015-04-13
|\| | | | | | | | | | | | | | | | | | | * commit '73dacabfc9b9ef1fd2c08105fdab6238ee29c2fc': ffv1: Check memory allocations Conflicts: libavcodec/ffv1.c Merged-by: Michael Niedermayer <michaelni@gmx.at>