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
66acb76b
Commit
66acb76b
authored
Jun 16, 2015
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: add Intel libmfx-based HEVC encoder
parent
3a85397e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
203 additions
and
17 deletions
+203
-17
Changelog
Changelog
+1
-1
configure
configure
+1
-0
Makefile
libavcodec/Makefile
+1
-0
allcodecs.c
libavcodec/allcodecs.c
+1
-0
hevc.h
libavcodec/hevc.h
+3
-0
hevc_ps_enc.c
libavcodec/hevc_ps_enc.c
+116
-0
qsv.c
libavcodec/qsv.c
+50
-1
qsv_internal.h
libavcodec/qsv_internal.h
+6
-1
qsvdec.c
libavcodec/qsvdec.c
+1
-1
qsvenc.c
libavcodec/qsvenc.c
+18
-11
qsvenc.h
libavcodec/qsvenc.h
+3
-0
qsvenc_hevc.c
libavcodec/qsvenc_hevc.c
+0
-0
version.h
libavcodec/version.h
+2
-2
No files found.
Changelog
View file @
66acb76b
...
@@ -38,7 +38,7 @@ version <next>:
...
@@ -38,7 +38,7 @@ version <next>:
- DirectDraw Surface image/texture decoder
- DirectDraw Surface image/texture decoder
- rewritten ASF demuxer
- rewritten ASF demuxer
- Go2Meeting decoding support
- Go2Meeting decoding support
- Intel QSV-accelerated MPEG-2 video encoding
- Intel QSV-accelerated MPEG-2 video
and HEVC
encoding
version 11:
version 11:
...
...
configure
View file @
66acb76b
...
@@ -1869,6 +1869,7 @@ hap_encoder_deps="libsnappy"
...
@@ -1869,6 +1869,7 @@ hap_encoder_deps="libsnappy"
hap_encoder_select
=
"texturedspenc"
hap_encoder_select
=
"texturedspenc"
hevc_decoder_select
=
"bswapdsp cabac golomb videodsp"
hevc_decoder_select
=
"bswapdsp cabac golomb videodsp"
hevc_nvenc_encoder_deps
=
"nvenc"
hevc_nvenc_encoder_deps
=
"nvenc"
hevc_qsv_encoder_select
=
"qsvenc"
huffyuv_decoder_select
=
"bswapdsp huffyuvdsp"
huffyuv_decoder_select
=
"bswapdsp huffyuvdsp"
huffyuv_encoder_select
=
"bswapdsp huffman huffyuvencdsp"
huffyuv_encoder_select
=
"bswapdsp huffman huffyuvencdsp"
iac_decoder_select
=
"imc_decoder"
iac_decoder_select
=
"imc_decoder"
...
...
libavcodec/Makefile
View file @
66acb76b
...
@@ -242,6 +242,7 @@ OBJS-$(CONFIG_HEVC_DECODER) += hevc.o hevc_mvs.o hevc_ps.o hevc_sei.o
...
@@ -242,6 +242,7 @@ OBJS-$(CONFIG_HEVC_DECODER) += hevc.o hevc_mvs.o hevc_ps.o hevc_sei.o
hevc_cabac.o
hevc_refs.o
hevcpred.o
\
hevc_cabac.o
hevc_refs.o
hevcpred.o
\
hevcdsp.o
hevc_filter.o
hevc_parse.o
hevcdsp.o
hevc_filter.o
hevc_parse.o
OBJS-$(CONFIG_HEVC_NVENC_ENCODER)
+=
nvenc_hevc.o
OBJS-$(CONFIG_HEVC_NVENC_ENCODER)
+=
nvenc_hevc.o
OBJS-$(CONFIG_HEVC_QSV_ENCODER)
+=
qsvenc_hevc.o
hevc_ps_enc.o
hevc_parse.o
OBJS-$(CONFIG_HNM4_VIDEO_DECODER)
+=
hnm4video.o
OBJS-$(CONFIG_HNM4_VIDEO_DECODER)
+=
hnm4video.o
OBJS-$(CONFIG_HQ_HQA_DECODER)
+=
hq_hqa.o
hq_hqadata.o
hq_hqadsp.o
\
OBJS-$(CONFIG_HQ_HQA_DECODER)
+=
hq_hqa.o
hq_hqadata.o
hq_hqadsp.o
\
canopus.o
canopus.o
...
...
libavcodec/allcodecs.c
View file @
66acb76b
...
@@ -484,6 +484,7 @@ void avcodec_register_all(void)
...
@@ -484,6 +484,7 @@ void avcodec_register_all(void)
REGISTER_ENCODER
(
H264_NVENC
,
h264_nvenc
);
REGISTER_ENCODER
(
H264_NVENC
,
h264_nvenc
);
REGISTER_ENCODER
(
H264_QSV
,
h264_qsv
);
REGISTER_ENCODER
(
H264_QSV
,
h264_qsv
);
REGISTER_ENCODER
(
HEVC_NVENC
,
hevc_nvenc
);
REGISTER_ENCODER
(
HEVC_NVENC
,
hevc_nvenc
);
REGISTER_ENCODER
(
HEVC_QSV
,
hevc_qsv
);
REGISTER_ENCODER
(
MPEG2_QSV
,
mpeg2_qsv
);
REGISTER_ENCODER
(
MPEG2_QSV
,
mpeg2_qsv
);
/* parsers */
/* parsers */
...
...
libavcodec/hevc.h
View file @
66acb76b
...
@@ -1008,6 +1008,9 @@ void ff_hevc_pred_init(HEVCPredContext *hpc, int bit_depth);
...
@@ -1008,6 +1008,9 @@ void ff_hevc_pred_init(HEVCPredContext *hpc, int bit_depth);
int
ff_hevc_extract_rbsp
(
const
uint8_t
*
src
,
int
length
,
int
ff_hevc_extract_rbsp
(
const
uint8_t
*
src
,
int
length
,
HEVCNAL
*
nal
);
HEVCNAL
*
nal
);
int
ff_hevc_encode_nal_vps
(
HEVCVPS
*
vps
,
unsigned
int
id
,
uint8_t
*
buf
,
int
buf_size
);
extern
const
uint8_t
ff_hevc_qpel_extra_before
[
4
];
extern
const
uint8_t
ff_hevc_qpel_extra_before
[
4
];
extern
const
uint8_t
ff_hevc_qpel_extra_after
[
4
];
extern
const
uint8_t
ff_hevc_qpel_extra_after
[
4
];
extern
const
uint8_t
ff_hevc_qpel_extra
[
4
];
extern
const
uint8_t
ff_hevc_qpel_extra
[
4
];
...
...
libavcodec/hevc_ps_enc.c
0 → 100644
View file @
66acb76b
/*
* HEVC Parameter Set encoding
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "golomb.h"
#include "hevc.h"
#include "put_bits.h"
static
void
write_ptl_layer
(
PutBitContext
*
pb
,
PTLCommon
*
ptl
)
{
int
i
;
put_bits
(
pb
,
2
,
ptl
->
profile_space
);
put_bits
(
pb
,
1
,
ptl
->
tier_flag
);
put_bits
(
pb
,
5
,
ptl
->
profile_idc
);
for
(
i
=
0
;
i
<
32
;
i
++
)
put_bits
(
pb
,
1
,
ptl
->
profile_compatibility_flag
[
i
]);
put_bits
(
pb
,
1
,
ptl
->
progressive_source_flag
);
put_bits
(
pb
,
1
,
ptl
->
interlaced_source_flag
);
put_bits
(
pb
,
1
,
ptl
->
non_packed_constraint_flag
);
put_bits
(
pb
,
1
,
ptl
->
frame_only_constraint_flag
);
put_bits32
(
pb
,
0
);
// reserved
put_bits
(
pb
,
12
,
0
);
// reserved
}
static
void
write_ptl
(
PutBitContext
*
pb
,
PTL
*
ptl
,
int
max_num_sub_layers
)
{
int
i
;
write_ptl_layer
(
pb
,
&
ptl
->
general_ptl
);
put_bits
(
pb
,
8
,
ptl
->
general_ptl
.
level_idc
);
for
(
i
=
0
;
i
<
max_num_sub_layers
-
1
;
i
++
)
{
put_bits
(
pb
,
1
,
ptl
->
sub_layer_profile_present_flag
[
i
]);
put_bits
(
pb
,
1
,
ptl
->
sub_layer_level_present_flag
[
i
]);
}
if
(
max_num_sub_layers
>
1
)
for
(
i
=
max_num_sub_layers
-
1
;
i
<
8
;
i
++
)
put_bits
(
pb
,
2
,
0
);
// reserved
for
(
i
=
0
;
i
<
max_num_sub_layers
-
1
;
i
++
)
{
if
(
ptl
->
sub_layer_profile_present_flag
[
i
])
write_ptl_layer
(
pb
,
&
ptl
->
sub_layer_ptl
[
i
]);
if
(
ptl
->
sub_layer_level_present_flag
[
i
])
put_bits
(
pb
,
8
,
ptl
->
sub_layer_ptl
[
i
].
level_idc
);
}
}
int
ff_hevc_encode_nal_vps
(
HEVCVPS
*
vps
,
unsigned
int
id
,
uint8_t
*
buf
,
int
buf_size
)
{
PutBitContext
pb
;
int
i
;
init_put_bits
(
&
pb
,
buf
,
buf_size
);
put_bits
(
&
pb
,
4
,
id
);
put_bits
(
&
pb
,
2
,
3
);
// reserved
put_bits
(
&
pb
,
6
,
vps
->
vps_max_layers
-
1
);
put_bits
(
&
pb
,
3
,
vps
->
vps_max_sub_layers
-
1
);
put_bits
(
&
pb
,
1
,
vps
->
vps_temporal_id_nesting_flag
);
put_bits
(
&
pb
,
16
,
0xffff
);
// reserved
write_ptl
(
&
pb
,
&
vps
->
ptl
,
vps
->
vps_max_sub_layers
);
put_bits
(
&
pb
,
1
,
vps
->
vps_sub_layer_ordering_info_present_flag
);
for
(
i
=
vps
->
vps_sub_layer_ordering_info_present_flag
?
0
:
vps
->
vps_max_layers
-
1
;
i
<
vps
->
vps_max_sub_layers
;
i
++
)
{
set_ue_golomb
(
&
pb
,
vps
->
vps_max_dec_pic_buffering
[
i
]
-
1
);
set_ue_golomb
(
&
pb
,
vps
->
vps_num_reorder_pics
[
i
]);
set_ue_golomb
(
&
pb
,
vps
->
vps_max_latency_increase
[
i
]
+
1
);
}
put_bits
(
&
pb
,
6
,
vps
->
vps_max_layer_id
);
set_ue_golomb
(
&
pb
,
vps
->
vps_num_layer_sets
-
1
);
// writing layer_id_included_flag not supported
if
(
vps
->
vps_num_layer_sets
>
1
)
return
AVERROR_PATCHWELCOME
;
put_bits
(
&
pb
,
1
,
vps
->
vps_timing_info_present_flag
);
if
(
vps
->
vps_timing_info_present_flag
)
{
put_bits32
(
&
pb
,
vps
->
vps_num_units_in_tick
);
put_bits32
(
&
pb
,
vps
->
vps_time_scale
);
put_bits
(
&
pb
,
1
,
vps
->
vps_poc_proportional_to_timing_flag
);
if
(
vps
->
vps_poc_proportional_to_timing_flag
)
set_ue_golomb
(
&
pb
,
vps
->
vps_num_ticks_poc_diff_one
-
1
);
// writing HRD parameters not supported
if
(
vps
->
vps_num_hrd_parameters
)
return
AVERROR_PATCHWELCOME
;
}
put_bits
(
&
pb
,
1
,
0
);
// extension flag
put_bits
(
&
pb
,
1
,
1
);
// stop bit
avpriv_align_put_bits
(
&
pb
);
return
put_bits_count
(
&
pb
)
/
8
;
}
libavcodec/qsv.c
View file @
66acb76b
...
@@ -19,7 +19,12 @@
...
@@ -19,7 +19,12 @@
*/
*/
#include <mfx/mfxvideo.h>
#include <mfx/mfxvideo.h>
#include <mfx/mfxplugin.h>
#include <stdio.h>
#include <string.h>
#include "libavutil/avstring.h"
#include "libavutil/error.h"
#include "libavutil/error.h"
#include "avcodec.h"
#include "avcodec.h"
...
@@ -30,6 +35,10 @@ int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
...
@@ -30,6 +35,10 @@ int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
switch
(
codec_id
)
{
switch
(
codec_id
)
{
case
AV_CODEC_ID_H264
:
case
AV_CODEC_ID_H264
:
return
MFX_CODEC_AVC
;
return
MFX_CODEC_AVC
;
#if QSV_VERSION_ATLEAST(1, 8)
case
AV_CODEC_ID_HEVC
:
return
MFX_CODEC_HEVC
;
#endif
case
AV_CODEC_ID_MPEG1VIDEO
:
case
AV_CODEC_ID_MPEG1VIDEO
:
case
AV_CODEC_ID_MPEG2VIDEO
:
case
AV_CODEC_ID_MPEG2VIDEO
:
return
MFX_CODEC_MPEG2
;
return
MFX_CODEC_MPEG2
;
...
@@ -77,7 +86,8 @@ int ff_qsv_error(int mfx_err)
...
@@ -77,7 +86,8 @@ int ff_qsv_error(int mfx_err)
}
}
}
}
int
ff_qsv_init_internal_session
(
AVCodecContext
*
avctx
,
mfxSession
*
session
)
int
ff_qsv_init_internal_session
(
AVCodecContext
*
avctx
,
mfxSession
*
session
,
const
char
*
load_plugins
)
{
{
mfxIMPL
impl
=
MFX_IMPL_AUTO_ANY
;
mfxIMPL
impl
=
MFX_IMPL_AUTO_ANY
;
mfxVersion
ver
=
{
{
QSV_VERSION_MINOR
,
QSV_VERSION_MAJOR
}
};
mfxVersion
ver
=
{
{
QSV_VERSION_MINOR
,
QSV_VERSION_MAJOR
}
};
...
@@ -107,6 +117,45 @@ int ff_qsv_init_internal_session(AVCodecContext *avctx, mfxSession *session)
...
@@ -107,6 +117,45 @@ int ff_qsv_init_internal_session(AVCodecContext *avctx, mfxSession *session)
desc
=
"unknown"
;
desc
=
"unknown"
;
}
}
if
(
load_plugins
&&
*
load_plugins
)
{
while
(
*
load_plugins
)
{
mfxPluginUID
uid
;
int
i
,
err
=
0
;
char
*
plugin
=
av_get_token
(
&
load_plugins
,
":"
);
if
(
!
plugin
)
return
AVERROR
(
ENOMEM
);
if
(
strlen
(
plugin
)
!=
2
*
sizeof
(
uid
.
Data
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid plugin UID length
\n
"
);
err
=
AVERROR
(
EINVAL
);
goto
load_plugin_fail
;
}
for
(
i
=
0
;
i
<
sizeof
(
uid
.
Data
);
i
++
)
{
err
=
sscanf
(
plugin
+
2
*
i
,
"%2hhx"
,
uid
.
Data
+
i
);
if
(
err
!=
1
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid plugin UID
\n
"
);
err
=
AVERROR
(
EINVAL
);
goto
load_plugin_fail
;
}
}
ret
=
MFXVideoUSER_Load
(
*
session
,
&
uid
,
1
);
if
(
ret
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Could not load the requested plugin: %s
\n
"
,
plugin
);
err
=
ff_qsv_error
(
ret
);
goto
load_plugin_fail
;
}
load_plugin_fail:
av_freep
(
&
plugin
);
if
(
err
<
0
)
return
err
;
}
}
av_log
(
avctx
,
AV_LOG_VERBOSE
,
av_log
(
avctx
,
AV_LOG_VERBOSE
,
"Initialized an internal MFX session using %s implementation
\n
"
,
"Initialized an internal MFX session using %s implementation
\n
"
,
desc
);
desc
);
...
...
libavcodec/qsv_internal.h
View file @
66acb76b
...
@@ -30,6 +30,10 @@
...
@@ -30,6 +30,10 @@
#define ASYNC_DEPTH_DEFAULT 4 // internal parallelism
#define ASYNC_DEPTH_DEFAULT 4 // internal parallelism
#define QSV_VERSION_ATLEAST(MAJOR, MINOR) \
(MFX_VERSION_MAJOR > (MAJOR) || \
MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >= (MINOR))
typedef
struct
QSVFrame
{
typedef
struct
QSVFrame
{
AVFrame
*
frame
;
AVFrame
*
frame
;
mfxFrameSurface1
*
surface
;
mfxFrameSurface1
*
surface
;
...
@@ -46,6 +50,7 @@ int ff_qsv_error(int mfx_err);
...
@@ -46,6 +50,7 @@ int ff_qsv_error(int mfx_err);
int
ff_qsv_codec_id_to_mfx
(
enum
AVCodecID
codec_id
);
int
ff_qsv_codec_id_to_mfx
(
enum
AVCodecID
codec_id
);
int
ff_qsv_init_internal_session
(
AVCodecContext
*
avctx
,
mfxSession
*
session
);
int
ff_qsv_init_internal_session
(
AVCodecContext
*
avctx
,
mfxSession
*
session
,
const
char
*
load_plugins
);
#endif
/* AVCODEC_QSV_INTERNAL_H */
#endif
/* AVCODEC_QSV_INTERNAL_H */
libavcodec/qsvdec.c
View file @
66acb76b
...
@@ -52,7 +52,7 @@ static int qsv_init_session(AVCodecContext *avctx, QSVContext *q, mfxSession ses
...
@@ -52,7 +52,7 @@ static int qsv_init_session(AVCodecContext *avctx, QSVContext *q, mfxSession ses
{
{
if
(
!
session
)
{
if
(
!
session
)
{
if
(
!
q
->
internal_session
)
{
if
(
!
q
->
internal_session
)
{
int
ret
=
ff_qsv_init_internal_session
(
avctx
,
&
q
->
internal_session
);
int
ret
=
ff_qsv_init_internal_session
(
avctx
,
&
q
->
internal_session
,
NULL
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
}
}
...
...
libavcodec/qsvenc.c
View file @
66acb76b
...
@@ -49,6 +49,8 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
...
@@ -49,6 +49,8 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
return
AVERROR_BUG
;
return
AVERROR_BUG
;
q
->
param
.
mfx
.
CodecId
=
ret
;
q
->
param
.
mfx
.
CodecId
=
ret
;
q
->
width_align
=
avctx
->
codec_id
==
AV_CODEC_ID_HEVC
?
32
:
16
;
if
(
avctx
->
level
>
0
)
if
(
avctx
->
level
>
0
)
q
->
param
.
mfx
.
CodecLevel
=
avctx
->
level
;
q
->
param
.
mfx
.
CodecLevel
=
avctx
->
level
;
...
@@ -65,7 +67,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
...
@@ -65,7 +67,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
q
->
param
.
mfx
.
BufferSizeInKB
=
0
;
q
->
param
.
mfx
.
BufferSizeInKB
=
0
;
q
->
param
.
mfx
.
FrameInfo
.
FourCC
=
MFX_FOURCC_NV12
;
q
->
param
.
mfx
.
FrameInfo
.
FourCC
=
MFX_FOURCC_NV12
;
q
->
param
.
mfx
.
FrameInfo
.
Width
=
FFALIGN
(
avctx
->
width
,
16
);
q
->
param
.
mfx
.
FrameInfo
.
Width
=
FFALIGN
(
avctx
->
width
,
q
->
width_align
);
q
->
param
.
mfx
.
FrameInfo
.
Height
=
FFALIGN
(
avctx
->
height
,
32
);
q
->
param
.
mfx
.
FrameInfo
.
Height
=
FFALIGN
(
avctx
->
height
,
32
);
q
->
param
.
mfx
.
FrameInfo
.
CropX
=
0
;
q
->
param
.
mfx
.
FrameInfo
.
CropX
=
0
;
q
->
param
.
mfx
.
FrameInfo
.
CropY
=
0
;
q
->
param
.
mfx
.
FrameInfo
.
CropY
=
0
;
...
@@ -124,15 +126,19 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
...
@@ -124,15 +126,19 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
break
;
break
;
}
}
q
->
extco
.
Header
.
BufferId
=
MFX_EXTBUFF_CODING_OPTION
;
// the HEVC encoder plugin currently fails if coding options
q
->
extco
.
Header
.
BufferSz
=
sizeof
(
q
->
extco
);
// are provided
q
->
extco
.
CAVLC
=
avctx
->
coder_type
==
FF_CODER_TYPE_VLC
?
if
(
avctx
->
codec_id
!=
AV_CODEC_ID_HEVC
)
{
MFX_CODINGOPTION_ON
:
MFX_CODINGOPTION_UNKNOWN
;
q
->
extco
.
Header
.
BufferId
=
MFX_EXTBUFF_CODING_OPTION
;
q
->
extco
.
Header
.
BufferSz
=
sizeof
(
q
->
extco
);
q
->
extco
.
CAVLC
=
avctx
->
coder_type
==
FF_CODER_TYPE_VLC
?
MFX_CODINGOPTION_ON
:
MFX_CODINGOPTION_UNKNOWN
;
q
->
extparam
[
0
]
=
(
mfxExtBuffer
*
)
&
q
->
extco
;
q
->
extparam
[
0
]
=
(
mfxExtBuffer
*
)
&
q
->
extco
;
q
->
param
.
ExtParam
=
q
->
extparam
;
q
->
param
.
ExtParam
=
q
->
extparam
;
q
->
param
.
NumExtParam
=
FF_ARRAY_ELEMS
(
q
->
extparam
);
q
->
param
.
NumExtParam
=
FF_ARRAY_ELEMS
(
q
->
extparam
);
}
return
0
;
return
0
;
}
}
...
@@ -199,7 +205,8 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q)
...
@@ -199,7 +205,8 @@ int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q)
}
}
if
(
!
q
->
session
)
{
if
(
!
q
->
session
)
{
ret
=
ff_qsv_init_internal_session
(
avctx
,
&
q
->
internal_session
);
ret
=
ff_qsv_init_internal_session
(
avctx
,
&
q
->
internal_session
,
q
->
load_plugins
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
...
@@ -303,9 +310,9 @@ static int submit_frame(QSVEncContext *q, const AVFrame *frame,
...
@@ -303,9 +310,9 @@ static int submit_frame(QSVEncContext *q, const AVFrame *frame,
}
}
/* make a copy if the input is not padded as libmfx requires */
/* make a copy if the input is not padded as libmfx requires */
if
(
frame
->
height
&
31
||
frame
->
linesize
[
0
]
&
15
)
{
if
(
frame
->
height
&
31
||
frame
->
linesize
[
0
]
&
(
q
->
width_align
-
1
)
)
{
qf
->
frame
->
height
=
FFALIGN
(
frame
->
height
,
32
);
qf
->
frame
->
height
=
FFALIGN
(
frame
->
height
,
32
);
qf
->
frame
->
width
=
FFALIGN
(
frame
->
width
,
16
);
qf
->
frame
->
width
=
FFALIGN
(
frame
->
width
,
q
->
width_align
);
ret
=
ff_get_buffer
(
q
->
avctx
,
qf
->
frame
,
AV_GET_BUFFER_FLAG_REF
);
ret
=
ff_get_buffer
(
q
->
avctx
,
qf
->
frame
,
AV_GET_BUFFER_FLAG_REF
);
if
(
ret
<
0
)
if
(
ret
<
0
)
...
...
libavcodec/qsvenc.h
View file @
66acb76b
...
@@ -42,6 +42,7 @@ typedef struct QSVEncContext {
...
@@ -42,6 +42,7 @@ typedef struct QSVEncContext {
mfxSession
internal_session
;
mfxSession
internal_session
;
int
packet_size
;
int
packet_size
;
int
width_align
;
mfxVideoParam
param
;
mfxVideoParam
param
;
mfxFrameAllocRequest
req
;
mfxFrameAllocRequest
req
;
...
@@ -56,6 +57,8 @@ typedef struct QSVEncContext {
...
@@ -56,6 +57,8 @@ typedef struct QSVEncContext {
int
preset
;
int
preset
;
int
avbr_accuracy
;
int
avbr_accuracy
;
int
avbr_convergence
;
int
avbr_convergence
;
char
*
load_plugins
;
}
QSVEncContext
;
}
QSVEncContext
;
int
ff_qsv_enc_init
(
AVCodecContext
*
avctx
,
QSVEncContext
*
q
);
int
ff_qsv_enc_init
(
AVCodecContext
*
avctx
,
QSVEncContext
*
q
);
...
...
libavcodec/qsvenc_hevc.c
0 → 100644
View file @
66acb76b
This diff is collapsed.
Click to expand it.
libavcodec/version.h
View file @
66acb76b
...
@@ -29,8 +29,8 @@
...
@@ -29,8 +29,8 @@
#include "libavutil/version.h"
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 56
#define LIBAVCODEC_VERSION_MAJOR 56
#define LIBAVCODEC_VERSION_MINOR 3
1
#define LIBAVCODEC_VERSION_MINOR 3
2
#define LIBAVCODEC_VERSION_MICRO
2
#define LIBAVCODEC_VERSION_MICRO
0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
LIBAVCODEC_VERSION_MINOR, \
...
...
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