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
f4d95e09
Commit
f4d95e09
authored
Mar 25, 2017
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/vp9: rename {ref,unref,alloc}_frame to frame_{ref,unref,alloc}
For consistency with Libav.
parent
12c44d63
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
vp9.c
libavcodec/vp9.c
+16
-16
No files found.
libavcodec/vp9.c
View file @
f4d95e09
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
#define VP9_SYNCCODE 0x498342
#define VP9_SYNCCODE 0x498342
static
void
vp9_
unref_frame
(
AVCodecContext
*
avctx
,
VP9Frame
*
f
)
static
void
vp9_
frame_unref
(
AVCodecContext
*
avctx
,
VP9Frame
*
f
)
{
{
ff_thread_release_buffer
(
avctx
,
&
f
->
tf
);
ff_thread_release_buffer
(
avctx
,
&
f
->
tf
);
av_buffer_unref
(
&
f
->
extradata
);
av_buffer_unref
(
&
f
->
extradata
);
...
@@ -45,7 +45,7 @@ static void vp9_unref_frame(AVCodecContext *avctx, VP9Frame *f)
...
@@ -45,7 +45,7 @@ static void vp9_unref_frame(AVCodecContext *avctx, VP9Frame *f)
f
->
hwaccel_picture_private
=
NULL
;
f
->
hwaccel_picture_private
=
NULL
;
}
}
static
int
vp9_
alloc_frame
(
AVCodecContext
*
avctx
,
VP9Frame
*
f
)
static
int
vp9_
frame_alloc
(
AVCodecContext
*
avctx
,
VP9Frame
*
f
)
{
{
VP9Context
*
s
=
avctx
->
priv_data
;
VP9Context
*
s
=
avctx
->
priv_data
;
int
ret
,
sz
;
int
ret
,
sz
;
...
@@ -74,11 +74,11 @@ static int vp9_alloc_frame(AVCodecContext *avctx, VP9Frame *f)
...
@@ -74,11 +74,11 @@ static int vp9_alloc_frame(AVCodecContext *avctx, VP9Frame *f)
return
0
;
return
0
;
fail:
fail:
vp9_
unref_frame
(
avctx
,
f
);
vp9_
frame_unref
(
avctx
,
f
);
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
}
}
static
int
vp9_
ref_frame
(
AVCodecContext
*
avctx
,
VP9Frame
*
dst
,
VP9Frame
*
src
)
static
int
vp9_
frame_ref
(
AVCodecContext
*
avctx
,
VP9Frame
*
dst
,
VP9Frame
*
src
)
{
{
int
res
;
int
res
;
...
@@ -102,7 +102,7 @@ static int vp9_ref_frame(AVCodecContext *avctx, VP9Frame *dst, VP9Frame *src)
...
@@ -102,7 +102,7 @@ static int vp9_ref_frame(AVCodecContext *avctx, VP9Frame *dst, VP9Frame *src)
return
0
;
return
0
;
fail:
fail:
vp9_
unref_frame
(
avctx
,
dst
);
vp9_
frame_unref
(
avctx
,
dst
);
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
}
}
...
@@ -1243,7 +1243,7 @@ static av_cold int vp9_decode_free(AVCodecContext *avctx)
...
@@ -1243,7 +1243,7 @@ static av_cold int vp9_decode_free(AVCodecContext *avctx)
for
(
i
=
0
;
i
<
3
;
i
++
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
if
(
s
->
s
.
frames
[
i
].
tf
.
f
->
buf
[
0
])
if
(
s
->
s
.
frames
[
i
].
tf
.
f
->
buf
[
0
])
vp9_
unref_frame
(
avctx
,
&
s
->
s
.
frames
[
i
]);
vp9_
frame_unref
(
avctx
,
&
s
->
s
.
frames
[
i
]);
av_frame_free
(
&
s
->
s
.
frames
[
i
].
tf
.
f
);
av_frame_free
(
&
s
->
s
.
frames
[
i
].
tf
.
f
);
}
}
for
(
i
=
0
;
i
<
8
;
i
++
)
{
for
(
i
=
0
;
i
<
8
;
i
++
)
{
...
@@ -1306,19 +1306,19 @@ FF_ENABLE_DEPRECATION_WARNINGS
...
@@ -1306,19 +1306,19 @@ FF_ENABLE_DEPRECATION_WARNINGS
if
(
!
retain_segmap_ref
||
s
->
s
.
h
.
keyframe
||
s
->
s
.
h
.
intraonly
)
{
if
(
!
retain_segmap_ref
||
s
->
s
.
h
.
keyframe
||
s
->
s
.
h
.
intraonly
)
{
if
(
s
->
s
.
frames
[
REF_FRAME_SEGMAP
].
tf
.
f
->
buf
[
0
])
if
(
s
->
s
.
frames
[
REF_FRAME_SEGMAP
].
tf
.
f
->
buf
[
0
])
vp9_
unref_frame
(
avctx
,
&
s
->
s
.
frames
[
REF_FRAME_SEGMAP
]);
vp9_
frame_unref
(
avctx
,
&
s
->
s
.
frames
[
REF_FRAME_SEGMAP
]);
if
(
!
s
->
s
.
h
.
keyframe
&&
!
s
->
s
.
h
.
intraonly
&&
!
s
->
s
.
h
.
errorres
&&
s
->
s
.
frames
[
CUR_FRAME
].
tf
.
f
->
buf
[
0
]
&&
if
(
!
s
->
s
.
h
.
keyframe
&&
!
s
->
s
.
h
.
intraonly
&&
!
s
->
s
.
h
.
errorres
&&
s
->
s
.
frames
[
CUR_FRAME
].
tf
.
f
->
buf
[
0
]
&&
(
res
=
vp9_
ref_frame
(
avctx
,
&
s
->
s
.
frames
[
REF_FRAME_SEGMAP
],
&
s
->
s
.
frames
[
CUR_FRAME
]))
<
0
)
(
res
=
vp9_
frame_ref
(
avctx
,
&
s
->
s
.
frames
[
REF_FRAME_SEGMAP
],
&
s
->
s
.
frames
[
CUR_FRAME
]))
<
0
)
return
res
;
return
res
;
}
}
if
(
s
->
s
.
frames
[
REF_FRAME_MVPAIR
].
tf
.
f
->
buf
[
0
])
if
(
s
->
s
.
frames
[
REF_FRAME_MVPAIR
].
tf
.
f
->
buf
[
0
])
vp9_
unref_frame
(
avctx
,
&
s
->
s
.
frames
[
REF_FRAME_MVPAIR
]);
vp9_
frame_unref
(
avctx
,
&
s
->
s
.
frames
[
REF_FRAME_MVPAIR
]);
if
(
!
s
->
s
.
h
.
intraonly
&&
!
s
->
s
.
h
.
keyframe
&&
!
s
->
s
.
h
.
errorres
&&
s
->
s
.
frames
[
CUR_FRAME
].
tf
.
f
->
buf
[
0
]
&&
if
(
!
s
->
s
.
h
.
intraonly
&&
!
s
->
s
.
h
.
keyframe
&&
!
s
->
s
.
h
.
errorres
&&
s
->
s
.
frames
[
CUR_FRAME
].
tf
.
f
->
buf
[
0
]
&&
(
res
=
vp9_
ref_frame
(
avctx
,
&
s
->
s
.
frames
[
REF_FRAME_MVPAIR
],
&
s
->
s
.
frames
[
CUR_FRAME
]))
<
0
)
(
res
=
vp9_
frame_ref
(
avctx
,
&
s
->
s
.
frames
[
REF_FRAME_MVPAIR
],
&
s
->
s
.
frames
[
CUR_FRAME
]))
<
0
)
return
res
;
return
res
;
if
(
s
->
s
.
frames
[
CUR_FRAME
].
tf
.
f
->
buf
[
0
])
if
(
s
->
s
.
frames
[
CUR_FRAME
].
tf
.
f
->
buf
[
0
])
vp9_
unref_frame
(
avctx
,
&
s
->
s
.
frames
[
CUR_FRAME
]);
vp9_
frame_unref
(
avctx
,
&
s
->
s
.
frames
[
CUR_FRAME
]);
if
((
res
=
vp9_
alloc_frame
(
avctx
,
&
s
->
s
.
frames
[
CUR_FRAME
]))
<
0
)
if
((
res
=
vp9_
frame_alloc
(
avctx
,
&
s
->
s
.
frames
[
CUR_FRAME
]))
<
0
)
return
res
;
return
res
;
f
=
s
->
s
.
frames
[
CUR_FRAME
].
tf
.
f
;
f
=
s
->
s
.
frames
[
CUR_FRAME
].
tf
.
f
;
f
->
key_frame
=
s
->
s
.
h
.
keyframe
;
f
->
key_frame
=
s
->
s
.
h
.
keyframe
;
...
@@ -1329,7 +1329,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
...
@@ -1329,7 +1329,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
if
(
s
->
s
.
frames
[
REF_FRAME_SEGMAP
].
tf
.
f
->
buf
[
0
]
&&
if
(
s
->
s
.
frames
[
REF_FRAME_SEGMAP
].
tf
.
f
->
buf
[
0
]
&&
(
s
->
s
.
frames
[
REF_FRAME_MVPAIR
].
tf
.
f
->
width
!=
s
->
s
.
frames
[
CUR_FRAME
].
tf
.
f
->
width
||
(
s
->
s
.
frames
[
REF_FRAME_MVPAIR
].
tf
.
f
->
width
!=
s
->
s
.
frames
[
CUR_FRAME
].
tf
.
f
->
width
||
s
->
s
.
frames
[
REF_FRAME_MVPAIR
].
tf
.
f
->
height
!=
s
->
s
.
frames
[
CUR_FRAME
].
tf
.
f
->
height
))
{
s
->
s
.
frames
[
REF_FRAME_MVPAIR
].
tf
.
f
->
height
!=
s
->
s
.
frames
[
CUR_FRAME
].
tf
.
f
->
height
))
{
vp9_
unref_frame
(
avctx
,
&
s
->
s
.
frames
[
REF_FRAME_SEGMAP
]);
vp9_
frame_unref
(
avctx
,
&
s
->
s
.
frames
[
REF_FRAME_SEGMAP
]);
}
}
// ref frame setup
// ref frame setup
...
@@ -1554,7 +1554,7 @@ static void vp9_decode_flush(AVCodecContext *avctx)
...
@@ -1554,7 +1554,7 @@ static void vp9_decode_flush(AVCodecContext *avctx)
int
i
;
int
i
;
for
(
i
=
0
;
i
<
3
;
i
++
)
for
(
i
=
0
;
i
<
3
;
i
++
)
vp9_
unref_frame
(
avctx
,
&
s
->
s
.
frames
[
i
]);
vp9_
frame_unref
(
avctx
,
&
s
->
s
.
frames
[
i
]);
for
(
i
=
0
;
i
<
8
;
i
++
)
for
(
i
=
0
;
i
<
8
;
i
++
)
ff_thread_release_buffer
(
avctx
,
&
s
->
s
.
refs
[
i
]);
ff_thread_release_buffer
(
avctx
,
&
s
->
s
.
refs
[
i
]);
}
}
...
@@ -1609,9 +1609,9 @@ static int vp9_decode_update_thread_context(AVCodecContext *dst, const AVCodecCo
...
@@ -1609,9 +1609,9 @@ static int vp9_decode_update_thread_context(AVCodecContext *dst, const AVCodecCo
for
(
i
=
0
;
i
<
3
;
i
++
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
if
(
s
->
s
.
frames
[
i
].
tf
.
f
->
buf
[
0
])
if
(
s
->
s
.
frames
[
i
].
tf
.
f
->
buf
[
0
])
vp9_
unref_frame
(
dst
,
&
s
->
s
.
frames
[
i
]);
vp9_
frame_unref
(
dst
,
&
s
->
s
.
frames
[
i
]);
if
(
ssrc
->
s
.
frames
[
i
].
tf
.
f
->
buf
[
0
])
{
if
(
ssrc
->
s
.
frames
[
i
].
tf
.
f
->
buf
[
0
])
{
if
((
res
=
vp9_
ref_frame
(
dst
,
&
s
->
s
.
frames
[
i
],
&
ssrc
->
s
.
frames
[
i
]))
<
0
)
if
((
res
=
vp9_
frame_ref
(
dst
,
&
s
->
s
.
frames
[
i
],
&
ssrc
->
s
.
frames
[
i
]))
<
0
)
return
res
;
return
res
;
}
}
}
}
...
...
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