1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00
Commit Graph

20780 Commits

Author SHA1 Message Date
Diego Biurrun
81f769fa12 gsm: Move requant_tab table to the gsm tables file
This avoids duplicating the table in the gsm template file.
Also adjust the table type to uint8_t to save space.
2016-06-07 13:22:22 +02:00
Diego Biurrun
42dc214323 mpc: Drop unused GetBitContext context member 2016-06-07 13:09:57 +02:00
Diego Biurrun
85b8403c6f svq1enc: Drop unused GetBitContext context member 2016-06-07 13:09:57 +02:00
Diego Biurrun
6d8fd614ff vorbis: Kill some pointless debug code 2016-06-07 13:09:57 +02:00
Diego Biurrun
59c6509d9f mss2: Drop a silly assert 2016-06-07 13:09:57 +02:00
Diego Biurrun
b668662939 get_bits: Move BITSTREAM_READER_LE definition before all relevant #includes
This avoids the danger that get_bits.h might get indirectly #included before
BITSTREAM_READER_LE is defined.

Also sort headers into canonical order where appropriate.
2016-06-07 13:09:57 +02:00
Diego Biurrun
09c4e5c598 indeo2: Drop disabled big-endian ir2_codes table
Only the little-endian variant of the table is ever used.
2016-06-07 13:09:57 +02:00
Diego Biurrun
b7f98659f2 Remove unnecessary get_bits.h #includes 2016-06-07 13:09:57 +02:00
Paul B Mahol
2a48a75a6f sgirledec: simplify, no need to use reget buffer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-06-06 12:05:02 -04:00
Paul B Mahol
6e2ad28cf7 aic: add frame threading support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-06-06 12:03:20 -04:00
Denis Charmet
38f99017e6 vp9: Return the correct size when decoding a superframe
According to avcodec.h, avcodec_decode_video2 should return the number of
bytes used if a frame was decoded.

The current implementation returns size - used size of all the subframes.
This fixes the VLC's bug https://trac.videolan.org/vlc/ticket/16836.

The superframe is always fully consumed.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-06-05 16:58:04 +02:00
Diego Biurrun
535a742c26 build: Change structure of the linker version script templates
Split version files into one line per symbol/directive to allow compatibility
with the Solaris linker without preprocessing and eliminate $ from version file
templates to simplify the postprocessing shell command.
2016-05-29 16:43:11 +02:00
Diego Biurrun
1e9c5bf4c1 asm: FF_-prefix internal macros used in inline assembly
These warnings conflict with system macros on Solaris, producing
truckloads of warnings about macro redefinition.
2016-05-28 19:18:26 +02:00
Diego Biurrun
dc40a70c57 Drop unnecessary libavutil/x86/asm.h #includes 2016-05-28 19:18:26 +02:00
Luca Barbato
5264e7ba21 ac3: Check the array bound before dereferencing
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-05-27 15:49:48 +02:00
Mark Thompson
a86aa16088 vaapi_h264: Add trivial support for low-power encoding
Experimental; requires Skylake and VAAPI 0.39.1 (not yet released).
Also increases the allowed range of the quality option - in low-power
mode, the Intel driver supports levels 1-8 (and 0 meaning default).
2016-05-27 10:57:00 +01:00
Mark Thompson
b51c7c6b8a vaapi_h264: Fix frame_num after non-reference frames
Non-reference frames (nal_ref_idc == 0) should be discardable, so
frame_num does not advance after them.  Before this change, a stream
containing unreferenced B-frames would be rejected by the reference
decoder.
2016-05-27 10:56:55 +01:00
Mark Thompson
2bfa067d0b vaapi_encode: Check config attributes before creating config
This prevents attempts to use unsupported modes, such as low-power
H.264 mode on non-Skylake targets.  Also fixes a crash on invalid
configuration, when trying to destroy an invalid VA config/context.
2016-05-27 10:56:45 +01:00
Andrey Turkin
24b5cff01b lavc: handle hw_frames_ctx where necessary
avcodec_copy_context() didn't handle hw_frames_ctx references correctly
which could cause crashes.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-26 15:40:05 +02:00
Diego Biurrun
4024b566d6 golomb: Give svq3_get_se_golomb()/svq3_get_ue_golomb() better names 2016-05-25 16:37:43 +02:00
Diego Biurrun
e47b8bbf0b avcodec: Bump micro version after changing public JPEG 2000 defines 2016-05-24 15:47:15 +02:00
Francois Cartegnie
ad61da054b jpeg2000: Fix profile define values
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-24 12:22:57 +02:00
Anton Khirnov
2ef6dab0a7 lavc: document that avcodec_close() should not be used
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.
2016-05-23 06:46:18 +02:00
Anton Khirnov
04fc8e24a0 lavc: deprecate avcodec_get_context_defaults3()
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.
2016-05-23 06:46:17 +02:00
Anton Khirnov
5f30ac2779 lavc: deprecate avcodec_copy_context()
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.
2016-05-23 06:46:17 +02:00
Luca Barbato
74b1bf632f mp3: Make the extrasize explicit
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>
2016-05-22 23:07:54 +02:00
Diego Biurrun
52567e8198 get_bits: Drop some TRACE-level debug code
It will not be provided by the new bit reader anyway.
2016-05-22 20:22:43 +02:00
Anton Khirnov
3399a26d3f nvenc: allow setting the number of slices
Based on a patch by Agatha Hu <ahu@nvidia.com>
2016-05-19 14:17:04 +02:00
Philip Langdale
10545f84b8 nvenc: De-compensate aspect ratio compensation of DVD-like content.
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>
2016-05-19 14:17:04 +02:00
Anton Khirnov
9375c97460 nvenc: list the major contributors in the copyright header 2016-05-19 14:17:04 +02:00
Anton Khirnov
6f58b4dc47 nvenc: drop the hard dependency on CUDA
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>.
2016-05-19 14:17:03 +02:00
Anton Khirnov
f11ec8cee7 nvenc: only support HW frames when CUDA is enabled
hwcontext_cuda.h includes cuda.h, so this will allow building nvenc
without depending on cuda.h
2016-05-19 14:17:03 +02:00
Anton Khirnov
2156c4c300 nvenc: write the VUI signal properties for HEVC
Bump the API version requirement to 6.

