summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* aacenc: add support for changing options based on a profileRostislav Pehlivanov2015-10-12
| | | | | | | | | | | | | | | | | | | | This commit adds the ability for a profile to set the default options, as well as for the user to override such options by simply stating them in the command line while still keeping the same profile, as long as those options are still permitted by the profile. Example: setting the profile to aac_low (the default) will turn PNS and IS on. They can be disabled by -aac_pns 0 and -aac_is 0, respectively. Turning on -aac_pred 1 will cause the profile to be elevated to aac_main, as long as no options forbidding aac_main have been entered (like AAC-LTP, which will be pushed soon). A useful feature is that by setting the profile to mpeg2_aac_low, all MPEG4 features will be disabled and if the user tries to enable them then the program will exit with an error. This profile is signalled with the same bitstream as aac_low (MPEG4) but some devices and decoders will fail if any MPEG4 features have been enabled.
* aacenc: add support for encoding 7.1 channel audioRostislav Pehlivanov2015-10-12
| | | | | | | This commit implements support for 7.1 channel audio. There's no more predefined bitstream channel mappings so going beyond 8 channels (and 7 channels exactly) will require programmable channel elements, which is already underway.
* aacenc_quantization: fix header descriptionRostislav Pehlivanov2015-10-12
| | | | Two guesses as to which file was used as boilerplate.
* AAC encoder: memoize quantize_band_costClaudio Freire2015-10-12
| | | | | | | | | | The bulk of calls to quantize_band_cost are replaced by a call to a version that memoizes, greatly improving performance, since during coefficient search there is a great deal of repeat work. Memoization cannot always be applied, so do this in a different function, and leave the original as-is.
* AAC encoder: fix assertion error re SF differencesClaudio Freire2015-10-11
| | | | | | | | Intermediate results can indeed violate SF delta. Instead of asserting there, just make the code safe, and assert on the final result. Also re-clamp SFs more often in short windows (which tend to violate the restriction when encoding the switch from one window to the other)
* aaccoder_twoloop.h: simplify and comment ff_pns_bits()Rostislav Pehlivanov2015-10-12
|
* aacenc_utils: add 'inline' flag to find_form_factor, silence warningRostislav Pehlivanov2015-10-12
| | | | Seems it was forgotten.
* avcodec: remove leftover iff_byterun1 decoderAndreas Cadhalpun2015-10-12
| | | | | | | | | | | It was merged with the iff_ilbm decoder in commit 929a24efff9a208a52748605eb412ffb915c1403. Define AV_CODEC_ID_IFF_BYTERUN1 as AV_CODEC_ID_IFF_ILBM for API compatibility. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* intmath: remove av_ctz.Ronald S. Bultje2015-10-11
| | | | | It's a non-installed header and only used in one place (flacenc). Since ff_ctz is static inline, it's fine to use that instead.
* AAC encoder: cosmetics from last commitClaudio Freire2015-10-11
| | | | Reindent
* AAC encoder: Extensive improvementsClaudio Freire2015-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This finalizes merging of the work in the patches in ticket #2686. Improvements to twoloop and RC logic are extensive. The non-exhaustive list of twoloop improvments includes: - Tweaks to distortion limits on the RD optimization phase of twoloop - Deeper search in twoloop - PNS information marking to let twoloop decide when to use it (turned out having the decision made separately wasn't working) - Tonal band detection and priorization - Better band energy conservation rules - Strict hole avoidance For rate control: - Use psymodel's bit allocation to allow proper use of the bit reservoir. Don't work against the bit reservoir by moving lambda in the opposite direction when psymodel decides to allocate more/less bits to a frame. - Retry the encode if the effective rate lies outside a reasonable margin of psymodel's allocation or the selected ABR. - Log average lambda at the end. Useful info for everyone, but especially for tuning of the various encoder constants that relate to lambda feedback. Psy: - Do not apply lowpass with a FIR filter, instead just let the coder zero bands above the cutoff. The FIR filter induces group delay, and while zeroing bands causes ripple, it's lost in the quantization noise. - Experimental VBR bit allocation code - Tweak automatic lowpass filter threshold to maximize audio bandwidth at all bitrates while still providing acceptable, stable quality. I/S: - Phase decision fixes. Unrelated to #2686, but the bugs only surfaced when the merge was finalized. Measure I/S band energy accounting for phase, and prevent I/S and M/S from being applied both. PNS: - Avoid marking short bands with PNS when they're part of a window group in which there's a large variation of energy from one window to the next. PNS can't preserve those and the effect is extremely noticeable. M/S: - Implement BMLD protection similar to the specified in ISO-IEC/13818:7-2003, Appendix C Section 6.1. Since M/S decision doesn't conform to section 6.1, a different method had to be implemented, but should provide equivalent protection. - Move the decision logic closer to the method specified in ISO-IEC/13818:7-2003, Appendix C Section 6.1. Specifically, make sure M/S needs less bits than dual stereo. - Don't apply M/S in bands that are using I/S Now, this of course needed adjustments in the compare targets and fuzz factors of the AAC encoder's fate tests, but if wondering why the targets go up (more distortion), consider the previous coder was using too many bits on LF content (far more than required by psy), and thus those signals will now be more distorted, not less. The extra distortion isn't audible though, I carried extensive ABX testing to make sure. A very similar patch was also extensively tested by Kamendo2 in the context of #2686.
* avcodec/sipr: use AVERROR return code instead of -1Paul B Mahol2015-10-11
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/pngdec: Use av_malloc_array()Michael Niedermayer2015-10-11
| | | | | Suggested-by: ubitux Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Check that step_x/y are valid before use in ↵Michael Niedermayer2015-10-11
| | | | | | | | JPEG2000_PGOD_PCRL Fixes: CID1322305 and CID1322304 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pngdec: Alloc buffer after blend_op check in handle_p_frame_apng()Michael Niedermayer2015-10-11
| | | | | | | Avoids memleak on error Fixes CID1322342 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pngdec: Check blend_op.Michael Niedermayer2015-10-11
| | | | | | Fixes CID1322359, CID1322358 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc: move bitstream filter args to the bsf ctxRodger Combs2015-10-10
|
* avcodec/ac3enc: fix undefined negative left shiftGanesh Ajjanagadde2015-10-10
| | | | | | | | | | | | | | | This should fix the undefined behavior reported in: https://trac.ffmpeg.org/ticket/4727. I can reproduce this at runtime: simply stick in an abort call in asym_quant to check if c < 0 and run FATE. I don't know ac3 so I can't confirm if negative coefficients are intentional, but at the moment they clearly are according to FATE. This resolves the undefined behavior. Tested with FATE. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'c3e5c47bdae2bb8219fea62d91b7455650b22c60'Hendrik Leppkes2015-10-10
|\ | | | | | | | | | | | | * commit 'c3e5c47bdae2bb8219fea62d91b7455650b22c60': libopenh264enc: Added max_nal_size option Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * libopenh264enc: Added max_nal_size optionMario Gasparoni2015-10-09
| | | | | | | | | | | | Also added dynamic slice_mode option, needed for the max_nal_size. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * cabac: Make CABAC states hardcodedAnton Khirnov2015-10-08
| | | | | | | | | | | | | | There is not much reason to generate such a small table at runtime. Signed-off-by: Derek Buitenhuis <derekb@vimeo.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | cabac: Make cabac starts hardcodedAnton Khirnov2015-10-10
| | | | | | | | | | | | There's not much reason to generate such a small table at runtime. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Revert "cabac: Allow hardcoding CABAC table."Derek Buitenhuis2015-10-10
| | | | | | | | | | | | | | | | This becomes unuseful in the following commit. This reverts commit 092d1977cc7146f20c8db2155e7d648afb300de7. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Merge commit '58b42345b38b46d11c32e11d9c57517f99d6a601'Hendrik Leppkes2015-10-10
|\| | | | | | | | | | | | | * commit '58b42345b38b46d11c32e11d9c57517f99d6a601': dcadec: reorganise context data Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * dcadec: reorganise context dataAlexandra Khirnova2015-10-07
| | | | | | | | | | | | | | | | | | place primary audio coding header data into DCAAudioHeader structure to make DCAContext clearer and move channel related data to DCAChan structure to make them easier to use by extensions Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '3a4d369ea4ded91b1178ae6e2ff0ab9ea470e344'Hendrik Leppkes2015-10-10
|\| | | | | | | | | | | | | * commit '3a4d369ea4ded91b1178ae6e2ff0ab9ea470e344': g2m: Relax resolution change constraints Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * g2m: Relax resolution change constraintsVittorio Giovara2015-10-07
| | | | | | | | | | | | | | Do not fail when original resolution is smaller than current one, as the frame buffer is resized automatically. Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>
* | x86/takdsp: use arithmetic shift instructionsJames Almer2015-10-09
| | | | | | | | | | | | | | p1 and p2 are int32_t. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | h264_mp4toannexb: fix the pps offset when there are more than one sps in avcc赵宇龙2015-10-10
| | | | | | | | | | | | | | | | | | | | the pps offset is used to locate pps in the spspps_buf; however, the current calc method is wrong because it is the offset of the original avctx->extradata; when there is only one sps in the avcc; the value is correct by coincidence, however, it will fail in avcc with multi sps Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/h264_mp4toannexb_bsf: Use av_freep() to free spspps_bufMichael Niedermayer2015-10-10
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/xvmc: apply attribute_deprecated correctlyGanesh Ajjanagadde2015-10-09
| | | | | | | | | | | | | | | | | | This fixes a warning observed on Clang 3.7: "warning: attribute 'deprecated' is ignored, place it after "struct" to apply attribute to type declaration [-Wignored-attributes]" and thus enables deprecation warning for the relevant struct. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* | avcodec/mpegvideoenc: fix undefined negative left shiftGanesh Ajjanagadde2015-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should fix the first undefined behavior reported in: https://trac.ffmpeg.org/ticket/4727. I can't reproduce the runtime behavior reported in the ticket, hence I can't confirm that this actually fixes the exact issue reported in the ticket. Regardless, I can confirm that this is a genuine issue, and that negative shifts can (and do) occur, fixed by this. Tested with FATE. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | doc: fix spelling errorsAndreas Cadhalpun2015-10-09
| | | | | | | | | | Reviewed-by: Lou Logan <lou@lrcd.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avcodec/takdec: add x86 SIMD for rest of decorrelation modesPaul B Mahol2015-10-09
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavc/mjpegenc: Add an option to force outputting chroma matrix.Carl Eugen Hoyos2015-10-09
| | | | | | | | RFC 2435 suggests that mjpeg over rtp uses both two tables.
* | avcodec/pthread_frame: update doxygen for update_context_from_threadGanesh Ajjanagadde2015-10-09
| | | | | | | | | | Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* | avcodec/ass: fix doxygen typowm42015-10-08
| |
* | dnxhdenc: mark CID 1260 encoder experimentalChristophe Gisquet2015-10-08
| | | | | | | | | | | | | | | | | | | | | | The MBAFF handling recently introduced on the decoder side shows that the encoder does not support it correctly. Therefore, make the related profile experimental. Furthermore, current encoder logic treats it as unable to encode as progressive, which isn't the case. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | dnxhddata: introduce and use MBAFF flagChristophe Gisquet2015-10-07
| | | | | | | | | | | | | | MBAFF-like handling of interlaced content in CID 1260 is different from the other CIDs, and in particular doesn't use the same syntax. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | dnxhddec: better support for 4:4:4Christophe Gisquet2015-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Profiles 1256 & 1270 (currently) signal at the frame header and MB levels the colorspace used, either RGB or YUV. While a MB-level varying colorspace is not supported, whether it is constant can be tracked so as to determine the exact colorspace. This requires having bitdepth and the ACT and 4:4:4 flags, in turn needing the CID. Because setting those before having validated enough things may result in invalid/unset DSP fucntions, setting the bitdepth in the context is delayed. It is not tested against a true RGB sequence, though. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mips: build fix for MSA 64bitShivraj Patil2015-10-07
| | | | | | | | | | | | | | Modified datatype of function argument (pitch from int32_t to ptrdiff_t) Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mips: build fix for MSAShivraj Patil2015-10-07
| | | | | | | | | | | | | | Modified sps and pps access from old HEVCContext(s) structure to newly introduced HEVCParamSets(ps) Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | doc/encoders: Fix libkvazaar documentationArttu Ylä-Outinen2015-10-07
| | | | | | | | | | | | | | | | | | The -threads option is ignored with libkvazaar since it does not have any of the AV_CODEC_CAP_{FRAME,SLICE,AUTO}_THREADS capabilities. This commit removes the incorrect documentation as well as the no-op of setting the number of threads in libkvazaar encoder. Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* | libkvazaar: Fix setting framerateArttu Ylä-Outinen2015-10-07
| | | | | | | | | | | | | | The divisor and dividend in the equation had been swapped, making the result the inverse of the actual framerate. Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* | libkvazaar: Use av_image_copy for copying pixelsArttu Ylä-Outinen2015-10-07
| | | | | | | | | | | | Replaces a for loop for copying pixels by a call to av_image_copy. Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* | libkvazaar: Set pts and dtsArttu Ylä-Outinen2015-10-07
| | | | | | | | Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* | libkvazaar: Replace asserts with proper errorsArttu Ylä-Outinen2015-10-07
| | | | | | | | | | | | | | | | Changes function libkvazaar_encode to return proper error codes instead of crashing when the video dimensions or pixel format change in the middle of encoding. Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* | libkvazaar: Remove unnecessary NULL checksArttu Ylä-Outinen2015-10-07
| | | | | | | | Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* | libkvazaar: Update to work with the latest versionArttu Ylä-Outinen2015-10-07
| | | | | | | | | | | | | | | | Function encoder_encode in Kvazaar API was changed to have new output parameters: source picture and frame info. Frame info is used to set the keyframe flag and source picture is ignored. Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* | vp9: don't keep a stack pointer if we don't need it.Ronald S. Bultje2015-10-07
| | | | | | | | | | | | | | | | This saves one register in a few cases on 32bit builds with unaligned stack (e.g. MSVC), making the code slightly easier to maintain. (Can someone please test this on 32bit+msvc and confirm make fate-vp9 and tests/checkasm/checkasm still work after this patch?)