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
6475a6e1
Commit
6475a6e1
authored
Nov 08, 2011
by
shahriman AMS
Committed by
Anton Khirnov
Nov 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vc1dec: take ME precision into account while scaling MV predictors.
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
055a141e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
vc1dec.c
libavcodec/vc1dec.c
+14
-6
No files found.
libavcodec/vc1dec.c
View file @
6475a6e1
...
@@ -1422,29 +1422,36 @@ static av_always_inline int scaleforsame(VC1Context *v, int i, int n /* MV */,
...
@@ -1422,29 +1422,36 @@ static av_always_inline int scaleforsame(VC1Context *v, int i, int n /* MV */,
int
dim
,
int
dir
)
int
dim
,
int
dir
)
{
{
int
brfd
,
scalesame
;
int
brfd
,
scalesame
;
int
hpel
=
1
-
v
->
s
.
quarter_sample
;
n
>>=
hpel
;
if
(
v
->
s
.
pict_type
!=
AV_PICTURE_TYPE_B
||
v
->
second_field
||
!
dir
)
{
if
(
v
->
s
.
pict_type
!=
AV_PICTURE_TYPE_B
||
v
->
second_field
||
!
dir
)
{
if
(
dim
)
if
(
dim
)
return
scaleforsame_y
(
v
,
i
,
n
,
dir
)
;
n
=
scaleforsame_y
(
v
,
i
,
n
,
dir
)
<<
hpel
;
else
else
return
scaleforsame_x
(
v
,
n
,
dir
);
n
=
scaleforsame_x
(
v
,
n
,
dir
)
<<
hpel
;
return
n
;
}
}
brfd
=
FFMIN
(
v
->
brfd
,
3
);
brfd
=
FFMIN
(
v
->
brfd
,
3
);
scalesame
=
vc1_b_field_mvpred_scales
[
0
][
brfd
];
scalesame
=
vc1_b_field_mvpred_scales
[
0
][
brfd
];
return
n
*
scalesame
>>
8
;
n
=
(
n
*
scalesame
>>
8
)
<<
hpel
;
return
n
;
}
}
static
av_always_inline
int
scaleforopp
(
VC1Context
*
v
,
int
n
/* MV */
,
static
av_always_inline
int
scaleforopp
(
VC1Context
*
v
,
int
n
/* MV */
,
int
dim
,
int
dir
)
int
dim
,
int
dir
)
{
{
int
refdist
,
scaleopp
;
int
refdist
,
scaleopp
;
int
hpel
=
1
-
v
->
s
.
quarter_sample
;
n
>>=
hpel
;
if
(
v
->
s
.
pict_type
==
AV_PICTURE_TYPE_B
&&
!
v
->
second_field
&&
dir
==
1
)
{
if
(
v
->
s
.
pict_type
==
AV_PICTURE_TYPE_B
&&
!
v
->
second_field
&&
dir
==
1
)
{
if
(
dim
)
if
(
dim
)
return
scaleforopp_y
(
v
,
n
,
dir
)
;
n
=
scaleforopp_y
(
v
,
n
,
dir
)
<<
hpel
;
else
else
return
scaleforopp_x
(
v
,
n
);
n
=
scaleforopp_x
(
v
,
n
)
<<
hpel
;
return
n
;
}
}
if
(
v
->
s
.
pict_type
!=
AV_PICTURE_TYPE_B
)
if
(
v
->
s
.
pict_type
!=
AV_PICTURE_TYPE_B
)
refdist
=
FFMIN
(
v
->
refdist
,
3
);
refdist
=
FFMIN
(
v
->
refdist
,
3
);
...
@@ -1452,7 +1459,8 @@ static av_always_inline int scaleforopp(VC1Context *v, int n /* MV */,
...
@@ -1452,7 +1459,8 @@ static av_always_inline int scaleforopp(VC1Context *v, int n /* MV */,
refdist
=
dir
?
v
->
brfd
:
v
->
frfd
;
refdist
=
dir
?
v
->
brfd
:
v
->
frfd
;
scaleopp
=
vc1_field_mvpred_scales
[
dir
^
v
->
second_field
][
0
][
refdist
];
scaleopp
=
vc1_field_mvpred_scales
[
dir
^
v
->
second_field
][
0
][
refdist
];
return
n
*
scaleopp
>>
8
;
n
=
(
n
*
scaleopp
>>
8
)
<<
hpel
;
return
n
;
}
}
/** Predict and set motion vector
/** Predict and set motion vector
...
...
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