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
cfe4389d
Commit
cfe4389d
authored
May 22, 2019
by
Andreas Rheinhardt
Committed by
Mark Thompson
May 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cbs_mpeg2: Correct and use enum values
Signed-off-by:
Andreas Rheinhardt
<
andreas.rheinhardt@gmail.com
>
parent
819ed1df
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
19 deletions
+23
-19
cbs_mpeg2.c
libavcodec/cbs_mpeg2.c
+17
-13
cbs_mpeg2.h
libavcodec/cbs_mpeg2.h
+1
-1
cbs_mpeg2_syntax_template.c
libavcodec/cbs_mpeg2_syntax_template.c
+5
-5
No files found.
libavcodec/cbs_mpeg2.c
View file @
cfe4389d
...
...
@@ -215,12 +215,15 @@ static int cbs_mpeg2_read_unit(CodedBitstreamContext *ctx,
return err; \
} \
break;
START
(
0x00
,
MPEG2RawPictureHeader
,
picture_header
,
NULL
);
START
(
0xb2
,
MPEG2RawUserData
,
user_data
,
&
cbs_mpeg2_free_user_data
);
START
(
0xb3
,
MPEG2RawSequenceHeader
,
sequence_header
,
NULL
);
START
(
0xb5
,
MPEG2RawExtensionData
,
extension_data
,
NULL
);
START
(
0xb8
,
MPEG2RawGroupOfPicturesHeader
,
START
(
MPEG2_START_PICTURE
,
MPEG2RawPictureHeader
,
picture_header
,
NULL
);
START
(
MPEG2_START_USER_DATA
,
MPEG2RawUserData
,
user_data
,
&
cbs_mpeg2_free_user_data
);
START
(
MPEG2_START_SEQUENCE_HEADER
,
MPEG2RawSequenceHeader
,
sequence_header
,
NULL
);
START
(
MPEG2_START_EXTENSION
,
MPEG2RawExtensionData
,
extension_data
,
NULL
);
START
(
MPEG2_START_GROUP
,
MPEG2RawGroupOfPicturesHeader
,
group_of_pictures_header
,
NULL
);
#undef START
default:
...
...
@@ -244,11 +247,12 @@ static int cbs_mpeg2_write_header(CodedBitstreamContext *ctx,
case start_code: \
err = cbs_mpeg2_write_ ## func(ctx, pbc, unit->content); \
break;
START
(
0x00
,
MPEG2RawPictureHeader
,
picture_header
);
START
(
0xb2
,
MPEG2RawUserData
,
user_data
);
START
(
0xb3
,
MPEG2RawSequenceHeader
,
sequence_header
);
START
(
0xb5
,
MPEG2RawExtensionData
,
extension_data
);
START
(
0xb8
,
MPEG2RawGroupOfPicturesHeader
,
group_of_pictures_header
);
START
(
MPEG2_START_PICTURE
,
MPEG2RawPictureHeader
,
picture_header
);
START
(
MPEG2_START_USER_DATA
,
MPEG2RawUserData
,
user_data
);
START
(
MPEG2_START_SEQUENCE_HEADER
,
MPEG2RawSequenceHeader
,
sequence_header
);
START
(
MPEG2_START_EXTENSION
,
MPEG2RawExtensionData
,
extension_data
);
START
(
MPEG2_START_GROUP
,
MPEG2RawGroupOfPicturesHeader
,
group_of_pictures_header
);
#undef START
default:
av_log
(
ctx
->
log_ctx
,
AV_LOG_ERROR
,
"Write unimplemented for start "
...
...
@@ -331,7 +335,7 @@ static int cbs_mpeg2_write_unit(CodedBitstreamContext *ctx,
init_put_bits
(
&
pbc
,
priv
->
write_buffer
,
priv
->
write_buffer_size
);
if
(
unit
->
type
>=
0x01
&&
unit
->
type
<=
0xaf
)
if
(
MPEG2_START_IS_SLICE
(
unit
->
type
)
)
err
=
cbs_mpeg2_write_slice
(
ctx
,
unit
,
&
pbc
);
else
err
=
cbs_mpeg2_write_header
(
ctx
,
unit
,
&
pbc
);
...
...
libavcodec/cbs_mpeg2.h
View file @
cfe4389d
...
...
@@ -51,7 +51,7 @@ enum {
MPEG2_EXTENSION_PICTURE_CODING
=
0x8
,
MPEG2_EXTENSION_PICTURE_SPATIAL_SCALABLE
=
0x9
,
MPEG2_EXTENSION_PICTURE_TEMPORAL_SCALABLE
=
0xa
,
MPEG2_EXTENSION_CAM
AERA_PARAMETERS
=
0xb
,
MPEG2_EXTENSION_CAM
ERA_PARAMETERS
=
0xb
,
MPEG2_EXTENSION_ITU_T
=
0xc
,
};
...
...
libavcodec/cbs_mpeg2_syntax_template.c
View file @
cfe4389d
...
...
@@ -303,19 +303,19 @@ static int FUNC(extension_data)(CodedBitstreamContext *ctx, RWContext *rw,
ui
(
4
,
extension_start_code_identifier
);
switch
(
current
->
extension_start_code_identifier
)
{
case
1
:
case
MPEG2_EXTENSION_SEQUENCE
:
return
FUNC
(
sequence_extension
)
(
ctx
,
rw
,
&
current
->
data
.
sequence
);
case
2
:
case
MPEG2_EXTENSION_SEQUENCE_DISPLAY
:
return
FUNC
(
sequence_display_extension
)
(
ctx
,
rw
,
&
current
->
data
.
sequence_display
);
case
3
:
case
MPEG2_EXTENSION_QUANT_MATRIX
:
return
FUNC
(
quant_matrix_extension
)
(
ctx
,
rw
,
&
current
->
data
.
quant_matrix
);
case
7
:
case
MPEG2_EXTENSION_PICTURE_DISPLAY
:
return
FUNC
(
picture_display_extension
)
(
ctx
,
rw
,
&
current
->
data
.
picture_display
);
case
8
:
case
MPEG2_EXTENSION_PICTURE_CODING
:
return
FUNC
(
picture_coding_extension
)
(
ctx
,
rw
,
&
current
->
data
.
picture_coding
);
default:
...
...
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