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

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

Issue 375983002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 5 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_blockd.c ('k') | source/libvpx/vp9/common/vp9_frame_buffers.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/common/vp9_convolve.c
===================================================================
--- source/libvpx/vp9/common/vp9_convolve.c (revision 281795)
+++ source/libvpx/vp9/common/vp9_convolve.c (working copy)
@@ -117,17 +117,25 @@
const InterpKernel *const y_filters,
int y0_q4, int y_step_q4,
int w, int h) {
- // Fixed size intermediate buffer places limits on parameters.
- // Maximum intermediate_height is 324, for y_step_q4 == 80,
- // h == 64, taps == 8.
- // y_step_q4 of 80 allows for 1/10 scale for 5 layer svc
- uint8_t temp[64 * 324];
+ // Note: Fixed size intermediate buffer, temp, places limits on parameters.
+ // 2d filtering proceeds in 2 steps:
+ // (1) Interpolate horizontally into an intermediate buffer, temp.
+ // (2) Interpolate temp vertically to derive the sub-pixel result.
+ // Deriving the maximum number of rows in the temp buffer (135):
+ // --Smallest scaling factor is x1/2 ==> y_step_q4 = 32 (Normative).
+ // --Largest block size is 64x64 pixels.
+ // --64 rows in the downscaled frame span a distance of (64 - 1) * 32 in the
+ // original frame (in 1/16th pixel units).
+ // --Must round-up because block may be located at sub-pixel position.
+ // --Require an additional SUBPEL_TAPS rows for the 8-tap filter tails.
+ // --((64 - 1) * 32 + 15) >> 4 + 8 = 135.
+ uint8_t temp[135 * 64];
int intermediate_height = (((h - 1) * y_step_q4 + 15) >> 4) + SUBPEL_TAPS;
assert(w <= 64);
assert(h <= 64);
- assert(y_step_q4 <= 80);
- assert(x_step_q4 <= 80);
+ assert(y_step_q4 <= 32);
+ assert(x_step_q4 <= 32);
if (intermediate_height < h)
intermediate_height = h;
« no previous file with comments | « source/libvpx/vp9/common/vp9_blockd.c ('k') | source/libvpx/vp9/common/vp9_frame_buffers.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698