Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
2c62fcdf
Commit
2c62fcdf
authored
Mar 23, 2016
by
Mark Thompson
Committed by
Anton Khirnov
Mar 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: VAAPI H.264 encoder
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
104c804b
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
967 additions
and
1 deletion
+967
-1
Changelog
Changelog
+1
-0
configure
configure
+3
-0
Makefile
libavcodec/Makefile
+1
-0
allcodecs.c
libavcodec/allcodecs.c
+1
-0
vaapi_encode_h264.c
libavcodec/vaapi_encode_h264.c
+847
-0
vaapi_encode_h26x.c
libavcodec/vaapi_encode_h26x.c
+68
-0
vaapi_encode_h26x.h
libavcodec/vaapi_encode_h26x.h
+45
-0
version.h
libavcodec/version.h
+1
-1
No files found.
Changelog
View file @
2c62fcdf
...
...
@@ -53,6 +53,7 @@ version <next>:
- compressed SWF
- VAAPI-accelerated format conversion and scaling
- libnpp/CUDA-accelerated format conversion and scaling
- VAAPI-accelerate H.264 encoding
version 11:
...
...
configure
View file @
2c62fcdf
...
...
@@ -1956,6 +1956,8 @@ h264_qsv_decoder_deps="libmfx"
h264_qsv_decoder_select
=
"h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel"
h264_qsv_encoder_deps
=
"libmfx"
h264_qsv_encoder_select
=
"qsvenc"
h264_vaapi_encoder_deps
=
"VAEncPictureParameterBufferH264"
h264_vaapi_encoder_select
=
"vaapi_encode golomb"
hap_decoder_select
=
"snappy texturedsp"
hap_encoder_deps
=
"libsnappy"
hap_encoder_select
=
"texturedspenc"
...
...
@@ -4467,6 +4469,7 @@ check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
check_type
"d3d9.h dxva2api.h"
DXVA2_ConfigPictureDecode
-D_WIN32_WINNT
=
0x0602
check_type
"va/va.h va/va_vpp.h"
"VAProcPipelineParameterBuffer"
check_type
"va/va.h va/va_enc_h264.h"
"VAEncPictureParameterBufferH264"
check_type
"vdpau/vdpau.h"
"VdpPictureInfoHEVC"
...
...
libavcodec/Makefile
View file @
2c62fcdf
...
...
@@ -259,6 +259,7 @@ OBJS-$(CONFIG_H264_MMAL_DECODER) += mmaldec.o
OBJS-$(CONFIG_H264_NVENC_ENCODER)
+=
nvenc_h264.o
OBJS-$(CONFIG_H264_QSV_DECODER)
+=
qsvdec_h2645.o
OBJS-$(CONFIG_H264_QSV_ENCODER)
+=
qsvenc_h264.o
OBJS-$(CONFIG_H264_VAAPI_ENCODER)
+=
vaapi_encode_h264.o
vaapi_encode_h26x.o
OBJS-$(CONFIG_HAP_DECODER)
+=
hapdec.o
hap.o
OBJS-$(CONFIG_HAP_ENCODER)
+=
hapenc.o
hap.o
OBJS-$(CONFIG_HEVC_DECODER)
+=
hevc.o
hevc_mvs.o
hevc_ps.o
hevc_sei.o
\
...
...
libavcodec/allcodecs.c
View file @
2c62fcdf
...
...
@@ -166,6 +166,7 @@ void avcodec_register_all(void)
REGISTER_DECODER
(
H264
,
h264
);
REGISTER_DECODER
(
H264_MMAL
,
h264_mmal
);
REGISTER_DECODER
(
H264_QSV
,
h264_qsv
);
REGISTER_ENCODER
(
H264_VAAPI
,
h264_vaapi
);
REGISTER_ENCDEC
(
HAP
,
hap
);
REGISTER_DECODER
(
HEVC
,
hevc
);
REGISTER_DECODER
(
HEVC_QSV
,
hevc_qsv
);
...
...
libavcodec/vaapi_encode_h264.c
0 → 100644
View file @
2c62fcdf
This diff is collapsed.
Click to expand it.
libavcodec/vaapi_encode_h26x.c
0 → 100644
View file @
2c62fcdf
/*
* 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 <stdint.h>
#include "vaapi_encode_h26x.h"
int
ff_vaapi_encode_h26x_nal_unit_to_byte_stream
(
uint8_t
*
dst
,
size_t
*
dst_bit_len
,
uint8_t
*
src
,
size_t
src_bit_len
)
{
size_t
dp
,
sp
;
int
zero_run
=
0
;
size_t
dst_len
=
*
dst_bit_len
/
8
;
size_t
src_len
=
(
src_bit_len
+
7
)
/
8
;
int
trailing_zeroes
=
src_len
*
8
-
src_bit_len
;
if
(
dst_len
<
src_len
+
4
)
{
// Definitely doesn't fit.
goto
fail
;
}
// Start code.
dst
[
0
]
=
dst
[
1
]
=
dst
[
2
]
=
0
;
dst
[
3
]
=
1
;
dp
=
4
;
for
(
sp
=
0
;
sp
<
src_len
;
sp
++
)
{
if
(
dp
>=
dst_len
)
goto
fail
;
if
(
zero_run
<
2
)
{
if
(
src
[
sp
]
==
0
)
++
zero_run
;
else
zero_run
=
0
;
}
else
{
if
((
src
[
sp
]
&
~
3
)
==
0
)
{
// emulation_prevention_three_byte
dst
[
dp
++
]
=
3
;
if
(
dp
>=
dst_len
)
goto
fail
;
}
zero_run
=
src
[
sp
]
==
0
;
}
dst
[
dp
++
]
=
src
[
sp
];
}
*
dst_bit_len
=
8
*
dp
-
trailing_zeroes
;
return
0
;
fail:
*
dst_bit_len
=
0
;
return
AVERROR
(
ENOSPC
);
}
libavcodec/vaapi_encode_h26x.h
0 → 100644
View file @
2c62fcdf
/*
* 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
*/
#ifndef AVCODEC_VAAPI_ENCODE_H26X_H
#define AVCODEC_VAAPI_ENCODE_H26X_H
#include <stddef.h>
#include <stdint.h>
#include "golomb.h"
#include "put_bits.h"
// Debug code may be interested in the name of the syntax element being
// for tracing purposes. Here, it is just discarded.
#define write_u(pbc, width, value, name) put_bits(pbc, width, value)
#define write_ue(pbc, value, name) set_ue_golomb(pbc, value)
#define write_se(pbc, value, name) set_se_golomb(pbc, value)
#define u(width, ...) write_u(pbc, width, __VA_ARGS__)
#define ue(...) write_ue(pbc, __VA_ARGS__)
#define se(...) write_se(pbc, __VA_ARGS__)
// Copy from src to dst, applying emulation prevention.
int
ff_vaapi_encode_h26x_nal_unit_to_byte_stream
(
uint8_t
*
dst
,
size_t
*
dst_len
,
uint8_t
*
src
,
size_t
src_len
);
#endif
/* AVCODEC_VAAPI_ENCODE_H26X_H */
libavcodec/version.h
View file @
2c62fcdf
...
...
@@ -28,7 +28,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 1
6
#define LIBAVCODEC_VERSION_MINOR 1
7
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
...
...
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