| 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 // WebPPicture tools: copy, crop, rescaling and view. | 10 // WebPPicture tools: copy, crop, rescaling and view. |
| 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 | 16 |
| 17 #include "./vp8enci.h" | 17 #include "./vp8i_enc.h" |
| 18 #include "../utils/rescaler.h" | 18 #include "../utils/rescaler_utils.h" |
| 19 #include "../utils/utils.h" | 19 #include "../utils/utils.h" |
| 20 | 20 |
| 21 #define HALVE(x) (((x) + 1) >> 1) | 21 #define HALVE(x) (((x) + 1) >> 1) |
| 22 | 22 |
| 23 // Grab the 'specs' (writer, *opaque, width, height...) from 'src' and copy them | 23 // Grab the 'specs' (writer, *opaque, width, height...) from 'src' and copy them |
| 24 // into 'dst'. Mark 'dst' as not owning any memory. | 24 // into 'dst'. Mark 'dst' as not owning any memory. |
| 25 static void PictureGrabSpecs(const WebPPicture* const src, | 25 static void PictureGrabSpecs(const WebPPicture* const src, |
| 26 WebPPicture* const dst) { | 26 WebPPicture* const dst) { |
| 27 assert(src != NULL && dst != NULL); | 27 assert(src != NULL && dst != NULL); |
| 28 *dst = *src; | 28 *dst = *src; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 work, 4); | 255 work, 4); |
| 256 AlphaMultiplyARGB(&tmp, 1); | 256 AlphaMultiplyARGB(&tmp, 1); |
| 257 } | 257 } |
| 258 WebPPictureFree(pic); | 258 WebPPictureFree(pic); |
| 259 WebPSafeFree(work); | 259 WebPSafeFree(work); |
| 260 *pic = tmp; | 260 *pic = tmp; |
| 261 return 1; | 261 return 1; |
| 262 } | 262 } |
| 263 | 263 |
| 264 //------------------------------------------------------------------------------ | 264 //------------------------------------------------------------------------------ |
| OLD | NEW |