1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

43377 Commits

Author SHA1 Message Date
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
b2d5d6a7f2 build: Only enable symbol reduction if the compiler does proper DCE
With compilers that do not support proper dead code elimination, like
Sun C 5.12, linking fails due to missing references to unavailable,
but also unused, symbols.

Bug-Id: 895
2016-05-30 14:59:43 +02:00
Diego Biurrun
c5fd4b5061 build: Simplify postprocessing of linker version script files
Generate the files in a single postprocessing step w/o intermediate files.
2016-05-29 16:49:16 +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
5b1b495c8d build: Print a message when generating version scripts 2016-05-29 15:09:05 +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
Diego Biurrun
6641819fee build: Ignore generated mapfile and remove it on distclean 2016-05-27 11:27:24 +02:00
Anton Khirnov
f5c4388419 FATE: drop the audio stream from the dxtory test
This is a video test and there are no audio packets in the sample
anyway.
2016-05-26 15:40:34 +02:00
Anton Khirnov
fe7b21c8f1 avconv: fix parsing bitstream filters
The current code modifies the user-supplied string, which is shared for
the whole output file. So a bitstream filter specification applied to
multiple streams would not work correctly.
2016-05-26 15:40:34 +02:00
Anton Khirnov
80fb19bc23 avconv: fix a check for av_bsf_get_by_name() return value 2016-05-26 15:40:34 +02:00
Anton Khirnov
9f7590f4e4 avconv_vaapi: use the hwcontext device creation API 2016-05-26 15:40:34 +02:00
Anton Khirnov
18c506e9e6 avconv_dxva2: use the hwcontext device creation API 2016-05-26 15:40:34 +02:00
Anton Khirnov
f72db3f2f3 avconv_vdpau: use the hwcontext device creation API 2016-05-26 15:40:34 +02:00
Anton Khirnov
b8bf9194af hwcontext_vaapi: implement device creation 2016-05-26 15:40:34 +02:00
Anton Khirnov
8e70385a8e hwcontext_dxva2: implement device creation 2016-05-26 15:40:33 +02:00
Anton Khirnov
2e219b491b hwcontext_cuda: implement device creation 2016-05-26 15:40:33 +02:00
Anton Khirnov
38392b2af8 hwcontext_vdpau: implement device creation 2016-05-26 15:40:33 +02:00
Anton Khirnov
1c9e8616c5 hwcontext: add a function for opening devices 2016-05-26 15:40:32 +02: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
7ca4fdc046 fate: More fine-grained dependencies for demuxer tests 2016-05-25 15:16:38 +02:00
Diego Biurrun
07377fb557 fate: More fine-grained dependencies for voice codec tests 2016-05-25 15:16:25 +02:00
Martin Storsjö
3fdffc032e rtsp: Use avcodec_descriptor_get instead of avcodec_find_decoder
This is only used for logging a human readable codec name for
debugging.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-25 12:22:28 +03: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
ac84e618df avfiltergraph: check the query_formats() return value 2016-05-23 06:46:18 +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
Anton Khirnov
14634429b9 lavf: update muxing doxy
Describe the new AVCodecParameters API.
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
Diego Biurrun
e45a638f50 dump: Drop unused variable 2016-05-22 20:22:43 +02:00
Diego Biurrun
e2a3df1a46 avconv: Use more precise deprecation ifdefs
This fixes compilation with the libavcodec version bumped to 58.
2016-05-22 20:22:43 +02:00
Anton Khirnov
35c8580668 avconv: stop using AVStream.codec
It is now only used by the av_parser_change() call during streamcopy, so
allocate a special AVCodecContext instance for this case. This instance
should go away when the new parser API is finished.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-22 20:22:42 +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
Timo Rothenpieler
09522a303d configure: Don't require nonfree for nvenc
As the nvEncodeApi.h header is now MIT licensed, this can be dropped.
The loaded CUDA and NVENC libraries are part of the nvidia driver, and
thus count as system libraries.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-19 14:17:03 +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