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

63 Commits

Author SHA1 Message Date
Zhong Li
755ad01dd1 lavc/qsv: remove the unused funtion ff_qsv_profile_to_mfx()
Signed-off-by: Zhong Li <zhongli_dev@126.com>
2019-12-29 20:23:07 +08:00
Linjie Fu
5345965b3f lavc/qsvdec: Add GPU-accelerated memory copy support
GPU copy enables or disables GPU accelerated copying between video
and system memory. This may lead to a notable performance improvement.
Memory must be sequent and aligned with 128x64.

CMD:
ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -c:v h264_qsv
                    -gpu_copy on -i input.h264 -f null -
or:
ffmpeg -c:v h264_qsv -gpu_copy on -i input.h264 -f null -

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: ChaoX A Liu <chaox.a.liu@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-10-09 11:27:34 +08:00
Zhong Li
949a1b3e2f lavc/qsv: remove vaapi device free function
It is not needed since av_buffer_unref() will call it internally

Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-10-09 10:44:04 +08:00
Zhong Li
6f0dd6b4ab lavc/qsv: fix a memory leak in ff_qsv_set_display_handle()
Reported-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-10-08 10:25:01 +08:00
Zhong Li
525de95679 lavc/qsv: add memory type message
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-09-26 13:44:11 +08:00
Zhong Li
74007dd86a lavc/qsv: Fix MSDK initialization failure in system memory mode
MSDK does not create internal acceleration device on Linux,
So MFXVideoCORE_SetHandle() is necessary.
It has been added for ff_qsv_init_session_device().
But missed for ff_qsv_init_internal_session() due to commit
1f26a23 overwrited commit db89f45

Fix #7030

Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-09-26 13:44:02 +08:00
Zhong Li
655ff4708b lavc/qsvdec: Add VP9 decoder support
VP9 decoder is support on Intel kabyLake+ platforms with MSDK Version 1.19+

Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-08-20 13:34:04 +08:00
Zhong Li
f3dfd34f27 lavc/qsv: make function qsv_map_fourcc() can be called externally
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-08-20 13:34:02 +08:00
Zhong Li
f115a2b763 lavc/qsvdec: add function ff_qsv_map_picstruct()
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-08-20 13:34:01 +08:00
Zhong Li
5b318ce68d lavc/qsv: extactly map profile
Currently profile mapping is hard-coded, and not flexible to do extactly
map (E.g: libmfx treats H264 constrained baseline to be baseline profile).

vaapi profile mapping funtion provides a better soultion than current
qsv mapping.

Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-05-07 11:00:19 +08:00
Zhong Li
94ab39ec78 lavc/qsvdec: fix hevc level incorrectly map
libmfx hevc level defination is same as h264, not level_idc of SPEC.

Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-05-07 11:00:14 +08:00
Zhong Li
3c26ce4644 lavc/qsv: handle MFX_FRAMETYPE_UNKNOWN case
Signed-off-by: Zhong Li <zhong.li@intel.com>
2018-07-12 15:29:55 +08:00
Zhong Li
8a0c2901f1 lavc/qsv: suppress code scan complain
Suppress the complain "variables 'type' is used but maybe uninitialized".
2018-06-13 00:13:24 +08:00
James Almer
f790410b6b Merge commit 'cca5e4f040971db6de0bfe6968f00c021d8a9c42'
* commit 'cca5e4f040971db6de0bfe6968f00c021d8a9c42':
  qsv: adding Multi Frame Encode support

Merged-by: James Almer <jamrial@gmail.com>
2018-04-13 20:34:23 -03:00
James Almer
6f277e1f76 Merge commit '52ed83fa1a7f5170447eff6fad0b6c57119596e9'
* commit '52ed83fa1a7f5170447eff6fad0b6c57119596e9':
  lavc/qsvdec: expose frame pic_type and key_frame

Merged-by: James Almer <jamrial@gmail.com>
2018-04-13 19:58:05 -03:00
Maxym Dmytrychenko
cca5e4f040 qsv: adding Multi Frame Encode support
Starting from API 1.25 helps to improve performance of the simultaneous
encode, 1:N scenario, like:

./avconv  -y -hwaccel qsv -c:v h264_qsv -r 30000/1001 -i
~/bbb_sunflower_1080p_60fps_normal.mp4  -vframes 600 -an \
    -filter_complex "split=2[s1][s2]; [s1]scale_qsv=1280:720[o1];
