Lines Matching full:picture
58 int WebPPictureHasTransparency(const WebPPicture* picture) { in WebPPictureHasTransparency() argument
59 if (picture == NULL) return 0; in WebPPictureHasTransparency()
60 if (!picture->use_argb) { in WebPPictureHasTransparency()
61 return CheckNonOpaque(picture->a, picture->width, picture->height, in WebPPictureHasTransparency()
62 1, picture->a_stride); in WebPPictureHasTransparency()
65 return CheckNonOpaque((const uint8_t*)picture->argb + alpha_offset, in WebPPictureHasTransparency()
66 picture->width, picture->height, in WebPPictureHasTransparency()
67 4, picture->argb_stride * sizeof(*picture->argb)); in WebPPictureHasTransparency()
397 WebPPicture* const picture) { in ConvertWRGBToYUV() argument
399 uint8_t* dst_y = picture->y; in ConvertWRGBToYUV()
400 uint8_t* dst_u = picture->u; in ConvertWRGBToYUV()
401 uint8_t* dst_v = picture->v; in ConvertWRGBToYUV()
403 const int w = (picture->width + 1) & ~1; in ConvertWRGBToYUV()
404 const int h = (picture->height + 1) & ~1; in ConvertWRGBToYUV()
407 for (best_uv = best_uv_base, j = 0; j < picture->height; ++j) { in ConvertWRGBToYUV()
408 for (i = 0; i < picture->width; ++i) { in ConvertWRGBToYUV()
418 dst_y += picture->y_stride; in ConvertWRGBToYUV()
430 dst_u += picture->uv_stride; in ConvertWRGBToYUV()
431 dst_v += picture->uv_stride; in ConvertWRGBToYUV()
445 WebPPicture* const picture) { in PreprocessARGB() argument
447 const int w = (picture->width + 1) & ~1; in PreprocessARGB()
448 const int h = (picture->height + 1) & ~1; in PreprocessARGB()
474 ok = WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY); in PreprocessARGB()
477 assert(picture->width >= kMinDimensionIterativeConversion); in PreprocessARGB()
478 assert(picture->height >= kMinDimensionIterativeConversion); in PreprocessARGB()
483 for (j = 0; j < picture->height; j += 2) { in PreprocessARGB()
484 const int is_last_row = (j == picture->height - 1); in PreprocessARGB()
489 ImportOneRow(r_ptr, g_ptr, b_ptr, step, picture->width, src1); in PreprocessARGB()
492 step, picture->width, src2); in PreprocessARGB()
553 ok = ConvertWRGBToYUV(best_y_base, best_uv_base, picture); in PreprocessARGB()
846 WebPPicture* const picture) { in ImportYUVAFromRGBA() argument
848 const int width = picture->width; in ImportYUVAFromRGBA()
849 const int height = picture->height; in ImportYUVAFromRGBA()
853 picture->colorspace = has_alpha ? WEBP_YUV420A : WEBP_YUV420; in ImportYUVAFromRGBA()
854 picture->use_argb = 0; in ImportYUVAFromRGBA()
862 if (!WebPPictureAllocYUVA(picture, width, height)) { in ImportYUVAFromRGBA()
874 if (!PreprocessARGB(r_ptr, g_ptr, b_ptr, step, rgb_stride, picture)) { in ImportYUVAFromRGBA()
879 picture->a, picture->a_stride); in ImportYUVAFromRGBA()
887 uint8_t* dst_y = picture->y; in ImportYUVAFromRGBA()
888 uint8_t* dst_u = picture->u; in ImportYUVAFromRGBA()
889 uint8_t* dst_v = picture->v; in ImportYUVAFromRGBA()
890 uint8_t* dst_a = picture->a; in ImportYUVAFromRGBA()
911 dst_y + picture->y_stride, width); in ImportYUVAFromRGBA()
915 dst_y + picture->y_stride, width); in ImportYUVAFromRGBA()
922 dst_y + picture->y_stride, width, rg); in ImportYUVAFromRGBA()
924 dst_y += 2 * picture->y_stride; in ImportYUVAFromRGBA()
927 dst_a, picture->a_stride); in ImportYUVAFromRGBA()
928 dst_a += 2 * picture->a_stride; in ImportYUVAFromRGBA()
942 dst_u += picture->uv_stride; in ImportYUVAFromRGBA()
943 dst_v += picture->uv_stride; in ImportYUVAFromRGBA()
991 static int PictureARGBToYUVA(WebPPicture* picture, WebPEncCSP colorspace, in PictureARGBToYUVA() argument
993 if (picture == NULL) return 0; in PictureARGBToYUVA()
994 if (picture->argb == NULL) { in PictureARGBToYUVA()
995 return WebPEncodingSetError(picture, VP8_ENC_ERROR_NULL_PARAMETER); in PictureARGBToYUVA()
997 return WebPEncodingSetError(picture, VP8_ENC_ERROR_INVALID_CONFIGURATION); in PictureARGBToYUVA()
999 const uint8_t* const argb = (const uint8_t*)picture->argb; in PictureARGBToYUVA()
1005 picture->colorspace = WEBP_YUV420; in PictureARGBToYUVA()
1006 return ImportYUVAFromRGBA(r, g, b, a, 4, 4 * picture->argb_stride, in PictureARGBToYUVA()
1007 dithering, use_iterative_conversion, picture); in PictureARGBToYUVA()
1011 int WebPPictureARGBToYUVADithered(WebPPicture* picture, WebPEncCSP colorspace, in WebPPictureARGBToYUVADithered() argument
1013 return PictureARGBToYUVA(picture, colorspace, dithering, 0); in WebPPictureARGBToYUVADithered()
1016 int WebPPictureARGBToYUVA(WebPPicture* picture, WebPEncCSP colorspace) { in WebPPictureARGBToYUVA() argument
1017 return PictureARGBToYUVA(picture, colorspace, 0.f, 0); in WebPPictureARGBToYUVA()
1020 int WebPPictureSharpARGBToYUVA(WebPPicture* picture) { in WebPPictureSharpARGBToYUVA() argument
1021 return PictureARGBToYUVA(picture, WEBP_YUV420, 0.f, 1); in WebPPictureSharpARGBToYUVA()
1024 int WebPPictureSmartARGBToYUVA(WebPPicture* picture) { in WebPPictureSmartARGBToYUVA() argument
1025 return WebPPictureSharpARGBToYUVA(picture); in WebPPictureSmartARGBToYUVA()
1031 int WebPPictureYUVAToARGB(WebPPicture* picture) { in WebPPictureYUVAToARGB() argument
1032 if (picture == NULL) return 0; in WebPPictureYUVAToARGB()
1033 if (picture->y == NULL || picture->u == NULL || picture->v == NULL) { in WebPPictureYUVAToARGB()
1034 return WebPEncodingSetError(picture, VP8_ENC_ERROR_NULL_PARAMETER); in WebPPictureYUVAToARGB()
1036 if ((picture->colorspace & WEBP_CSP_ALPHA_BIT) && picture->a == NULL) { in WebPPictureYUVAToARGB()
1037 return WebPEncodingSetError(picture, VP8_ENC_ERROR_NULL_PARAMETER); in WebPPictureYUVAToARGB()
1039 if ((picture->colorspace & WEBP_CSP_UV_MASK) != WEBP_YUV420) { in WebPPictureYUVAToARGB()
1040 return WebPEncodingSetError(picture, VP8_ENC_ERROR_INVALID_CONFIGURATION); in WebPPictureYUVAToARGB()
1043 if (!WebPPictureAllocARGB(picture, picture->width, picture->height)) return 0; in WebPPictureYUVAToARGB()
1044 picture->use_argb = 1; in WebPPictureYUVAToARGB()
1049 const int width = picture->width; in WebPPictureYUVAToARGB()
1050 const int height = picture->height; in WebPPictureYUVAToARGB()
1051 const int argb_stride = 4 * picture->argb_stride; in WebPPictureYUVAToARGB()
1052 uint8_t* dst = (uint8_t*)picture->argb; in WebPPictureYUVAToARGB()
1053 const uint8_t *cur_u = picture->u, *cur_v = picture->v, *cur_y = picture->y; in WebPPictureYUVAToARGB()
1059 cur_y += picture->y_stride; in WebPPictureYUVAToARGB()
1065 cur_u += picture->uv_stride; in WebPPictureYUVAToARGB()
1066 cur_v += picture->uv_stride; in WebPPictureYUVAToARGB()
1067 upsample(cur_y, cur_y + picture->y_stride, top_u, top_v, cur_u, cur_v, in WebPPictureYUVAToARGB()
1069 cur_y += 2 * picture->y_stride; in WebPPictureYUVAToARGB()
1077 if (picture->colorspace & WEBP_CSP_ALPHA_BIT) { in WebPPictureYUVAToARGB()
1079 uint32_t* const argb_dst = picture->argb + y * picture->argb_stride; in WebPPictureYUVAToARGB()
1080 const uint8_t* const src = picture->a + y * picture->a_stride; in WebPPictureYUVAToARGB()
1094 static int Import(WebPPicture* const picture, in Import() argument
1102 const int width = picture->width; in Import()
1103 const int height = picture->height; in Import()
1105 if (!picture->use_argb) { in Import()
1108 0.f /* no dithering */, 0, picture); in Import()
1110 if (!WebPPictureAlloc(picture)) return 0; in Import()
1117 uint32_t* dst = picture->argb; in Import()
1124 dst += picture->argb_stride; in Import()
1140 dst += picture->argb_stride; in Import()
1144 uint32_t* dst = picture->argb; in Import()
1151 dst += picture->argb_stride; in Import()
1161 int WebPPictureImportBGR(WebPPicture* picture, in WebPPictureImportBGR() argument
1163 return (picture != NULL && rgb != NULL) in WebPPictureImportBGR()
1164 ? Import(picture, rgb, rgb_stride, 3, 1, 0) in WebPPictureImportBGR()
1168 int WebPPictureImportBGRA(WebPPicture* picture, in WebPPictureImportBGRA() argument
1170 return (picture != NULL && rgba != NULL) in WebPPictureImportBGRA()
1171 ? Import(picture, rgba, rgba_stride, 4, 1, 1) in WebPPictureImportBGRA()
1176 int WebPPictureImportBGRX(WebPPicture* picture, in WebPPictureImportBGRX() argument
1178 return (picture != NULL && rgba != NULL) in WebPPictureImportBGRX()
1179 ? Import(picture, rgba, rgba_stride, 4, 1, 0) in WebPPictureImportBGRX()
1185 int WebPPictureImportRGB(WebPPicture* picture, in WebPPictureImportRGB() argument
1187 return (picture != NULL && rgb != NULL) in WebPPictureImportRGB()
1188 ? Import(picture, rgb, rgb_stride, 3, 0, 0) in WebPPictureImportRGB()
1192 int WebPPictureImportRGBA(WebPPicture* picture, in WebPPictureImportRGBA() argument
1194 return (picture != NULL && rgba != NULL) in WebPPictureImportRGBA()
1195 ? Import(picture, rgba, rgba_stride, 4, 0, 1) in WebPPictureImportRGBA()
1199 int WebPPictureImportRGBX(WebPPicture* picture, in WebPPictureImportRGBX() argument
1201 return (picture != NULL && rgba != NULL) in WebPPictureImportRGBX()
1202 ? Import(picture, rgba, rgba_stride, 4, 0, 0) in WebPPictureImportRGBX()