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
126bc2c3
Commit
126bc2c3
authored
Apr 26, 2017
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vp9_superframe_bsf: convert to the new bitstream reader
parent
3daaa441
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
vp9_superframe_bsf.c
libavcodec/vp9_superframe_bsf.c
+12
-10
No files found.
libavcodec/vp9_superframe_bsf.c
View file @
126bc2c3
...
@@ -21,8 +21,8 @@
...
@@ -21,8 +21,8 @@
#include "libavutil/avassert.h"
#include "libavutil/avassert.h"
#include "avcodec.h"
#include "avcodec.h"
#include "bitstream.h"
#include "bsf.h"
#include "bsf.h"
#include "get_bits.h"
#define MAX_CACHE 8
#define MAX_CACHE 8
typedef
struct
VP9BSFContext
{
typedef
struct
VP9BSFContext
{
...
@@ -101,7 +101,7 @@ static int merge_superframe(const struct CachedBuf *in, int n_in, AVPacket *out)
...
@@ -101,7 +101,7 @@ static int merge_superframe(const struct CachedBuf *in, int n_in, AVPacket *out)
static
int
vp9_superframe_filter
(
AVBSFContext
*
ctx
,
AVPacket
*
out
)
static
int
vp9_superframe_filter
(
AVBSFContext
*
ctx
,
AVPacket
*
out
)
{
{
GetBitContext
gb
;
BitstreamContext
bc
;
VP9BSFContext
*
s
=
ctx
->
priv_data
;
VP9BSFContext
*
s
=
ctx
->
priv_data
;
AVPacket
*
in
;
AVPacket
*
in
;
int
res
,
invisible
,
profile
,
marker
,
uses_superframe_syntax
=
0
,
n
;
int
res
,
invisible
,
profile
,
marker
,
uses_superframe_syntax
=
0
,
n
;
...
@@ -118,19 +118,21 @@ static int vp9_superframe_filter(AVBSFContext *ctx, AVPacket *out)
...
@@ -118,19 +118,21 @@ static int vp9_superframe_filter(AVBSFContext *ctx, AVPacket *out)
uses_superframe_syntax
=
in
->
size
>=
idx_sz
&&
in
->
data
[
in
->
size
-
idx_sz
]
==
marker
;
uses_superframe_syntax
=
in
->
size
>=
idx_sz
&&
in
->
data
[
in
->
size
-
idx_sz
]
==
marker
;
}
}
if
((
res
=
init_get_bits8
(
&
gb
,
in
->
data
,
in
->
size
))
<
0
)
res
=
bitstream_init8
(
&
bc
,
in
->
data
,
in
->
size
);
if
(
res
<
0
)
goto
done
;
goto
done
;
get_bits
(
&
gb
,
2
);
// frame marker
bitstream_read
(
&
bc
,
2
);
// frame marker
profile
=
get_bits1
(
&
gb
);
profile
=
bitstream_read
(
&
bc
,
1
);
profile
|=
get_bits1
(
&
gb
)
<<
1
;
profile
|=
bitstream_read
(
&
bc
,
1
)
<<
1
;
if
(
profile
==
3
)
profile
+=
get_bits1
(
&
gb
);
if
(
profile
==
3
)
profile
+=
bitstream_read
(
&
bc
,
1
);
if
(
get_bits1
(
&
gb
))
{
if
(
bitstream_read
(
&
bc
,
1
))
{
invisible
=
0
;
invisible
=
0
;
}
else
{
}
else
{
get_bits1
(
&
gb
);
// keyframe
bitstream_read
(
&
bc
,
1
);
// keyframe
invisible
=
!
get_bits1
(
&
gb
);
invisible
=
!
bitstream_read
(
&
bc
,
1
);
}
}
if
(
uses_superframe_syntax
&&
s
->
n_cache
>
0
)
{
if
(
uses_superframe_syntax
&&
s
->
n_cache
>
0
)
{
...
...
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