OLD | NEW |
1 // Copyright 2011 Google Inc. All Rights Reserved. | 1 // Copyright 2011 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 class basis | 10 // WebPPicture class basis |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 return WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY); | 81 return WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY); |
82 } | 82 } |
83 // TODO(skal): align plane to cache line? | 83 // TODO(skal): align plane to cache line? |
84 picture->memory_argb_ = memory; | 84 picture->memory_argb_ = memory; |
85 picture->argb = (uint32_t*)memory; | 85 picture->argb = (uint32_t*)memory; |
86 picture->argb_stride = width; | 86 picture->argb_stride = width; |
87 return 1; | 87 return 1; |
88 } | 88 } |
89 | 89 |
90 int WebPPictureAllocYUVA(WebPPicture* const picture, int width, int height) { | 90 int WebPPictureAllocYUVA(WebPPicture* const picture, int width, int height) { |
91 const WebPEncCSP uv_csp = picture->colorspace & WEBP_CSP_UV_MASK; | 91 const WebPEncCSP uv_csp = |
92 const int has_alpha = picture->colorspace & WEBP_CSP_ALPHA_BIT; | 92 (WebPEncCSP)((int)picture->colorspace & WEBP_CSP_UV_MASK); |
| 93 const int has_alpha = (int)picture->colorspace & WEBP_CSP_ALPHA_BIT; |
93 const int y_stride = width; | 94 const int y_stride = width; |
94 const int uv_width = (width + 1) >> 1; | 95 const int uv_width = (width + 1) >> 1; |
95 const int uv_height = (height + 1) >> 1; | 96 const int uv_height = (height + 1) >> 1; |
96 const int uv_stride = uv_width; | 97 const int uv_stride = uv_width; |
97 int a_width, a_stride; | 98 int a_width, a_stride; |
98 uint64_t y_size, uv_size, a_size, total_size; | 99 uint64_t y_size, uv_size, a_size, total_size; |
99 uint8_t* mem; | 100 uint8_t* mem; |
100 | 101 |
101 assert(picture != NULL); | 102 assert(picture != NULL); |
102 | 103 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 } | 284 } |
284 | 285 |
285 LOSSLESS_ENCODE_FUNC(WebPEncodeLosslessRGB, WebPPictureImportRGB) | 286 LOSSLESS_ENCODE_FUNC(WebPEncodeLosslessRGB, WebPPictureImportRGB) |
286 LOSSLESS_ENCODE_FUNC(WebPEncodeLosslessBGR, WebPPictureImportBGR) | 287 LOSSLESS_ENCODE_FUNC(WebPEncodeLosslessBGR, WebPPictureImportBGR) |
287 LOSSLESS_ENCODE_FUNC(WebPEncodeLosslessRGBA, WebPPictureImportRGBA) | 288 LOSSLESS_ENCODE_FUNC(WebPEncodeLosslessRGBA, WebPPictureImportRGBA) |
288 LOSSLESS_ENCODE_FUNC(WebPEncodeLosslessBGRA, WebPPictureImportBGRA) | 289 LOSSLESS_ENCODE_FUNC(WebPEncodeLosslessBGRA, WebPPictureImportBGRA) |
289 | 290 |
290 #undef LOSSLESS_ENCODE_FUNC | 291 #undef LOSSLESS_ENCODE_FUNC |
291 | 292 |
292 //------------------------------------------------------------------------------ | 293 //------------------------------------------------------------------------------ |
OLD | NEW |