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
c14a12ac
Commit
c14a12ac
authored
Aug 29, 2019
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/wcmv: use ff_reget_buffer()
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
9ea6d214
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
14 deletions
+9
-14
wcmv.c
libavcodec/wcmv.c
+9
-14
No files found.
libavcodec/wcmv.c
View file @
c14a12ac
...
@@ -60,7 +60,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -60,7 +60,7 @@ static int decode_frame(AVCodecContext *avctx,
if
(
!
blocks
)
if
(
!
blocks
)
return
avpkt
->
size
;
return
avpkt
->
size
;
if
((
ret
=
ff_
get_buffer
(
avctx
,
frame
,
AV_GET_BUFFER_FLAG_REF
))
<
0
)
if
((
ret
=
ff_
reget_buffer
(
avctx
,
s
->
prev_frame
,
0
))
<
0
)
return
ret
;
return
ret
;
if
(
blocks
>
5
)
{
if
(
blocks
>
5
)
{
...
@@ -157,13 +157,9 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -157,13 +157,9 @@ static int decode_frame(AVCodecContext *avctx,
if
(
bytestream2_get_bytes_left
(
&
gb
)
<
8LL
*
blocks
)
if
(
bytestream2_get_bytes_left
(
&
gb
)
<
8LL
*
blocks
)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
if
(
s
->
prev_frame
->
data
[
0
])
{
if
(
!
avctx
->
frame_number
)
{
ret
=
av_frame_copy
(
frame
,
s
->
prev_frame
);
ptrdiff_t
linesize
[
4
]
=
{
s
->
prev_frame
->
linesize
[
0
],
0
,
0
,
0
};
if
(
ret
<
0
)
av_image_fill_black
(
s
->
prev_frame
->
data
,
linesize
,
avctx
->
pix_fmt
,
0
,
return
ret
;
}
else
{
ptrdiff_t
linesize
[
4
]
=
{
frame
->
linesize
[
0
],
0
,
0
,
0
};
av_image_fill_black
(
frame
->
data
,
linesize
,
avctx
->
pix_fmt
,
0
,
avctx
->
width
,
avctx
->
height
);
avctx
->
width
,
avctx
->
height
);
}
}
...
@@ -184,7 +180,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -184,7 +180,7 @@ static int decode_frame(AVCodecContext *avctx,
if
(
w
>
avctx
->
width
||
h
>
avctx
->
height
)
if
(
w
>
avctx
->
width
||
h
>
avctx
->
height
)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
dst
=
frame
->
data
[
0
]
+
(
avctx
->
height
-
y
-
1
)
*
frame
->
linesize
[
0
]
+
x
*
bpp
;
dst
=
s
->
prev_frame
->
data
[
0
]
+
(
avctx
->
height
-
y
-
1
)
*
s
->
prev_
frame
->
linesize
[
0
]
+
x
*
bpp
;
for
(
int
i
=
0
;
i
<
h
;
i
++
)
{
for
(
int
i
=
0
;
i
<
h
;
i
++
)
{
s
->
zstream
.
next_out
=
dst
;
s
->
zstream
.
next_out
=
dst
;
s
->
zstream
.
avail_out
=
w
*
bpp
;
s
->
zstream
.
avail_out
=
w
*
bpp
;
...
@@ -196,15 +192,14 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -196,15 +192,14 @@ static int decode_frame(AVCodecContext *avctx,
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
dst
-=
frame
->
linesize
[
0
];
dst
-=
s
->
prev_
frame
->
linesize
[
0
];
}
}
}
}
frame
->
key_frame
=
intra
;
s
->
prev_
frame
->
key_frame
=
intra
;
frame
->
pict_type
=
intra
?
AV_PICTURE_TYPE_I
:
AV_PICTURE_TYPE_P
;
s
->
prev_
frame
->
pict_type
=
intra
?
AV_PICTURE_TYPE_I
:
AV_PICTURE_TYPE_P
;
av_frame_unref
(
s
->
prev_frame
);
if
((
ret
=
av_frame_ref
(
frame
,
s
->
prev_frame
))
<
0
)
if
((
ret
=
av_frame_ref
(
s
->
prev_frame
,
frame
))
<
0
)
return
ret
;
return
ret
;
*
got_frame
=
1
;
*
got_frame
=
1
;
...
...
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