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
4c013946
Commit
4c013946
authored
Feb 25, 2017
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/vp56: Factorize vp56_render_mb() out
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
949d2176
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
54 deletions
+23
-54
vp56.c
libavcodec/vp56.c
+23
-54
No files found.
libavcodec/vp56.c
View file @
4c013946
...
@@ -400,30 +400,18 @@ static void vp56_mc(VP56Context *s, int b, int plane, uint8_t *src,
...
@@ -400,30 +400,18 @@ static void vp56_mc(VP56Context *s, int b, int plane, uint8_t *src,
}
}
}
}
static
int
vp56_decode_mb
(
VP56Context
*
s
,
int
row
,
int
col
,
int
is_alpha
)
static
av_always_inline
void
vp56_render_mb
(
VP56Context
*
s
,
int
row
,
int
col
,
int
is_alpha
,
VP56mb
mb_type
)
{
{
AVFrame
*
frame_current
,
*
frame_ref
;
VP56mb
mb_type
;
VP56Frame
ref_frame
;
int
b
,
ab
,
b_max
,
plane
,
off
;
int
b
,
ab
,
b_max
,
plane
,
off
;
int
ret
;
AVFrame
*
frame_current
,
*
frame_ref
;
VP56Frame
ref_frame
=
ff_vp56_reference_frame
[
mb_type
];
if
(
s
->
frames
[
VP56_FRAME_CURRENT
]
->
key_frame
)
mb_type
=
VP56_MB_INTRA
;
else
mb_type
=
vp56_decode_mv
(
s
,
row
,
col
);
ref_frame
=
ff_vp56_reference_frame
[
mb_type
];
ret
=
s
->
parse_coeff
(
s
);
if
(
ret
<
0
)
return
ret
;
vp56_add_predictors_dc
(
s
,
ref_frame
);
vp56_add_predictors_dc
(
s
,
ref_frame
);
frame_current
=
s
->
frames
[
VP56_FRAME_CURRENT
];
frame_current
=
s
->
frames
[
VP56_FRAME_CURRENT
];
frame_ref
=
s
->
frames
[
ref_frame
];
frame_ref
=
s
->
frames
[
ref_frame
];
if
(
mb_type
!=
VP56_MB_INTRA
&&
!
frame_ref
->
data
[
0
])
if
(
mb_type
!=
VP56_MB_INTRA
&&
!
frame_ref
->
data
[
0
])
return
0
;
return
;
ab
=
6
*
is_alpha
;
ab
=
6
*
is_alpha
;
b_max
=
6
-
2
*
is_alpha
;
b_max
=
6
-
2
*
is_alpha
;
...
@@ -473,57 +461,38 @@ static int vp56_decode_mb(VP56Context *s, int row, int col, int is_alpha)
...
@@ -473,57 +461,38 @@ static int vp56_decode_mb(VP56Context *s, int row, int col, int is_alpha)
s
->
block_coeff
[
4
][
0
]
=
0
;
s
->
block_coeff
[
4
][
0
]
=
0
;
s
->
block_coeff
[
5
][
0
]
=
0
;
s
->
block_coeff
[
5
][
0
]
=
0
;
}
}
return
0
;
}
}
static
int
vp56_
conceal
_mb
(
VP56Context
*
s
,
int
row
,
int
col
,
int
is_alpha
)
static
int
vp56_
decode
_mb
(
VP56Context
*
s
,
int
row
,
int
col
,
int
is_alpha
)
{
{
AVFrame
*
frame_current
,
*
frame_ref
;
VP56mb
mb_type
;
VP56mb
mb_type
;
VP56Frame
ref_frame
;
int
ret
;
int
b
,
ab
,
b_max
,
plane
,
off
;
if
(
s
->
frames
[
VP56_FRAME_CURRENT
]
->
key_frame
)
if
(
s
->
frames
[
VP56_FRAME_CURRENT
]
->
key_frame
)
mb_type
=
VP56_MB_INTRA
;
mb_type
=
VP56_MB_INTRA
;
else
else
mb_type
=
vp56_conceal_mv
(
s
,
row
,
col
);
mb_type
=
vp56_decode_mv
(
s
,
row
,
col
);
ref_frame
=
ff_vp56_reference_frame
[
mb_type
];
ret
=
s
->
parse_coeff
(
s
);
if
(
ret
<
0
)
return
ret
;
vp56_render_mb
(
s
,
row
,
col
,
is_alpha
,
mb_type
);
frame_current
=
s
->
frames
[
VP56_FRAME_CURRENT
];
frame_ref
=
s
->
frames
[
ref_frame
];
if
(
mb_type
!=
VP56_MB_INTRA
&&
!
frame_ref
->
data
[
0
])
return
0
;
return
0
;
}
ab
=
6
*
is_alpha
;
static
int
vp56_conceal_mb
(
VP56Context
*
s
,
int
row
,
int
col
,
int
is_alpha
)
b_max
=
6
-
2
*
is_alpha
;
{
VP56mb
mb_type
;
switch
(
mb_type
)
{
if
(
s
->
frames
[
VP56_FRAME_CURRENT
]
->
key_frame
)
case
VP56_MB_INTRA
:
mb_type
=
VP56_MB_INTRA
;
for
(
b
=
0
;
b
<
b_max
;
b
++
)
{
else
plane
=
ff_vp56_b2p
[
b
+
ab
];
mb_type
=
vp56_conceal_mv
(
s
,
row
,
col
);
s
->
vp3dsp
.
idct_put
(
frame_current
->
data
[
plane
]
+
s
->
block_offset
[
b
],
s
->
stride
[
plane
],
s
->
block_coeff
[
b
]);
}
break
;
case
VP56_MB_INTER_NOVEC_PF
:
vp56_render_mb
(
s
,
row
,
col
,
is_alpha
,
mb_type
);
case
VP56_MB_INTER_NOVEC_GF
:
for
(
b
=
0
;
b
<
b_max
;
b
++
)
{
plane
=
ff_vp56_b2p
[
b
+
ab
];
off
=
s
->
block_offset
[
b
];
s
->
hdsp
.
put_pixels_tab
[
1
][
0
](
frame_current
->
data
[
plane
]
+
off
,
frame_ref
->
data
[
plane
]
+
off
,
s
->
stride
[
plane
],
8
);
s
->
vp3dsp
.
idct_add
(
frame_current
->
data
[
plane
]
+
off
,
s
->
stride
[
plane
],
s
->
block_coeff
[
b
]);
}
break
;
}
if
(
is_alpha
)
{
s
->
block_coeff
[
4
][
0
]
=
0
;
s
->
block_coeff
[
5
][
0
]
=
0
;
}
return
0
;
return
0
;
}
}
...
...
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