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
513d849b
Commit
513d849b
authored
Nov 26, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg4videodec: move num_sprite_warping_points from MpegEncContext to Mpeg4DecContext
parent
9ba3fc3e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
11 deletions
+12
-11
mpeg4video.h
libavcodec/mpeg4video.h
+2
-0
mpeg4videodec.c
libavcodec/mpeg4videodec.c
+8
-8
mpegvideo.h
libavcodec/mpegvideo.h
+0
-1
vaapi_mpeg4.c
libavcodec/vaapi_mpeg4.c
+2
-2
No files found.
libavcodec/mpeg4video.h
View file @
513d849b
...
...
@@ -67,6 +67,8 @@ typedef struct Mpeg4DecContext {
int
shape
;
int
vol_sprite_usage
;
int
sprite_brightness_change
;
int
num_sprite_warping_points
;
// reversible vlc
int
rvlc
;
///< could this stream contain resync markers
...
...
libavcodec/mpeg4videodec.c
View file @
513d849b
...
...
@@ -172,7 +172,7 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
if
(
w
<=
0
||
h
<=
0
)
return
AVERROR_INVALIDDATA
;
for
(
i
=
0
;
i
<
s
->
num_sprite_warping_points
;
i
++
)
{
for
(
i
=
0
;
i
<
ctx
->
num_sprite_warping_points
;
i
++
)
{
int
length
;
int
x
=
0
,
y
=
0
;
...
...
@@ -240,7 +240,7 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
ROUNDED_DIV
(((
h
-
h2
)
*
(
r
*
sprite_ref
[
0
][
1
]
-
16
*
vop_ref
[
0
][
1
])
+
h2
*
(
r
*
sprite_ref
[
2
][
1
]
-
16
*
vop_ref
[
2
][
1
])),
h
);
switch
(
s
->
num_sprite_warping_points
)
{
switch
(
ctx
->
num_sprite_warping_points
)
{
case
0
:
s
->
sprite_offset
[
0
][
0
]
=
s
->
sprite_offset
[
0
][
1
]
=
...
...
@@ -359,7 +359,7 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
s
->
sprite_delta
[
1
][
i
]
<<=
shift_y
;
s
->
sprite_shift
[
i
]
=
16
;
}
s
->
real_sprite_warping_points
=
s
->
num_sprite_warping_points
;
s
->
real_sprite_warping_points
=
ctx
->
num_sprite_warping_points
;
}
return
0
;
...
...
@@ -1780,12 +1780,12 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
skip_bits
(
gb
,
13
);
// sprite_top
skip_bits1
(
gb
);
/* marker */
}
s
->
num_sprite_warping_points
=
get_bits
(
gb
,
6
);
if
(
s
->
num_sprite_warping_points
>
3
)
{
ctx
->
num_sprite_warping_points
=
get_bits
(
gb
,
6
);
if
(
ctx
->
num_sprite_warping_points
>
3
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"%d sprite_warping_points
\n
"
,
s
->
num_sprite_warping_points
);
s
->
num_sprite_warping_points
=
0
;
ctx
->
num_sprite_warping_points
);
ctx
->
num_sprite_warping_points
=
0
;
return
-
1
;
}
s
->
sprite_warping_accuracy
=
get_bits
(
gb
,
2
);
...
...
@@ -2242,7 +2242,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
gb
->
size_in_bits
,
s
->
progressive_sequence
,
s
->
alternate_scan
,
s
->
top_field_first
,
s
->
quarter_sample
?
"q"
:
"h"
,
s
->
data_partitioning
,
ctx
->
resync_marker
,
s
->
num_sprite_warping_points
,
s
->
sprite_warping_accuracy
,
ctx
->
num_sprite_warping_points
,
s
->
sprite_warping_accuracy
,
1
-
s
->
no_rounding
,
s
->
vo_type
,
s
->
vol_control_parameters
?
" VOLC"
:
" "
,
s
->
intra_dc_threshold
,
ctx
->
cplx_estimation_trash_i
,
ctx
->
cplx_estimation_trash_p
,
...
...
libavcodec/mpegvideo.h
View file @
513d849b
...
...
@@ -579,7 +579,6 @@ typedef struct MpegEncContext {
uint16_t
pb_time
;
///< time distance between the last b and p,s,i frame
uint16_t
pp_field_time
;
uint16_t
pb_field_time
;
///< like above, just for interlaced
int
num_sprite_warping_points
;
int
real_sprite_warping_points
;
uint16_t
sprite_traj
[
4
][
2
];
///< sprite trajectory points
int
sprite_offset
[
2
][
2
];
///< sprite offset[isChroma][isMVY]
...
...
libavcodec/vaapi_mpeg4.c
View file @
513d849b
...
...
@@ -73,8 +73,8 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
pic_param
->
vol_fields
.
bits
.
data_partitioned
=
s
->
data_partitioning
;
pic_param
->
vol_fields
.
bits
.
reversible_vlc
=
ctx
->
rvlc
;
pic_param
->
vol_fields
.
bits
.
resync_marker_disable
=
!
ctx
->
resync_marker
;
pic_param
->
no_of_sprite_warping_points
=
s
->
num_sprite_warping_points
;
for
(
i
=
0
;
i
<
s
->
num_sprite_warping_points
&&
i
<
3
;
i
++
)
{
pic_param
->
no_of_sprite_warping_points
=
ctx
->
num_sprite_warping_points
;
for
(
i
=
0
;
i
<
ctx
->
num_sprite_warping_points
&&
i
<
3
;
i
++
)
{
pic_param
->
sprite_trajectory_du
[
i
]
=
s
->
sprite_traj
[
i
][
0
];
pic_param
->
sprite_trajectory_dv
[
i
]
=
s
->
sprite_traj
[
i
][
1
];
}
...
...
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