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
29be9b53
Commit
29be9b53
authored
Mar 17, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/dxva2: fix pointers after H264Picture
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
2a37e560
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
22 deletions
+22
-22
dxva2.c
libavcodec/dxva2.c
+6
-6
dxva2_h264.c
libavcodec/dxva2_h264.c
+5
-5
dxva2_internal.h
libavcodec/dxva2_internal.h
+3
-3
dxva2_mpeg2.c
libavcodec/dxva2_mpeg2.c
+4
-4
dxva2_vc1.c
libavcodec/dxva2_vc1.c
+4
-4
No files found.
libavcodec/dxva2.c
View file @
29be9b53
...
...
@@ -30,15 +30,15 @@
#include "mpegvideo.h"
#include "dxva2_internal.h"
void
*
ff_dxva2_get_surface
(
const
Picture
*
pictur
e
)
void
*
ff_dxva2_get_surface
(
const
AVFrame
*
fram
e
)
{
return
picture
->
f
.
data
[
3
];
return
frame
->
data
[
3
];
}
unsigned
ff_dxva2_get_surface_index
(
const
struct
dxva_context
*
ctx
,
const
Picture
*
pictur
e
)
const
AVFrame
*
fram
e
)
{
void
*
surface
=
ff_dxva2_get_surface
(
pictur
e
);
void
*
surface
=
ff_dxva2_get_surface
(
fram
e
);
unsigned
i
;
for
(
i
=
0
;
i
<
ctx
->
surface_count
;
i
++
)
...
...
@@ -91,7 +91,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx,
return
result
;
}
int
ff_dxva2_common_end_frame
(
AVCodecContext
*
avctx
,
Picture
*
pic
,
int
ff_dxva2_common_end_frame
(
AVCodecContext
*
avctx
,
AVFrame
*
frame
,
const
void
*
pp
,
unsigned
pp_size
,
const
void
*
qm
,
unsigned
qm_size
,
int
(
*
commit_bs_si
)(
AVCodecContext
*
,
...
...
@@ -107,7 +107,7 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, Picture *pic,
do
{
hr
=
IDirectXVideoDecoder_BeginFrame
(
ctx
->
decoder
,
ff_dxva2_get_surface
(
pic
),
ff_dxva2_get_surface
(
frame
),
NULL
);
if
(
hr
==
E_PENDING
)
av_usleep
(
2000
);
...
...
libavcodec/dxva2_h264.c
View file @
29be9b53
...
...
@@ -51,7 +51,7 @@ static void fill_picture_parameters(struct dxva_context *ctx, const H264Context
memset
(
pp
,
0
,
sizeof
(
*
pp
));
/* Configure current picture */
fill_picture_entry
(
&
pp
->
CurrPic
,
ff_dxva2_get_surface_index
(
ctx
,
current_picture
),
ff_dxva2_get_surface_index
(
ctx
,
&
current_picture
->
f
),
h
->
picture_structure
==
PICT_BOTTOM_FIELD
);
/* Configure the set of references */
pp
->
UsedForReferenceFlags
=
0
;
...
...
@@ -67,7 +67,7 @@ static void fill_picture_parameters(struct dxva_context *ctx, const H264Context
}
if
(
r
)
{
fill_picture_entry
(
&
pp
->
RefFrameList
[
i
],
ff_dxva2_get_surface_index
(
ctx
,
r
),
ff_dxva2_get_surface_index
(
ctx
,
&
r
->
f
),
r
->
long_ref
!=
0
);
if
((
r
->
reference
&
PICT_TOP_FIELD
)
&&
r
->
field_poc
[
0
]
!=
INT_MAX
)
...
...
@@ -243,9 +243,9 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice,
unsigned
plane
;
unsigned
index
;
if
(
ctx
->
workaround
&
FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO
)
index
=
ff_dxva2_get_surface_index
(
ctx
,
r
);
index
=
ff_dxva2_get_surface_index
(
ctx
,
&
r
->
f
);
else
index
=
get_refpic_index
(
pp
,
ff_dxva2_get_surface_index
(
ctx
,
r
));
index
=
get_refpic_index
(
pp
,
ff_dxva2_get_surface_index
(
ctx
,
&
r
->
f
));
fill_picture_entry
(
&
slice
->
RefPicList
[
list
][
i
],
index
,
r
->
reference
==
PICT_BOTTOM_FIELD
);
for
(
plane
=
0
;
plane
<
3
;
plane
++
)
{
...
...
@@ -448,7 +448,7 @@ static int dxva2_h264_end_frame(AVCodecContext *avctx)
if
(
ctx_pic
->
slice_count
<=
0
||
ctx_pic
->
bitstream_size
<=
0
)
return
-
1
;
ret
=
ff_dxva2_common_end_frame
(
avctx
,
h
->
cur_pic_ptr
,
ret
=
ff_dxva2_common_end_frame
(
avctx
,
&
h
->
cur_pic_ptr
->
f
,
&
ctx_pic
->
pp
,
sizeof
(
ctx_pic
->
pp
),
&
ctx_pic
->
qm
,
sizeof
(
ctx_pic
->
qm
),
commit_bitstream_and_slice_buffer
);
...
...
libavcodec/dxva2_internal.h
View file @
29be9b53
...
...
@@ -35,10 +35,10 @@
#include "avcodec.h"
#include "mpegvideo.h"
void
*
ff_dxva2_get_surface
(
const
Picture
*
pictur
e
);
void
*
ff_dxva2_get_surface
(
const
AVFrame
*
fram
e
);
unsigned
ff_dxva2_get_surface_index
(
const
struct
dxva_context
*
,
const
Picture
*
pictur
e
);
const
AVFrame
*
fram
e
);
int
ff_dxva2_commit_buffer
(
AVCodecContext
*
,
struct
dxva_context
*
,
DXVA2_DecodeBufferDesc
*
,
...
...
@@ -46,7 +46,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *, struct dxva_context *,
unsigned
mb_count
);
int
ff_dxva2_common_end_frame
(
AVCodecContext
*
,
Pictur
e
*
,
int
ff_dxva2_common_end_frame
(
AVCodecContext
*
,
AVFram
e
*
,
const
void
*
pp
,
unsigned
pp_size
,
const
void
*
qm
,
unsigned
qm_size
,
int
(
*
commit_bs_si
)(
AVCodecContext
*
,
...
...
libavcodec/dxva2_mpeg2.c
View file @
29be9b53
...
...
@@ -44,14 +44,14 @@ static void fill_picture_parameters(AVCodecContext *avctx,
int
is_field
=
s
->
picture_structure
!=
PICT_FRAME
;
memset
(
pp
,
0
,
sizeof
(
*
pp
));
pp
->
wDecodedPictureIndex
=
ff_dxva2_get_surface_index
(
ctx
,
current_picture
);
pp
->
wDecodedPictureIndex
=
ff_dxva2_get_surface_index
(
ctx
,
&
current_picture
->
f
);
pp
->
wDeblockedPictureIndex
=
0
;
if
(
s
->
pict_type
!=
AV_PICTURE_TYPE_I
)
pp
->
wForwardRefPictureIndex
=
ff_dxva2_get_surface_index
(
ctx
,
&
s
->
last_picture
);
pp
->
wForwardRefPictureIndex
=
ff_dxva2_get_surface_index
(
ctx
,
&
s
->
last_picture
.
f
);
else
pp
->
wForwardRefPictureIndex
=
0xffff
;
if
(
s
->
pict_type
==
AV_PICTURE_TYPE_B
)
pp
->
wBackwardRefPictureIndex
=
ff_dxva2_get_surface_index
(
ctx
,
&
s
->
next_picture
);
pp
->
wBackwardRefPictureIndex
=
ff_dxva2_get_surface_index
(
ctx
,
&
s
->
next_picture
.
f
);
else
pp
->
wBackwardRefPictureIndex
=
0xffff
;
pp
->
wPicWidthInMBminus1
=
s
->
mb_width
-
1
;
...
...
@@ -258,7 +258,7 @@ static int dxva2_mpeg2_end_frame(AVCodecContext *avctx)
if
(
ctx_pic
->
slice_count
<=
0
||
ctx_pic
->
bitstream_size
<=
0
)
return
-
1
;
ret
=
ff_dxva2_common_end_frame
(
avctx
,
s
->
current_picture_ptr
,
ret
=
ff_dxva2_common_end_frame
(
avctx
,
&
s
->
current_picture_ptr
->
f
,
&
ctx_pic
->
pp
,
sizeof
(
ctx_pic
->
pp
),
&
ctx_pic
->
qm
,
sizeof
(
ctx_pic
->
qm
),
commit_bitstream_and_slice_buffer
);
...
...
libavcodec/dxva2_vc1.c
View file @
29be9b53
...
...
@@ -51,13 +51,13 @@ static void fill_picture_parameters(AVCodecContext *avctx,
memset
(
pp
,
0
,
sizeof
(
*
pp
));
pp
->
wDecodedPictureIndex
=
pp
->
wDeblockedPictureIndex
=
ff_dxva2_get_surface_index
(
ctx
,
current_picture
);
pp
->
wDeblockedPictureIndex
=
ff_dxva2_get_surface_index
(
ctx
,
&
current_picture
->
f
);
if
(
s
->
pict_type
!=
AV_PICTURE_TYPE_I
&&
!
v
->
bi_type
)
pp
->
wForwardRefPictureIndex
=
ff_dxva2_get_surface_index
(
ctx
,
&
s
->
last_picture
);
pp
->
wForwardRefPictureIndex
=
ff_dxva2_get_surface_index
(
ctx
,
&
s
->
last_picture
.
f
);
else
pp
->
wForwardRefPictureIndex
=
0xffff
;
if
(
s
->
pict_type
==
AV_PICTURE_TYPE_B
&&
!
v
->
bi_type
)
pp
->
wBackwardRefPictureIndex
=
ff_dxva2_get_surface_index
(
ctx
,
&
s
->
next_picture
);
pp
->
wBackwardRefPictureIndex
=
ff_dxva2_get_surface_index
(
ctx
,
&
s
->
next_picture
.
f
);
else
pp
->
wBackwardRefPictureIndex
=
0xffff
;
if
(
v
->
profile
==
PROFILE_ADVANCED
)
{
...
...
@@ -283,7 +283,7 @@ static int dxva2_vc1_end_frame(AVCodecContext *avctx)
if
(
ctx_pic
->
bitstream_size
<=
0
)
return
-
1
;
ret
=
ff_dxva2_common_end_frame
(
avctx
,
v
->
s
.
current_picture_ptr
,
ret
=
ff_dxva2_common_end_frame
(
avctx
,
&
v
->
s
.
current_picture_ptr
->
f
,
&
ctx_pic
->
pp
,
sizeof
(
ctx_pic
->
pp
),
NULL
,
0
,
commit_bitstream_and_slice_buffer
);
...
...
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