Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: source/libvpx/vp9/common/vp9_scale.c

Issue 592203002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/common/vp9_scale.h ('k') | source/libvpx/vp9/common/x86/vp9_asm_stubs.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/common/vp9_scale.c
===================================================================
--- source/libvpx/vp9/common/vp9_scale.c (revision 292072)
+++ source/libvpx/vp9/common/vp9_scale.c (working copy)
@@ -43,9 +43,16 @@
return res;
}
+#if CONFIG_VP9_HIGHBITDEPTH
void vp9_setup_scale_factors_for_frame(struct scale_factors *sf,
int other_w, int other_h,
+ int this_w, int this_h,
+ int use_high) {
+#else
+void vp9_setup_scale_factors_for_frame(struct scale_factors *sf,
+ int other_w, int other_h,
int this_w, int this_h) {
+#endif
if (!valid_ref_frame_size(other_w, other_h, this_w, this_h)) {
sf->x_scale_fp = REF_INVALID_SCALE;
sf->y_scale_fp = REF_INVALID_SCALE;
@@ -111,4 +118,48 @@
// 2D subpel motion always gets filtered in both directions
sf->predict[1][1][0] = vp9_convolve8;
sf->predict[1][1][1] = vp9_convolve8_avg;
+#if CONFIG_VP9_HIGHBITDEPTH
+ if (use_high) {
+ if (sf->x_step_q4 == 16) {
+ if (sf->y_step_q4 == 16) {
+ // No scaling in either direction.
+ sf->high_predict[0][0][0] = vp9_high_convolve_copy;
+ sf->high_predict[0][0][1] = vp9_high_convolve_avg;
+ sf->high_predict[0][1][0] = vp9_high_convolve8_vert;
+ sf->high_predict[0][1][1] = vp9_high_convolve8_avg_vert;
+ sf->high_predict[1][0][0] = vp9_high_convolve8_horiz;
+ sf->high_predict[1][0][1] = vp9_high_convolve8_avg_horiz;
+ } else {
+ // No scaling in x direction. Must always scale in the y direction.
+ sf->high_predict[0][0][0] = vp9_high_convolve8_vert;
+ sf->high_predict[0][0][1] = vp9_high_convolve8_avg_vert;
+ sf->high_predict[0][1][0] = vp9_high_convolve8_vert;
+ sf->high_predict[0][1][1] = vp9_high_convolve8_avg_vert;
+ sf->high_predict[1][0][0] = vp9_high_convolve8;
+ sf->high_predict[1][0][1] = vp9_high_convolve8_avg;
+ }
+ } else {
+ if (sf->y_step_q4 == 16) {
+ // No scaling in the y direction. Must always scale in the x direction.
+ sf->high_predict[0][0][0] = vp9_high_convolve8_horiz;
+ sf->high_predict[0][0][1] = vp9_high_convolve8_avg_horiz;
+ sf->high_predict[0][1][0] = vp9_high_convolve8;
+ sf->high_predict[0][1][1] = vp9_high_convolve8_avg;
+ sf->high_predict[1][0][0] = vp9_high_convolve8_horiz;
+ sf->high_predict[1][0][1] = vp9_high_convolve8_avg_horiz;
+ } else {
+ // Must always scale in both directions.
+ sf->high_predict[0][0][0] = vp9_high_convolve8;
+ sf->high_predict[0][0][1] = vp9_high_convolve8_avg;
+ sf->high_predict[0][1][0] = vp9_high_convolve8;
+ sf->high_predict[0][1][1] = vp9_high_convolve8_avg;
+ sf->high_predict[1][0][0] = vp9_high_convolve8;
+ sf->high_predict[1][0][1] = vp9_high_convolve8_avg;
+ }
+ }
+ // 2D subpel motion always gets filtered in both directions.
+ sf->high_predict[1][1][0] = vp9_high_convolve8;
+ sf->high_predict[1][1][1] = vp9_high_convolve8_avg;
+ }
+#endif
}
« no previous file with comments | « source/libvpx/vp9/common/vp9_scale.h ('k') | source/libvpx/vp9/common/x86/vp9_asm_stubs.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698