Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
92736c74
Commit
92736c74
authored
Jun 22, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qsvdec: add support for P010 (10-bit 420) decoding
parent
ce320cf1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
qsv.c
libavcodec/qsv.c
+3
-0
qsvdec.c
libavcodec/qsvdec.c
+11
-4
qsvdec_h2645.c
libavcodec/qsvdec_h2645.c
+2
-0
No files found.
libavcodec/qsv.c
View file @
92736c74
...
@@ -96,6 +96,9 @@ int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc)
...
@@ -96,6 +96,9 @@ int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc)
case
AV_PIX_FMT_YUVJ420P
:
case
AV_PIX_FMT_YUVJ420P
:
*
fourcc
=
MFX_FOURCC_NV12
;
*
fourcc
=
MFX_FOURCC_NV12
;
return
AV_PIX_FMT_NV12
;
return
AV_PIX_FMT_NV12
;
case
AV_PIX_FMT_YUV420P10
:
*
fourcc
=
MFX_FOURCC_P010
;
return
AV_PIX_FMT_P010
;
default:
default:
return
AVERROR
(
ENOSYS
);
return
AVERROR
(
ENOSYS
);
}
}
...
...
libavcodec/qsvdec.c
View file @
92736c74
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include "libavutil/hwcontext_qsv.h"
#include "libavutil/hwcontext_qsv.h"
#include "libavutil/mem.h"
#include "libavutil/mem.h"
#include "libavutil/log.h"
#include "libavutil/log.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "libavutil/pixfmt.h"
#include "libavutil/time.h"
#include "libavutil/time.h"
...
@@ -86,11 +87,16 @@ static int qsv_init_session(AVCodecContext *avctx, QSVContext *q, mfxSession ses
...
@@ -86,11 +87,16 @@ static int qsv_init_session(AVCodecContext *avctx, QSVContext *q, mfxSession ses
static
int
qsv_decode_init
(
AVCodecContext
*
avctx
,
QSVContext
*
q
)
static
int
qsv_decode_init
(
AVCodecContext
*
avctx
,
QSVContext
*
q
)
{
{
const
AVPixFmtDescriptor
*
desc
;
mfxSession
session
=
NULL
;
mfxSession
session
=
NULL
;
int
iopattern
=
0
;
int
iopattern
=
0
;
mfxVideoParam
param
=
{
{
0
}
};
mfxVideoParam
param
=
{
{
0
}
};
int
ret
;
int
ret
;
desc
=
av_pix_fmt_desc_get
(
avctx
->
sw_pix_fmt
);
if
(
!
desc
)
return
AVERROR_BUG
;
if
(
!
q
->
async_fifo
)
{
if
(
!
q
->
async_fifo
)
{
q
->
async_fifo
=
av_fifo_alloc
((
1
+
q
->
async_depth
)
*
q
->
async_fifo
=
av_fifo_alloc
((
1
+
q
->
async_depth
)
*
(
sizeof
(
mfxSyncPoint
*
)
+
sizeof
(
QSVFrame
*
)));
(
sizeof
(
mfxSyncPoint
*
)
+
sizeof
(
QSVFrame
*
)));
...
@@ -136,9 +142,9 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
...
@@ -136,9 +142,9 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
param
.
mfx
.
CodecProfile
=
avctx
->
profile
;
param
.
mfx
.
CodecProfile
=
avctx
->
profile
;
param
.
mfx
.
CodecLevel
=
avctx
->
level
;
param
.
mfx
.
CodecLevel
=
avctx
->
level
;
param
.
mfx
.
FrameInfo
.
BitDepthLuma
=
8
;
param
.
mfx
.
FrameInfo
.
BitDepthLuma
=
desc
->
comp
[
0
].
depth
;
param
.
mfx
.
FrameInfo
.
BitDepthChroma
=
8
;
param
.
mfx
.
FrameInfo
.
BitDepthChroma
=
desc
->
comp
[
0
].
depth
;
param
.
mfx
.
FrameInfo
.
Shift
=
0
;
param
.
mfx
.
FrameInfo
.
Shift
=
desc
->
comp
[
0
].
depth
>
8
;
param
.
mfx
.
FrameInfo
.
FourCC
=
q
->
fourcc
;
param
.
mfx
.
FrameInfo
.
FourCC
=
q
->
fourcc
;
param
.
mfx
.
FrameInfo
.
Width
=
avctx
->
coded_width
;
param
.
mfx
.
FrameInfo
.
Width
=
avctx
->
coded_width
;
param
.
mfx
.
FrameInfo
.
Height
=
avctx
->
coded_height
;
param
.
mfx
.
FrameInfo
.
Height
=
avctx
->
coded_height
;
...
@@ -452,7 +458,8 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
...
@@ -452,7 +458,8 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
qsv_format
=
ff_qsv_map_pixfmt
(
q
->
parser
->
format
,
&
q
->
fourcc
);
qsv_format
=
ff_qsv_map_pixfmt
(
q
->
parser
->
format
,
&
q
->
fourcc
);
if
(
qsv_format
<
0
)
{
if
(
qsv_format
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Only 8-bit YUV420 streams are supported.
\n
"
);
"Decoding pixel format '%s' is not supported
\n
"
,
av_get_pix_fmt_name
(
q
->
parser
->
format
));
ret
=
AVERROR
(
ENOSYS
);
ret
=
AVERROR
(
ENOSYS
);
goto
reinit_fail
;
goto
reinit_fail
;
}
}
...
...
libavcodec/qsvdec_h2645.c
View file @
92736c74
...
@@ -269,6 +269,7 @@ AVCodec ff_hevc_qsv_decoder = {
...
@@ -269,6 +269,7 @@ AVCodec ff_hevc_qsv_decoder = {
.
capabilities
=
AV_CODEC_CAP_DELAY
|
AV_CODEC_CAP_DR1
,
.
capabilities
=
AV_CODEC_CAP_DELAY
|
AV_CODEC_CAP_DR1
,
.
priv_class
=
&
hevc_class
,
.
priv_class
=
&
hevc_class
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[]){
AV_PIX_FMT_NV12
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[]){
AV_PIX_FMT_NV12
,
AV_PIX_FMT_P010
,
AV_PIX_FMT_QSV
,
AV_PIX_FMT_QSV
,
AV_PIX_FMT_NONE
},
AV_PIX_FMT_NONE
},
};
};
...
@@ -307,6 +308,7 @@ AVCodec ff_h264_qsv_decoder = {
...
@@ -307,6 +308,7 @@ AVCodec ff_h264_qsv_decoder = {
.
capabilities
=
AV_CODEC_CAP_DELAY
|
AV_CODEC_CAP_DR1
,
.
capabilities
=
AV_CODEC_CAP_DELAY
|
AV_CODEC_CAP_DR1
,
.
priv_class
=
&
class
,
.
priv_class
=
&
class
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[]){
AV_PIX_FMT_NV12
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[]){
AV_PIX_FMT_NV12
,
AV_PIX_FMT_P010
,
AV_PIX_FMT_QSV
,
AV_PIX_FMT_QSV
,
AV_PIX_FMT_NONE
},
AV_PIX_FMT_NONE
},
};
};
...
...
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