| OLD | NEW |
| 1 // Copyright 2014 Google Inc. All Rights Reserved. | 1 // Copyright 2014 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 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 | 168 |
| 169 void WebPRescalerExportRow(WebPRescaler* const wrk) { | 169 void WebPRescalerExportRow(WebPRescaler* const wrk) { |
| 170 if (wrk->y_accum <= 0) { | 170 if (wrk->y_accum <= 0) { |
| 171 assert(!WebPRescalerOutputDone(wrk)); | 171 assert(!WebPRescalerOutputDone(wrk)); |
| 172 if (wrk->y_expand) { | 172 if (wrk->y_expand) { |
| 173 WebPRescalerExportRowExpand(wrk); | 173 WebPRescalerExportRowExpand(wrk); |
| 174 } else if (wrk->fxy_scale) { | 174 } else if (wrk->fxy_scale) { |
| 175 WebPRescalerExportRowShrink(wrk); | 175 WebPRescalerExportRowShrink(wrk); |
| 176 } else { // very special case for src = dst = 1x1 | 176 } else { // special case |
| 177 int i; | 177 int i; |
| 178 assert(wrk->src_height == wrk->dst_height && wrk->x_add == 1); |
| 178 assert(wrk->src_width == 1 && wrk->dst_width <= 2); | 179 assert(wrk->src_width == 1 && wrk->dst_width <= 2); |
| 179 assert(wrk->src_height == 1 && wrk->dst_height == 1); | |
| 180 for (i = 0; i < wrk->num_channels * wrk->dst_width; ++i) { | 180 for (i = 0; i < wrk->num_channels * wrk->dst_width; ++i) { |
| 181 wrk->dst[i] = wrk->irow[i]; | 181 wrk->dst[i] = wrk->irow[i]; |
| 182 wrk->irow[i] = 0; | 182 wrk->irow[i] = 0; |
| 183 } | 183 } |
| 184 } | 184 } |
| 185 wrk->y_accum += wrk->y_add; | 185 wrk->y_accum += wrk->y_add; |
| 186 wrk->dst += wrk->dst_stride; | 186 wrk->dst += wrk->dst_stride; |
| 187 ++wrk->dst_y; | 187 ++wrk->dst_y; |
| 188 } | 188 } |
| 189 } | 189 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 } | 229 } |
| 230 #endif | 230 #endif |
| 231 #if defined(WEBP_USE_MIPS_DSP_R2) | 231 #if defined(WEBP_USE_MIPS_DSP_R2) |
| 232 if (VP8GetCPUInfo(kMIPSdspR2)) { | 232 if (VP8GetCPUInfo(kMIPSdspR2)) { |
| 233 WebPRescalerDspInitMIPSdspR2(); | 233 WebPRescalerDspInitMIPSdspR2(); |
| 234 } | 234 } |
| 235 #endif | 235 #endif |
| 236 } | 236 } |
| 237 rescaler_last_cpuinfo_used = VP8GetCPUInfo; | 237 rescaler_last_cpuinfo_used = VP8GetCPUInfo; |
| 238 } | 238 } |
| OLD | NEW |