Timothy Gu
b6f80b16d1
qsvdec: Fix memory leak
...
Fixes CID1396851.
8 years ago
Diego Biurrun
76167140a9
qsvdec: Drop stray extra braces around initializer
...
libavcodec/qsvdec.c:93:5: warning: braces around scalar initializer
8 years ago
Mark Thompson
0940b748bd
qsvdec: Only warn about unconsumed data if it happens more than once
8 years ago
Mark Thompson
030d84fa2e
qsvdec: Pass field order information to libmfx
...
The VC-1 decoder fails to initialise if this is not set.
8 years ago
Mark Thompson
cd1047f391
qsvdec: Pass the correct profile to libmfx
...
This was correct for H.26[45], because libmfx uses the same values
derived from profile_idc and the constraint_set flags, but it is
wrong for other codecs.
Also avoid passing FF_LEVEL_UNKNOWN (-99) as the level, as this is
certainly invalid.
8 years ago
Anton Khirnov
4ab61cd983
qsv{enc,dec}: extend the internal frame allocator
...
Handle the internal frame requests, which is required by the HEVC
encoding plugin.
Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
8 years ago
Anton Khirnov
00aeedd841
qsv{dec,enc}: use a struct as a memory id with internal memory allocator
...
This will allow implementing the allocator more fully, which is needed
by the HEVC encoder plugin with video memory input.
Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
8 years ago
Anton Khirnov
404e51478e
qsv{dec,enc}: always use an internal mfxFrameSurface1
...
For encoding, this avoids modifying the input surface, which we are not
allowed to do.
This will also be useful in the following commits.
Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
8 years ago
Mark Thompson
1f26a231bb
qsv: Merge libav implementation
...
Merged as-at libav 398f015
, and therefore includes outstanding
skipped merges 04b17ff
and 130e1f1
.
All features not in libav are preserved, and no options change.
8 years ago
Luca Barbato
801ac7156d
qsv: Be informative when reporting that no data has been consumed
8 years ago
Yuli Khodorkovskiy
f0adb99d06
avcodec/qsvdec: Fix null dereferences in the qsv decoder
...
This patch fixes the h264_qsv decoder issues mentioned
in https://ffmpeg.zeranoe.com/forum/viewtopic.php?t=2962 .
The patch may be tested by specifying h264_qsv as the decoder to ffplay
for an h264 encoded file.
ffplay -vcodec h264_qsv foo.mts
Signed-off-by: Yuli Khodorkovskiy <ykhodo@gmail.com>
Push requested-by: Ivan Uskov
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Anton Khirnov
e328178da9
qsvdec: only access hwaccel_context is the pixel format is QSV
...
We do not strictly specify that hwaccel_context must be cleared if no
hwaccel is used.
Reported-By: wm4 <nfxjfg@googlemail.com>
9 years ago
Ivan Uskov
b4054100f6
Revert "Merge commit '3c53627ac17fc6bdea5029be57da1e03b32d265d'"
...
This reverts commit d30cf57a7b
, reversing changes made to
acc155ac55
. The commit d30cf57a7b
provided irrelevant code complexity and decoding slowdown. But the main disadvantage of this
commit is a decoder crash. So it should be reverted.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Anton Khirnov
95414eb2dc
qsv: print more complete error messages
...
Include the libmfx error code and its description
9 years ago
Anton Khirnov
924e2ecd2b
qsvdec: when a frames ctx is supplied, use its frame dimensions
...
The allocated frame size may be larger than the coded dimensions.
9 years ago
Anton Khirnov
92736c74fb
qsvdec: add support for P010 (10-bit 420) decoding
9 years ago
Anton Khirnov
ce320cf1c4
qsvdec: use the same mfxFrameInfo for allocating frames that was passed to DECODE_Init
...
Stop duplicating this information.
9 years ago
Anton Khirnov
536bb17e96
qsvdec: make ff_qsv_map_pixfmt() return a MFX fourcc as well
...
Stop hardcoding NV12.
Also, move this function to the shared code, it will be used by the
encoder as well.
9 years ago
Anton Khirnov
32c8359093
lavc: export the timestamps when decoding in AVFrame.pts
...
Currently it's exported as AVFrame.pkt_pts, which is also the only use
for that field. The reason it is done like this is that lavc used to
export various codec-specific "timing" information in AVFrame.pts, which
is not done anymore.
Since it is confusing to the callers to have a separate field which is
used only for decoder timestamps and nothing else, deprecate pkt_pts and
use just AVFrame.pts everywhere.
9 years ago
Anton Khirnov
a0524d9b1e
qsvdec: support getting the session from an AVHWFramesContext
9 years ago
Anton Khirnov
6f19bbcf85
qsvdec: move reading the user-provided session to qsv_decode_init()
...
This is a more appropriate place for it.
9 years ago
Anton Khirnov
3c53627ac1
qsvdec: store the sync point in heap memory
...
The reasoning is the same as for the corresponding qsvenc patch.
9 years ago
Maxym Dmytrychenko
3b6473b43e
qsvdec: properly handle the warning from MFXVideoCORE_SyncOperation
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years ago
Hendrik Leppkes
b54d645116
qsvdec: fix get_format and hwaccel_context handling
...
This enables the qsv transcoder to actually get activated
9 years ago
Anton Khirnov
8aecec8402
qsvdec: make ff_qsv_decode_init() static
...
It is not used outside of qsvdec.c anymore.
9 years ago
Anton Khirnov
2c32eace5e
qsvdec: close the MFX decoder on uninit
9 years ago
Ivan Uskov
3f8e2e9953
libavcodec/qsvdec.c: correct flush() handler has been implemented
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 years ago
Ivan Uskov
cc167f7e55
libavcodec/qsvdec.c: correct handling of dynamic frame size changing has been implemented
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 years ago
Ivan Uskov
fffae8e605
libavcodec/qsvdec.c: the ff_get_format() missed at refactoring has been restored
...
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 years ago
Ivan Uskov
44857e7a36
libavcodec/qsvdec.c: Extended error messages for MFXVideoDECODE_Init() result
...
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 years ago
Ivan Uskov
9f543e01af
libavcodec/qsvdec.c delay in 1 microsecond replaced to more appropriate 500 microseconds
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 years ago
Vittorio Giovara
059a934806
lavc: Consistently prefix input buffer defines
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
Anton Khirnov
41d47ea85f
lavc: add Intel libmfx-based HEVC decoder.
10 years ago
Anton Khirnov
96dca089b1
qsvdec: move qsv_process_data() from qsvdec_h264 to the common code
...
It will be shared with the upcoming mpeg2 and hevc decoders.
10 years ago
Anton Khirnov
22522d9c2c
qsvdec: fix a memleak of async_fifo
...
init() is called whenever format changes, so current code would leak the
fifo in this case.
10 years ago
Anton Khirnov
aa9d15d89b
qsvdec: avoid an infinite loop with no consumed data and no output
...
This is triggerable with the HEVC decoder. It is unclear yet whether the
bug is in the calling code or the MSDK, but it seems better to check for
this in any case.
10 years ago
Ivan Uskov
c90dbc67ed
libavcodec/qsvdec.c: The ff_qsv_decode() now guarantees the consumption of whole packet.
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 years ago
Ivan Uskov
d50ab820da
libavcodec/qsvdec_h264.c: refactoring: functionality of qsv_process_data() has been moved into qsvdec.c
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 years ago
Ivan Uskov
1acb19d12b
libavcodec/qsvdec_h264.c: SPS parsing is now performed by MFXVideoDECODE_DecodeHeader() in libavcodec/qsvdec.c
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 years ago
Ivan Uskov
264ba3d847
libavcodec/qsvdec.c: missed MFXVideoDECODE_Close() call
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 years ago
Anton Khirnov
f5c4d38c78
qsvdec: properly handle asynchronous decoding
...
Wait for async_depth frames before syncing.
10 years ago
Ivan Uskov
6e127990fa
Refactoring to move common QSV-related code part into libavcodec/qsvdec.c
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 years ago
Ivan Uskov
ce91bab70f
libavcodec/qsv.c: Issue fixed: QSV engine does not release display handler under linux platform.
...
Reviewed-by: Gwenole Beauchesne <gb.devel@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
10 years ago
Anton Khirnov
66acb76bb0
lavc: add Intel libmfx-based HEVC encoder
10 years ago
Anton Khirnov
9ba27c2348
qsvdec: add 'decode' to the non-static function names
10 years ago
Anton Khirnov
d0a63d8b98
qsvdec: split off some code that will be shared with the encoder
10 years ago
Anton Khirnov
b04d009b0e
qsv: rename to qsvdec
...
This is to avoid conflicts with the upcoming QSV encoding support.
10 years ago
Yukinori Yamazoe
212556cd21
qsv: Improve the log message of when initializing MFX_IMPL_HARDWARE{2, 3, 4}
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
10 years ago
Anton Khirnov
4e08c82110
lavc: add an Intel libmfx-based H.264 decoder
...
Based on the code by Luca Barbato <lu_zero@gentoo.org> and Yukinori
Yamazoe <drocon11@gmail.com>.
10 years ago