summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* lavc: handle hw_frames_ctx where necessaryAndrey Turkin2016-05-25
| | | | | | | avcodec_copy_context() didn't handle hw_frames_ctx references correctly which could cause crashes. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* jpeg2000: Fix profile define valuesFrancois Cartegnie2016-05-24
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* lavc: document that avcodec_close() should not be usedAnton Khirnov2016-05-23
| | | | | | | We cannot deprecate it until the new parser API is in place, because of the way libavformat works. But the majority of the users can already simply replace it with avcodec_free_context(), which will simplify the transition once it is finally deprecated.
* lavc: deprecate avcodec_get_context_defaults3()Anton Khirnov2016-05-23
| | | | | | | | | This function is supposed to "reset" a codec context to a clean state so that it can be opened again. The only reason it exists is to allow using AVStream.codec as a decoding context (after it was already opened/used/closed by avformat_find_stream_info()). Since that behaviour is now deprecated, there is no reason for this function to exist anymore.
* lavc: deprecate avcodec_copy_context()Anton Khirnov2016-05-23
| | | | | | | | | Since AVCodecContext contains a lot of complex state, copying a codec context is not a well-defined operation. The purpose for which it is typically used (which is well-defined) is copying the stream parameters from one codec context to another. That is now possible with through the AVCodecParameters API. Therefore, there is no reason for avcodec_copy_context() to exist.
* mp3: Make the extrasize explicitLuca Barbato2016-05-22
| | | | | | | | | Initialize the bit buffer with the correct size (amount of bits that will be read) instead of relying on the bitstream reader overreading the correct values. Signed-off-by: Luca Barbato <lu_zero@gentoo.org> Signed-off-by: Diego Biurrun <diego@biurrun.de>
* get_bits: Drop some TRACE-level debug codeDiego Biurrun2016-05-22
| | | | It will not be provided by the new bit reader anyway.
* nvenc: allow setting the number of slicesAnton Khirnov2016-05-19
| | | | Based on a patch by Agatha Hu <ahu@nvidia.com>
* nvenc: De-compensate aspect ratio compensation of DVD-like content.Philip Langdale2016-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For reasons we are not privy to, nvidia decided that the nvenc encoder should apply aspect ratio compensation to 'DVD like' content, assuming that the content is not BT.601 compliant, but needs to be BT.601 compliant. In this context, that means that they make the following, questionable, assumptions: 1) If the input dimensions are 720x480 or 720x576, assume the content has an active area of 704x480 or 704x576. 2) Assume that whatever the input sample aspect ratio is, it does not account for the difference between 'physical' and 'active' dimensions. From these assumptions, they then conclude that they can 'help', by adjusting the sample aspect ratio by a factor of 45/44. And indeed, if you wanted to display only the 704 wide active area with the same aspect ratio as the full 720 wide image - this would be the correct adjustment factor, but what if you don't? And more importantly, what if you're used to lavc not making this kind of adjustment at encode time - because none of the other encoders do this! And, what if you had already accounted for BT.601 and your input had the correct attributes? Well, it's going to apply the compensation anyway! So, if you take some content, and feed it through nvenc repeatedly, it will keep scaling the aspect ratio every time, stretching your video out more and more and more. So, clearly, regardless of whether you want to apply bt.601 aspect ratio adjustments or not, this is not the way to do it. With any other lavc encoder, you would do it as part of defining your input parameters or do the adjustment at playback time, and there's no reason by nvenc should be any different. This change adds some logic to undo the compensation that nvenc would otherwise do. nvidia engineers have told us that they will work to make this compensation mechanism optional in a future release of the nvenc SDK. At that point, we can adapt accordingly. Signed-off-by: Philip Langdale <philipl@overt.org> Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* nvenc: list the major contributors in the copyright headerAnton Khirnov2016-05-19
|
* nvenc: drop the hard dependency on CUDAAnton Khirnov2016-05-19
| | | | | | | | The code needs only a few definitions from cuda.h, so define them directly when CUDA is not enabled. CUDA is still required for accepting HW frames as input. Based on the code by Timo Rothenpieler <timo@rothenpieler.org>.
* nvenc: only support HW frames when CUDA is enabledAnton Khirnov2016-05-19
| | | | | hwcontext_cuda.h includes cuda.h, so this will allow building nvenc without depending on cuda.h
* nvenc: write the VUI signal properties for HEVCAnton Khirnov2016-05-19
| | | | | | Bump the API version requirement to 6. Based on a patch by Agatha Hu <ahu@nvidia.com>.
* nvenc: only write the VUI signal type fields if they are setAnton Khirnov2016-05-19
| | | | Based on a patch by Agatha Hu <ahu@nvidia.com>.
* nvenc: Generate bufferingPeriod/pictureTiming SEITimo Rothenpieler2016-05-19
| | | | | | | For some unknown reason enabling these causes proper CBR padding, so as there are no known downsides just always enable them in CBR mode. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* nvenc: Delay frame output to increase encoding speedTimo Rothenpieler2016-05-19
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* nvenc: add support for lossless encodingAnton Khirnov2016-05-19
| | | | Based on a patch by Philip Langdale <philipl@overt.org>
* nvenc: Generate AUD NAL units for better compatiblityTimo Rothenpieler2016-05-19
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* nvenc: fix the rc option definitionsAnton Khirnov2016-05-19
|
* mjpegdec: Properly fail on malloc failureDerek Buitenhuis2016-05-19
| | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc: revert the Makefile part of 330177bAnton Khirnov2016-05-19
| | | | | | | There is no real advantage to listing some codecs or subsystems separately simply because they are somehow "hw-accelerated", on the contrary it makes them harder to find than in a plain alphabetically ordered list.
* Move VLC and RL_VLC_ELEM structure definitions to a separate headerAlexandra Hájková2016-05-17
| | | | | | | Use the newly created vlc.h directly instead of including get_bits when needed. The VLC and RL_VLC_ELEM structures are independent from the bitreader. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mpeg4videodec: Call av_log() in check_marker() with AVCodecContext instead ↵Alexandra Hájková2016-05-16
| | | | | | of NULL Signed-off-by: Anton Khirnov <anton@khirnov.net>
* Move check_marker() from get_bits to mpeg4videodecAlexandra Hájková2016-05-16
| | | | | | MPEG-4 is the only decoder which uses check_marker(). Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc: mark the old audio/video encoding API as deprecatedAnton Khirnov2016-05-16
|
* avpacket: fix setting AVPacket.data in av_packet_ref()Anton Khirnov2016-05-16
| | | | | | | The data field does not necessarily point to the beginning of the underlying AVBuffer. CC: libav-stable@libav.org
* lavc: make avcodec_open2() fail when the timebase is not set for encodingAnton Khirnov2016-05-16
| | | | | Many encoders use it. There is also a divide by the timebase lower in this function, which would crash when it is not set.
* tests: Move all test programs to a subdirectoryDiego Biurrun2016-05-13
|
* Split global .gitignore file into per-directory filesDiego Biurrun2016-05-13
|
* Add some more deprecation guardsDiego Biurrun2016-05-11
| | | | Avoids unused function/label/variable warnings after the next version bump.
* Reduce the scope of some variablesDiego Biurrun2016-05-11
| | | | | This avoids unused variable warnings after the next version bump. Also drop a trace level av_log() call that is in the way.
* pgssub: Fix subpicture colorspace and rangeJan Ekström2016-05-10
| | | | | | | | | Widen the values from limited to full range and use BT.709 where it should be used according to the video resolution: SD is BT.601, HD is BT.709 Default to BT.709 due to most observed HDMV content being HD.
* simple_idct_template: Fix strict aliasing violationMichael Niedermayer2016-05-10
| | | | | | | This fixes fate-wmv8-intrax8 in certain configurations, e.g. gcc 4.4. Signed-off-by: Martin Storsjö <martin@martin.st>
* Mark read-only tables as staticDiego Biurrun2016-05-05
|
* cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* Remove unnecessary get_bits.h #includes and add missing headers where needed.Alexandra Hájková2016-05-04
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* h264: Drop broken trace debug outputDiego Biurrun2016-05-03
|
* vaapi: Drop pointless debug outputDiego Biurrun2016-05-03
|
* libopencore-amr: Fix ff_dlog()/av_log() invocationsDiego Biurrun2016-05-03
|
* Drop pointless assert.h #includesDiego Biurrun2016-05-03
|
* mmaldec: limit internal bufferingwm42016-04-30
| | | | | | | | | | | | | | | | | | This uses a new MMAL feature, which limits the number of extra frames that can be buffered within the decoder. VIDEO_MAX_NUM_CALLBACKS can be defined as positive or negative number. Positive numbers are absolute, and can lead to deadlocks if the user underestimates the number of required buffers. Negative numbers specify the number of extra buffers, e.g. -1 means no extra buffer, (-1-N) means N extra buffers. Set a gratuitous default of -11 (N=10). This is much lower than the firmware default, which appears to be 96. This is backwards compatible, but needs a symbol only present in newer firmware headers. (It's an enum item, so it requires a check in configure.) Signed-off-by: Anton Khirnov <anton@khirnov.net>
* mmaldec: print the MMAL format FourCC automaticallywm42016-04-30
| | | | | | | Slight simplification. The result is the same. Also, change the wording of the message as requested in patch review. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* mmaldec: send only a single EOS packet on flushingwm42016-04-30
| | | | | | | | Fixes apparent mmal_port_disable() freezes in ffmmal_stop_decoder() when calling ffmmal_decode() with flush semantics a large number of times in a row. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* mmaldec: correct package buffering accountingwm42016-04-30
| | | | | | | | | | | The assert in ffmmal_stop_decoder() could trigger sometimes. The packets_buffered counter was indeed not correctly maintained, and packets were not subtracted from it if they were still in the waiting queue. For some reason, this happened especially with VC-1. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* mmaldec: add vc1 decoding supportwm42016-04-30
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* mmaldec: Add mpeg2 decoding supportJulian Scheel2016-04-30
| | | | | | | | | | | Register mmaldec as mpeg2 decoder. Supporting mpeg2 in mmaldec is just a matter of setting the correct MMAL_ENCODING on the input port. To ease the addition of further supported mmal codecs a macro is introduced to generate the decoder and decoder class structs. Signed-off-by: Julian Scheel <julian@jusst.de> Signed-off-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* mmaldec: Fix avpriv_atomic_get usageJulian Scheel2016-04-30
| | | | | | | | | There is no avpriv_atomic_get, instead avpriv_atomic_int_get is to be used for integers. This fixes building mmaldec. Signed-off-by: Julian Scheel <julian@jusst.de> Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* mmaldec: Use av_assert0() instead of assert()Michael Niedermayer2016-04-30
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* dds: Add support for monochrome imagesVittorio Giovara2016-04-26
|
* dds: Drop gray-alpha swappingVittorio Giovara2016-04-26
| | | | The original sample was generated with invalid software.