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
35e0833d
Commit
35e0833d
authored
Nov 26, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg4videodec: add a mpeg4-specific private context.
parent
95fd52c1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
+26
-6
mpeg4video.h
libavcodec/mpeg4video.h
+4
-0
mpeg4video_parser.c
libavcodec/mpeg4video_parser.c
+4
-3
mpeg4videodec.c
libavcodec/mpeg4videodec.c
+18
-3
No files found.
libavcodec/mpeg4video.h
View file @
35e0833d
...
...
@@ -59,6 +59,10 @@
#define VISUAL_OBJ_STARTCODE 0x1B5
#define VOP_STARTCODE 0x1B6
typedef
struct
Mpeg4DecContext
{
MpegEncContext
m
;
}
Mpeg4DecContext
;
/* dc encoding for mpeg4 */
extern
const
uint8_t
ff_mpeg4_DCtab_lum
[
13
][
2
];
extern
const
uint8_t
ff_mpeg4_DCtab_chrom
[
13
][
2
];
...
...
libavcodec/mpeg4video_parser.c
View file @
35e0833d
...
...
@@ -28,7 +28,7 @@
struct
Mp4vParseContext
{
ParseContext
pc
;
struct
MpegEncContext
enc
;
Mpeg4DecContext
dec_ctx
;
int
first_picture
;
};
...
...
@@ -76,7 +76,8 @@ static int av_mpeg4_decode_header(AVCodecParserContext *s1,
const
uint8_t
*
buf
,
int
buf_size
)
{
struct
Mp4vParseContext
*
pc
=
s1
->
priv_data
;
MpegEncContext
*
s
=
&
pc
->
enc
;
Mpeg4DecContext
*
dec_ctx
=
&
pc
->
dec_ctx
;
MpegEncContext
*
s
=
&
dec_ctx
->
m
;
GetBitContext
gb1
,
*
gb
=
&
gb1
;
int
ret
;
...
...
@@ -106,7 +107,7 @@ static av_cold int mpeg4video_parse_init(AVCodecParserContext *s)
struct
Mp4vParseContext
*
pc
=
s
->
priv_data
;
pc
->
first_picture
=
1
;
pc
->
enc
.
slice_context_count
=
1
;
pc
->
dec_ctx
.
m
.
slice_context_count
=
1
;
return
0
;
}
...
...
libavcodec/mpeg4videodec.c
View file @
35e0833d
...
...
@@ -2397,9 +2397,24 @@ end:
return
decode_vop_header
(
s
,
gb
);
}
static
int
mpeg4_update_thread_context
(
AVCodecContext
*
dst
,
const
AVCodecContext
*
src
)
{
Mpeg4DecContext
*
s
=
dst
->
priv_data
;
const
Mpeg4DecContext
*
s1
=
src
->
priv_data
;
int
ret
=
ff_mpeg_update_thread_context
(
dst
,
src
);
if
(
ret
<
0
)
return
ret
;
return
0
;
}
static
av_cold
int
decode_init
(
AVCodecContext
*
avctx
)
{
MpegEncContext
*
s
=
avctx
->
priv_data
;
Mpeg4DecContext
*
ctx
=
avctx
->
priv_data
;
MpegEncContext
*
s
=
&
ctx
->
m
;
int
ret
;
static
int
done
=
0
;
...
...
@@ -2469,7 +2484,7 @@ AVCodec ff_mpeg4_decoder = {
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"MPEG-4 part 2"
),
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_MPEG4
,
.
priv_data_size
=
sizeof
(
Mpeg
En
cContext
),
.
priv_data_size
=
sizeof
(
Mpeg
4De
cContext
),
.
init
=
decode_init
,
.
close
=
ff_h263_decode_end
,
.
decode
=
ff_h263_decode_frame
,
...
...
@@ -2479,5 +2494,5 @@ AVCodec ff_mpeg4_decoder = {
.
flush
=
ff_mpeg_flush
,
.
pix_fmts
=
ff_h263_hwaccel_pixfmt_list_420
,
.
profiles
=
NULL_IF_CONFIG_SMALL
(
mpeg4_video_profiles
),
.
update_thread_context
=
ONLY_IF_THREADS_ENABLED
(
ff_mpeg
_update_thread_context
),
.
update_thread_context
=
ONLY_IF_THREADS_ENABLED
(
mpeg4
_update_thread_context
),
};
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