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
ce320cf1
Commit
ce320cf1
authored
Jun 22, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qsvdec: use the same mfxFrameInfo for allocating frames that was passed to DECODE_Init
Stop duplicating this information.
parent
536bb17e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
qsvdec.c
libavcodec/qsvdec.c
+6
-9
qsvdec.h
libavcodec/qsvdec.h
+1
-0
No files found.
libavcodec/qsvdec.c
View file @
ce320cf1
...
@@ -155,10 +155,12 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
...
@@ -155,10 +155,12 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
return
ff_qsv_error
(
ret
);
return
ff_qsv_error
(
ret
);
}
}
q
->
frame_info
=
param
.
mfx
.
FrameInfo
;
return
0
;
return
0
;
}
}
static
int
alloc_frame
(
AVCodecContext
*
avctx
,
QSVFrame
*
frame
)
static
int
alloc_frame
(
AVCodecContext
*
avctx
,
QSV
Context
*
q
,
QSV
Frame
*
frame
)
{
{
int
ret
;
int
ret
;
...
@@ -169,12 +171,7 @@ static int alloc_frame(AVCodecContext *avctx, QSVFrame *frame)
...
@@ -169,12 +171,7 @@ static int alloc_frame(AVCodecContext *avctx, QSVFrame *frame)
if
(
frame
->
frame
->
format
==
AV_PIX_FMT_QSV
)
{
if
(
frame
->
frame
->
format
==
AV_PIX_FMT_QSV
)
{
frame
->
surface
=
(
mfxFrameSurface1
*
)
frame
->
frame
->
data
[
3
];
frame
->
surface
=
(
mfxFrameSurface1
*
)
frame
->
frame
->
data
[
3
];
}
else
{
}
else
{
frame
->
surface_internal
.
Info
.
BitDepthLuma
=
8
;
frame
->
surface_internal
.
Info
=
q
->
frame_info
;
frame
->
surface_internal
.
Info
.
BitDepthChroma
=
8
;
frame
->
surface_internal
.
Info
.
FourCC
=
MFX_FOURCC_NV12
;
frame
->
surface_internal
.
Info
.
Width
=
avctx
->
coded_width
;
frame
->
surface_internal
.
Info
.
Height
=
avctx
->
coded_height
;
frame
->
surface_internal
.
Info
.
ChromaFormat
=
MFX_CHROMAFORMAT_YUV420
;
frame
->
surface_internal
.
Data
.
PitchLow
=
frame
->
frame
->
linesize
[
0
];
frame
->
surface_internal
.
Data
.
PitchLow
=
frame
->
frame
->
linesize
[
0
];
frame
->
surface_internal
.
Data
.
Y
=
frame
->
frame
->
data
[
0
];
frame
->
surface_internal
.
Data
.
Y
=
frame
->
frame
->
data
[
0
];
...
@@ -209,7 +206,7 @@ static int get_surface(AVCodecContext *avctx, QSVContext *q, mfxFrameSurface1 **
...
@@ -209,7 +206,7 @@ static int get_surface(AVCodecContext *avctx, QSVContext *q, mfxFrameSurface1 **
last
=
&
q
->
work_frames
;
last
=
&
q
->
work_frames
;
while
(
frame
)
{
while
(
frame
)
{
if
(
!
frame
->
surface
)
{
if
(
!
frame
->
surface
)
{
ret
=
alloc_frame
(
avctx
,
frame
);
ret
=
alloc_frame
(
avctx
,
q
,
frame
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
*
surf
=
frame
->
surface
;
*
surf
=
frame
->
surface
;
...
@@ -230,7 +227,7 @@ static int get_surface(AVCodecContext *avctx, QSVContext *q, mfxFrameSurface1 **
...
@@ -230,7 +227,7 @@ static int get_surface(AVCodecContext *avctx, QSVContext *q, mfxFrameSurface1 **
}
}
*
last
=
frame
;
*
last
=
frame
;
ret
=
alloc_frame
(
avctx
,
frame
);
ret
=
alloc_frame
(
avctx
,
q
,
frame
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
...
...
libavcodec/qsvdec.h
View file @
ce320cf1
...
@@ -57,6 +57,7 @@ typedef struct QSVContext {
...
@@ -57,6 +57,7 @@ typedef struct QSVContext {
AVCodecContext
*
avctx_internal
;
AVCodecContext
*
avctx_internal
;
enum
AVPixelFormat
orig_pix_fmt
;
enum
AVPixelFormat
orig_pix_fmt
;
uint32_t
fourcc
;
uint32_t
fourcc
;
mfxFrameInfo
frame_info
;
// options set by the caller
// options set by the caller
int
async_depth
;
int
async_depth
;
...
...
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