Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
aom-rav1e
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiph.Org
aom-rav1e
Commits
b082790c
Commit
b082790c
authored
14 years ago
by
Scott LaVarnway
Committed by
Code Review
14 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Moved ref frame calculations"
parents
eda7d538
96fd758e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp8/encoder/rdopt.c
+62
-53
62 additions, 53 deletions
vp8/encoder/rdopt.c
with
62 additions
and
53 deletions
vp8/encoder/rdopt.c
+
62
−
53
View file @
b082790c
...
...
@@ -1729,10 +1729,60 @@ int vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
int
saddone
=
0
;
int
sr
=
0
;
//search range got from mv_pred(). It uses step_param levels. (0-7)
*
returnintra
=
INT_MAX
;
MV
frame_nearest_mv
[
4
];
MV
frame_near_mv
[
4
];
MV
frame_best_ref_mv
[
4
];
int
frame_mdcounts
[
4
][
4
];
int
frame_lf_or_gf
[
4
];
unsigned
char
*
y_buffer
[
4
];
unsigned
char
*
u_buffer
[
4
];
unsigned
char
*
v_buffer
[
4
];
vpx_memset
(
&
best_mbmode
,
0
,
sizeof
(
best_mbmode
));
if
(
cpi
->
ref_frame_flags
&
VP8_LAST_FLAG
)
{
YV12_BUFFER_CONFIG
*
lst_yv12
=
&
cpi
->
common
.
yv12_fb
[
cpi
->
common
.
lst_fb_idx
];
vp8_find_near_mvs
(
&
x
->
e_mbd
,
x
->
e_mbd
.
mode_info_context
,
&
frame_nearest_mv
[
LAST_FRAME
],
&
frame_near_mv
[
LAST_FRAME
],
&
frame_best_ref_mv
[
LAST_FRAME
],
frame_mdcounts
[
LAST_FRAME
],
LAST_FRAME
,
cpi
->
common
.
ref_frame_sign_bias
);
y_buffer
[
LAST_FRAME
]
=
lst_yv12
->
y_buffer
+
recon_yoffset
;
u_buffer
[
LAST_FRAME
]
=
lst_yv12
->
u_buffer
+
recon_uvoffset
;
v_buffer
[
LAST_FRAME
]
=
lst_yv12
->
v_buffer
+
recon_uvoffset
;
frame_lf_or_gf
[
LAST_FRAME
]
=
0
;
}
if
(
cpi
->
ref_frame_flags
&
VP8_GOLD_FLAG
)
{
YV12_BUFFER_CONFIG
*
gld_yv12
=
&
cpi
->
common
.
yv12_fb
[
cpi
->
common
.
gld_fb_idx
];
vpx_memset
(
&
best_mbmode
,
0
,
sizeof
(
best_mbmode
));
// clean
vp8_find_near_mvs
(
&
x
->
e_mbd
,
x
->
e_mbd
.
mode_info_context
,
&
frame_nearest_mv
[
GOLDEN_FRAME
],
&
frame_near_mv
[
GOLDEN_FRAME
],
&
frame_best_ref_mv
[
GOLDEN_FRAME
],
frame_mdcounts
[
GOLDEN_FRAME
],
GOLDEN_FRAME
,
cpi
->
common
.
ref_frame_sign_bias
);
y_buffer
[
GOLDEN_FRAME
]
=
gld_yv12
->
y_buffer
+
recon_yoffset
;
u_buffer
[
GOLDEN_FRAME
]
=
gld_yv12
->
u_buffer
+
recon_uvoffset
;
v_buffer
[
GOLDEN_FRAME
]
=
gld_yv12
->
v_buffer
+
recon_uvoffset
;
frame_lf_or_gf
[
GOLDEN_FRAME
]
=
1
;
}
if
(
cpi
->
ref_frame_flags
&
VP8_ALT_FLAG
)
{
YV12_BUFFER_CONFIG
*
alt_yv12
=
&
cpi
->
common
.
yv12_fb
[
cpi
->
common
.
alt_fb_idx
];
vp8_find_near_mvs
(
&
x
->
e_mbd
,
x
->
e_mbd
.
mode_info_context
,
&
frame_nearest_mv
[
ALTREF_FRAME
],
&
frame_near_mv
[
ALTREF_FRAME
],
&
frame_best_ref_mv
[
ALTREF_FRAME
],
frame_mdcounts
[
ALTREF_FRAME
],
ALTREF_FRAME
,
cpi
->
common
.
ref_frame_sign_bias
);
y_buffer
[
ALTREF_FRAME
]
=
alt_yv12
->
y_buffer
+
recon_yoffset
;
u_buffer
[
ALTREF_FRAME
]
=
alt_yv12
->
u_buffer
+
recon_uvoffset
;
v_buffer
[
ALTREF_FRAME
]
=
alt_yv12
->
v_buffer
+
recon_uvoffset
;
frame_lf_or_gf
[
ALTREF_FRAME
]
=
1
;
}
*
returnintra
=
INT_MAX
;
cpi
->
mbs_tested_so_far
++
;
// Count of the number of MBs tested so far this frame
x
->
skip
=
0
;
...
...
@@ -1789,8 +1839,6 @@ int vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
if
(
best_rd
<=
cpi
->
rd_threshes
[
mode_index
])
continue
;
// These variables hold are rolling total cost and distortion for this mode
rate2
=
0
;
distortion2
=
0
;
...
...
@@ -1808,58 +1856,19 @@ int vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
continue
;
}
if
(
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
==
LAST_FRAME
)
{
YV12_BUFFER_CONFIG
*
lst_yv12
=
&
cpi
->
common
.
yv12_fb
[
cpi
->
common
.
lst_fb_idx
];
if
(
!
(
cpi
->
ref_frame_flags
&
VP8_LAST_FLAG
))
continue
;
lf_or_gf
=
0
;
// Local last frame vs Golden frame flag
// Set up pointers for this macro block into the previous frame recon buffer
x
->
e_mbd
.
pre
.
y_buffer
=
lst_yv12
->
y_buffer
+
recon_yoffset
;
x
->
e_mbd
.
pre
.
u_buffer
=
lst_yv12
->
u_buffer
+
recon_uvoffset
;
x
->
e_mbd
.
pre
.
v_buffer
=
lst_yv12
->
v_buffer
+
recon_uvoffset
;
}
else
if
(
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
==
GOLDEN_FRAME
)
{
YV12_BUFFER_CONFIG
*
gld_yv12
=
&
cpi
->
common
.
yv12_fb
[
cpi
->
common
.
gld_fb_idx
];
// not supposed to reference gold frame
if
(
!
(
cpi
->
ref_frame_flags
&
VP8_GOLD_FLAG
))
continue
;
lf_or_gf
=
1
;
// Local last frame vs Golden frame flag
// Set up pointers for this macro block into the previous frame recon buffer
x
->
e_mbd
.
pre
.
y_buffer
=
gld_yv12
->
y_buffer
+
recon_yoffset
;
x
->
e_mbd
.
pre
.
u_buffer
=
gld_yv12
->
u_buffer
+
recon_uvoffset
;
x
->
e_mbd
.
pre
.
v_buffer
=
gld_yv12
->
v_buffer
+
recon_uvoffset
;
}
else
if
(
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
==
ALTREF_FRAME
)
/* everything but intra */
if
(
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
)
{
YV12_BUFFER_CONFIG
*
alt_yv12
=
&
cpi
->
common
.
yv12_fb
[
cpi
->
common
.
alt_fb_idx
];
// not supposed to reference alt ref frame
if
(
!
(
cpi
->
ref_frame_flags
&
VP8_ALT_FLAG
))
continue
;
//if ( !cpi->source_alt_ref_active )
// continue;
lf_or_gf
=
1
;
// Local last frame vs Golden frame flag
// Set up pointers for this macro block into the previous frame recon buffer
x
->
e_mbd
.
pre
.
y_buffer
=
alt_yv12
->
y_buffer
+
recon_yoffset
;
x
->
e_mbd
.
pre
.
u_buffer
=
alt_yv12
->
u_buffer
+
recon_uvoffset
;
x
->
e_mbd
.
pre
.
v_buffer
=
alt_yv12
->
v_buffer
+
recon_uvoffset
;
x
->
e_mbd
.
pre
.
y_buffer
=
y_buffer
[
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
];
x
->
e_mbd
.
pre
.
u_buffer
=
u_buffer
[
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
];
x
->
e_mbd
.
pre
.
v_buffer
=
v_buffer
[
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
];
mode_mv
[
NEARESTMV
]
=
frame_nearest_mv
[
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
];
mode_mv
[
NEARMV
]
=
frame_near_mv
[
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
];
best_ref_mv
=
frame_best_ref_mv
[
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
];
vpx_memcpy
(
mdcounts
,
frame_mdcounts
[
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
],
sizeof
(
mdcounts
));
lf_or_gf
=
frame_lf_or_gf
[
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
];
}
vp8_find_near_mvs
(
&
x
->
e_mbd
,
x
->
e_mbd
.
mode_info_context
,
&
mode_mv
[
NEARESTMV
],
&
mode_mv
[
NEARMV
],
&
best_ref_mv
,
mdcounts
,
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
,
cpi
->
common
.
ref_frame_sign_bias
);
if
(
x
->
e_mbd
.
mode_info_context
->
mbmi
.
mode
==
NEWMV
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment