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
cd975d56
Commit
cd975d56
authored
Nov 16, 2014
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hevc: Spin the mv_mpv_mode calls in a stand alone function
Signed-off-by:
Luca Barbato
<
lu_zero@gentoo.org
>
parent
1f80742f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
40 deletions
+46
-40
hevc.c
libavcodec/hevc.c
+46
-40
No files found.
libavcodec/hevc.c
View file @
cd975d56
...
@@ -1621,6 +1621,50 @@ static void hevc_await_progress(HEVCContext *s, HEVCFrame *ref,
...
@@ -1621,6 +1621,50 @@ static void hevc_await_progress(HEVCContext *s, HEVCFrame *ref,
ff_thread_await_progress
(
&
ref
->
tf
,
y
,
0
);
ff_thread_await_progress
(
&
ref
->
tf
,
y
,
0
);
}
}
static
void
hevc_luma_mv_mpv_mode
(
HEVCContext
*
s
,
int
x0
,
int
y0
,
int
nPbW
,
int
nPbH
,
int
log2_cb_size
,
int
part_idx
,
int
merge_idx
,
MvField
*
mv
)
{
HEVCLocalContext
*
lc
=
&
s
->
HEVClc
;
enum
InterPredIdc
inter_pred_idc
=
PRED_L0
;
int
mvp_flag
;
ff_hevc_set_neighbour_available
(
s
,
x0
,
y0
,
nPbW
,
nPbH
);
if
(
s
->
sh
.
slice_type
==
B_SLICE
)
inter_pred_idc
=
ff_hevc_inter_pred_idc_decode
(
s
,
nPbW
,
nPbH
);
if
(
inter_pred_idc
!=
PRED_L1
)
{
if
(
s
->
sh
.
nb_refs
[
L0
])
mv
->
ref_idx
[
0
]
=
ff_hevc_ref_idx_lx_decode
(
s
,
s
->
sh
.
nb_refs
[
L0
]);
mv
->
pred_flag
[
0
]
=
1
;
hls_mvd_coding
(
s
,
x0
,
y0
,
0
);
mvp_flag
=
ff_hevc_mvp_lx_flag_decode
(
s
);
ff_hevc_luma_mv_mvp_mode
(
s
,
x0
,
y0
,
nPbW
,
nPbH
,
log2_cb_size
,
part_idx
,
merge_idx
,
mv
,
mvp_flag
,
0
);
mv
->
mv
[
0
].
x
+=
lc
->
pu
.
mvd
.
x
;
mv
->
mv
[
0
].
y
+=
lc
->
pu
.
mvd
.
y
;
}
if
(
inter_pred_idc
!=
PRED_L0
)
{
if
(
s
->
sh
.
nb_refs
[
L1
])
mv
->
ref_idx
[
1
]
=
ff_hevc_ref_idx_lx_decode
(
s
,
s
->
sh
.
nb_refs
[
L1
]);
if
(
s
->
sh
.
mvd_l1_zero_flag
==
1
&&
inter_pred_idc
==
PRED_BI
)
{
AV_ZERO32
(
&
lc
->
pu
.
mvd
);
}
else
{
hls_mvd_coding
(
s
,
x0
,
y0
,
1
);
}
mv
->
pred_flag
[
1
]
=
1
;
mvp_flag
=
ff_hevc_mvp_lx_flag_decode
(
s
);
ff_hevc_luma_mv_mvp_mode
(
s
,
x0
,
y0
,
nPbW
,
nPbH
,
log2_cb_size
,
part_idx
,
merge_idx
,
mv
,
mvp_flag
,
1
);
mv
->
mv
[
1
].
x
+=
lc
->
pu
.
mvd
.
x
;
mv
->
mv
[
1
].
y
+=
lc
->
pu
.
mvd
.
y
;
}
}
static
void
hls_prediction_unit
(
HEVCContext
*
s
,
int
x0
,
int
y0
,
static
void
hls_prediction_unit
(
HEVCContext
*
s
,
int
x0
,
int
y0
,
int
nPbW
,
int
nPbH
,
int
nPbW
,
int
nPbH
,
int
log2_cb_size
,
int
partIdx
)
int
log2_cb_size
,
int
partIdx
)
...
@@ -1664,46 +1708,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
...
@@ -1664,46 +1708,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
ff_hevc_luma_mv_merge_mode
(
s
,
x0
,
y0
,
nPbW
,
nPbH
,
log2_cb_size
,
ff_hevc_luma_mv_merge_mode
(
s
,
x0
,
y0
,
nPbW
,
nPbH
,
log2_cb_size
,
partIdx
,
merge_idx
,
&
current_mv
);
partIdx
,
merge_idx
,
&
current_mv
);
}
else
{
}
else
{
enum
InterPredIdc
inter_pred_idc
=
PRED_L0
;
hevc_luma_mv_mpv_mode
(
s
,
x0
,
y0
,
nPbW
,
nPbH
,
log2_cb_size
,
int
mvp_flag
;
partIdx
,
merge_idx
,
&
current_mv
);
ff_hevc_set_neighbour_available
(
s
,
x0
,
y0
,
nPbW
,
nPbH
);
if
(
s
->
sh
.
slice_type
==
B_SLICE
)
inter_pred_idc
=
ff_hevc_inter_pred_idc_decode
(
s
,
nPbW
,
nPbH
);
if
(
inter_pred_idc
!=
PRED_L1
)
{
if
(
s
->
sh
.
nb_refs
[
L0
])
{
current_mv
.
ref_idx
[
0
]
=
ff_hevc_ref_idx_lx_decode
(
s
,
s
->
sh
.
nb_refs
[
L0
]);
}
current_mv
.
pred_flag
[
0
]
=
1
;
hls_mvd_coding
(
s
,
x0
,
y0
,
0
);
mvp_flag
=
ff_hevc_mvp_lx_flag_decode
(
s
);
ff_hevc_luma_mv_mvp_mode
(
s
,
x0
,
y0
,
nPbW
,
nPbH
,
log2_cb_size
,
partIdx
,
merge_idx
,
&
current_mv
,
mvp_flag
,
0
);
current_mv
.
mv
[
0
].
x
+=
lc
->
pu
.
mvd
.
x
;
current_mv
.
mv
[
0
].
y
+=
lc
->
pu
.
mvd
.
y
;
}
if
(
inter_pred_idc
!=
PRED_L0
)
{
if
(
s
->
sh
.
nb_refs
[
L1
])
{
current_mv
.
ref_idx
[
1
]
=
ff_hevc_ref_idx_lx_decode
(
s
,
s
->
sh
.
nb_refs
[
L1
]);
}
if
(
s
->
sh
.
mvd_l1_zero_flag
==
1
&&
inter_pred_idc
==
PRED_BI
)
{
AV_ZERO32
(
&
lc
->
pu
.
mvd
);
}
else
{
hls_mvd_coding
(
s
,
x0
,
y0
,
1
);
}
current_mv
.
pred_flag
[
1
]
=
1
;
mvp_flag
=
ff_hevc_mvp_lx_flag_decode
(
s
);
ff_hevc_luma_mv_mvp_mode
(
s
,
x0
,
y0
,
nPbW
,
nPbH
,
log2_cb_size
,
partIdx
,
merge_idx
,
&
current_mv
,
mvp_flag
,
1
);
current_mv
.
mv
[
1
].
x
+=
lc
->
pu
.
mvd
.
x
;
current_mv
.
mv
[
1
].
y
+=
lc
->
pu
.
mvd
.
y
;
}
}
}
x_pu
=
x0
>>
s
->
sps
->
log2_min_pu_size
;
x_pu
=
x0
>>
s
->
sps
->
log2_min_pu_size
;
...
...
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