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
982e7bbf
Commit
982e7bbf
authored
May 08, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/vc1: Skip chroma operations if CODEC_FLAG_GRAY is set
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
23e6cf83
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
vc1_block.c
libavcodec/vc1_block.c
+4
-0
vc1_loopfilter.c
libavcodec/vc1_loopfilter.c
+14
-8
No files found.
libavcodec/vc1_block.c
View file @
982e7bbf
...
...
@@ -99,6 +99,7 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v)
s
->
idsp
.
put_signed_pixels_clamped
(
v
->
block
[
v
->
topleft_blk_idx
][
3
],
s
->
dest
[
0
]
-
v_dist
*
s
->
linesize
-
8
,
stride_y
);
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
))
{
s
->
idsp
.
put_signed_pixels_clamped
(
v
->
block
[
v
->
topleft_blk_idx
][
4
],
s
->
dest
[
1
]
-
8
*
s
->
uvlinesize
-
8
,
s
->
uvlinesize
);
...
...
@@ -106,6 +107,7 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v)
s
->
dest
[
2
]
-
8
*
s
->
uvlinesize
-
8
,
s
->
uvlinesize
);
}
}
if
(
s
->
mb_x
==
s
->
mb_width
-
1
)
{
top_mb_pos
=
(
s
->
mb_y
-
1
)
*
s
->
mb_stride
+
s
->
mb_x
;
if
(
v
->
fcm
==
ILACE_FRAME
)
...
...
@@ -124,6 +126,7 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v)
s
->
idsp
.
put_signed_pixels_clamped
(
v
->
block
[
v
->
top_blk_idx
][
3
],
s
->
dest
[
0
]
-
v_dist
*
s
->
linesize
+
8
,
stride_y
);
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
))
{
s
->
idsp
.
put_signed_pixels_clamped
(
v
->
block
[
v
->
top_blk_idx
][
4
],
s
->
dest
[
1
]
-
8
*
s
->
uvlinesize
,
s
->
uvlinesize
);
...
...
@@ -132,6 +135,7 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v)
s
->
uvlinesize
);
}
}
}
#define inc_blk_idx(idx) do { \
idx++; \
...
...
libavcodec/vc1_loopfilter.c
View file @
982e7bbf
...
...
@@ -40,6 +40,7 @@ void ff_vc1_loop_filter_iblk(VC1Context *v, int pq)
if
(
s
->
mb_x
)
v
->
vc1dsp
.
vc1_h_loop_filter16
(
s
->
dest
[
0
]
-
16
*
s
->
linesize
,
s
->
linesize
,
pq
);
v
->
vc1dsp
.
vc1_h_loop_filter16
(
s
->
dest
[
0
]
-
16
*
s
->
linesize
+
8
,
s
->
linesize
,
pq
);
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
))
for
(
j
=
0
;
j
<
2
;
j
++
)
{
v
->
vc1dsp
.
vc1_v_loop_filter8
(
s
->
dest
[
j
+
1
],
s
->
uvlinesize
,
pq
);
if
(
s
->
mb_x
)
...
...
@@ -51,9 +52,11 @@ void ff_vc1_loop_filter_iblk(VC1Context *v, int pq)
if
(
s
->
mb_y
==
s
->
end_mb_y
-
1
)
{
if
(
s
->
mb_x
)
{
v
->
vc1dsp
.
vc1_h_loop_filter16
(
s
->
dest
[
0
],
s
->
linesize
,
pq
);
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
))
{
v
->
vc1dsp
.
vc1_h_loop_filter8
(
s
->
dest
[
1
],
s
->
uvlinesize
,
pq
);
v
->
vc1dsp
.
vc1_h_loop_filter8
(
s
->
dest
[
2
],
s
->
uvlinesize
,
pq
);
}
}
v
->
vc1dsp
.
vc1_h_loop_filter16
(
s
->
dest
[
0
]
+
8
,
s
->
linesize
,
pq
);
}
}
...
...
@@ -73,6 +76,7 @@ void ff_vc1_loop_filter_iblk_delayed(VC1Context *v, int pq)
if
(
s
->
mb_x
>=
2
)
v
->
vc1dsp
.
vc1_h_loop_filter16
(
s
->
dest
[
0
]
-
32
*
s
->
linesize
-
16
,
s
->
linesize
,
pq
);
v
->
vc1dsp
.
vc1_h_loop_filter16
(
s
->
dest
[
0
]
-
32
*
s
->
linesize
-
8
,
s
->
linesize
,
pq
);
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
))
for
(
j
=
0
;
j
<
2
;
j
++
)
{
v
->
vc1dsp
.
vc1_v_loop_filter8
(
s
->
dest
[
j
+
1
]
-
8
*
s
->
uvlinesize
-
8
,
s
->
uvlinesize
,
pq
);
if
(
s
->
mb_x
>=
2
)
{
...
...
@@ -90,6 +94,7 @@ void ff_vc1_loop_filter_iblk_delayed(VC1Context *v, int pq)
if
(
s
->
mb_x
)
v
->
vc1dsp
.
vc1_h_loop_filter16
(
s
->
dest
[
0
]
-
32
*
s
->
linesize
,
s
->
linesize
,
pq
);
v
->
vc1dsp
.
vc1_h_loop_filter16
(
s
->
dest
[
0
]
-
32
*
s
->
linesize
+
8
,
s
->
linesize
,
pq
);
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
))
for
(
j
=
0
;
j
<
2
;
j
++
)
{
v
->
vc1dsp
.
vc1_v_loop_filter8
(
s
->
dest
[
j
+
1
]
-
8
*
s
->
uvlinesize
,
s
->
uvlinesize
,
pq
);
if
(
s
->
mb_x
>=
2
)
{
...
...
@@ -105,7 +110,7 @@ void ff_vc1_loop_filter_iblk_delayed(VC1Context *v, int pq)
if
(
s
->
mb_x
>=
2
)
v
->
vc1dsp
.
vc1_h_loop_filter16
(
s
->
dest
[
0
]
-
16
*
s
->
linesize
-
16
,
s
->
linesize
,
pq
);
v
->
vc1dsp
.
vc1_h_loop_filter16
(
s
->
dest
[
0
]
-
16
*
s
->
linesize
-
8
,
s
->
linesize
,
pq
);
if
(
s
->
mb_x
>=
2
)
{
if
(
s
->
mb_x
>=
2
&&
!
(
s
->
flags
&
CODEC_FLAG_GRAY
)
)
{
for
(
j
=
0
;
j
<
2
;
j
++
)
{
v
->
vc1dsp
.
vc1_h_loop_filter8
(
s
->
dest
[
j
+
1
]
-
8
*
s
->
uvlinesize
-
8
,
s
->
uvlinesize
,
pq
);
}
...
...
@@ -116,7 +121,7 @@ void ff_vc1_loop_filter_iblk_delayed(VC1Context *v, int pq)
if
(
s
->
mb_x
)
v
->
vc1dsp
.
vc1_h_loop_filter16
(
s
->
dest
[
0
]
-
16
*
s
->
linesize
,
s
->
linesize
,
pq
);
v
->
vc1dsp
.
vc1_h_loop_filter16
(
s
->
dest
[
0
]
-
16
*
s
->
linesize
+
8
,
s
->
linesize
,
pq
);
if
(
s
->
mb_x
)
{
if
(
s
->
mb_x
&&
!
(
s
->
flags
&
CODEC_FLAG_GRAY
)
)
{
for
(
j
=
0
;
j
<
2
;
j
++
)
{
v
->
vc1dsp
.
vc1_h_loop_filter8
(
s
->
dest
[
j
+
1
]
-
8
*
s
->
uvlinesize
,
s
->
uvlinesize
,
pq
);
}
...
...
@@ -150,7 +155,7 @@ void ff_vc1_smooth_overlap_filter_iblk(VC1Context *v)
v
->
block
[
v
->
cur_blk_idx
][
0
]);
v
->
vc1dsp
.
vc1_h_s_overlap
(
v
->
block
[
v
->
left_blk_idx
][
3
],
v
->
block
[
v
->
cur_blk_idx
][
2
]);
if
(
!
(
s
->
flags
&
CODEC_FLAG_GRAY
))
{
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
))
{
v
->
vc1dsp
.
vc1_h_s_overlap
(
v
->
block
[
v
->
left_blk_idx
][
4
],
v
->
block
[
v
->
cur_blk_idx
][
4
]);
v
->
vc1dsp
.
vc1_h_s_overlap
(
v
->
block
[
v
->
left_blk_idx
][
5
],
...
...
@@ -169,7 +174,7 @@ void ff_vc1_smooth_overlap_filter_iblk(VC1Context *v)
v
->
block
[
v
->
cur_blk_idx
][
0
]);
v
->
vc1dsp
.
vc1_v_s_overlap
(
v
->
block
[
v
->
top_blk_idx
][
3
],
v
->
block
[
v
->
cur_blk_idx
][
1
]);
if
(
!
(
s
->
flags
&
CODEC_FLAG_GRAY
))
{
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
))
{
v
->
vc1dsp
.
vc1_v_s_overlap
(
v
->
block
[
v
->
top_blk_idx
][
4
],
v
->
block
[
v
->
cur_blk_idx
][
4
]);
v
->
vc1dsp
.
vc1_v_s_overlap
(
v
->
block
[
v
->
top_blk_idx
][
5
],
...
...
@@ -189,7 +194,7 @@ void ff_vc1_smooth_overlap_filter_iblk(VC1Context *v)
v
->
block
[
v
->
left_blk_idx
][
0
]);
v
->
vc1dsp
.
vc1_v_s_overlap
(
v
->
block
[
v
->
topleft_blk_idx
][
3
],
v
->
block
[
v
->
left_blk_idx
][
1
]);
if
(
!
(
s
->
flags
&
CODEC_FLAG_GRAY
))
{
if
(
!
CONFIG_GRAY
||
!
(
s
->
flags
&
CODEC_FLAG_GRAY
))
{
v
->
vc1dsp
.
vc1_v_s_overlap
(
v
->
block
[
v
->
topleft_blk_idx
][
4
],
v
->
block
[
v
->
left_blk_idx
][
4
]);
v
->
vc1dsp
.
vc1_v_s_overlap
(
v
->
block
[
v
->
topleft_blk_idx
][
5
],
...
...
@@ -331,21 +336,22 @@ void ff_vc1_apply_p_loop_filter(VC1Context *v)
{
MpegEncContext
*
s
=
&
v
->
s
;
int
i
;
int
block_count
=
CONFIG_GRAY
&&
(
s
->
flags
&
CODEC_FLAG_GRAY
)
?
4
:
6
;
for
(
i
=
0
;
i
<
6
;
i
++
)
{
for
(
i
=
0
;
i
<
block_count
;
i
++
)
{
vc1_apply_p_v_loop_filter
(
v
,
i
);
}
/* V always precedes H, therefore we run H one MB before V;
* at the end of a row, we catch up to complete the row */
if
(
s
->
mb_x
)
{
for
(
i
=
0
;
i
<
6
;
i
++
)
{
for
(
i
=
0
;
i
<
block_count
;
i
++
)
{
vc1_apply_p_h_loop_filter
(
v
,
i
);
}
if
(
s
->
mb_x
==
s
->
mb_width
-
1
)
{
s
->
mb_x
++
;
ff_update_block_index
(
s
);
for
(
i
=
0
;
i
<
6
;
i
++
)
{
for
(
i
=
0
;
i
<
block_count
;
i
++
)
{
vc1_apply_p_h_loop_filter
(
v
,
i
);
}
}
...
...
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