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
10a9149d
Commit
10a9149d
authored
Jul 15, 2015
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffv1enc: Keep coded_frame.key_frame a write-only variable
parent
efc618af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
ffv1.h
libavcodec/ffv1.h
+1
-0
ffv1enc.c
libavcodec/ffv1enc.c
+6
-5
No files found.
libavcodec/ffv1.h
View file @
10a9149d
...
@@ -78,6 +78,7 @@ typedef struct FFV1Context {
...
@@ -78,6 +78,7 @@ typedef struct FFV1Context {
int
transparency
;
int
transparency
;
int
flags
;
int
flags
;
int
picture_number
;
int
picture_number
;
int
key_frame
;
const
AVFrame
*
frame
;
const
AVFrame
*
frame
;
AVFrame
*
last_picture
;
AVFrame
*
last_picture
;
...
...
libavcodec/ffv1enc.c
View file @
10a9149d
...
@@ -884,7 +884,7 @@ static int encode_slice(AVCodecContext *c, void *arg)
...
@@ -884,7 +884,7 @@ static int encode_slice(AVCodecContext *c, void *arg)
?
(
f
->
bits_per_raw_sample
>
8
)
+
1
?
(
f
->
bits_per_raw_sample
>
8
)
+
1
:
4
;
:
4
;
if
(
c
->
coded_frame
->
key_frame
)
if
(
f
->
key_frame
)
ffv1_clear_slice_state
(
f
,
fs
);
ffv1_clear_slice_state
(
f
,
fs
);
if
(
f
->
version
>
2
)
{
if
(
f
->
version
>
2
)
{
encode_slice_header
(
f
,
fs
);
encode_slice_header
(
f
,
fs
);
...
@@ -931,7 +931,6 @@ static int ffv1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
...
@@ -931,7 +931,6 @@ static int ffv1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
{
{
FFV1Context
*
f
=
avctx
->
priv_data
;
FFV1Context
*
f
=
avctx
->
priv_data
;
RangeCoder
*
const
c
=
&
f
->
slice_context
[
0
]
->
c
;
RangeCoder
*
const
c
=
&
f
->
slice_context
[
0
]
->
c
;
AVFrame
*
const
p
=
avctx
->
coded_frame
;
int
used_count
=
0
;
int
used_count
=
0
;
uint8_t
keystate
=
128
;
uint8_t
keystate
=
128
;
uint8_t
*
buf_p
;
uint8_t
*
buf_p
;
...
@@ -951,12 +950,12 @@ static int ffv1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
...
@@ -951,12 +950,12 @@ static int ffv1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if
(
avctx
->
gop_size
==
0
||
f
->
picture_number
%
avctx
->
gop_size
==
0
)
{
if
(
avctx
->
gop_size
==
0
||
f
->
picture_number
%
avctx
->
gop_size
==
0
)
{
put_rac
(
c
,
&
keystate
,
1
);
put_rac
(
c
,
&
keystate
,
1
);
p
->
key_frame
=
1
;
f
->
key_frame
=
1
;
f
->
gob_count
++
;
f
->
gob_count
++
;
write_header
(
f
);
write_header
(
f
);
}
else
{
}
else
{
put_rac
(
c
,
&
keystate
,
0
);
put_rac
(
c
,
&
keystate
,
0
);
p
->
key_frame
=
0
;
f
->
key_frame
=
0
;
}
}
if
(
f
->
ac
>
1
)
{
if
(
f
->
ac
>
1
)
{
...
@@ -1050,9 +1049,11 @@ static int ffv1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
...
@@ -1050,9 +1049,11 @@ static int ffv1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
else
if
(
avctx
->
flags
&
CODEC_FLAG_PASS1
)
}
else
if
(
avctx
->
flags
&
CODEC_FLAG_PASS1
)
avctx
->
stats_out
[
0
]
=
'\0'
;
avctx
->
stats_out
[
0
]
=
'\0'
;
avctx
->
coded_frame
->
key_frame
=
f
->
key_frame
;
f
->
picture_number
++
;
f
->
picture_number
++
;
pkt
->
size
=
buf_p
-
pkt
->
data
;
pkt
->
size
=
buf_p
-
pkt
->
data
;
pkt
->
flags
|=
AV_PKT_FLAG_KEY
*
p
->
key_frame
;
pkt
->
flags
|=
AV_PKT_FLAG_KEY
*
f
->
key_frame
;
*
got_packet
=
1
;
*
got_packet
=
1
;
return
0
;
return
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