Based on a patch by Agatha Hu <ahu@nvidia.com>.
2016-05-19 14:17:03 +02:00
Anton Khirnov
a1df786503 nvenc: only write the VUI signal type fields if they are set
Based on a patch by Agatha Hu <ahu@nvidia.com>.
2016-05-19 14:17:03 +02:00
Timo Rothenpieler
cea1fb854c nvenc: Generate bufferingPeriod/pictureTiming SEI
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>
2016-05-19 14:17:03 +02:00
Timo Rothenpieler
a1e215ea01 nvenc: Delay frame output to increase encoding speed
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-19 14:17:01 +02:00
Anton Khirnov
9427d92f40 nvenc: add support for lossless encoding
Based on a patch by Philip Langdale <philipl@overt.org>
2016-05-19 14:08:55 +02:00
Timo Rothenpieler
795329dd4c nvenc: Generate AUD NAL units for better compatiblity
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-19 14:08:30 +02:00
Anton Khirnov
e42b9bc894 nvenc: fix the rc option definitions 2016-05-19 14:08:25 +02:00
Derek Buitenhuis
d68fb14758 mjpegdec: Properly fail on malloc failure
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-19 13:44:41 +02:00
Anton Khirnov
0d95d88fbd lavc: revert the Makefile part of 330177b
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.
2016-05-19 13:40:53 +02:00
Alexandra Hájková
ffa190d047 Move VLC and RL_VLC_ELEM structure definitions to a separate header
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>
2016-05-17 10:29:27 +02:00
Alexandra Hájková
d338abb664 mpeg4videodec: Call av_log() in check_marker() with AVCodecContext instead of NULL
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-16 10:51:17 +02:00
Alexandra Hájková
e4b38878da Move check_marker() from get_bits to mpeg4videodec
MPEG-4 is the only decoder which uses check_marker().

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-16 10:51:01 +02:00
Anton Khirnov
31f6a4b4b8 lavc: mark the old audio/video encoding API as deprecated 2016-05-16 10:31:26 +02:00
Anton Khirnov
8996515b13 avpacket: fix setting AVPacket.data in av_packet_ref()
The data field does not necessarily point to the beginning of the
underlying AVBuffer.

CC: libav-stable@libav.org
2016-05-16 10:31:08 +02:00
Anton Khirnov
e62ff72fc1 lavc: make avcodec_open2() fail when the timebase is not set for encoding
Many encoders use it. There is also a divide by the timebase lower in
this function, which would crash when it is not set.
2016-05-16 10:30:57 +02:00
Diego Biurrun
a6a750c7ef tests: Move all test programs to a subdirectory 2016-05-13 14:55:56 +02:00
Diego Biurrun
257f00ec1a Split global .gitignore file into per-directory files 2016-05-13 14:55:56 +02:00
Diego Biurrun
763d69bfb2 Add some more deprecation guards
Avoids unused function/label/variable warnings after the next version bump.
2016-05-11 12:22:49 +02:00