[s2]scale_qsv=960:540[o2]" \
    -map [o1] -c:v h264_qsv -b:v 3200k -minrate 3200k -maxrate 3200k -f
rawvideo /tmp/3200a.264 \
    -map [o2] -c:v h264_qsv -b:v 1750k -minrate 1750k -maxrate 1750k -f
rawvideo /tmp/1750a.264

Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2018-04-08 20:47:59 +02:00
Zhong Li
52ed83fa1a lavc/qsvdec: expose frame pic_type and key_frame
Currently pict_type and key_frame are unset.
Add an extra param to fetch the picture type from qsv decoder

The judgement “key frame is equal to IDR frame” only suitable for H264.
For HEVC, all IRAP frames are key frames, and other codecs have no IDR
frame.

Signed-off-by: ChaoX A Liu <chaox.a.liu@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2018-04-08 20:47:59 +02:00
James Almer
87faeb1e68 Merge commit '6829a079444e10818a847e153121fb458cc5c0a8'
* commit '6829a079444e10818a847e153121fb458cc5c0a8':
  qsvdec: Relax the surface vs coded dimension check

Merged-by: James Almer <jamrial@gmail.com>
2018-02-11 22:44:12 -03:00
Zhong Li
6829a07944 qsvdec: Relax the surface vs coded dimension check
Fix a common vp8 decoding failure.

Many vp8 clips cannot decode if hw_frames_ctx is enabled, reporting
"Error during QSV decoding.: incompatible video parameters (-14)".

It is due to mfx.FrameInfo.Width/Height not matching coded_w/coded_h.

See: avconv -hwaccel qsv -init_hw_device qsv -c:v vp8_qsv -i vp8-test-vectors-r1/vp80-00-comprehensive-001.ivf
-vf "hwdownload,format=nv12" -pix_fmt yuv420p -f md5 -

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-01-26 10:00:17 +01:00
James Almer
1a24d4f020 Merge commit 'ea25ccd1b2a980df8d43cc1f86a23e3c094090a6'
* commit 'ea25ccd1b2a980df8d43cc1f86a23e3c094090a6':
  qsv: Join the derived session to the parent

Merged-by: James Almer <jamrial@gmail.com>
2017-11-11 15:24:08 -03:00
James Almer
1926f13a20 Merge commit '2fd6e7d077f590e4d7195356f9baeb271f8b9ae2'
* commit '2fd6e7d077f590e4d7195356f9baeb271f8b9ae2':
  libavcodec/mjpeg_qsv: Add QSV MJPEG encoder

Merged-by: James Almer <jamrial@gmail.com>
2017-11-08 13:45:09 -03:00
James Almer
5678b2a820 Merge commit '984736dd9e5b50987a5910e22495304e4a6d975c'
* commit '984736dd9e5b50987a5910e22495304e4a6d975c':
  lavc: make sure not to return EAGAIN from codecs

Merged-by: James Almer <jamrial@gmail.com>
2017-10-03 20:52:44 -03:00
Luca Barbato
ea25ccd1b2 qsv: Join the derived session to the parent
Should improve the performance on multiple transcoding from a single
source.
2017-09-27 12:27:34 +00:00
Huang, Zhengxu
2fd6e7d077 libavcodec/mjpeg_qsv: Add QSV MJPEG encoder
usage:
-hwaccel qsv -c:v h264_qsv -i in -c:v mjpeg_qsv -global_quality 80 -f
mjpeg out

Signed-off-by: ChaoX A Liu <chaox.a.liu@gmail.com>
Signed-off-by: Zhengxu Huang <zhengxu.maxwell@gmail.com>
Signed-off-by: Andrew Zhang <huazh407@gmail.com
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2017-07-25 13:27:43 +02:00
Mark Thompson
91c3b50d74 qsv: Add ability to create a session from a device
(cherry picked from commit 4936a48b1e)
2017-06-14 22:26:32 +01:00
Mark Thompson
4936a48b1e qsv: Add ability to create a session from a device 2017-04-02 19:06:33 +01:00
Clément Bœsch
a032c5224d Merge commit '715b8243460836fb7dd15bf7e41668e773beb276'
* commit '715b8243460836fb7dd15bf7e41668e773beb276':
  qsv: Drop some unused variables

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-01 15:14:31 +02:00
Clément Bœsch
e06b8b07d5 Merge commit 'e0b164576f7467b7b1127c18175e215dc1df011f'
* commit 'e0b164576f7467b7b1127c18175e215dc1df011f':
  qsv: Add VP8 decoder

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-01 11:21:02 +02:00
Mark Thompson
ff821fdfce Merge commit '4ab61cd983b539749bd621ea271624ddb5196a8e'
* commit '4ab61cd983b539749bd621ea271624ddb5196a8e':
  qsv{enc,dec}: extend the internal frame allocator

