| OLD | NEW |
| 1 // Copyright 2012 Google Inc. All Rights Reserved. | 1 // Copyright 2012 Google Inc. All Rights Reserved. |
| 2 // | 2 // |
| 3 // Use of this source code is governed by a BSD-style license | 3 // Use of this source code is governed by a BSD-style license |
| 4 // that can be found in the COPYING file in the root of the source | 4 // that can be found in the COPYING file in the root of the source |
| 5 // tree. An additional intellectual property rights grant can be found | 5 // tree. An additional intellectual property rights grant can be found |
| 6 // in the file PATENTS. All contributing project authors may | 6 // in the file PATENTS. All contributing project authors may |
| 7 // be found in the AUTHORS file in the root of the source tree. | 7 // be found in the AUTHORS file in the root of the source tree. |
| 8 // ----------------------------------------------------------------------------- | 8 // ----------------------------------------------------------------------------- |
| 9 // | 9 // |
| 10 // Rescaling functions | 10 // Rescaling functions |
| 11 // | 11 // |
| 12 // Author: Skal (pascal.massimino@gmail.com) | 12 // Author: Skal (pascal.massimino@gmail.com) |
| 13 | 13 |
| 14 #include <assert.h> | 14 #include <assert.h> |
| 15 #include <stdlib.h> | 15 #include <stdlib.h> |
| 16 #include <string.h> | 16 #include <string.h> |
| 17 #include "../dsp/dsp.h" | 17 #include "../dsp/dsp.h" |
| 18 #include "./rescaler.h" | 18 #include "./rescaler_utils.h" |
| 19 | 19 |
| 20 //------------------------------------------------------------------------------ | 20 //------------------------------------------------------------------------------ |
| 21 | 21 |
| 22 void WebPRescalerInit(WebPRescaler* const wrk, int src_width, int src_height, | 22 void WebPRescalerInit(WebPRescaler* const wrk, int src_width, int src_height, |
| 23 uint8_t* const dst, | 23 uint8_t* const dst, |
| 24 int dst_width, int dst_height, int dst_stride, | 24 int dst_width, int dst_height, int dst_stride, |
| 25 int num_channels, rescaler_t* const work) { | 25 int num_channels, rescaler_t* const work) { |
| 26 const int x_add = src_width, x_sub = dst_width; | 26 const int x_add = src_width, x_sub = dst_width; |
| 27 const int y_add = src_height, y_sub = dst_height; | 27 const int y_add = src_height, y_sub = dst_height; |
| 28 wrk->x_expand = (src_width < dst_width); | 28 wrk->x_expand = (src_width < dst_width); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 int WebPRescalerExport(WebPRescaler* const rescaler) { | 137 int WebPRescalerExport(WebPRescaler* const rescaler) { |
| 138 int total_exported = 0; | 138 int total_exported = 0; |
| 139 while (WebPRescalerHasPendingOutput(rescaler)) { | 139 while (WebPRescalerHasPendingOutput(rescaler)) { |
| 140 WebPRescalerExportRow(rescaler); | 140 WebPRescalerExportRow(rescaler); |
| 141 ++total_exported; | 141 ++total_exported; |
| 142 } | 142 } |
| 143 return total_exported; | 143 return total_exported; |
| 144 } | 144 } |
| 145 | 145 |
| 146 //------------------------------------------------------------------------------ | 146 //------------------------------------------------------------------------------ |
| OLD | NEW |