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
d8b9dbe7
Commit
d8b9dbe7
authored
May 03, 2013
by
Michael Niedermayer
Committed by
Martin Storsjö
May 28, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vc1dec: Fix mixed field/frame intensity compensation
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
17410faa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
26 deletions
+32
-26
vc1dec.c
libavcodec/vc1dec.c
+32
-26
No files found.
libavcodec/vc1dec.c
View file @
d8b9dbe7
...
@@ -348,7 +348,7 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
...
@@ -348,7 +348,7 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
int
dxy
,
mx
,
my
,
uvmx
,
uvmy
,
src_x
,
src_y
,
uvsrc_x
,
uvsrc_y
;
int
dxy
,
mx
,
my
,
uvmx
,
uvmy
,
src_x
,
src_y
,
uvsrc_x
,
uvsrc_y
;
int
v_edge_pos
=
s
->
v_edge_pos
>>
v
->
field_mode
;
int
v_edge_pos
=
s
->
v_edge_pos
>>
v
->
field_mode
;
int
i
;
int
i
;
const
uint8_t
*
luty
,
*
lutuv
;
uint8_t
(
*
luty
)[
256
],
(
*
lutuv
)[
256
]
;
int
use_ic
;
int
use_ic
;
if
((
!
v
->
field_mode
||
if
((
!
v
->
field_mode
||
...
@@ -388,23 +388,23 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
...
@@ -388,23 +388,23 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
srcY
=
s
->
current_picture
.
f
.
data
[
0
];
srcY
=
s
->
current_picture
.
f
.
data
[
0
];
srcU
=
s
->
current_picture
.
f
.
data
[
1
];
srcU
=
s
->
current_picture
.
f
.
data
[
1
];
srcV
=
s
->
current_picture
.
f
.
data
[
2
];
srcV
=
s
->
current_picture
.
f
.
data
[
2
];
luty
=
v
->
curr_luty
[
v
->
ref_field_type
[
dir
]]
;
luty
=
v
->
curr_luty
;
lutuv
=
v
->
curr_lutuv
[
v
->
ref_field_type
[
dir
]]
;
lutuv
=
v
->
curr_lutuv
;
use_ic
=
v
->
curr_use_ic
;
use_ic
=
v
->
curr_use_ic
;
}
else
{
}
else
{
srcY
=
s
->
last_picture
.
f
.
data
[
0
];
srcY
=
s
->
last_picture
.
f
.
data
[
0
];
srcU
=
s
->
last_picture
.
f
.
data
[
1
];
srcU
=
s
->
last_picture
.
f
.
data
[
1
];
srcV
=
s
->
last_picture
.
f
.
data
[
2
];
srcV
=
s
->
last_picture
.
f
.
data
[
2
];
luty
=
v
->
last_luty
[
v
->
ref_field_type
[
dir
]]
;
luty
=
v
->
last_luty
;
lutuv
=
v
->
last_lutuv
[
v
->
ref_field_type
[
dir
]]
;
lutuv
=
v
->
last_lutuv
;
use_ic
=
v
->
last_use_ic
;
use_ic
=
v
->
last_use_ic
;
}
}
}
else
{
}
else
{
srcY
=
s
->
next_picture
.
f
.
data
[
0
];
srcY
=
s
->
next_picture
.
f
.
data
[
0
];
srcU
=
s
->
next_picture
.
f
.
data
[
1
];
srcU
=
s
->
next_picture
.
f
.
data
[
1
];
srcV
=
s
->
next_picture
.
f
.
data
[
2
];
srcV
=
s
->
next_picture
.
f
.
data
[
2
];
luty
=
v
->
next_luty
[
v
->
ref_field_type
[
dir
]]
;
luty
=
v
->
next_luty
;
lutuv
=
v
->
next_lutuv
[
v
->
ref_field_type
[
dir
]]
;
lutuv
=
v
->
next_lutuv
;
use_ic
=
v
->
next_use_ic
;
use_ic
=
v
->
next_use_ic
;
}
}
...
@@ -488,16 +488,18 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
...
@@ -488,16 +488,18 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
src
=
srcY
;
src
=
srcY
;
for
(
j
=
0
;
j
<
17
+
s
->
mspel
*
2
;
j
++
)
{
for
(
j
=
0
;
j
<
17
+
s
->
mspel
*
2
;
j
++
)
{
int
f
=
v
->
field_mode
?
v
->
ref_field_type
[
dir
]
:
((
j
+
src_y
-
s
->
mspel
)
&
1
)
;
for
(
i
=
0
;
i
<
17
+
s
->
mspel
*
2
;
i
++
)
for
(
i
=
0
;
i
<
17
+
s
->
mspel
*
2
;
i
++
)
src
[
i
]
=
luty
[
src
[
i
]];
src
[
i
]
=
luty
[
f
][
src
[
i
]];
src
+=
s
->
linesize
;
src
+=
s
->
linesize
;
}
}
src
=
srcU
;
src
=
srcU
;
src2
=
srcV
;
src2
=
srcV
;
for
(
j
=
0
;
j
<
9
;
j
++
)
{
for
(
j
=
0
;
j
<
9
;
j
++
)
{
int
f
=
v
->
field_mode
?
v
->
ref_field_type
[
dir
]
:
((
j
+
uvsrc_y
)
&
1
);
for
(
i
=
0
;
i
<
9
;
i
++
)
{
for
(
i
=
0
;
i
<
9
;
i
++
)
{
src
[
i
]
=
lutuv
[
src
[
i
]];
src
[
i
]
=
lutuv
[
f
][
src
[
i
]];
src2
[
i
]
=
lutuv
[
src2
[
i
]];
src2
[
i
]
=
lutuv
[
f
][
src2
[
i
]];
}
}
src
+=
s
->
uvlinesize
;
src
+=
s
->
uvlinesize
;
src2
+=
s
->
uvlinesize
;
src2
+=
s
->
uvlinesize
;
...
@@ -555,7 +557,7 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
...
@@ -555,7 +557,7 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
int
off
;
int
off
;
int
fieldmv
=
(
v
->
fcm
==
ILACE_FRAME
)
?
v
->
blk_mv_type
[
s
->
block_index
[
n
]]
:
0
;
int
fieldmv
=
(
v
->
fcm
==
ILACE_FRAME
)
?
v
->
blk_mv_type
[
s
->
block_index
[
n
]]
:
0
;
int
v_edge_pos
=
s
->
v_edge_pos
>>
v
->
field_mode
;
int
v_edge_pos
=
s
->
v_edge_pos
>>
v
->
field_mode
;
const
uint8_t
*
luty
;
uint8_t
(
*
luty
)[
256
]
;
int
use_ic
;
int
use_ic
;
if
((
!
v
->
field_mode
||
if
((
!
v
->
field_mode
||
...
@@ -569,16 +571,16 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
...
@@ -569,16 +571,16 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
if
(
!
dir
)
{
if
(
!
dir
)
{
if
(
v
->
field_mode
&&
(
v
->
cur_field_type
!=
v
->
ref_field_type
[
dir
])
&&
v
->
second_field
)
{
if
(
v
->
field_mode
&&
(
v
->
cur_field_type
!=
v
->
ref_field_type
[
dir
])
&&
v
->
second_field
)
{
srcY
=
s
->
current_picture
.
f
.
data
[
0
];
srcY
=
s
->
current_picture
.
f
.
data
[
0
];
luty
=
v
->
curr_luty
[
v
->
ref_field_type
[
dir
]]
;
luty
=
v
->
curr_luty
;
use_ic
=
v
->
curr_use_ic
;
use_ic
=
v
->
curr_use_ic
;
}
else
{
}
else
{
srcY
=
s
->
last_picture
.
f
.
data
[
0
];
srcY
=
s
->
last_picture
.
f
.
data
[
0
];
luty
=
v
->
last_luty
[
v
->
ref_field_type
[
dir
]]
;
luty
=
v
->
last_luty
;
use_ic
=
v
->
last_use_ic
;
use_ic
=
v
->
last_use_ic
;
}
}
}
else
{
}
else
{
srcY
=
s
->
next_picture
.
f
.
data
[
0
];
srcY
=
s
->
next_picture
.
f
.
data
[
0
];
luty
=
v
->
next_luty
[
v
->
ref_field_type
[
dir
]]
;
luty
=
v
->
next_luty
;
use_ic
=
v
->
next_use_ic
;
use_ic
=
v
->
next_use_ic
;
}
}
...
@@ -706,8 +708,9 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
...
@@ -706,8 +708,9 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
src
=
srcY
;
src
=
srcY
;
for
(
j
=
0
;
j
<
9
+
s
->
mspel
*
2
;
j
++
)
{
for
(
j
=
0
;
j
<
9
+
s
->
mspel
*
2
;
j
++
)
{
int
f
=
v
->
field_mode
?
v
->
ref_field_type
[
dir
]
:
(((
j
<<
fieldmv
)
+
src_y
-
(
s
->
mspel
<<
fieldmv
))
&
1
);
for
(
i
=
0
;
i
<
9
+
s
->
mspel
*
2
;
i
++
)
for
(
i
=
0
;
i
<
9
+
s
->
mspel
*
2
;
i
++
)
src
[
i
]
=
luty
[
src
[
i
]];
src
[
i
]
=
luty
[
f
][
src
[
i
]];
src
+=
s
->
linesize
<<
fieldmv
;
src
+=
s
->
linesize
<<
fieldmv
;
}
}
}
}
...
@@ -795,7 +798,7 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
...
@@ -795,7 +798,7 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
int
valid_count
;
int
valid_count
;
int
chroma_ref_type
=
v
->
cur_field_type
;
int
chroma_ref_type
=
v
->
cur_field_type
;
int
v_edge_pos
=
s
->
v_edge_pos
>>
v
->
field_mode
;
int
v_edge_pos
=
s
->
v_edge_pos
>>
v
->
field_mode
;
const
uint8_t
*
lutuv
;
uint8_t
(
*
lutuv
)[
256
]
;
int
use_ic
;
int
use_ic
;
if
(
!
v
->
field_mode
&&
!
v
->
s
.
last_picture
.
f
.
data
[
0
])
if
(
!
v
->
field_mode
&&
!
v
->
s
.
last_picture
.
f
.
data
[
0
])
...
@@ -862,18 +865,18 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
...
@@ -862,18 +865,18 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
if
(
v
->
field_mode
&&
(
v
->
cur_field_type
!=
chroma_ref_type
)
&&
v
->
second_field
)
{
if
(
v
->
field_mode
&&
(
v
->
cur_field_type
!=
chroma_ref_type
)
&&
v
->
second_field
)
{
srcU
=
s
->
current_picture
.
f
.
data
[
1
];
srcU
=
s
->
current_picture
.
f
.
data
[
1
];
srcV
=
s
->
current_picture
.
f
.
data
[
2
];
srcV
=
s
->
current_picture
.
f
.
data
[
2
];
lutuv
=
v
->
curr_lutuv
[
chroma_ref_type
]
;
lutuv
=
v
->
curr_lutuv
;
use_ic
=
v
->
curr_use_ic
;
use_ic
=
v
->
curr_use_ic
;
}
else
{
}
else
{
srcU
=
s
->
last_picture
.
f
.
data
[
1
];
srcU
=
s
->
last_picture
.
f
.
data
[
1
];
srcV
=
s
->
last_picture
.
f
.
data
[
2
];
srcV
=
s
->
last_picture
.
f
.
data
[
2
];
lutuv
=
v
->
last_lutuv
[
chroma_ref_type
]
;
lutuv
=
v
->
last_lutuv
;
use_ic
=
v
->
last_use_ic
;
use_ic
=
v
->
last_use_ic
;
}
}
}
else
{
}
else
{
srcU
=
s
->
next_picture
.
f
.
data
[
1
];
srcU
=
s
->
next_picture
.
f
.
data
[
1
];
srcV
=
s
->
next_picture
.
f
.
data
[
2
];
srcV
=
s
->
next_picture
.
f
.
data
[
2
];
lutuv
=
v
->
next_lutuv
[
chroma_ref_type
]
;
lutuv
=
v
->
next_lutuv
;
use_ic
=
v
->
next_use_ic
;
use_ic
=
v
->
next_use_ic
;
}
}
...
@@ -924,9 +927,10 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
...
@@ -924,9 +927,10 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
src
=
srcU
;
src
=
srcU
;
src2
=
srcV
;
src2
=
srcV
;
for
(
j
=
0
;
j
<
9
;
j
++
)
{
for
(
j
=
0
;
j
<
9
;
j
++
)
{
int
f
=
v
->
field_mode
?
chroma_ref_type
:
((
j
+
uvsrc_y
)
&
1
);
for
(
i
=
0
;
i
<
9
;
i
++
)
{
for
(
i
=
0
;
i
<
9
;
i
++
)
{
src
[
i
]
=
lutuv
[
src
[
i
]];
src
[
i
]
=
lutuv
[
f
][
src
[
i
]];
src2
[
i
]
=
lutuv
[
src2
[
i
]];
src2
[
i
]
=
lutuv
[
f
][
src2
[
i
]];
}
}
src
+=
s
->
uvlinesize
;
src
+=
s
->
uvlinesize
;
src2
+=
s
->
uvlinesize
;
src2
+=
s
->
uvlinesize
;
...
@@ -1972,23 +1976,25 @@ static void vc1_interp_mc(VC1Context *v)
...
@@ -1972,23 +1976,25 @@ static void vc1_interp_mc(VC1Context *v)
}
}
if
(
use_ic
)
{
if
(
use_ic
)
{
const
uint8_t
*
luty
=
v
->
next_luty
[
v
->
ref_field_type
[
1
]]
;
uint8_t
(
*
luty
)[
256
]
=
v
->
next_luty
;
const
uint8_t
*
lutuv
=
v
->
next_lutuv
[
v
->
ref_field_type
[
1
]]
;
uint8_t
(
*
lutuv
)[
256
]
=
v
->
next_lutuv
;
int
i
,
j
;
int
i
,
j
;
uint8_t
*
src
,
*
src2
;
uint8_t
*
src
,
*
src2
;
src
=
srcY
;
src
=
srcY
;
for
(
j
=
0
;
j
<
17
+
s
->
mspel
*
2
;
j
++
)
{
for
(
j
=
0
;
j
<
17
+
s
->
mspel
*
2
;
j
++
)
{
int
f
=
v
->
field_mode
?
v
->
ref_field_type
[
1
]
:
((
j
+
src_y
-
s
->
mspel
)
&
1
);
for
(
i
=
0
;
i
<
17
+
s
->
mspel
*
2
;
i
++
)
for
(
i
=
0
;
i
<
17
+
s
->
mspel
*
2
;
i
++
)
src
[
i
]
=
luty
[
src
[
i
]];
src
[
i
]
=
luty
[
f
][
src
[
i
]];
src
+=
s
->
linesize
;
src
+=
s
->
linesize
;
}
}
src
=
srcU
;
src
=
srcU
;
src2
=
srcV
;
src2
=
srcV
;
for
(
j
=
0
;
j
<
9
;
j
++
)
{
for
(
j
=
0
;
j
<
9
;
j
++
)
{
int
f
=
v
->
field_mode
?
v
->
ref_field_type
[
1
]
:
((
j
+
uvsrc_y
)
&
1
);
for
(
i
=
0
;
i
<
9
;
i
++
)
{
for
(
i
=
0
;
i
<
9
;
i
++
)
{
src
[
i
]
=
lutuv
[
src
[
i
]];
src
[
i
]
=
lutuv
[
f
][
src
[
i
]];
src2
[
i
]
=
lutuv
[
src2
[
i
]];
src2
[
i
]
=
lutuv
[
f
][
src2
[
i
]];
}
}
src
+=
s
->
uvlinesize
;
src
+=
s
->
uvlinesize
;
src2
+=
s
->
uvlinesize
;
src2
+=
s
->
uvlinesize
;
...
...
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