Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
b47446cc
Commit
b47446cc
authored
Mar 25, 2019
by
Zhong Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/qsvenc: make the queried libmfx version easily reused
Signed-off-by:
Zhong Li
<
zhong.li@intel.com
>
parent
81ae387a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
qsvenc.c
libavcodec/qsvenc.c
+8
-9
qsvenc.h
libavcodec/qsvenc.h
+2
-0
No files found.
libavcodec/qsvenc.c
View file @
b47446cc
...
@@ -468,13 +468,6 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
...
@@ -468,13 +468,6 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
int
target_bitrate_kbps
,
max_bitrate_kbps
,
brc_param_multiplier
;
int
target_bitrate_kbps
,
max_bitrate_kbps
,
brc_param_multiplier
;
int
buffer_size_in_kilobytes
,
initial_delay_in_kilobytes
;
int
buffer_size_in_kilobytes
,
initial_delay_in_kilobytes
;
int
ret
;
int
ret
;
mfxVersion
ver
;
ret
=
MFXQueryVersion
(
q
->
session
,
&
ver
);
if
(
ret
!=
MFX_ERR_NONE
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error getting the session handle
\n
"
);
return
AVERROR_UNKNOWN
;
}
ret
=
ff_qsv_codec_id_to_mfx
(
avctx
->
codec_id
);
ret
=
ff_qsv_codec_id_to_mfx
(
avctx
->
codec_id
);
if
(
ret
<
0
)
if
(
ret
<
0
)
...
@@ -530,7 +523,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
...
@@ -530,7 +523,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
// If the minor version is greater than or equal to 19,
// If the minor version is greater than or equal to 19,
// then can use the same alignment settings as H.264 for HEVC
// then can use the same alignment settings as H.264 for HEVC
q
->
width_align
=
(
avctx
->
codec_id
!=
AV_CODEC_ID_HEVC
||
q
->
width_align
=
(
avctx
->
codec_id
!=
AV_CODEC_ID_HEVC
||
QSV_RUNTIME_VERSION_ATLEAST
(
ver
,
1
,
19
))
?
16
:
32
;
QSV_RUNTIME_VERSION_ATLEAST
(
q
->
ver
,
1
,
19
))
?
16
:
32
;
q
->
param
.
mfx
.
FrameInfo
.
Width
=
FFALIGN
(
avctx
->
width
,
q
->
width_align
);
q
->
param
.
mfx
.
FrameInfo
.
Width
=
FFALIGN
(
avctx
->
width
,
q
->
width_align
);
if
(
avctx
->
flags
&
AV_CODEC_FLAG_INTERLACED_DCT
)
{
if
(
avctx
->
flags
&
AV_CODEC_FLAG_INTERLACED_DCT
)
{
...
@@ -729,7 +722,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
...
@@ -729,7 +722,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
#endif
#endif
#if QSV_HAVE_MF
#if QSV_HAVE_MF
if
(
QSV_RUNTIME_VERSION_ATLEAST
(
ver
,
1
,
25
))
{
if
(
QSV_RUNTIME_VERSION_ATLEAST
(
q
->
ver
,
1
,
25
))
{
q
->
extmfp
.
Header
.
BufferId
=
MFX_EXTBUFF_MULTI_FRAME_PARAM
;
q
->
extmfp
.
Header
.
BufferId
=
MFX_EXTBUFF_MULTI_FRAME_PARAM
;
q
->
extmfp
.
Header
.
BufferSz
=
sizeof
(
q
->
extmfp
);
q
->
extmfp
.
Header
.
BufferSz
=
sizeof
(
q
->
extmfp
);
...
@@ -985,6 +978,12 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q)
...
@@ -985,6 +978,12 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q)
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
ret
=
MFXQueryVersion
(
q
->
session
,
&
q
->
ver
);
if
(
ret
<
0
)
{
return
ff_qsv_print_error
(
avctx
,
ret
,
"Error querying mfx version"
);
}
// in the mfxInfoMFX struct, JPEG is different from other codecs
// in the mfxInfoMFX struct, JPEG is different from other codecs
switch
(
avctx
->
codec_id
)
{
switch
(
avctx
->
codec_id
)
{
case
AV_CODEC_ID_MJPEG
:
case
AV_CODEC_ID_MJPEG
:
...
...
libavcodec/qsvenc.h
View file @
b47446cc
...
@@ -131,6 +131,8 @@ typedef struct QSVEncContext {
...
@@ -131,6 +131,8 @@ typedef struct QSVEncContext {
QSVFramesContext
frames_ctx
;
QSVFramesContext
frames_ctx
;
mfxVersion
ver
;
// options set by the caller
// options set by the caller
int
async_depth
;
int
async_depth
;
int
idr_interval
;
int
idr_interval
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment