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
5f390eef
Commit
5f390eef
authored
Jan 17, 2015
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: move mb_[uv]linesize into the per-slice context
parent
99a35d1c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
64 deletions
+64
-64
h264.h
libavcodec/h264.h
+3
-3
h264_mb.c
libavcodec/h264_mb.c
+47
-47
h264_mb_template.c
libavcodec/h264_mb_template.c
+6
-6
h264_mc_template.c
libavcodec/h264_mc_template.c
+4
-4
h264_slice.c
libavcodec/h264_slice.c
+4
-4
No files found.
libavcodec/h264.h
View file @
5f390eef
...
...
@@ -342,6 +342,9 @@ typedef struct H264SliceContext {
unsigned
int
topright_samples_available
;
unsigned
int
left_samples_available
;
ptrdiff_t
mb_linesize
;
///< may be equal to s->linesize or s->linesize * 2, for mbaff
ptrdiff_t
mb_uvlinesize
;
/**
* number of neighbors (top and/or left) that used 8x8 dct
*/
...
...
@@ -413,9 +416,6 @@ typedef struct H264Context {
uint32_t
*
mb2br_xy
;
int
b_stride
;
// FIXME use s->b4_stride
ptrdiff_t
mb_linesize
;
///< may be equal to s->linesize or s->linesize * 2, for mbaff
ptrdiff_t
mb_uvlinesize
;
SPS
sps
;
///< current sps
PPS
pps
;
///< current pps
...
...
libavcodec/h264_mb.c
View file @
5f390eef
This diff is collapsed.
Click to expand it.
libavcodec/h264_mb_template.c
View file @
5f390eef
...
...
@@ -67,8 +67,8 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
h
->
list_counts
[
mb_xy
]
=
h
->
list_count
;
if
(
!
SIMPLE
&&
MB_FIELD
(
h
))
{
linesize
=
h
->
mb_linesize
=
h
->
linesize
*
2
;
uvlinesize
=
h
->
mb_uvlinesize
=
h
->
uvlinesize
*
2
;
linesize
=
sl
->
mb_linesize
=
h
->
linesize
*
2
;
uvlinesize
=
sl
->
mb_uvlinesize
=
h
->
uvlinesize
*
2
;
block_offset
=
&
h
->
block_offset
[
48
];
if
(
mb_y
&
1
)
{
// FIXME move out of this function?
dest_y
-=
h
->
linesize
*
15
;
...
...
@@ -94,8 +94,8 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
}
}
}
else
{
linesize
=
h
->
mb_linesize
=
h
->
linesize
;
uvlinesize
=
h
->
mb_uvlinesize
=
h
->
uvlinesize
;
linesize
=
sl
->
mb_linesize
=
h
->
linesize
;
uvlinesize
=
sl
->
mb_uvlinesize
=
h
->
uvlinesize
;
// dct_offset = s->linesize * 16;
}
...
...
@@ -295,7 +295,7 @@ static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h, H264SliceContext
h
->
list_counts
[
mb_xy
]
=
h
->
list_count
;
if
(
!
SIMPLE
&&
MB_FIELD
(
h
))
{
linesize
=
h
->
mb_linesize
=
h
->
mb_uvlinesize
=
h
->
linesize
*
2
;
linesize
=
sl
->
mb_linesize
=
sl
->
mb_uvlinesize
=
h
->
linesize
*
2
;
block_offset
=
&
h
->
block_offset
[
48
];
if
(
mb_y
&
1
)
// FIXME move out of this function?
for
(
p
=
0
;
p
<
3
;
p
++
)
...
...
@@ -319,7 +319,7 @@ static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h, H264SliceContext
}
}
}
else
{
linesize
=
h
->
mb_linesize
=
h
->
mb_uvlinesize
=
h
->
linesize
;
linesize
=
sl
->
mb_linesize
=
sl
->
mb_uvlinesize
=
h
->
linesize
;
}
if
(
!
SIMPLE
&&
IS_INTRA_PCM
(
mb_type
))
{
...
...
libavcodec/h264_mc_template.c
View file @
5f390eef
...
...
@@ -95,11 +95,11 @@ static void MCFUNC(hl_motion)(H264Context *h, H264SliceContext *sl,
weight_op
,
weight_avg
,
IS_DIR
(
mb_type
,
1
,
0
),
IS_DIR
(
mb_type
,
1
,
1
));
}
else
if
(
IS_8X16
(
mb_type
))
{
mc_part
(
h
,
sl
,
0
,
0
,
16
,
8
*
h
->
mb_linesize
,
dest_y
,
dest_cb
,
dest_cr
,
0
,
0
,
mc_part
(
h
,
sl
,
0
,
0
,
16
,
8
*
sl
->
mb_linesize
,
dest_y
,
dest_cb
,
dest_cr
,
0
,
0
,
qpix_put
[
1
],
chroma_put
[
1
],
qpix_avg
[
1
],
chroma_avg
[
1
],
&
weight_op
[
1
],
&
weight_avg
[
1
],
IS_DIR
(
mb_type
,
0
,
0
),
IS_DIR
(
mb_type
,
0
,
1
));
mc_part
(
h
,
sl
,
4
,
0
,
16
,
8
*
h
->
mb_linesize
,
dest_y
,
dest_cb
,
dest_cr
,
4
,
0
,
mc_part
(
h
,
sl
,
4
,
0
,
16
,
8
*
sl
->
mb_linesize
,
dest_y
,
dest_cb
,
dest_cr
,
4
,
0
,
qpix_put
[
1
],
chroma_put
[
1
],
qpix_avg
[
1
],
chroma_avg
[
1
],
&
weight_op
[
1
],
&
weight_avg
[
1
],
IS_DIR
(
mb_type
,
1
,
0
),
IS_DIR
(
mb_type
,
1
,
1
));
...
...
@@ -132,12 +132,12 @@ static void MCFUNC(hl_motion)(H264Context *h, H264SliceContext *sl,
&
weight_op
[
1
],
&
weight_avg
[
1
],
IS_DIR
(
sub_mb_type
,
0
,
0
),
IS_DIR
(
sub_mb_type
,
0
,
1
));
}
else
if
(
IS_SUB_4X8
(
sub_mb_type
))
{
mc_part
(
h
,
sl
,
n
,
0
,
8
,
4
*
h
->
mb_linesize
,
mc_part
(
h
,
sl
,
n
,
0
,
8
,
4
*
sl
->
mb_linesize
,
dest_y
,
dest_cb
,
dest_cr
,
x_offset
,
y_offset
,
qpix_put
[
2
],
chroma_put
[
2
],
qpix_avg
[
2
],
chroma_avg
[
2
],
&
weight_op
[
2
],
&
weight_avg
[
2
],
IS_DIR
(
sub_mb_type
,
0
,
0
),
IS_DIR
(
sub_mb_type
,
0
,
1
));
mc_part
(
h
,
sl
,
n
+
1
,
0
,
8
,
4
*
h
->
mb_linesize
,
mc_part
(
h
,
sl
,
n
+
1
,
0
,
8
,
4
*
sl
->
mb_linesize
,
dest_y
,
dest_cb
,
dest_cr
,
x_offset
+
2
,
y_offset
,
qpix_put
[
2
],
chroma_put
[
2
],
qpix_avg
[
2
],
chroma_avg
[
2
],
&
weight_op
[
2
],
&
weight_avg
[
2
],
...
...
libavcodec/h264_slice.c
View file @
5f390eef
...
...
@@ -2086,16 +2086,16 @@ static void loop_filter(H264Context *h, H264SliceContext *sl, int start_x, int e
// FIXME simplify above
if
(
MB_FIELD
(
h
))
{
linesize
=
h
->
mb_linesize
=
h
->
linesize
*
2
;
uvlinesize
=
h
->
mb_uvlinesize
=
h
->
uvlinesize
*
2
;
linesize
=
sl
->
mb_linesize
=
h
->
linesize
*
2
;
uvlinesize
=
sl
->
mb_uvlinesize
=
h
->
uvlinesize
*
2
;
if
(
mb_y
&
1
)
{
// FIXME move out of this function?
dest_y
-=
h
->
linesize
*
15
;
dest_cb
-=
h
->
uvlinesize
*
(
block_h
-
1
);
dest_cr
-=
h
->
uvlinesize
*
(
block_h
-
1
);
}
}
else
{
linesize
=
h
->
mb_linesize
=
h
->
linesize
;
uvlinesize
=
h
->
mb_uvlinesize
=
h
->
uvlinesize
;
linesize
=
sl
->
mb_linesize
=
h
->
linesize
;
uvlinesize
=
sl
->
mb_uvlinesize
=
h
->
uvlinesize
;
}
backup_mb_border
(
h
,
dest_y
,
dest_cb
,
dest_cr
,
linesize
,
uvlinesize
,
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