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
a1c2b480
Commit
a1c2b480
authored
May 17, 2014
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hevc: templatize intra_pred
parent
04db5794
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
9 deletions
+25
-9
hevc.c
libavcodec/hevc.c
+5
-5
hevc.h
libavcodec/hevc.h
+1
-2
hevcpred.c
libavcodec/hevcpred.c
+4
-1
hevcpred_template.c
libavcodec/hevcpred_template.c
+15
-1
No files found.
libavcodec/hevc.c
View file @
a1c2b480
...
...
@@ -1240,18 +1240,18 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0,
int
trafo_size
=
1
<<
log2_trafo_size
;
ff_hevc_set_neighbour_available
(
s
,
x0
,
y0
,
trafo_size
,
trafo_size
);
s
->
hpc
.
intra_pred
(
s
,
x0
,
y0
,
log2_trafo_size
,
0
);
s
->
hpc
.
intra_pred
[
log2_trafo_size
-
2
](
s
,
x0
,
y0
,
0
);
if
(
log2_trafo_size
>
2
)
{
trafo_size
=
trafo_size
<<
(
s
->
sps
->
hshift
[
1
]
-
1
);
ff_hevc_set_neighbour_available
(
s
,
x0
,
y0
,
trafo_size
,
trafo_size
);
s
->
hpc
.
intra_pred
(
s
,
x0
,
y0
,
log2_trafo_size
-
1
,
1
);
s
->
hpc
.
intra_pred
(
s
,
x0
,
y0
,
log2_trafo_size
-
1
,
2
);
s
->
hpc
.
intra_pred
[
log2_trafo_size
-
3
](
s
,
x0
,
y0
,
1
);
s
->
hpc
.
intra_pred
[
log2_trafo_size
-
3
](
s
,
x0
,
y0
,
2
);
}
else
if
(
blk_idx
==
3
)
{
trafo_size
=
trafo_size
<<
s
->
sps
->
hshift
[
1
];
ff_hevc_set_neighbour_available
(
s
,
xBase
,
yBase
,
trafo_size
,
trafo_size
);
s
->
hpc
.
intra_pred
(
s
,
xBase
,
yBase
,
log2_trafo_siz
e
,
1
);
s
->
hpc
.
intra_pred
(
s
,
xBase
,
yBase
,
log2_trafo_siz
e
,
2
);
s
->
hpc
.
intra_pred
[
log2_trafo_size
-
2
](
s
,
xBase
,
yBas
e
,
1
);
s
->
hpc
.
intra_pred
[
log2_trafo_size
-
2
](
s
,
xBase
,
yBas
e
,
2
);
}
}
...
...
libavcodec/hevc.h
View file @
a1c2b480
...
...
@@ -712,8 +712,7 @@ typedef struct HEVCNAL {
struct
HEVCContext
;
typedef
struct
HEVCPredContext
{
void
(
*
intra_pred
)(
struct
HEVCContext
*
s
,
int
x0
,
int
y0
,
int
log2_size
,
int
c_idx
);
void
(
*
intra_pred
[
4
])(
struct
HEVCContext
*
s
,
int
x0
,
int
y0
,
int
c_idx
);
void
(
*
pred_planar
[
4
])(
uint8_t
*
src
,
const
uint8_t
*
top
,
const
uint8_t
*
left
,
ptrdiff_t
stride
);
...
...
libavcodec/hevcpred.c
View file @
a1c2b480
...
...
@@ -40,7 +40,10 @@ void ff_hevc_pred_init(HEVCPredContext *hpc, int bit_depth)
#define FUNC(a, depth) a ## _ ## depth
#define HEVC_PRED(depth) \
hpc->intra_pred = FUNC(intra_pred, depth); \
hpc->intra_pred[0] = FUNC(intra_pred_2, depth); \
hpc->intra_pred[1] = FUNC(intra_pred_3, depth); \
hpc->intra_pred[2] = FUNC(intra_pred_4, depth); \
hpc->intra_pred[3] = FUNC(intra_pred_5, depth); \
hpc->pred_planar[0] = FUNC(pred_planar_0, depth); \
hpc->pred_planar[1] = FUNC(pred_planar_1, depth); \
hpc->pred_planar[2] = FUNC(pred_planar_2, depth); \
...
...
libavcodec/hevcpred_template.c
View file @
a1c2b480
...
...
@@ -28,7 +28,8 @@
#define POS(x, y) src[(x) + stride * (y)]
static
void
FUNC
(
intra_pred
)(
HEVCContext
*
s
,
int
x0
,
int
y0
,
int
log2_size
,
int
c_idx
)
static
av_always_inline
void
FUNC
(
intra_pred
)(
HEVCContext
*
s
,
int
x0
,
int
y0
,
int
log2_size
,
int
c_idx
)
{
#define PU(x) \
((x) >> s->sps->log2_min_pu_size)
...
...
@@ -349,6 +350,19 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
}
}
#define INTRA_PRED(size) \
static void FUNC(intra_pred_ ## size)(HEVCContext *s, int x0, int y0, int c_idx) \
{ \
FUNC(intra_pred)(s, x0, y0, size, c_idx); \
}
INTRA_PRED
(
2
)
INTRA_PRED
(
3
)
INTRA_PRED
(
4
)
INTRA_PRED
(
5
)
#undef INTRA_PRED
static
av_always_inline
void
FUNC
(
pred_planar
)(
uint8_t
*
_src
,
const
uint8_t
*
_top
,
const
uint8_t
*
_left
,
ptrdiff_t
stride
,
int
trafo_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