Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
ce320cf1
Commit
ce320cf1
authored
8 years ago
by
Anton Khirnov
Browse files
Options
Downloads
Patches
Plain Diff
qsvdec: use the same mfxFrameInfo for allocating frames that was passed to DECODE_Init
Stop duplicating this information.
parent
536bb17e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libavcodec/qsvdec.c
+6
-9
6 additions, 9 deletions
libavcodec/qsvdec.c
libavcodec/qsvdec.h
+1
-0
1 addition, 0 deletions
libavcodec/qsvdec.h
with
7 additions
and
9 deletions
libavcodec/qsvdec.c
+
6
−
9
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
,
QSVContext
*
q
,
QSVFrame
*
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
;
...
...
This diff is collapsed.
Click to expand it.
libavcodec/qsvdec.h
+
1
−
0
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment