Currently, AVHWAccels are looked up using a (codec_id, pixfmt) tuple.
This means it's impossible to have 2 decoders for the same codec and
using the same opaque hardware pixel format.
This breaks merging Libav's CUVID hwaccel. FFmpeg has its own CUVID
support, but it's a full stream decoder, using NVIDIA's codec parser.
The Libav one is a true hwaccel, which is based on the builtin software
decoders.
Fix this by introducing another field to disambiguate AVHWAccels, and
use it for our CUVID decoders. FF_CODEC_CAP_HWACCEL_REQUIRE_CLASS makes
this mechanism backwards compatible and optional.
cuvid.c is used by Libav's CUVID hwaccel. Resolve the conflict and
avoid future merge problems by renaming our decoder.
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This will be useful in the CUVID hwaccel. It should also eventually
replace current decoder-specific mechanisms used by various other
hwaccels.
Merges Libav commit 704311b2946d74a80f65906961cd9baaa18683a3.
Use the AVFrame.private_ref field.
This new struct will be useful in the following commits.
Merges Libav commit 359a8a3e2d1194b52b6c386f94fd0929567dfb67.
This gives FFmpeg libs a field that they can freely and safely use.
Avoiding the need of wrapping of a users opaque_ref field and its issues.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
ff_alloc_packet have been deprecated, switch to use
ff_alloc_packet2.
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
ff_alloc_packet have been deprecated, switch to use the
ff_alloc_packet2.
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Reviewed-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
The user-supplied value for timecode_rate in drawtext is rounded
to nearest integer. So, a supplied value of 0.49 or lower is rounded to 0.
This throws a misleading error message which says "Timecode frame rate must be
specified". Changed message to account for values under one.
Also noted supported framerates for drop TC.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Fixes: runtime error: value -36211.7 is outside the range of representable values of type 'short'
Fixes: 2992/clusterfuzz-testcase-6649611793989632
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
The spec is correct, it does list these layouts as having rear speakers.
Questionable how many decoders correctly interpret those correctly since
side is way more popular.
Also fixes fate-aac-yoraw-encode.
Reported-by: pkviet <pkv.stream@gmail.com>
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
This commit implements support for PCE (Program Configuration Elements) in the
AAC encoder, and as such allows for encoding of channel layouts not present
in the presets defined by the spec (which only lists the 8 most common ones).
This has been a highly requested feature and is also the first open source encoder
to support this many layouts.
Many thanks to pkviet <pkv.stream@gmail.com> who implemented support for and
verified all channel layouts.
Since non-Haar wavelets need to look into pixels outside the frame, we
need to pad the buffer. The old factor of two seemed to be a workaround
that fact and only padded to the left and bottom. This correctly pads
by the slice size and as such reduces memory usage and potential
exploits.
Reported by Liu Bingchang.
Ideally, there should be no temporary buffer but the encoder is designed
to deinterleave the coefficients into the classical wavelet structure
with the lower frequency values in the top left corner.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Use mask buffer.
Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Use global mask buffer for appropriate mask load.
Use immediate unsigned saturation for clip to max saving one vector register.
Remove unused macro.
Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Use global mask buffer for appropriate mask load.
Remove unused macro and table.
Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Use global mask buffer for appropriate mask load.
Use immediate unsigned saturation for clip to max saving one vector register.
Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* commit '70946e605924e2108c39f96faa369c220177f301':
h264dec: Fix mix of lossless and lossy MBs decoding
h264_cabac: Fix CABAC+8x8dct in 4:4:4
h264dec: fix Lossless Decoding (Profile 244) for 8x8 Intra Prediction
This commit is a noop, see
6f7ca1f55be1270e0d7c33409de4473e4dd00add
840b41b2a643fc8f0617c0370125a19c02c6b586
cf231b68da1150c100114f2c5671b7ed740f917a
Merged-by: James Almer <jamrial@gmail.com>
* commit '45df7adc1d9b7e8fbae5af9328baa6ab3562002b':
imgutils: add function to clear an image to black
lavc, lavu: move frame cropping to a convenience function
rmdec: add missing brackets to compound statement
This commit is a noop, see
65b83ce01b94eae944290c11257799a9288f2d4c
caa12027baf1180453846c58da08fc87accc0ff6
463b81de2b252691d75417643597c42684bf830d
Merged-by: James Almer <jamrial@gmail.com>
* commit '2b1324bd167553f49736e4eaa94f96da9982925e':
lavf: allow avformat_close_input() with NULL
dxva: DXVA2_ModeHEVC_VLD_Main10 does not support Main
caf: add an Opus tag
hevc: Make sure to update the current frame transfer characteristic
This commit is a noop, see
dc9735eb67ca696d926922735a9bf01776d5c328
b4093e60c51af493a6dad7819264ef769736227f
5a3b602acda68fe5ca09082dc753179450a97a13
c64da19bbc1d3b405703ef3b705dba39a450504f
36cd017acd9cac0e6695124c052a59fb1fc13145
Merged-by: James Almer <jamrial@gmail.com>
It has no reason to be in a public header, even if defined as private.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
* commit '95ce02b35d3d1bb16111031df1d82a6e4d894d36':
rmdec: don't ignore the return value of av_get_packet()
See 65b83ce01b94eae944290c11257799a9288f2d4c
Merged-by: James Almer <jamrial@gmail.com>
* commit '825e463a170c7004c63030dc484b2b2de869227b':
build: Add feature test macros for glibc 2.19+
This commit is a noop, see
26e8895b7395ed180dcb7e30465058c45050b5e2
af1818276ef271af98e2e2bbabb4dc875b4fa7d8
Merged-by: James Almer <jamrial@gmail.com>
* commit '9c1e111406bd4cbb04d8e8611b71bebf203bec5e':
flac: Convert to the new bitstream reader
bitstream: Avoid undefined behavior in bitstream_skip()
This commit is a noop, see
https://ffmpeg.org/pipermail/ffmpeg-devel/2017-April/209609.html
Merged-by: James Almer <jamrial@gmail.com>