Merged-by: Mark Thompson <sw@jkqxz.net>
2017-03-30 22:07:57 +01:00
Mark Thompson
c0f2a8eac1 Merge commit '00aeedd84105a17f414185bd33ecadebeddb3a27'
* commit '00aeedd84105a17f414185bd33ecadebeddb3a27':
  qsv{dec,enc}: use a struct as a memory id with internal memory allocator

Merged-by: Mark Thompson <sw@jkqxz.net>
2017-03-30 22:06:03 +01:00
Mark Thompson
a7434ef195 Merge commit '8e07c22e508b349d145b9f142aa3ee8b3ce1d3a4'
* commit '8e07c22e508b349d145b9f142aa3ee8b3ce1d3a4':
  qsvenc: print warnings from encode/init

Merged-by: Mark Thompson <sw@jkqxz.net>
2017-03-12 15:21:41 +00:00
Mark Thompson
15887a410c Merge commit '95414eb2dc63a6f934275b4ed33dedd4369f2c49'
* commit '95414eb2dc63a6f934275b4ed33dedd4369f2c49':
  qsv: print more complete error messages

Merged-by: Mark Thompson <sw@jkqxz.net>
2017-03-12 15:19:05 +00:00
Mark Thompson
210dd7bbb2 Merge commit '21962261c74aed4df00ae8348a5e2d1ecb67c52d'
* commit '21962261c74aed4df00ae8348a5e2d1ecb67c52d':
  qsv: handle the semi-packed formats in map_fourcc as well

Merged-by: Mark Thompson <sw@jkqxz.net>
2017-03-12 14:21:37 +00:00
Anton Khirnov
984736dd9e lavc: make sure not to return EAGAIN from codecs
This error is treated specially by the API.

CC: libav-stable@libav.org
2017-02-25 09:57:44 +01:00
Diego Biurrun
715b824346 qsv: Drop some unused variables 2016-11-17 16:53:48 +01:00
Mark Thompson
e0b164576f qsv: Add VP8 decoder 2016-11-14 19:38:20 +00:00
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.
2016-11-14 19:38:19 +00:00
Hendrik Leppkes
3c81fa9a9c Merge commit '92736c74fb1633e36f7134a880422a9b7db14d3f'
* commit '92736c74fb1633e36f7134a880422a9b7db14d3f':
  qsvdec: add support for P010 (10-bit 420) decoding

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-14 15:20:00 +01:00
Hendrik Leppkes
1bc6cdf2fc Merge commit '536bb17e9659c5ed7576a218d4085cdd6d5742fa'
* commit '536bb17e9659c5ed7576a218d4085cdd6d5742fa':
  qsvdec: make ff_qsv_map_pixfmt() return a MFX fourcc as well

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-14 15:19:43 +01:00
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>
2016-11-07 12:48:00 +01:00
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>
2016-11-07 12:47:54 +01:00
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.
2016-10-31 19:23:40 +00:00
Anton Khirnov
8e07c22e50 qsvenc: print warnings from encode/init 2016-07-22 19:08:13 +02:00
Anton Khirnov
95414eb2dc qsv: print more complete error messages
Include the libmfx error code and its description
2016-07-22 19:08:13 +02:00
Anton Khirnov
21962261c7 qsv: handle the semi-packed formats in map_fourcc as well
This will allow using this function for encoding as well, where the
input format is already the semi-packed version.
2016-07-22 19:08:13 +02:00
Anton Khirnov
92736c74fb qsvdec: add support for P010 (10-bit 420) decoding 2016-07-03 09:13:29 +02:00
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.
2016-07-03 09:13:29 +02:00
Anton Khirnov
ad9c9440d5 qsvenc: support getting the session from an AVHWFramesContext 2016-06-21 19:53:38 +02:00
Anton Khirnov
a0524d9b1e qsvdec: support getting the session from an AVHWFramesContext 2016-06-21 19:53:38 +02:00
Derek Buitenhuis
c182845068 Merge commit '92c1a83ee9394b39d68f6affd9104752a03714f8'
* commit '92c1a83ee9394b39d68f6affd9104752a03714f8':
  qsv: Fix loading multiple plugins

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-13 17:31:36 +01:00