Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
edcdf351
Commit
edcdf351
authored
Oct 27, 2018
by
Mark Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cbs_vp9: Ensure that reserved zero bits are actually zero
parent
ad5ca1fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
cbs_vp9.c
libavcodec/cbs_vp9.c
+13
-0
cbs_vp9.h
libavcodec/cbs_vp9.h
+0
-2
cbs_vp9_syntax_template.c
libavcodec/cbs_vp9_syntax_template.c
+3
-3
No files found.
libavcodec/cbs_vp9.c
View file @
edcdf351
...
...
@@ -314,6 +314,12 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc,
current->name = prob; \
} while (0)
#define fixed(width, name, value) do { \
av_unused uint32_t fixed_value = value; \
CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \
0, &fixed_value, value, value)); \
} while (0)
#define infer(name, value) do { \
current->name = value; \
} while (0)
...
...
@@ -331,6 +337,7 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc,
#undef fle
#undef delta_q
#undef prob
#undef fixed
#undef infer
#undef byte_alignment
...
...
@@ -370,6 +377,11 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc,
xf(8, name.prob, current->name, subs, __VA_ARGS__); \
} while (0)
#define fixed(width, name, value) do { \
CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \
0, value, value, value)); \
} while (0)
#define infer(name, value) do { \
if (current->name != (value)) { \
av_log(ctx->log_ctx, AV_LOG_WARNING, "Warning: " \
...
...
@@ -392,6 +404,7 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc,
#undef fle
#undef delta_q
#undef prob
#undef fixed
#undef infer
#undef byte_alignment
...
...
libavcodec/cbs_vp9.h
View file @
edcdf351
...
...
@@ -84,7 +84,6 @@ typedef struct VP9RawFrameHeader {
uint8_t
frame_marker
;
uint8_t
profile_low_bit
;
uint8_t
profile_high_bit
;
uint8_t
profile_reserved_zero
;
uint8_t
show_existing_frame
;
uint8_t
frame_to_show_map_idx
;
...
...
@@ -99,7 +98,6 @@ typedef struct VP9RawFrameHeader {
uint8_t
color_range
;
uint8_t
subsampling_x
;
uint8_t
subsampling_y
;
uint8_t
color_config_reserved_zero
;
uint8_t
refresh_frame_flags
;
...
...
libavcodec/cbs_vp9_syntax_template.c
View file @
edcdf351
...
...
@@ -55,7 +55,7 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw,
if
(
profile
==
1
||
profile
==
3
)
{
f
(
1
,
subsampling_x
);
f
(
1
,
subsampling_y
);
f
(
1
,
color_config_reserved_zero
);
f
ixed
(
1
,
reserved_zero
,
0
);
}
else
{
infer
(
subsampling_x
,
1
);
infer
(
subsampling_y
,
1
);
...
...
@@ -65,7 +65,7 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw,
if
(
profile
==
1
||
profile
==
3
)
{
infer
(
subsampling_x
,
0
);
infer
(
subsampling_y
,
0
);
f
(
1
,
color_config_reserved_zero
);
f
ixed
(
1
,
reserved_zero
,
0
);
}
}
...
...
@@ -258,7 +258,7 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
f
(
1
,
profile_high_bit
);
profile
=
(
current
->
profile_high_bit
<<
1
)
+
current
->
profile_low_bit
;
if
(
profile
==
3
)
f
(
1
,
profile_reserved_zero
);
f
ixed
(
1
,
reserved_zero
,
0
);
f
(
1
,
show_existing_frame
);
if
(
current
->
show_existing_frame
)
{
...
...
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