diff --git a/examples/anim_diff.c b/examples/anim_diff.c index 75986971..6abed2df 100644 --- a/examples/anim_diff.c +++ b/examples/anim_diff.c @@ -57,8 +57,8 @@ static WEBP_INLINE int PixelsAreSimilar(uint32_t src, uint32_t dst, } static int FramesAreSimilar(const uint8_t* const rgba1, - const uint8_t* const rgba2, - int width, int height, int max_allowed_diff) { + const uint8_t* const rgba2, int width, int height, + int max_allowed_diff) { int i, j; assert(max_allowed_diff > 0); for (j = 0; j < height; ++j) { @@ -120,8 +120,7 @@ static int CompareBackgroundColor(uint32_t bg1, uint32_t bg2, int premultiply) { if (alpha1 == 0 && alpha2 == 0) return 1; } if (bg1 != bg2) { - fprintf(stderr, "Background color mismatch: 0x%08x vs 0x%08x\n", - bg1, bg2); + fprintf(stderr, "Background color mismatch: 0x%08x vs 0x%08x\n", bg1, bg2); return 0; } return 1; @@ -131,8 +130,7 @@ static int CompareBackgroundColor(uint32_t bg1, uint32_t bg2, int premultiply) { // is OK for other aspects like offsets, dispose/blend method to vary. static int CompareAnimatedImagePair(const AnimatedImage* const img1, const AnimatedImage* const img2, - int premultiply, - double min_psnr) { + int premultiply, double min_psnr) { int ok = 1; const int is_multi_frame_image = (img1->num_frames > 1); uint32_t i; @@ -141,8 +139,8 @@ static int CompareAnimatedImagePair(const AnimatedImage* const img1, "Canvas width mismatch"); ok &= CompareValues(img1->canvas_height, img2->canvas_height, "Canvas height mismatch"); - ok &= CompareValues(img1->num_frames, img2->num_frames, - "Frame count mismatch"); + ok &= + CompareValues(img1->num_frames, img2->num_frames, "Frame count mismatch"); if (!ok) return 0; // These are fatal failures, can't proceed. if (is_multi_frame_image) { // Checks relevant for multi-frame images only. @@ -178,8 +176,8 @@ static int CompareAnimatedImagePair(const AnimatedImage* const img1, premultiply, &max_diff, &psnr); if (min_psnr > 0.) { if (psnr < min_psnr) { - fprintf(stderr, "Frame #%d, psnr = %.2lf (min_psnr = %f)\n", i, - psnr, min_psnr); + fprintf(stderr, "Frame #%d, psnr = %.2lf (min_psnr = %f)\n", i, psnr, + min_psnr); ok = 0; } } else { @@ -199,9 +197,10 @@ static void Help(void) { printf(" -min_psnr ... minimum per-frame PSNR\n"); printf(" -raw_comparison ..... if this flag is not used, RGB is\n"); printf(" premultiplied before comparison\n"); - printf(" -max_diff ..... maximum allowed difference per channel\n" - " between corresponding pixels in subsequent\n" - " frames\n"); + printf( + " -max_diff ..... maximum allowed difference per channel\n" + " between corresponding pixels in subsequent\n" + " frames\n"); printf(" -h .................. this help\n"); printf(" -version ............ print version number and exit\n"); } @@ -217,7 +216,7 @@ int main(int argc, const char* argv[]) { int premultiply = 1; int max_diff = 0; int i, c; - const char* files[2] = { NULL, NULL }; + const char* files[2] = {NULL, NULL}; AnimatedImage images[2]; INIT_WARGV(argc, argv); @@ -253,9 +252,8 @@ int main(int argc, const char* argv[]) { GetAnimatedImageVersions(&dec_version, &demux_version); printf("WebP Decoder version: %d.%d.%d\nWebP Demux version: %d.%d.%d\n", (dec_version >> 16) & 0xff, (dec_version >> 8) & 0xff, - (dec_version >> 0) & 0xff, - (demux_version >> 16) & 0xff, (demux_version >> 8) & 0xff, - (demux_version >> 0) & 0xff); + (dec_version >> 0) & 0xff, (demux_version >> 16) & 0xff, + (demux_version >> 8) & 0xff, (demux_version >> 0) & 0xff); FREE_WARGV_AND_RETURN(0); } else { if (!got_input1) { @@ -278,7 +276,6 @@ int main(int argc, const char* argv[]) { FREE_WARGV_AND_RETURN(return_code); } - if (!got_input2) { Help(); FREE_WARGV_AND_RETURN(return_code); @@ -301,8 +298,8 @@ int main(int argc, const char* argv[]) { } } - if (!CompareAnimatedImagePair(&images[0], &images[1], - premultiply, min_psnr)) { + if (!CompareAnimatedImagePair(&images[0], &images[1], premultiply, + min_psnr)) { WFPRINTF(stderr, "\nFiles %s and %s differ.\n", (const W_CHAR*)files[0], (const W_CHAR*)files[1]); return_code = 1; @@ -311,7 +308,7 @@ int main(int argc, const char* argv[]) { (const W_CHAR*)files[1]); return_code = 0; } - End: +End: ClearAnimatedImage(&images[0]); ClearAnimatedImage(&images[1]); FREE_WARGV_AND_RETURN(return_code); diff --git a/examples/anim_dump.c b/examples/anim_dump.c index 55ac0ad3..449d5a88 100644 --- a/examples/anim_dump.c +++ b/examples/anim_dump.c @@ -29,8 +29,9 @@ static void Help(void) { printf("Usage: anim_dump [options] files...\n"); printf("\nOptions:\n"); printf(" -folder .... dump folder (default: '.')\n"); - printf(" -prefix .... prefix for dumped frames " - "(default: 'dump_')\n"); + printf( + " -prefix .... prefix for dumped frames " + "(default: 'dump_')\n"); printf(" -tiff ............... save frames as TIFF\n"); printf(" -pam ................ save frames as PAM\n"); printf(" -h .................. this help\n"); @@ -82,17 +83,16 @@ int main(int argc, const char* argv[]) { GetAnimatedImageVersions(&dec_version, &demux_version); printf("WebP Decoder version: %d.%d.%d\nWebP Demux version: %d.%d.%d\n", (dec_version >> 16) & 0xff, (dec_version >> 8) & 0xff, - (dec_version >> 0) & 0xff, - (demux_version >> 16) & 0xff, (demux_version >> 8) & 0xff, - (demux_version >> 0) & 0xff); + (dec_version >> 0) & 0xff, (demux_version >> 16) & 0xff, + (demux_version >> 8) & 0xff, (demux_version >> 0) & 0xff); FREE_WARGV_AND_RETURN(EXIT_SUCCESS); } else { uint32_t i; AnimatedImage image; const W_CHAR* const file = GET_WARGV(argv, c); memset(&image, 0, sizeof(image)); - WPRINTF("Decoding file: %s as %s/%sxxxx.%s\n", - file, dump_folder, prefix, suffix); + WPRINTF("Decoding file: %s as %s/%sxxxx.%s\n", file, dump_folder, prefix, + suffix); if (!ReadAnimatedImage((const char*)file, &image, 0, NULL)) { WFPRINTF(stderr, "Error decoding file: %s\n Aborting.\n", file); error = 1; @@ -113,8 +113,8 @@ int main(int argc, const char* argv[]) { buffer.u.RGBA.rgba = image.frames[i].rgba; buffer.u.RGBA.stride = buffer.width * sizeof(uint32_t); buffer.u.RGBA.size = buffer.u.RGBA.stride * buffer.height; - WSNPRINTF(out_file, sizeof(out_file), "%s/%s%.4d.%s", - dump_folder, prefix, i, suffix); + WSNPRINTF(out_file, sizeof(out_file), "%s/%s%.4d.%s", dump_folder, + prefix, i, suffix); if (!WebPSaveImage(&buffer, format, (const char*)out_file)) { WFPRINTF(stderr, "Error while saving image '%s'\n", out_file); error = 1; diff --git a/examples/anim_util.c b/examples/anim_util.c index e480063c..5759dbed 100644 --- a/examples/anim_util.c +++ b/examples/anim_util.c @@ -41,11 +41,11 @@ static const int kNumChannels = 4; #if defined(WEBP_HAVE_GIF) // Returns true if the frame covers the full canvas. -static int IsFullFrame(int width, int height, - int canvas_width, int canvas_height) { +static int IsFullFrame(int width, int height, int canvas_width, + int canvas_height) { return (width == canvas_width && height == canvas_height); } -#endif // WEBP_HAVE_GIF +#endif // WEBP_HAVE_GIF static int CheckSizeForOverflow(uint64_t size) { return (size == (size_t)size); @@ -95,8 +95,8 @@ void ClearAnimatedImage(AnimatedImage* const image) { #if defined(WEBP_HAVE_GIF) // Clear the canvas to transparent. -static void ZeroFillCanvas(uint8_t* rgba, - uint32_t canvas_width, uint32_t canvas_height) { +static void ZeroFillCanvas(uint8_t* rgba, uint32_t canvas_width, + uint32_t canvas_height) { memset(rgba, 0, canvas_width * kNumChannels * canvas_height); } @@ -113,16 +113,16 @@ static void ZeroFillFrameRect(uint8_t* rgba, int rgba_stride, int x_offset, } // Copy width * height pixels from 'src' to 'dst'. -static void CopyCanvas(const uint8_t* src, uint8_t* dst, - uint32_t width, uint32_t height) { +static void CopyCanvas(const uint8_t* src, uint8_t* dst, uint32_t width, + uint32_t height) { assert(src != NULL && dst != NULL); memcpy(dst, src, width * kNumChannels * height); } // Copy pixels in the given rectangle from 'src' to 'dst' honoring the 'stride'. static void CopyFrameRectangle(const uint8_t* src, uint8_t* dst, int stride, - int x_offset, int y_offset, - int width, int height) { + int x_offset, int y_offset, int width, + int height) { int j; const int width_in_bytes = width * kNumChannels; const size_t offset = y_offset * stride + x_offset * kNumChannels; @@ -135,11 +135,11 @@ static void CopyFrameRectangle(const uint8_t* src, uint8_t* dst, int stride, dst += stride; } } -#endif // WEBP_HAVE_GIF +#endif // WEBP_HAVE_GIF // Canonicalize all transparent pixels to transparent black to aid comparison. -static void CleanupTransparentPixels(uint32_t* rgba, - uint32_t width, uint32_t height) { +static void CleanupTransparentPixels(uint32_t* rgba, uint32_t width, + uint32_t height) { const uint32_t* const rgba_end = rgba + width * height; while (rgba < rgba_end) { const uint8_t alpha = (*rgba >> 24) & 0xff; @@ -152,8 +152,8 @@ static void CleanupTransparentPixels(uint32_t* rgba, // Dump frame to a PAM file. Returns true on success. static int DumpFrame(const char filename[], const char dump_folder[], - uint32_t frame_num, const uint8_t rgba[], - int canvas_width, int canvas_height) { + uint32_t frame_num, const uint8_t rgba[], int canvas_width, + int canvas_height) { int ok = 0; size_t max_len; int y; @@ -166,8 +166,8 @@ static int DumpFrame(const char filename[], const char dump_folder[], base_name = WSTRRCHR(filename, '/'); base_name = (base_name == NULL) ? (const W_CHAR*)filename : base_name + 1; - max_len = WSTRLEN(dump_folder) + 1 + WSTRLEN(base_name) - + strlen("_frame_") + strlen(".pam") + 8; + max_len = WSTRLEN(dump_folder) + 1 + WSTRLEN(base_name) + strlen("_frame_") + + strlen(".pam") + 8; file_name = (W_CHAR*)WebPMalloc(max_len * sizeof(*file_name)); if (file_name == NULL) goto End; @@ -183,7 +183,8 @@ static int DumpFrame(const char filename[], const char dump_folder[], ok = 0; goto End; } - if (fprintf(f, "P7\nWIDTH %d\nHEIGHT %d\n" + if (fprintf(f, + "P7\nWIDTH %d\nHEIGHT %d\n" "DEPTH 4\nMAXVAL 255\nTUPLTYPE RGB_ALPHA\nENDHDR\n", canvas_width, canvas_height) < 0) { WFPRINTF(stderr, "Write error for file %s\n", file_name); @@ -198,7 +199,7 @@ static int DumpFrame(const char filename[], const char dump_folder[], row += canvas_width * kNumChannels; } ok = 1; - End: +End: if (f != NULL) fclose(f); WebPFree(file_name); return ok; @@ -266,8 +267,8 @@ static int ReadAnimatedWebP(const char filename[], image->canvas_width * kNumChannels * image->canvas_height); // Needed only because we may want to compare with GIF later. - CleanupTransparentPixels((uint32_t*)curr_rgba, - image->canvas_width, image->canvas_height); + CleanupTransparentPixels((uint32_t*)curr_rgba, image->canvas_width, + image->canvas_height); if (dump_frames && dump_ok) { dump_ok = DumpFrame(filename, dump_folder, frame_index, curr_rgba, @@ -283,7 +284,7 @@ static int ReadAnimatedWebP(const char filename[], ok = dump_ok; if (ok) image->format = ANIM_WEBP; - End: +End: WebPAnimDecoderDelete(dec); return ok; } @@ -303,12 +304,11 @@ static int IsGIF(const WebPData* const data) { // GIFLIB_MAJOR is only defined in libgif >= 4.2.0. #if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) -# define LOCAL_GIF_VERSION ((GIFLIB_MAJOR << 8) | GIFLIB_MINOR) -# define LOCAL_GIF_PREREQ(maj, min) \ - (LOCAL_GIF_VERSION >= (((maj) << 8) | (min))) +#define LOCAL_GIF_VERSION ((GIFLIB_MAJOR << 8) | GIFLIB_MINOR) +#define LOCAL_GIF_PREREQ(maj, min) (LOCAL_GIF_VERSION >= (((maj) << 8) | (min))) #else -# define LOCAL_GIF_VERSION 0 -# define LOCAL_GIF_PREREQ(maj, min) 0 +#define LOCAL_GIF_VERSION 0 +#define LOCAL_GIF_PREREQ(maj, min) 0 #endif #if !LOCAL_GIF_PREREQ(5, 0) @@ -316,14 +316,14 @@ static int IsGIF(const WebPData* const data) { // Added in v5.0 typedef struct { int DisposalMode; -#define DISPOSAL_UNSPECIFIED 0 // No disposal specified -#define DISPOSE_DO_NOT 1 // Leave image in place -#define DISPOSE_BACKGROUND 2 // Set area to background color -#define DISPOSE_PREVIOUS 3 // Restore to previous content - int UserInputFlag; // User confirmation required before disposal - int DelayTime; // Pre-display delay in 0.01sec units - int TransparentColor; // Palette index for transparency, -1 if none -#define NO_TRANSPARENT_COLOR -1 +#define DISPOSAL_UNSPECIFIED 0 // No disposal specified +#define DISPOSE_DO_NOT 1 // Leave image in place +#define DISPOSE_BACKGROUND 2 // Set area to background color +#define DISPOSE_PREVIOUS 3 // Restore to previous content + int UserInputFlag; // User confirmation required before disposal + int DelayTime; // Pre-display delay in 0.01sec units + int TransparentColor; // Palette index for transparency, -1 if none +#define NO_TRANSPARENT_COLOR -1 } GraphicsControlBlock; static int DGifExtensionToGCB(const size_t GifExtensionLength, @@ -357,8 +357,8 @@ static int DGifSavedExtensionToGCB(GifFileType* GifFile, int ImageIndex, for (i = 0; i < GifFile->SavedImages[ImageIndex].ExtensionBlockCount; i++) { ExtensionBlock* ep = &GifFile->SavedImages[ImageIndex].ExtensionBlocks[i]; if (ep->Function == GRAPHICS_EXT_FUNC_CODE) { - return DGifExtensionToGCB( - ep->ByteCount, (const GifByteType*)ep->Bytes, gcb); + return DGifExtensionToGCB(ep->ByteCount, (const GifByteType*)ep->Bytes, + gcb); } } return GIF_ERROR; @@ -377,12 +377,12 @@ static int DGifSavedExtensionToGCB(GifFileType* GifFile, int ImageIndex, #endif static int IsKeyFrameGIF(const GifImageDesc* prev_desc, int prev_dispose, - const DecodedFrame* const prev_frame, - int canvas_width, int canvas_height) { + const DecodedFrame* const prev_frame, int canvas_width, + int canvas_height) { if (prev_frame == NULL) return 1; if (prev_dispose == DISPOSE_BACKGROUND) { - if (IsFullFrame(prev_desc->Width, prev_desc->Height, - canvas_width, canvas_height)) { + if (IsFullFrame(prev_desc->Width, prev_desc->Height, canvas_width, + canvas_height)) { return 1; } if (prev_frame->is_key_frame) return 1; @@ -403,14 +403,12 @@ static uint32_t GetBackgroundColorGIF(GifFileType* gif) { if (transparent_index != NO_TRANSPARENT_COLOR && gif->SBackGroundColor == transparent_index) { return 0x00000000; // Special case: transparent black. - } else if (color_map == NULL || color_map->Colors == NULL - || gif->SBackGroundColor >= color_map->ColorCount) { + } else if (color_map == NULL || color_map->Colors == NULL || + gif->SBackGroundColor >= color_map->ColorCount) { return 0xffffffff; // Invalid: assume white. } else { const GifColorType color = color_map->Colors[gif->SBackGroundColor]; - return (0xffu << 24) | - (color.Red << 16) | - (color.Green << 8) | + return (0xffu << 24) | (color.Red << 16) | (color.Green << 8) | (color.Blue << 0); } } @@ -435,11 +433,10 @@ static uint32_t GetLoopCountGIF(const GifFileType* const gif) { (eb1->ByteCount == 11) && (!memcmp(signature, "NETSCAPE2.0", 11) || !memcmp(signature, "ANIMEXTS1.0", 11)); - if (signature_is_ok && - eb2->Function == CONTINUE_EXT_FUNC_CODE && eb2->ByteCount >= 3 && - eb2->Bytes[0] == 1) { - const uint32_t extra_loop = ((uint32_t)(eb2->Bytes[2]) << 8) + - ((uint32_t)(eb2->Bytes[1]) << 0); + if (signature_is_ok && eb2->Function == CONTINUE_EXT_FUNC_CODE && + eb2->ByteCount >= 3 && eb2->Bytes[0] == 1) { + const uint32_t extra_loop = + ((uint32_t)(eb2->Bytes[2]) << 8) + ((uint32_t)(eb2->Bytes[1]) << 0); return (extra_loop > 0) ? extra_loop + 1 : 0; } } @@ -535,8 +532,8 @@ static int ReadAnimatedGIF(const char filename[], AnimatedImage* const image, image->canvas_height = (uint32_t)gif->SHeight; if (image->canvas_width > MAX_CANVAS_SIZE || image->canvas_height > MAX_CANVAS_SIZE) { - fprintf(stderr, "Invalid canvas dimension: %d x %d\n", - image->canvas_width, image->canvas_height); + fprintf(stderr, "Invalid canvas dimension: %d x %d\n", image->canvas_width, + image->canvas_height); DGifCloseFile(gif, NULL); return 0; } @@ -611,11 +608,9 @@ static int ReadAnimatedGIF(const char filename[], AnimatedImage* const image, CopyCanvas(prev_rgba, curr_rgba, canvas_width, canvas_height); // Dispose previous frame rectangle. - prev_frame_disposed = - (prev_gcb.DisposalMode == DISPOSE_BACKGROUND || - prev_gcb.DisposalMode == DISPOSE_PREVIOUS); - curr_frame_opaque = - (curr_gcb.TransparentColor == NO_TRANSPARENT_COLOR); + prev_frame_disposed = (prev_gcb.DisposalMode == DISPOSE_BACKGROUND || + prev_gcb.DisposalMode == DISPOSE_PREVIOUS); + curr_frame_opaque = (curr_gcb.TransparentColor == NO_TRANSPARENT_COLOR); prev_frame_completely_covered = curr_frame_opaque && CoversFrameGIF(&curr_gif_image->ImageDesc, prev_desc); @@ -643,9 +638,9 @@ static int ReadAnimatedGIF(const char filename[], AnimatedImage* const image, uint8_t* const src_frame_rgba = image->frames[src_frame_num].rgba; CopyFrameRectangle(src_frame_rgba, curr_rgba, - canvas_width_in_bytes, - prev_desc->Left, prev_desc->Top, - prev_desc->Width, prev_desc->Height); + canvas_width_in_bytes, prev_desc->Left, + prev_desc->Top, prev_desc->Width, + prev_desc->Height); } else { // Source canvas doesn't exist. So clear previous frame // rectangle to background. @@ -670,8 +665,8 @@ static int ReadAnimatedGIF(const char filename[], AnimatedImage* const image, } if (dump_frames) { - if (!DumpFrame(filename, dump_folder, i, curr_rgba, - canvas_width, canvas_height)) { + if (!DumpFrame(filename, dump_folder, i, curr_rgba, canvas_width, + canvas_height)) { DGifCloseFile(gif, NULL); return 0; } @@ -695,7 +690,8 @@ static int ReadAnimatedGIF(const char filename[], AnimatedImage* const image, (void)image; (void)dump_frames; (void)dump_folder; - fprintf(stderr, "GIF support not compiled. Please install the libgif-dev " + fprintf(stderr, + "GIF support not compiled. Please install the libgif-dev " "package before building.\n"); return 0; } @@ -718,8 +714,8 @@ int ReadAnimatedImage(const char filename[], AnimatedImage* const image, } if (IsWebP(&webp_data)) { - ok = ReadAnimatedWebP(filename, &webp_data, image, dump_frames, - dump_folder); + ok = + ReadAnimatedWebP(filename, &webp_data, image, dump_frames, dump_folder); } else if (IsGIF(&webp_data)) { ok = ReadAnimatedGIF(filename, image, dump_frames, dump_folder); } else { @@ -763,8 +759,7 @@ void GetDiffAndPSNR(const uint8_t rgba1[], const uint8_t rgba2[], // premultiply R/G/B channels with alpha value for (k = 0; k < kAlphaChannel; ++k) { Accumulate(rgba1[offset + k] * alpha1 / 255., - rgba2[offset + k] * alpha2 / 255., - &f_max_diff, &sse); + rgba2[offset + k] * alpha2 / 255., &f_max_diff, &sse); } } } diff --git a/examples/anim_util.h b/examples/anim_util.h index 574e032d..c9d24be3 100644 --- a/examples/anim_util.h +++ b/examples/anim_util.h @@ -22,15 +22,12 @@ extern "C" { #endif -typedef enum { - ANIM_GIF, - ANIM_WEBP -} AnimatedFileFormat; +typedef enum { ANIM_GIF, ANIM_WEBP } AnimatedFileFormat; typedef struct { - uint8_t* rgba; // Decoded and reconstructed full frame. - int duration; // Frame duration in milliseconds. - int is_key_frame; // True if this frame is a key-frame. + uint8_t* rgba; // Decoded and reconstructed full frame. + int duration; // Frame duration in milliseconds. + int is_key_frame; // True if this frame is a key-frame. } DecodedFrame; typedef struct { @@ -67,7 +64,7 @@ void GetAnimatedImageVersions(int* const decoder_version, int* const demux_version); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_EXAMPLES_ANIM_UTIL_H_ diff --git a/examples/cwebp.c b/examples/cwebp.c index 7a878405..fb1b7552 100644 --- a/examples/cwebp.c +++ b/examples/cwebp.c @@ -37,10 +37,10 @@ extern "C" { #endif -extern void* VP8GetCPUInfo; // opaque forward declaration. +extern void* VP8GetCPUInfo; // opaque forward declaration. #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_DLL @@ -66,12 +66,12 @@ static int ReadYUV(const uint8_t* const data, size_t data_size, pic->use_argb = 0; if (!WebPPictureAlloc(pic)) return 0; - ImgIoUtilCopyPlane(data, pic->width, pic->y, pic->y_stride, - pic->width, pic->height); - ImgIoUtilCopyPlane(data + y_plane_size, uv_width, - pic->u, pic->uv_stride, uv_width, uv_height); - ImgIoUtilCopyPlane(data + y_plane_size + uv_plane_size, uv_width, - pic->v, pic->uv_stride, uv_width, uv_height); + ImgIoUtilCopyPlane(data, pic->width, pic->y, pic->y_stride, pic->width, + pic->height); + ImgIoUtilCopyPlane(data + y_plane_size, uv_width, pic->u, pic->uv_stride, + uv_width, uv_height); + ImgIoUtilCopyPlane(data + y_plane_size + uv_plane_size, uv_width, pic->v, + pic->uv_stride, uv_width, uv_height); return use_argb ? WebPPictureYUVAToARGB(pic) : 1; } @@ -119,7 +119,7 @@ static int ReadPicture(const char* const filename, WebPPicture* const pic, // If image size is specified, infer it as YUV format. ok = ReadYUV(data, data_size, pic); } - End: +End: if (!ok) { WFPRINTF(stderr, "Error! Could not process file %s\n", (const W_CHAR*)filename); @@ -168,8 +168,8 @@ static void PrintValues(const int values[4]) { static void PrintFullLosslessInfo(const WebPAuxStats* const stats, const char* const description) { - fprintf(stderr, "Lossless-%s compressed size: %d bytes\n", - description, stats->lossless_size); + fprintf(stderr, "Lossless-%s compressed size: %d bytes\n", description, + stats->lossless_size); fprintf(stderr, " * Header size: %d bytes, image data size: %d\n", stats->lossless_hdr_size, stats->lossless_data_size); if (stats->lossless_features) { @@ -209,8 +209,7 @@ static void PrintExtraInfoLossless(const WebPPicture* const pic, } static void PrintExtraInfoLossy(const WebPPicture* const pic, int short_output, - int full_details, - const char* const file_name) { + int full_details, const char* const file_name) { const WebPAuxStats* const stats = pic->stats; if (short_output) { fprintf(stderr, "%7d %2.2f\n", stats->coded_size, stats->PSNR[3]); @@ -220,25 +219,25 @@ static void PrintExtraInfoLossy(const WebPPicture* const pic, int short_output, const int num_skip = stats->block_count[2]; const int total = num_i4 + num_i16; WFPRINTF(stderr, "File: %s\n", (const W_CHAR*)file_name); - fprintf(stderr, "Dimension: %d x %d%s\n", - pic->width, pic->height, + fprintf(stderr, "Dimension: %d x %d%s\n", pic->width, pic->height, stats->alpha_data_size ? " (with alpha)" : ""); - fprintf(stderr, "Output: " + fprintf(stderr, + "Output: " "%d bytes Y-U-V-All-PSNR %2.2f %2.2f %2.2f %2.2f dB\n" " (%.2f bpp)\n", - stats->coded_size, - stats->PSNR[0], stats->PSNR[1], stats->PSNR[2], stats->PSNR[3], - 8.f * stats->coded_size / pic->width / pic->height); + stats->coded_size, stats->PSNR[0], stats->PSNR[1], stats->PSNR[2], + stats->PSNR[3], 8.f * stats->coded_size / pic->width / pic->height); if (total > 0) { - int totals[4] = { 0, 0, 0, 0 }; - fprintf(stderr, "block count: intra4: %6d (%.2f%%)\n" - " intra16: %6d (%.2f%%)\n" - " skipped: %6d (%.2f%%)\n", - num_i4, 100.f * num_i4 / total, - num_i16, 100.f * num_i16 / total, + int totals[4] = {0, 0, 0, 0}; + fprintf(stderr, + "block count: intra4: %6d (%.2f%%)\n" + " intra16: %6d (%.2f%%)\n" + " skipped: %6d (%.2f%%)\n", + num_i4, 100.f * num_i4 / total, num_i16, 100.f * num_i16 / total, num_skip, 100.f * num_skip / total); - fprintf(stderr, "bytes used: header: %6d (%.1f%%)\n" - " mode-partition: %6d (%.1f%%)\n", + fprintf(stderr, + "bytes used: header: %6d (%.1f%%)\n" + " mode-partition: %6d (%.1f%%)\n", stats->header_bytes[0], 100.f * stats->header_bytes[0] / stats->coded_size, stats->header_bytes[1], @@ -247,9 +246,10 @@ static void PrintExtraInfoLossy(const WebPPicture* const pic, int short_output, fprintf(stderr, " transparency: %6d (%.1f dB)\n", stats->alpha_data_size, stats->PSNR[4]); } - fprintf(stderr, " Residuals bytes " - "|segment 1|segment 2|segment 3" - "|segment 4| total\n"); + fprintf(stderr, + " Residuals bytes " + "|segment 1|segment 2|segment 3" + "|segment 4| total\n"); if (full_details) { fprintf(stderr, " intra4-coeffs: "); PrintByteCount(stats->residual_bytes[0], stats->coded_size, totals); @@ -286,11 +286,11 @@ static void PrintMapInfo(const WebPPicture* const pic) { for (y = 0; y < mb_h; ++y) { for (x = 0; x < mb_w; ++x) { const int c = pic->extra_info[x + y * mb_w]; - if (type == 1) { // intra4/intra16 + if (type == 1) { // intra4/intra16 fprintf(stderr, "%c", "+."[c]); - } else if (type == 2) { // segments + } else if (type == 2) { // segments fprintf(stderr, "%c", ".-*X"[c]); - } else if (type == 3) { // quantizers + } else if (type == 3) { // quantizers fprintf(stderr, "%.2d ", c); } else if (type == 6 || type == 7) { fprintf(stderr, "%3d ", c); @@ -346,7 +346,7 @@ static int DumpPicture(const WebPPicture* const picture, const char* PGM_name) { } ok = 1; - Error: +Error: fclose(f); return ok; } @@ -356,9 +356,9 @@ static int DumpPicture(const WebPPicture* const picture, const char* PGM_name) { enum { METADATA_EXIF = (1 << 0), - METADATA_ICC = (1 << 1), - METADATA_XMP = (1 << 2), - METADATA_ALL = METADATA_EXIF | METADATA_ICC | METADATA_XMP + METADATA_ICC = (1 << 1), + METADATA_XMP = (1 << 2), + METADATA_ALL = METADATA_EXIF | METADATA_ICC | METADATA_XMP }; static const int kChunkHeaderSize = 8; @@ -411,9 +411,9 @@ static int WriteMetadataChunk(FILE* const out, const char fourcc[4], // Sets 'flag' in 'vp8x_flags' and updates 'metadata_size' with the size of the // chunk if there is metadata and 'keep' is true. -static int UpdateFlagsAndSize(const MetadataPayload* const payload, - int keep, int flag, - uint32_t* vp8x_flags, uint64_t* metadata_size) { +static int UpdateFlagsAndSize(const MetadataPayload* const payload, int keep, + int flag, uint32_t* vp8x_flags, + uint64_t* metadata_size) { if (keep && payload->bytes != NULL && payload->size > 0) { *vp8x_flags |= flag; *metadata_size += kChunkHeaderSize + payload->size + (payload->size & 1); @@ -434,23 +434,23 @@ static int WriteWebPWithMetadata(FILE* const out, int* const metadata_written) { const char kVP8XHeader[] = "VP8X\x0a\x00\x00\x00"; const int kAlphaFlag = 0x10; - const int kEXIFFlag = 0x08; - const int kICCPFlag = 0x20; - const int kXMPFlag = 0x04; + const int kEXIFFlag = 0x08; + const int kICCPFlag = 0x20; + const int kXMPFlag = 0x04; const size_t kRiffHeaderSize = 12; const size_t kMaxChunkPayload = ~0 - kChunkHeaderSize - 1; const size_t kMinSize = kRiffHeaderSize + kChunkHeaderSize; uint32_t flags = 0; uint64_t metadata_size = 0; - const int write_exif = UpdateFlagsAndSize(&metadata->exif, - !!(keep_metadata & METADATA_EXIF), - kEXIFFlag, &flags, &metadata_size); - const int write_iccp = UpdateFlagsAndSize(&metadata->iccp, - !!(keep_metadata & METADATA_ICC), - kICCPFlag, &flags, &metadata_size); - const int write_xmp = UpdateFlagsAndSize(&metadata->xmp, - !!(keep_metadata & METADATA_XMP), - kXMPFlag, &flags, &metadata_size); + const int write_exif = + UpdateFlagsAndSize(&metadata->exif, !!(keep_metadata & METADATA_EXIF), + kEXIFFlag, &flags, &metadata_size); + const int write_iccp = + UpdateFlagsAndSize(&metadata->iccp, !!(keep_metadata & METADATA_ICC), + kICCPFlag, &flags, &metadata_size); + const int write_xmp = + UpdateFlagsAndSize(&metadata->xmp, !!(keep_metadata & METADATA_XMP), + kXMPFlag, &flags, &metadata_size); uint8_t* webp = memory_writer->mem; size_t webp_size = memory_writer->size; @@ -458,17 +458,18 @@ static int WriteWebPWithMetadata(FILE* const out, if (webp_size < kMinSize) return 0; if (webp_size - kChunkHeaderSize + metadata_size > kMaxChunkPayload) { - fprintf(stderr, "Error! Addition of metadata would exceed " - "container size limit.\n"); + fprintf(stderr, + "Error! Addition of metadata would exceed " + "container size limit.\n"); return 0; } if (metadata_size > 0) { const int kVP8XChunkSize = 18; const int has_vp8x = !memcmp(webp + kRiffHeaderSize, "VP8X", kTagSize); - const uint32_t riff_size = (uint32_t)(webp_size - kChunkHeaderSize + - (has_vp8x ? 0 : kVP8XChunkSize) + - metadata_size); + const uint32_t riff_size = + (uint32_t)(webp_size - kChunkHeaderSize + + (has_vp8x ? 0 : kVP8XChunkSize) + metadata_size); // RIFF int ok = (fwrite(webp, kTagSize, 1, out) == 1); // RIFF size (file header size is not recorded) @@ -527,8 +528,7 @@ enum { RESIZE_MODE_DEFAULT = RESIZE_MODE_ALWAYS }; -static void ApplyResizeMode(const int resize_mode, - const WebPPicture* const pic, +static void ApplyResizeMode(const int resize_mode, const WebPPicture* const pic, int* const resize_w, int* const resize_h) { const int src_w = pic->width; const int src_h = pic->height; @@ -536,8 +536,7 @@ static void ApplyResizeMode(const int resize_mode, const int dst_h = *resize_h; if (resize_mode == RESIZE_MODE_DOWN_ONLY) { - if ((dst_w == 0 && src_h <= dst_h) || - (dst_h == 0 && src_w <= dst_w) || + if ((dst_w == 0 && src_h <= dst_h) || (dst_h == 0 && src_w <= dst_w) || (src_w <= dst_w && src_h <= dst_h)) { *resize_w = *resize_h = 0; } @@ -551,8 +550,7 @@ static void ApplyResizeMode(const int resize_mode, //------------------------------------------------------------------------------ static int ProgressReport(int percent, const WebPPicture* const picture) { - fprintf(stderr, "[%s]: %3d %% \r", - (char*)picture->user_data, percent); + fprintf(stderr, "[%s]: %3d %% \r", (char*)picture->user_data, percent); return 1; // all ok } @@ -569,8 +567,9 @@ static void HelpShort(void) { static void HelpLong(void) { printf("Usage:\n"); printf(" cwebp [-preset <...>] [options] in_file [-o out_file]\n\n"); - printf("If input size (-s) for an image is not specified, it is\n" - "assumed to be a PNG, JPEG, TIFF or WebP file.\n"); + printf( + "If input size (-s) for an image is not specified, it is\n" + "assumed to be a PNG, JPEG, TIFF or WebP file.\n"); printf("Note: Animated PNG and WebP files are not supported.\n"); #ifdef HAVE_WINCODEC_H printf("Windows builds can take as input any of the files handled by WIC.\n"); @@ -578,46 +577,59 @@ static void HelpLong(void) { printf("\nOptions:\n"); printf(" -h / -help ............. short help\n"); printf(" -H / -longhelp ......... long help\n"); - printf(" -q ............. quality factor (0:small..100:big), " - "default=75\n"); - printf(" -alpha_q ......... transparency-compression quality (0..100)," - "\n default=100\n"); + printf( + " -q ............. quality factor (0:small..100:big), " + "default=75\n"); + printf( + " -alpha_q ......... transparency-compression quality (0..100)," + "\n default=100\n"); printf(" -preset ....... preset setting, one of:\n"); printf(" default, photo, picture,\n"); printf(" drawing, icon, text\n"); printf(" -preset must come first, as it overwrites other parameters\n"); - printf(" -z ............... activates lossless preset with given\n" - " level in [0:fast, ..., 9:slowest]\n"); + printf( + " -z ............... activates lossless preset with given\n" + " level in [0:fast, ..., 9:slowest]\n"); printf("\n"); - printf(" -m ............... compression method (0=fast, 6=slowest), " - "default=4\n"); - printf(" -segments ........ number of segments to use (1..4), " - "default=4\n"); + printf( + " -m ............... compression method (0=fast, 6=slowest), " + "default=4\n"); + printf( + " -segments ........ number of segments to use (1..4), " + "default=4\n"); printf(" -size ............ target size (in bytes)\n"); printf(" -psnr .......... target PSNR (in dB. typically: 42)\n"); printf("\n"); printf(" -s ......... input size (width x height) for YUV\n"); - printf(" -sns ............. spatial noise shaping (0:off, 100:max), " - "default=50\n"); - printf(" -f ............... filter strength (0=off..100), " - "default=60\n"); - printf(" -sharpness ....... " - "filter sharpness (0:most .. 7:least sharp), default=0\n"); - printf(" -strong ................ use strong filter instead " - "of simple (default)\n"); + printf( + " -sns ............. spatial noise shaping (0:off, 100:max), " + "default=50\n"); + printf( + " -f ............... filter strength (0=off..100), " + "default=60\n"); + printf( + " -sharpness ....... " + "filter sharpness (0:most .. 7:least sharp), default=0\n"); + printf( + " -strong ................ use strong filter instead " + "of simple (default)\n"); printf(" -nostrong .............. use simple filter instead of strong\n"); - printf(" -sharp_yuv ............. use sharper (and slower) RGB->YUV " - "conversion\n"); + printf( + " -sharp_yuv ............. use sharper (and slower) RGB->YUV " + "conversion\n"); printf(" -partition_limit . limit quality to fit the 512k limit on\n"); - printf(" " - "the first partition (0=no degradation ... 100=full)\n"); + printf( + " " + "the first partition (0=no degradation ... 100=full)\n"); printf(" -pass ............ analysis pass number (1..10)\n"); - printf(" -qrange .... specifies the permissible quality range\n" - " (default: 0 100)\n"); + printf( + " -qrange .... specifies the permissible quality range\n" + " (default: 0 100)\n"); printf(" -crop .. crop picture with the given rectangle\n"); printf(" -resize ........ resize picture (*after* any cropping)\n"); - printf(" -resize_mode .. one of: up_only, down_only," - " always (default)\n"); + printf( + " -resize_mode .. one of: up_only, down_only," + " always (default)\n"); printf(" -mt .................... use multi-threading if available\n"); printf(" -low_memory ............ reduce memory usage (slower encoding)\n"); printf(" -map ............. print map of extra info\n"); @@ -625,20 +637,24 @@ static void HelpLong(void) { printf(" -print_ssim ............ prints averaged SSIM distortion\n"); printf(" -print_lsim ............ prints local-similarity distortion\n"); printf(" -d .......... dump the compressed output (PGM file)\n"); - printf(" -alpha_method .... transparency-compression method (0..1), " - "default=1\n"); + printf( + " -alpha_method .... transparency-compression method (0..1), " + "default=1\n"); printf(" -alpha_filter . predictive filtering for alpha plane,\n"); printf(" one of: none, fast (default) or best\n"); - printf(" -exact ................. preserve RGB values in transparent area, " - "default=off\n"); - printf(" -blend_alpha ..... blend colors against background color\n" - " expressed as RGB values written in\n" - " hexadecimal, e.g. 0xc0e0d0 for red=0xc0\n" - " green=0xe0 and blue=0xd0\n"); + printf( + " -exact ................. preserve RGB values in transparent area, " + "default=off\n"); + printf( + " -blend_alpha ..... blend colors against background color\n" + " expressed as RGB values written in\n" + " hexadecimal, e.g. 0xc0e0d0 for red=0xc0\n" + " green=0xe0 and blue=0xd0\n"); printf(" -noalpha ............... discard any transparency information\n"); printf(" -lossless .............. encode image losslessly, default=off\n"); - printf(" -near_lossless ... use near-lossless image preprocessing\n" - " (0..100=off), default=100\n"); + printf( + " -near_lossless ... use near-lossless image preprocessing\n" + " (0..100=off), default=100\n"); printf(" -hint ......... specify image characteristics hint,\n"); printf(" one of: photo, picture or graph\n"); @@ -646,8 +662,9 @@ static void HelpLong(void) { printf(" -metadata ..... comma separated list of metadata to\n"); printf(" "); printf("copy from the input to the output if present.\n"); - printf(" " - "Valid values: all, none (default), exif, icc, xmp\n"); + printf( + " " + "Valid values: all, none (default), exif, icc, xmp\n"); printf("\n"); printf(" -short ................. condense printed message\n"); @@ -656,8 +673,9 @@ static void HelpLong(void) { #ifndef WEBP_DLL printf(" -noasm ................. disable all assembly optimizations\n"); #endif - printf(" -v ..................... verbose, e.g. print encoding/decoding " - "times\n"); + printf( + " -v ..................... verbose, e.g. print encoding/decoding " + "times\n"); printf(" -progress .............. report encoding progress\n"); printf("\n"); printf("Experimental Options:\n"); @@ -672,30 +690,29 @@ static void HelpLong(void) { // Error messages static const char* const kErrorMessages[VP8_ENC_ERROR_LAST] = { - "OK", - "OUT_OF_MEMORY: Out of memory allocating objects", - "BITSTREAM_OUT_OF_MEMORY: Out of memory re-allocating byte buffer", - "NULL_PARAMETER: NULL parameter passed to function", - "INVALID_CONFIGURATION: configuration is invalid", - "BAD_DIMENSION: Bad picture dimension. Maximum width and height " - "allowed is 16383 pixels.", - "PARTITION0_OVERFLOW: Partition #0 is too big to fit 512k.\n" - "To reduce the size of this partition, try using less segments " - "with the -segments option, and eventually reduce the number of " - "header bits using -partition_limit. More details are available " - "in the manual (`man cwebp`)", - "PARTITION_OVERFLOW: Partition is too big to fit 16M", - "BAD_WRITE: Picture writer returned an I/O error", - "FILE_TOO_BIG: File would be too big to fit in 4G", - "USER_ABORT: encoding abort requested by user" -}; + "OK", + "OUT_OF_MEMORY: Out of memory allocating objects", + "BITSTREAM_OUT_OF_MEMORY: Out of memory re-allocating byte buffer", + "NULL_PARAMETER: NULL parameter passed to function", + "INVALID_CONFIGURATION: configuration is invalid", + "BAD_DIMENSION: Bad picture dimension. Maximum width and height " + "allowed is 16383 pixels.", + "PARTITION0_OVERFLOW: Partition #0 is too big to fit 512k.\n" + "To reduce the size of this partition, try using less segments " + "with the -segments option, and eventually reduce the number of " + "header bits using -partition_limit. More details are available " + "in the manual (`man cwebp`)", + "PARTITION_OVERFLOW: Partition is too big to fit 16M", + "BAD_WRITE: Picture writer returned an I/O error", + "FILE_TOO_BIG: File would be too big to fit in 4G", + "USER_ABORT: encoding abort requested by user"}; //------------------------------------------------------------------------------ // Returns EXIT_SUCCESS on success, EXIT_FAILURE on failure. int main(int argc, const char* argv[]) { int return_value = EXIT_FAILURE; - const char* in_file = NULL, *out_file = NULL, *dump_file = NULL; + const char *in_file = NULL, *out_file = NULL, *dump_file = NULL; FILE* out = NULL; int c; int short_output = 0; @@ -712,8 +729,8 @@ int main(int argc, const char* argv[]) { int keep_metadata = 0; int metadata_written = 0; WebPPicture picture; - int print_distortion = -1; // -1=off, 0=PSNR, 1=SSIM, 2=LSIM - WebPPicture original_picture; // when PSNR or SSIM is requested + int print_distortion = -1; // -1=off, 0=PSNR, 1=SSIM, 2=LSIM + WebPPicture original_picture; // when PSNR or SSIM is requested WebPConfig config; WebPAuxStats stats; WebPMemoryWriter memory_writer; @@ -725,8 +742,7 @@ int main(int argc, const char* argv[]) { MetadataInit(&metadata); WebPMemoryWriterInit(&memory_writer); - if (!WebPPictureInit(&picture) || - !WebPPictureInit(&original_picture) || + if (!WebPPictureInit(&picture) || !WebPPictureInit(&original_picture) || !WebPConfigInit(&config)) { fprintf(stderr, "Error! Version mismatch!\n"); FREE_WARGV_AND_RETURN(EXIT_FAILURE); @@ -765,18 +781,17 @@ int main(int argc, const char* argv[]) { picture.width = ExUtilGetInt(argv[++c], 0, &parse_error); picture.height = ExUtilGetInt(argv[++c], 0, &parse_error); if (picture.width > WEBP_MAX_DIMENSION || picture.width < 0 || - picture.height > WEBP_MAX_DIMENSION || picture.height < 0) { - fprintf(stderr, - "Specified dimension (%d x %d) is out of range.\n", + picture.height > WEBP_MAX_DIMENSION || picture.height < 0) { + fprintf(stderr, "Specified dimension (%d x %d) is out of range.\n", picture.width, picture.height); goto Error; } } else if (!strcmp(argv[c], "-m") && c + 1 < argc) { config.method = ExUtilGetInt(argv[++c], 0, &parse_error); - use_lossless_preset = 0; // disable -z option + use_lossless_preset = 0; // disable -z option } else if (!strcmp(argv[c], "-q") && c + 1 < argc) { config.quality = ExUtilGetFloat(argv[++c], &parse_error); - use_lossless_preset = 0; // disable -z option + use_lossless_preset = 0; // disable -z option } else if (!strcmp(argv[c], "-z") && c + 1 < argc) { lossless_preset = ExUtilGetInt(argv[++c], 0, &parse_error); if (use_lossless_preset != 0) use_lossless_preset = 1; @@ -892,11 +907,10 @@ int main(int argc, const char* argv[]) { } else if (!strcmp(argv[c], "-version")) { const int version = WebPGetEncoderVersion(); const int sharpyuv_version = SharpYuvGetVersion(); - printf("%d.%d.%d\n", - (version >> 16) & 0xff, (version >> 8) & 0xff, version & 0xff); - printf("libsharpyuv: %d.%d.%d\n", - (sharpyuv_version >> 24) & 0xff, (sharpyuv_version >> 16) & 0xffff, - sharpyuv_version & 0xff); + printf("%d.%d.%d\n", (version >> 16) & 0xff, (version >> 8) & 0xff, + version & 0xff); + printf("libsharpyuv: %d.%d.%d\n", (sharpyuv_version >> 24) & 0xff, + (sharpyuv_version >> 16) & 0xffff, sharpyuv_version & 0xff); FREE_WARGV_AND_RETURN(EXIT_SUCCESS); } else if (!strcmp(argv[c], "-progress")) { show_progress = 1; @@ -930,11 +944,11 @@ int main(int argc, const char* argv[]) { const char* option; int flag; } kTokens[] = { - { "all", METADATA_ALL }, - { "none", 0 }, - { "exif", METADATA_EXIF }, - { "icc", METADATA_ICC }, - { "xmp", METADATA_XMP }, + {"all", METADATA_ALL}, // + {"none", 0}, // + {"exif", METADATA_EXIF}, // + {"icc", METADATA_ICC}, // + {"xmp", METADATA_XMP}, // }; const size_t kNumTokens = sizeof(kTokens) / sizeof(kTokens[0]); const char* start = argv[++c]; @@ -966,8 +980,9 @@ int main(int argc, const char* argv[]) { #ifdef HAVE_WINCODEC_H if (keep_metadata != 0 && keep_metadata != METADATA_ICC) { // TODO(jzern): remove when -metadata is supported on all platforms. - fprintf(stderr, "Warning: only ICC profile extraction is currently" - " supported on this platform!\n"); + fprintf(stderr, + "Warning: only ICC profile extraction is currently" + " supported on this platform!\n"); } #endif } else if (!strcmp(argv[c], "-v")) { @@ -1005,12 +1020,14 @@ int main(int argc, const char* argv[]) { // warning for such options. if (!quiet && config.lossless == 1) { if (config.target_size > 0 || config.target_PSNR > 0) { - fprintf(stderr, "Encoding for specified size or PSNR is not supported" - " for lossless encoding. Ignoring such option(s)!\n"); + fprintf(stderr, + "Encoding for specified size or PSNR is not supported" + " for lossless encoding. Ignoring such option(s)!\n"); } if (config.partition_limit > 0) { - fprintf(stderr, "Partition limit option is not required for lossless" - " encoding. Ignoring this option!\n"); + fprintf(stderr, + "Partition limit option is not required for lossless" + " encoding. Ignoring this option!\n"); } } // If a target size or PSNR was given, but somehow the -pass option was @@ -1027,9 +1044,9 @@ int main(int argc, const char* argv[]) { // Read the input. We need to decide if we prefer ARGB or YUVA // samples, depending on the expected compression mode (this saves // some conversion steps). - picture.use_argb = (config.lossless || config.use_sharp_yuv || - config.preprocessing > 0 || - crop || (resize_w | resize_h) > 0); + picture.use_argb = + (config.lossless || config.use_sharp_yuv || config.preprocessing > 0 || + crop || (resize_w | resize_h) > 0); if (verbose) { StopwatchReset(&stop_watch); } @@ -1177,8 +1194,8 @@ int main(int argc, const char* argv[]) { } if (!WebPEncode(&config, &picture)) { fprintf(stderr, "Error! Cannot encode picture as WebP\n"); - fprintf(stderr, "Error code: %d (%s)\n", - picture.error_code, kErrorMessages[picture.error_code]); + fprintf(stderr, "Error code: %d (%s)\n", picture.error_code, + kErrorMessages[picture.error_code]); goto Error; } if (verbose) { @@ -1221,8 +1238,9 @@ int main(int argc, const char* argv[]) { // Write the YUV planes to a PGM file. Only available for lossy. if (dump_file) { if (picture.use_argb) { - fprintf(stderr, "Warning: can't dump file (-d option) " - "in lossless mode.\n"); + fprintf(stderr, + "Warning: can't dump file (-d option) " + "in lossless mode.\n"); } else if (!DumpPicture(&picture, dump_file)) { WFPRINTF(stderr, "Warning, couldn't dump picture %s\n", (const W_CHAR*)dump_file); @@ -1267,18 +1285,18 @@ int main(int argc, const char* argv[]) { if (!short_output && picture.extra_info_type > 0) { PrintMapInfo(&picture); } - if (print_distortion >= 0) { // print distortion - static const char* distortion_names[] = { "PSNR", "SSIM", "LSIM" }; + if (print_distortion >= 0) { // print distortion + static const char* distortion_names[] = {"PSNR", "SSIM", "LSIM"}; float values[5]; - if (!WebPPictureDistortion(&picture, &original_picture, - print_distortion, values)) { + if (!WebPPictureDistortion(&picture, &original_picture, print_distortion, + values)) { fprintf(stderr, "Error while computing the distortion.\n"); goto Error; } if (!short_output) { fprintf(stderr, "%s: ", distortion_names[print_distortion]); - fprintf(stderr, "B:%.2f G:%.2f R:%.2f A:%.2f Total:%.2f\n", - values[0], values[1], values[2], values[3], values[4]); + fprintf(stderr, "B:%.2f G:%.2f R:%.2f A:%.2f Total:%.2f\n", values[0], + values[1], values[2], values[3], values[4]); } else { fprintf(stderr, "%7d %.4f\n", picture.stats->coded_size, values[4]); } @@ -1289,7 +1307,7 @@ int main(int argc, const char* argv[]) { } return_value = EXIT_SUCCESS; - Error: +Error: WebPMemoryWriterClear(&memory_writer); WebPFree(picture.extra_info); MetadataFree(&metadata); diff --git a/examples/dwebp.c b/examples/dwebp.c index b84c2164..5c16fb1d 100644 --- a/examples/dwebp.c +++ b/examples/dwebp.c @@ -35,14 +35,13 @@ static int quiet = 0; extern "C" { #endif -extern void* VP8GetCPUInfo; // opaque forward declaration. +extern void* VP8GetCPUInfo; // opaque forward declaration. #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_DLL - static int SaveOutput(const WebPDecBuffer* const buffer, WebPOutputFileFormat format, const char* const out_file) { const int use_stdout = (out_file != NULL) && !WSTRCMP(out_file, "-"); @@ -77,43 +76,42 @@ static int SaveOutput(const WebPDecBuffer* const buffer, } static void Help(void) { - printf("Usage: dwebp in_file [options] [-o out_file]\n\n" - "Decodes the WebP image file to PNG format [Default].\n" - "Note: Animated WebP files are not supported.\n\n" - "Use following options to convert into alternate image formats:\n" - " -pam ......... save the raw RGBA samples as a color PAM\n" - " -ppm ......... save the raw RGB samples as a color PPM\n" - " -bmp ......... save as uncompressed BMP format\n" - " -tiff ........ save as uncompressed TIFF format\n" - " -pgm ......... save the raw YUV samples as a grayscale PGM\n" - " file with IMC4 layout\n" - " -yuv ......... save the raw YUV samples in flat layout\n" - "\n" - " Other options are:\n" - " -version ..... print version number and exit\n" - " -nofancy ..... don't use the fancy YUV420 upscaler\n" - " -nofilter .... disable in-loop filtering\n" - " -nodither .... disable dithering\n" - " -dither .. dithering strength (in 0..100)\n" - " -alpha_dither use alpha-plane dithering if needed\n" - " -mt .......... use multi-threading\n" - " -crop ... crop output with the given rectangle\n" - " -resize ......... resize output (*after* any cropping)\n" - " -flip ........ flip the output vertically\n" - " -alpha ....... only save the alpha plane\n" - " -incremental . use incremental decoding (useful for tests)\n" - " -h ........... this help message\n" - " -v ........... verbose (e.g. print encoding/decoding times)\n" - " -quiet ....... quiet mode, don't print anything\n" + printf( + "Usage: dwebp in_file [options] [-o out_file]\n\n" + "Decodes the WebP image file to PNG format [Default].\n" + "Note: Animated WebP files are not supported.\n\n" + "Use following options to convert into alternate image formats:\n" + " -pam ......... save the raw RGBA samples as a color PAM\n" + " -ppm ......... save the raw RGB samples as a color PPM\n" + " -bmp ......... save as uncompressed BMP format\n" + " -tiff ........ save as uncompressed TIFF format\n" + " -pgm ......... save the raw YUV samples as a grayscale PGM\n" + " file with IMC4 layout\n" + " -yuv ......... save the raw YUV samples in flat layout\n" + "\n" + " Other options are:\n" + " -version ..... print version number and exit\n" + " -nofancy ..... don't use the fancy YUV420 upscaler\n" + " -nofilter .... disable in-loop filtering\n" + " -nodither .... disable dithering\n" + " -dither .. dithering strength (in 0..100)\n" + " -alpha_dither use alpha-plane dithering if needed\n" + " -mt .......... use multi-threading\n" + " -crop ... crop output with the given rectangle\n" + " -resize ......... resize output (*after* any cropping)\n" + " -flip ........ flip the output vertically\n" + " -alpha ....... only save the alpha plane\n" + " -incremental . use incremental decoding (useful for tests)\n" + " -h ........... this help message\n" + " -v ........... verbose (e.g. print encoding/decoding times)\n" + " -quiet ....... quiet mode, don't print anything\n" #ifndef WEBP_DLL - " -noasm ....... disable all assembly optimizations\n" + " -noasm ....... disable all assembly optimizations\n" #endif - ); + ); } -static const char* const kFormatType[] = { - "unspecified", "lossy", "lossless" -}; +static const char* const kFormatType[] = {"unspecified", "lossy", "lossless"}; static uint8_t* AllocateExternalBuffer(WebPDecoderConfig* config, WebPOutputFileFormat format, @@ -130,23 +128,23 @@ static uint8_t* AllocateExternalBuffer(WebPDecoderConfig* config, h = config->options.crop_height; } if (format >= RGB && format <= rgbA_4444) { - const int bpp = (format == RGB || format == BGR) ? 3 - : (format == RGBA_4444 || format == rgbA_4444 || - format == RGB_565) ? 2 - : 4; - uint32_t stride = bpp * w + 7; // <- just for exercising + const int bpp = + (format == RGB || format == BGR) ? 3 + : (format == RGBA_4444 || format == rgbA_4444 || format == RGB_565) ? 2 + : 4; + uint32_t stride = bpp * w + 7; // <- just for exercising external_buffer = (uint8_t*)WebPMalloc(stride * h); if (external_buffer == NULL) return NULL; output_buffer->u.RGBA.stride = stride; output_buffer->u.RGBA.size = stride * h; output_buffer->u.RGBA.rgba = external_buffer; - } else { // YUV and YUVA + } else { // YUV and YUVA const int has_alpha = WebPIsAlphaMode(output_buffer->colorspace); uint8_t* tmp; uint32_t stride = w + 3; uint32_t uv_stride = (w + 1) / 2 + 13; - uint32_t total_size = stride * h * (has_alpha ? 2 : 1) - + 2 * uv_stride * (h + 1) / 2; + uint32_t total_size = + stride * h * (has_alpha ? 2 : 1) + 2 * uv_stride * (h + 1) / 2; assert(format >= YUV && format <= YUVA); external_buffer = (uint8_t*)WebPMalloc(total_size); if (external_buffer == NULL) return NULL; @@ -228,8 +226,8 @@ int main(int argc, const char* argv[]) { quiet = 1; } else if (!strcmp(argv[c], "-version")) { const int version = WebPGetDecoderVersion(); - printf("%d.%d.%d\n", - (version >> 16) & 0xff, (version >> 8) & 0xff, version & 0xff); + printf("%d.%d.%d\n", (version >> 16) & 0xff, (version >> 8) & 0xff, + version & 0xff); FREE_WARGV_AND_RETURN(EXIT_SUCCESS); } else if (!strcmp(argv[c], "-pgm")) { format = PGM; @@ -237,19 +235,32 @@ int main(int argc, const char* argv[]) { format = RAW_YUV; } else if (!strcmp(argv[c], "-pixel_format") && c < argc - 1) { const char* const fmt = argv[++c]; - if (!strcmp(fmt, "RGB")) format = RGB; - else if (!strcmp(fmt, "RGBA")) format = RGBA; - else if (!strcmp(fmt, "BGR")) format = BGR; - else if (!strcmp(fmt, "BGRA")) format = BGRA; - else if (!strcmp(fmt, "ARGB")) format = ARGB; - else if (!strcmp(fmt, "RGBA_4444")) format = RGBA_4444; - else if (!strcmp(fmt, "RGB_565")) format = RGB_565; - else if (!strcmp(fmt, "rgbA")) format = rgbA; - else if (!strcmp(fmt, "bgrA")) format = bgrA; - else if (!strcmp(fmt, "Argb")) format = Argb; - else if (!strcmp(fmt, "rgbA_4444")) format = rgbA_4444; - else if (!strcmp(fmt, "YUV")) format = YUV; - else if (!strcmp(fmt, "YUVA")) format = YUVA; + if (!strcmp(fmt, "RGB")) + format = RGB; + else if (!strcmp(fmt, "RGBA")) + format = RGBA; + else if (!strcmp(fmt, "BGR")) + format = BGR; + else if (!strcmp(fmt, "BGRA")) + format = BGRA; + else if (!strcmp(fmt, "ARGB")) + format = ARGB; + else if (!strcmp(fmt, "RGBA_4444")) + format = RGBA_4444; + else if (!strcmp(fmt, "RGB_565")) + format = RGB_565; + else if (!strcmp(fmt, "rgbA")) + format = rgbA; + else if (!strcmp(fmt, "bgrA")) + format = bgrA; + else if (!strcmp(fmt, "Argb")) + format = Argb; + else if (!strcmp(fmt, "rgbA_4444")) + format = rgbA_4444; + else if (!strcmp(fmt, "YUV")) + format = YUV; + else if (!strcmp(fmt, "YUVA")) + format = YUVA; else { fprintf(stderr, "Can't parse pixel_format %s\n", fmt); parse_error = 1; @@ -271,14 +282,14 @@ int main(int argc, const char* argv[]) { ExUtilGetInt(argv[++c], 0, &parse_error); } else if (!strcmp(argv[c], "-crop") && c < argc - 4) { config.options.use_cropping = 1; - config.options.crop_left = ExUtilGetInt(argv[++c], 0, &parse_error); - config.options.crop_top = ExUtilGetInt(argv[++c], 0, &parse_error); - config.options.crop_width = ExUtilGetInt(argv[++c], 0, &parse_error); + config.options.crop_left = ExUtilGetInt(argv[++c], 0, &parse_error); + config.options.crop_top = ExUtilGetInt(argv[++c], 0, &parse_error); + config.options.crop_width = ExUtilGetInt(argv[++c], 0, &parse_error); config.options.crop_height = ExUtilGetInt(argv[++c], 0, &parse_error); } else if ((!strcmp(argv[c], "-scale") || !strcmp(argv[c], "-resize")) && c < argc - 2) { // '-scale' is left for compatibility config.options.use_scaling = 1; - config.options.scaled_width = ExUtilGetInt(argv[++c], 0, &parse_error); + config.options.scaled_width = ExUtilGetInt(argv[++c], 0, &parse_error); config.options.scaled_height = ExUtilGetInt(argv[++c], 0, &parse_error); } else if (!strcmp(argv[c], "-flip")) { config.options.flip = 1; @@ -350,25 +361,52 @@ int main(int argc, const char* argv[]) { output_buffer->colorspace = MODE_YUVA; break; // forced modes: - case RGB: output_buffer->colorspace = MODE_RGB; break; - case RGBA: output_buffer->colorspace = MODE_RGBA; break; - case BGR: output_buffer->colorspace = MODE_BGR; break; - case BGRA: output_buffer->colorspace = MODE_BGRA; break; - case ARGB: output_buffer->colorspace = MODE_ARGB; break; - case RGBA_4444: output_buffer->colorspace = MODE_RGBA_4444; break; - case RGB_565: output_buffer->colorspace = MODE_RGB_565; break; - case rgbA: output_buffer->colorspace = MODE_rgbA; break; - case bgrA: output_buffer->colorspace = MODE_bgrA; break; - case Argb: output_buffer->colorspace = MODE_Argb; break; - case rgbA_4444: output_buffer->colorspace = MODE_rgbA_4444; break; - case YUV: output_buffer->colorspace = MODE_YUV; break; - case YUVA: output_buffer->colorspace = MODE_YUVA; break; - default: goto Exit; + case RGB: + output_buffer->colorspace = MODE_RGB; + break; + case RGBA: + output_buffer->colorspace = MODE_RGBA; + break; + case BGR: + output_buffer->colorspace = MODE_BGR; + break; + case BGRA: + output_buffer->colorspace = MODE_BGRA; + break; + case ARGB: + output_buffer->colorspace = MODE_ARGB; + break; + case RGBA_4444: + output_buffer->colorspace = MODE_RGBA_4444; + break; + case RGB_565: + output_buffer->colorspace = MODE_RGB_565; + break; + case rgbA: + output_buffer->colorspace = MODE_rgbA; + break; + case bgrA: + output_buffer->colorspace = MODE_bgrA; + break; + case Argb: + output_buffer->colorspace = MODE_Argb; + break; + case rgbA_4444: + output_buffer->colorspace = MODE_rgbA_4444; + break; + case YUV: + output_buffer->colorspace = MODE_YUV; + break; + case YUVA: + output_buffer->colorspace = MODE_YUVA; + break; + default: + goto Exit; } if (use_external_memory > 0 && format >= RGB) { - external_buffer = AllocateExternalBuffer(&config, format, - use_external_memory); + external_buffer = + AllocateExternalBuffer(&config, format, use_external_memory); if (external_buffer == NULL) goto Exit; } @@ -410,11 +448,12 @@ int main(int argc, const char* argv[]) { output_buffer->width, output_buffer->height, bitstream->has_alpha ? " (with alpha)" : "", kFormatType[bitstream->format]); - fprintf(stderr, "Nothing written; " - "use -o flag to save the result as e.g. PNG.\n"); + fprintf(stderr, + "Nothing written; " + "use -o flag to save the result as e.g. PNG.\n"); } } - Exit: +Exit: WebPFreeDecBuffer(output_buffer); WebPFree((void*)external_buffer); WebPFree((void*)data); diff --git a/examples/example_util.c b/examples/example_util.c index a8951aee..1dc3a0d9 100644 --- a/examples/example_util.c +++ b/examples/example_util.c @@ -46,7 +46,7 @@ int ExUtilGetInts(const char* v, int base, int max_output, int output[]) { if (error) return -1; output[n] = value; v = strchr(v, ','); - if (v != NULL) ++v; // skip over the trailing ',' + if (v != NULL) ++v; // skip over the trailing ',' } return n; } @@ -110,8 +110,7 @@ int ExUtilInitCommandLineArguments(int argc, const char* argv[], } argc = 0; - for (cur = strtok((char*)args->argv_data.bytes, sep); - cur != NULL; + for (cur = strtok((char*)args->argv_data.bytes, sep); cur != NULL; cur = strtok(NULL, sep)) { if (argc == MAX_ARGC) { fprintf(stderr, "ERROR: Arguments limit %d reached\n", MAX_ARGC); diff --git a/examples/example_util.h b/examples/example_util.h index 407f35c6..81bf7c0f 100644 --- a/examples/example_util.h +++ b/examples/example_util.h @@ -13,8 +13,8 @@ #ifndef WEBP_EXAMPLES_EXAMPLE_UTIL_H_ #define WEBP_EXAMPLES_EXAMPLE_UTIL_H_ -#include "webp/types.h" #include "webp/mux_types.h" +#include "webp/types.h" #ifdef __cplusplus extern "C" { @@ -64,7 +64,7 @@ int ExUtilInitCommandLineArguments(int argc, const char* argv[], void ExUtilDeleteCommandLineArguments(CommandLineArguments* const args); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_EXAMPLES_EXAMPLE_UTIL_H_ diff --git a/examples/gif2webp.c b/examples/gif2webp.c index 2b297428..8e95cb7d 100644 --- a/examples/gif2webp.c +++ b/examples/gif2webp.c @@ -28,14 +28,15 @@ #endif #include -#include "sharpyuv/sharpyuv.h" -#include "webp/encode.h" -#include "webp/mux.h" + #include "../examples/example_util.h" #include "../imageio/imageio_util.h" #include "./gifdec.h" #include "./unicode.h" #include "./unicode_gif.h" +#include "sharpyuv/sharpyuv.h" +#include "webp/encode.h" +#include "webp/mux.h" #if !defined(STDIN_FILENO) #define STDIN_FILENO 0 @@ -46,9 +47,8 @@ static int transparent_index = GIF_INDEX_INVALID; // Opaque by default. static const char* const kErrorMessages[-WEBP_MUX_NOT_ENOUGH_DATA + 1] = { - "WEBP_MUX_NOT_FOUND", "WEBP_MUX_INVALID_ARGUMENT", "WEBP_MUX_BAD_DATA", - "WEBP_MUX_MEMORY_ERROR", "WEBP_MUX_NOT_ENOUGH_DATA" -}; + "WEBP_MUX_NOT_FOUND", "WEBP_MUX_INVALID_ARGUMENT", "WEBP_MUX_BAD_DATA", + "WEBP_MUX_MEMORY_ERROR", "WEBP_MUX_NOT_ENOUGH_DATA"}; static const char* ErrorString(WebPMuxError err) { assert(err <= WEBP_MUX_NOT_FOUND && err >= WEBP_MUX_NOT_ENOUGH_DATA); @@ -56,9 +56,9 @@ static const char* ErrorString(WebPMuxError err) { } enum { - METADATA_ICC = (1 << 0), - METADATA_XMP = (1 << 1), - METADATA_ALL = METADATA_ICC | METADATA_XMP + METADATA_ICC = (1 << 0), + METADATA_XMP = (1 << 1), + METADATA_ALL = METADATA_ICC | METADATA_XMP }; //------------------------------------------------------------------------------ @@ -69,20 +69,25 @@ static void Help(void) { printf("Options:\n"); printf(" -h / -help ............. this help\n"); printf(" -lossy ................. encode image using lossy compression\n"); - printf(" -mixed ................. for each frame in the image, pick lossy\n" - " or lossless compression heuristically\n"); - printf(" -near_lossless ... use near-lossless image preprocessing\n" - " (0..100=off), default=100\n"); - printf(" -sharp_yuv ............. use sharper (and slower) RGB->YUV " - "conversion\n" - " (lossy only)\n"); + printf( + " -mixed ................. for each frame in the image, pick lossy\n" + " or lossless compression heuristically\n"); + printf( + " -near_lossless ... use near-lossless image preprocessing\n" + " (0..100=off), default=100\n"); + printf( + " -sharp_yuv ............. use sharper (and slower) RGB->YUV " + "conversion\n" + " (lossy only)\n"); printf(" -q ............. quality factor (0:small..100:big)\n"); - printf(" -m ............... compression method (0=fast, 6=slowest), " - "default=4\n"); - printf(" -min_size .............. minimize output size (default:off)\n" - " lossless compression by default; can be\n" - " combined with -q, -m, -lossy or -mixed\n" - " options\n"); + printf( + " -m ............... compression method (0=fast, 6=slowest), " + "default=4\n"); + printf( + " -min_size .............. minimize output size (default:off)\n" + " lossless compression by default; can be\n" + " combined with -q, -m, -lossy or -mixed\n" + " options\n"); printf(" -kmin ............ min distance between key frames\n"); printf(" -kmax ............ max distance between key frames\n"); printf(" -f ............... filter strength (0=off..100)\n"); @@ -109,21 +114,21 @@ int main(int argc, const char* argv[]) { int gif_error = GIF_ERROR; WebPMuxError err = WEBP_MUX_OK; int ok = 0; - const W_CHAR* in_file = NULL, *out_file = NULL; + const W_CHAR *in_file = NULL, *out_file = NULL; GifFileType* gif = NULL; int frame_duration = 0; int frame_timestamp = 0; GIFDisposeMethod orig_dispose = GIF_DISPOSE_NONE; - WebPPicture frame; // Frame rectangle only (not disposed). - WebPPicture curr_canvas; // Not disposed. - WebPPicture prev_canvas; // Disposed. + WebPPicture frame; // Frame rectangle only (not disposed). + WebPPicture curr_canvas; // Not disposed. + WebPPicture prev_canvas; // Disposed. WebPAnimEncoder* enc = NULL; WebPAnimEncoderOptions enc_options; WebPConfig config; - int frame_number = 0; // Whether we are processing the first frame. + int frame_number = 0; // Whether we are processing the first frame. int done; int c; int quiet = 0; @@ -131,7 +136,7 @@ int main(int argc, const char* argv[]) { int keep_metadata = METADATA_XMP; // ICC not output by default. WebPData icc_data; - int stored_icc = 0; // Whether we have already stored an ICC profile. + int stored_icc = 0; // Whether we have already stored an ICC profile. WebPData xmp_data; int stored_xmp = 0; // Whether we have already stored an XMP profile. int loop_count = 0; // default: infinite @@ -198,10 +203,10 @@ int main(int argc, const char* argv[]) { const char* option; int flag; } kTokens[] = { - { "all", METADATA_ALL }, - { "none", 0 }, - { "icc", METADATA_ICC }, - { "xmp", METADATA_XMP }, + {"all", METADATA_ALL}, + {"none", 0}, + {"icc", METADATA_ICC}, + {"xmp", METADATA_XMP}, }; const size_t kNumTokens = sizeof(kTokens) / sizeof(*kTokens); const char* start = argv[++c]; @@ -319,8 +324,8 @@ int main(int argc, const char* argv[]) { goto End; } if (verbose) { - printf("Fixed canvas screen dimension to: %d x %d\n", - gif->SWidth, gif->SHeight); + printf("Fixed canvas screen dimension to: %d x %d\n", gif->SWidth, + gif->SHeight); } } // Allocate current buffer. @@ -418,7 +423,7 @@ int main(int argc, const char* argv[]) { break; } case APPLICATION_EXT_FUNC_CODE: { - if (data[0] != 11) break; // Chunk is too short + if (data[0] != 11) break; // Chunk is too short if (!memcmp(data + 1, "NETSCAPE2.0", 11) || !memcmp(data + 1, "ANIMEXTS1.0", 11)) { if (!GIFReadLoopCount(gif, &data, &loop_count)) { @@ -529,7 +534,7 @@ int main(int argc, const char* argv[]) { } } - if (stored_icc) { // Add ICCP chunk. + if (stored_icc) { // Add ICCP chunk. err = WebPMuxSetChunk(mux, "ICCP", &icc_data, 1); if (verbose) { fprintf(stderr, "ICC size: %d\n", (int)icc_data.size); @@ -541,7 +546,7 @@ int main(int argc, const char* argv[]) { } } - if (stored_xmp) { // Add XMP chunk. + if (stored_xmp) { // Add XMP chunk. err = WebPMuxSetChunk(mux, "XMP ", &xmp_data, 1); if (verbose) { fprintf(stderr, "XMP size: %d\n", (int)xmp_data.size); @@ -555,8 +560,10 @@ int main(int argc, const char* argv[]) { err = WebPMuxAssemble(mux, &webp_data); if (err != WEBP_MUX_OK) { - fprintf(stderr, "ERROR (%s): Could not assemble when re-muxing to add " - "loop count/metadata.\n", ErrorString(err)); + fprintf(stderr, + "ERROR (%s): Could not assemble when re-muxing to add " + "loop count/metadata.\n", + ErrorString(err)); goto End; } } @@ -569,8 +576,7 @@ int main(int argc, const char* argv[]) { } if (!quiet) { if (!WSTRCMP(out_file, "-")) { - fprintf(stderr, "Saved %d bytes to STDIO\n", - (int)webp_data.size); + fprintf(stderr, "Saved %d bytes to STDIO\n", (int)webp_data.size); } else { WFPRINTF(stderr, "Saved output file (%d bytes): %s\n", (int)webp_data.size, out_file); @@ -578,8 +584,10 @@ int main(int argc, const char* argv[]) { } } else { if (!quiet) { - fprintf(stderr, "Nothing written; use -o flag to save the result " - "(%d bytes).\n", (int)webp_data.size); + fprintf(stderr, + "Nothing written; use -o flag to save the result " + "(%d bytes).\n", + (int)webp_data.size); } } @@ -587,7 +595,7 @@ int main(int argc, const char* argv[]) { ok = 1; gif_error = GIF_OK; - End: +End: WebPDataClear(&icc_data); WebPDataClear(&xmp_data); WebPMuxDelete(mux); @@ -601,7 +609,7 @@ int main(int argc, const char* argv[]) { GIFDisplayError(gif, gif_error); } if (gif != NULL) { -#if LOCAL_GIF_PREREQ(5,1) +#if LOCAL_GIF_PREREQ(5, 1) DGifCloseFile(gif, &gif_error); #else DGifCloseFile(gif); diff --git a/examples/gifdec.c b/examples/gifdec.c index fced38b5..1e806374 100644 --- a/examples/gifdec.c +++ b/examples/gifdec.c @@ -19,22 +19,21 @@ #include #include "webp/encode.h" -#include "webp/types.h" #include "webp/mux_types.h" +#include "webp/types.h" #define GIF_TRANSPARENT_COLOR 0x00000000u -#define GIF_WHITE_COLOR 0xffffffffu -#define GIF_TRANSPARENT_MASK 0x01 -#define GIF_DISPOSE_MASK 0x07 -#define GIF_DISPOSE_SHIFT 2 +#define GIF_WHITE_COLOR 0xffffffffu +#define GIF_TRANSPARENT_MASK 0x01 +#define GIF_DISPOSE_MASK 0x07 +#define GIF_DISPOSE_SHIFT 2 // from utils/utils.h #ifdef __cplusplus extern "C" { #endif -extern void WebPCopyPlane(const uint8_t* src, int src_stride, - uint8_t* dst, int dst_stride, - int width, int height); +extern void WebPCopyPlane(const uint8_t* src, int src_stride, uint8_t* dst, + int dst_stride, int width, int height); extern void WebPCopyPixels(const WebPPicture* const src, WebPPicture* const dst); #ifdef __cplusplus @@ -47,18 +46,16 @@ void GIFGetBackgroundColor(const ColorMapObject* const color_map, if (transparent_index != GIF_INDEX_INVALID && bgcolor_index == transparent_index) { *bgcolor = GIF_TRANSPARENT_COLOR; // Special case. - } else if (color_map == NULL || color_map->Colors == NULL - || bgcolor_index >= color_map->ColorCount) { + } else if (color_map == NULL || color_map->Colors == NULL || + bgcolor_index >= color_map->ColorCount) { *bgcolor = GIF_WHITE_COLOR; fprintf(stderr, "GIF decode warning: invalid background color index. Assuming " "white background.\n"); } else { const GifColorType color = color_map->Colors[bgcolor_index]; - *bgcolor = (0xffu << 24) - | (color.Red << 16) - | (color.Green << 8) - | (color.Blue << 0); + *bgcolor = (0xffu << 24) | (color.Red << 16) | (color.Green << 8) | + (color.Blue << 0); } } @@ -117,9 +114,8 @@ int GIFReadFrame(GifFileType* const gif, int transparent_index, const GifImageDesc* const image_desc = &gif->Image; uint32_t* dst = NULL; uint8_t* tmp = NULL; - const GIFFrameRect rect = { - image_desc->Left, image_desc->Top, image_desc->Width, image_desc->Height - }; + const GIFFrameRect rect = {image_desc->Left, image_desc->Top, + image_desc->Width, image_desc->Height}; const uint64_t memory_needed = 4 * rect.width * (uint64_t)rect.height; int ok = 0; *gif_rect = rect; @@ -130,8 +126,8 @@ int GIFReadFrame(GifFileType* const gif, int transparent_index, } // Use a view for the sub-picture: - if (!WebPPictureView(picture, rect.x_offset, rect.y_offset, - rect.width, rect.height, &sub_image)) { + if (!WebPPictureView(picture, rect.x_offset, rect.y_offset, rect.width, + rect.height, &sub_image)) { fprintf(stderr, "Sub-image %dx%d at position %d,%d is invalid!\n", rect.width, rect.height, rect.x_offset, rect.y_offset); return 0; @@ -143,8 +139,8 @@ int GIFReadFrame(GifFileType* const gif, int transparent_index, if (image_desc->Interlace) { // Interlaced image. // We need 4 passes, with the following offsets and jumps. - const int interlace_offsets[] = { 0, 4, 2, 1 }; - const int interlace_jumps[] = { 8, 8, 4, 2 }; + const int interlace_offsets[] = {0, 4, 2, 1}; + const int interlace_jumps[] = {8, 8, 4, 2}; int pass; for (pass = 0; pass < 4; ++pass) { const size_t stride = (size_t)sub_image.argb_stride; @@ -166,7 +162,7 @@ int GIFReadFrame(GifFileType* const gif, int transparent_index, } ok = 1; - End: +End: if (!ok) picture->error_code = sub_image.error_code; WebPPictureFree(&sub_image); WebPFree(tmp); @@ -184,7 +180,7 @@ int GIFReadLoopCount(GifFileType* const gif, GifByteType** const buf, return 0; // Loop count sub-block missing. } if ((*buf)[0] < 3 || (*buf)[1] != 1) { - return 0; // wrong size/marker + return 0; // wrong size/marker } *loop_count = (*buf)[2] | ((*buf)[3] << 8); return 1; @@ -220,8 +216,7 @@ int GIFReadMetadata(GifFileType* const gif, GifByteType** const buf, if (tmp == NULL) { return 0; } - memcpy((void*)(tmp + metadata->size), - subblock.bytes, subblock.size); + memcpy((void*)(tmp + metadata->size), subblock.bytes, subblock.size); metadata->bytes = tmp; metadata->size += subblock.size; } @@ -235,8 +230,8 @@ int GIFReadMetadata(GifFileType* const gif, GifByteType** const buf, return 1; } -static void ClearRectangle(WebPPicture* const picture, - int left, int top, int width, int height) { +static void ClearRectangle(WebPPicture* const picture, int left, int top, + int width, int height) { int i, j; const size_t stride = picture->argb_stride; uint32_t* dst = picture->argb + top * stride + left; @@ -247,8 +242,8 @@ static void ClearRectangle(WebPPicture* const picture, void GIFClearPic(WebPPicture* const pic, const GIFFrameRect* const rect) { if (rect != NULL) { - ClearRectangle(pic, rect->x_offset, rect->y_offset, - rect->width, rect->height); + ClearRectangle(pic, rect->x_offset, rect->y_offset, rect->width, + rect->height); } else { ClearRectangle(pic, 0, 0, pic->width, pic->height); } @@ -266,15 +261,14 @@ void GIFDisposeFrame(GIFDisposeMethod dispose, const GIFFrameRect* const rect, GIFClearPic(curr_canvas, rect); } else if (dispose == GIF_DISPOSE_RESTORE_PREVIOUS) { const size_t src_stride = prev_canvas->argb_stride; - const uint32_t* const src = prev_canvas->argb + rect->x_offset - + rect->y_offset * src_stride; + const uint32_t* const src = + prev_canvas->argb + rect->x_offset + rect->y_offset * src_stride; const size_t dst_stride = curr_canvas->argb_stride; - uint32_t* const dst = curr_canvas->argb + rect->x_offset - + rect->y_offset * dst_stride; + uint32_t* const dst = + curr_canvas->argb + rect->x_offset + rect->y_offset * dst_stride; assert(prev_canvas != NULL); - WebPCopyPlane((uint8_t*)src, (int)(4 * src_stride), - (uint8_t*)dst, (int)(4 * dst_stride), - 4 * rect->width, rect->height); + WebPCopyPlane((uint8_t*)src, (int)(4 * src_stride), (uint8_t*)dst, + (int)(4 * dst_stride), 4 * rect->width, rect->height); } } @@ -297,11 +291,11 @@ void GIFBlendFrames(const WebPPicture* const src, void GIFDisplayError(const GifFileType* const gif, int gif_error) { // libgif 4.2.0 has retired PrintGifError() and added GifErrorString(). -#if LOCAL_GIF_PREREQ(4,2) -#if LOCAL_GIF_PREREQ(5,0) +#if LOCAL_GIF_PREREQ(4, 2) +#if LOCAL_GIF_PREREQ(5, 0) // Static string actually, hence the const char* cast. - const char* error_str = (const char*)GifErrorString( - (gif == NULL) ? gif_error : gif->Error); + const char* error_str = + (const char*)GifErrorString((gif == NULL) ? gif_error : gif->Error); #else const char* error_str = (const char*)GifErrorString(); (void)gif; @@ -319,7 +313,8 @@ void GIFDisplayError(const GifFileType* const gif, int gif_error) { #else // !WEBP_HAVE_GIF static void ErrorGIFNotAvailable(void) { - fprintf(stderr, "GIF support not compiled. Please install the libgif-dev " + fprintf(stderr, + "GIF support not compiled. Please install the libgif-dev " "package before building.\n"); } diff --git a/examples/gifdec.h b/examples/gifdec.h index 2592c966..a5008d01 100644 --- a/examples/gifdec.h +++ b/examples/gifdec.h @@ -30,12 +30,11 @@ extern "C" { // GIFLIB_MAJOR is only defined in libgif >= 4.2.0. #if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) -# define LOCAL_GIF_VERSION ((GIFLIB_MAJOR << 8) | GIFLIB_MINOR) -# define LOCAL_GIF_PREREQ(maj, min) \ - (LOCAL_GIF_VERSION >= (((maj) << 8) | (min))) +#define LOCAL_GIF_VERSION ((GIFLIB_MAJOR << 8) | GIFLIB_MINOR) +#define LOCAL_GIF_PREREQ(maj, min) (LOCAL_GIF_VERSION >= (((maj) << 8) | (min))) #else -# define LOCAL_GIF_VERSION 0 -# define LOCAL_GIF_PREREQ(maj, min) 0 +#define LOCAL_GIF_VERSION 0 +#define LOCAL_GIF_PREREQ(maj, min) 0 #endif #define GIF_INDEX_INVALID (-1) @@ -111,7 +110,7 @@ void GIFCopyPixels(const struct WebPPicture* const src, struct WebPPicture* const dst); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_EXAMPLES_GIFDEC_H_ diff --git a/examples/img2webp.c b/examples/img2webp.c index c4eab6b8..9072c553 100644 --- a/examples/img2webp.c +++ b/examples/img2webp.c @@ -43,16 +43,20 @@ static void Help(void) { printf("File-level options (only used at the start of compression):\n"); printf(" -min_size ............ minimize size\n"); - printf(" -kmax .......... maximum number of frame between key-frames\n" - " (0=only keyframes)\n"); - printf(" -kmin .......... minimum number of frame between key-frames\n" - " (0=disable key-frames altogether)\n"); + printf( + " -kmax .......... maximum number of frame between key-frames\n" + " (0=only keyframes)\n"); + printf( + " -kmin .......... minimum number of frame between key-frames\n" + " (0=disable key-frames altogether)\n"); printf(" -mixed ............... use mixed lossy/lossless automatic mode\n"); - printf(" -near_lossless . use near-lossless image preprocessing\n" - " (0..100=off), default=100\n"); - printf(" -sharp_yuv ........... use sharper (and slower) RGB->YUV " - "conversion\n " - "(lossy only)\n"); + printf( + " -near_lossless . use near-lossless image preprocessing\n" + " (0..100=off), default=100\n"); + printf( + " -sharp_yuv ........... use sharper (and slower) RGB->YUV " + "conversion\n " + "(lossy only)\n"); printf(" -loop .......... loop count (default: 0, = infinite loop)\n"); printf(" -v ................... verbose mode\n"); printf(" -h ................... this help\n"); @@ -64,20 +68,25 @@ static void Help(void) { printf(" -lossless ............ use lossless mode (default)\n"); printf(" -lossy ............... use lossy mode\n"); printf(" -q ........... quality\n"); - printf(" -m ............. compression method (0=fast, 6=slowest), " - "default=4\n"); - printf(" -exact, -noexact ..... preserve or alter RGB values in transparent " - "area\n" - " (default: -noexact, may cause artifacts\n" - " with lossy animations)\n"); + printf( + " -m ............. compression method (0=fast, 6=slowest), " + "default=4\n"); + printf( + " -exact, -noexact ..... preserve or alter RGB values in transparent " + "area\n" + " (default: -noexact, may cause artifacts\n" + " with lossy animations)\n"); printf("\n"); - printf("example: img2webp -loop 2 in0.png -lossy in1.jpg\n" - " -d 80 in2.tiff -o out.webp\n"); - printf("\nNote: if a single file name is passed as the argument, the " - "arguments will be\n"); - printf("tokenized from this file. The file name must not start with " - "the character '-'.\n"); + printf( + "example: img2webp -loop 2 in0.png -lossy in1.jpg\n" + " -d 80 in2.tiff -o out.webp\n"); + printf( + "\nNote: if a single file name is passed as the argument, the " + "arguments will be\n"); + printf( + "tokenized from this file. The file name must not start with " + "the character '-'.\n"); printf("\nSupported input formats:\n %s\n", WebPGetEnabledInputFileFormats()); } @@ -127,7 +136,7 @@ static int SetLoopCount(int loop_count, WebPData* const webp_data) { ok = (err == WEBP_MUX_OK); } - End: +End: WebPMuxDelete(mux); if (!ok) { fprintf(stderr, "Error during loop-count setting\n"); @@ -166,8 +175,7 @@ int main(int argc, const char* argv[]) { argv = cmd_args.argv; WebPDataInit(&webp_data); - if (!WebPAnimEncoderOptionsInit(&anim_config) || - !WebPConfigInit(&config) || + if (!WebPAnimEncoderOptionsInit(&anim_config) || !WebPConfigInit(&config) || !WebPPictureInit(&pic)) { fprintf(stderr, "Library version mismatch!\n"); ok = 0; @@ -225,7 +233,7 @@ int main(int argc, const char* argv[]) { } ok = !parse_error; if (!ok) goto End; - argv[c] = NULL; // mark option as 'parsed' during 1st pass + argv[c] = NULL; // mark option as 'parsed' during 1st pass } else { have_input |= 1; } @@ -242,7 +250,7 @@ int main(int argc, const char* argv[]) { config.lossless = 1; for (c = 0; ok && c < argc; ++c) { if (argv[c] == NULL) continue; - if (argv[c][0] == '-') { // parse local options + if (argv[c][0] == '-') { // parse local options int parse_error = 0; if (!strcmp(argv[c], "-lossy")) { if (!anim_config.allow_mixed) config.lossless = 0; @@ -263,7 +271,7 @@ int main(int argc, const char* argv[]) { } else if (!strcmp(argv[c], "-noexact")) { config.exact = 0; } else { - parse_error = 1; // shouldn't be here. + parse_error = 1; // shouldn't be here. fprintf(stderr, "Unknown option [%s]\n", argv[c]); } ok = !parse_error; @@ -286,7 +294,7 @@ int main(int argc, const char* argv[]) { if (!ok) goto End; if (enc == NULL) { - width = pic.width; + width = pic.width; height = pic.height; enc = WebPAnimEncoderNew(width, height, &anim_config); ok = (enc != NULL); @@ -298,8 +306,9 @@ int main(int argc, const char* argv[]) { if (ok) { ok = (width == pic.width && height == pic.height); if (!ok) { - fprintf(stderr, "Frame #%d dimension mismatched! " - "Got %d x %d. Was expecting %d x %d.\n", + fprintf(stderr, + "Frame #%d dimension mismatched! " + "Got %d x %d. Was expecting %d x %d.\n", pic_num, pic.width, pic.height, width, height); } } @@ -314,8 +323,8 @@ int main(int argc, const char* argv[]) { if (!ok) goto End; if (verbose) { - WFPRINTF(stderr, "Added frame #%3d at time %4d (file: %s)\n", - pic_num, timestamp_ms, GET_WARGV_SHIFTED(argv, c)); + WFPRINTF(stderr, "Added frame #%3d at time %4d (file: %s)\n", pic_num, + timestamp_ms, GET_WARGV_SHIFTED(argv, c)); } timestamp_ms += duration; ++pic_num; @@ -323,8 +332,10 @@ int main(int argc, const char* argv[]) { for (c = last_input_index + 1; c < argc; ++c) { if (argv[c] != NULL) { - fprintf(stderr, "Warning: unused option [%s]!" - " Frame options go before the input frame.\n", argv[c]); + fprintf(stderr, + "Warning: unused option [%s]!" + " Frame options go before the input frame.\n", + argv[c]); } } @@ -335,7 +346,7 @@ int main(int argc, const char* argv[]) { fprintf(stderr, "Error during final animation assembly.\n"); } - End: +End: // free resources WebPAnimEncoderDelete(enc); @@ -353,8 +364,8 @@ int main(int argc, const char* argv[]) { } if (ok) { - fprintf(stderr, "[%d frames, %u bytes].\n", - pic_num, (unsigned int)webp_data.size); + fprintf(stderr, "[%d frames, %u bytes].\n", pic_num, + (unsigned int)webp_data.size); } WebPDataClear(&webp_data); ExUtilDeleteCommandLineArguments(&cmd_args); diff --git a/examples/stopwatch.h b/examples/stopwatch.h index f1b0faca..d5b649b6 100644 --- a/examples/stopwatch.h +++ b/examples/stopwatch.h @@ -28,17 +28,13 @@ static WEBP_INLINE void StopwatchReset(Stopwatch* watch) { static WEBP_INLINE double StopwatchReadAndReset(Stopwatch* watch) { const LARGE_INTEGER old_value = *watch; LARGE_INTEGER freq; - if (!QueryPerformanceCounter(watch)) - return 0.0; - if (!QueryPerformanceFrequency(&freq)) - return 0.0; - if (freq.QuadPart == 0) - return 0.0; + if (!QueryPerformanceCounter(watch)) return 0.0; + if (!QueryPerformanceFrequency(&freq)) return 0.0; + if (freq.QuadPart == 0) return 0.0; return (watch->QuadPart - old_value.QuadPart) / (double)freq.QuadPart; } - -#else /* !_WIN32 */ +#else /* !_WIN32 */ #include // memcpy #include @@ -58,6 +54,6 @@ static WEBP_INLINE double StopwatchReadAndReset(Stopwatch* watch) { return delta_sec + delta_usec / 1000000.0; } -#endif /* _WIN32 */ +#endif /* _WIN32 */ #endif // WEBP_EXAMPLES_STOPWATCH_H_ diff --git a/examples/unicode.h b/examples/unicode.h index 640d8e7e..1a8581c9 100644 --- a/examples/unicode.h +++ b/examples/unicode.h @@ -25,20 +25,20 @@ #include #include +#include #include #include -#include // Create a wchar_t array containing Unicode parameters. -#define INIT_WARGV(ARGC, ARGV) \ - int wargc; \ - const W_CHAR** const wargv = \ - (const W_CHAR**)CommandLineToArgvW(GetCommandLineW(), &wargc); \ - do { \ - if (wargv == NULL || wargc != (ARGC)) { \ - fprintf(stderr, "Error: Unable to get Unicode arguments.\n"); \ - FREE_WARGV_AND_RETURN(-1); \ - } \ +#define INIT_WARGV(ARGC, ARGV) \ + int wargc; \ + const W_CHAR** const wargv = \ + (const W_CHAR**)CommandLineToArgvW(GetCommandLineW(), &wargc); \ + do { \ + if (wargv == NULL || wargc != (ARGC)) { \ + fprintf(stderr, "Error: Unable to get Unicode arguments.\n"); \ + FREE_WARGV_AND_RETURN(-1); \ + } \ } while (0) // Use this to get a Unicode argument (e.g. file path). diff --git a/examples/unicode_gif.h b/examples/unicode_gif.h index 626c6e72..f836d0a8 100644 --- a/examples/unicode_gif.h +++ b/examples/unicode_gif.h @@ -28,6 +28,7 @@ #include #include + #include "./gifdec.h" #if !defined(STDIN_FILENO) diff --git a/examples/vwebp.c b/examples/vwebp.c index 89e8d8c1..afa52472 100644 --- a/examples/vwebp.c +++ b/examples/vwebp.c @@ -38,12 +38,11 @@ #include #endif -#include "webp/decode.h" -#include "webp/demux.h" - #include "../examples/example_util.h" #include "../imageio/imageio_util.h" #include "./unicode.h" +#include "webp/decode.h" +#include "webp/demux.h" #if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf _snprintf @@ -135,9 +134,8 @@ static int ApplyColorProfile(const WebPData* const profile, } qcms_profile_precache_output_transform(output_profile); - transform = qcms_transform_create(input_profile, input_type, - output_profile, output_type, - intent); + transform = qcms_transform_create(input_profile, input_type, output_profile, + output_type, intent); if (transform == NULL) { fprintf(stderr, "Error creating color transform!\n"); goto Error; @@ -149,7 +147,7 @@ static int ApplyColorProfile(const WebPData* const profile, } ok = 1; - Error: +Error: if (input_profile != NULL) qcms_profile_release(input_profile); if (output_profile != NULL) qcms_profile_release(output_profile); if (transform != NULL) qcms_transform_release(transform); @@ -164,7 +162,7 @@ static int ApplyColorProfile(const WebPData* const profile, //------------------------------------------------------------------------------ // File decoding -static int Decode(void) { // Fills kParams.curr_frame +static int Decode(void) { // Fills kParams.curr_frame const WebPIterator* const curr = &kParams.curr_frame; WebPDecoderConfig* const config = &kParams.config; WebPDecBuffer* const output_buffer = &config->output; @@ -172,8 +170,8 @@ static int Decode(void) { // Fills kParams.curr_frame ClearPreviousPic(); output_buffer->colorspace = MODE_RGBA; - ok = (WebPDecode(curr->fragment.bytes, curr->fragment.size, - config) == VP8_STATUS_OK); + ok = (WebPDecode(curr->fragment.bytes, curr->fragment.size, config) == + VP8_STATUS_OK); if (!ok) { fprintf(stderr, "Decoding of frame #%d failed!\n", curr->frame_num); } else { @@ -341,8 +339,7 @@ static void DrawBackground(void) { glPushMatrix(); glLoadIdentity(); glColor4f(GetColorf(kParams.bg_color, 16), // BGRA from spec - GetColorf(kParams.bg_color, 8), - GetColorf(kParams.bg_color, 0), + GetColorf(kParams.bg_color, 8), GetColorf(kParams.bg_color, 0), GetColorf(kParams.bg_color, 24)); glRecti(-1, -1, +1, +1); glPopMatrix(); @@ -402,8 +399,7 @@ static void HandleDisplay(void) { *prev = *curr; - glDrawPixels(pic->width, pic->height, - GL_RGBA, GL_UNSIGNED_BYTE, + glDrawPixels(pic->width, pic->height, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*)pic->u.RGBA.rgba); if (kParams.print_info) { char tmp[32]; @@ -417,8 +413,8 @@ static void HandleDisplay(void) { glRasterPos2f(-0.95f, 0.80f); PrintString(tmp); if (curr->x_offset != 0 || curr->y_offset != 0) { - snprintf(tmp, sizeof(tmp), " (offset:%d,%d)", - curr->x_offset, curr->y_offset); + snprintf(tmp, sizeof(tmp), " (offset:%d,%d)", curr->x_offset, + curr->y_offset); glRasterPos2f(-0.95f, 0.70f); PrintString(tmp); } @@ -571,8 +567,8 @@ int main(int argc, char* argv[]) { FREE_WARGV_AND_RETURN(EXIT_FAILURE); } - if (!ImgIoUtilReadFile(kParams.file_name, - &kParams.data.bytes, &kParams.data.size)) { + if (!ImgIoUtilReadFile(kParams.file_name, &kParams.data.bytes, + &kParams.data.size)) { goto Error; } @@ -603,7 +599,8 @@ int main(int argc, char* argv[]) { if (!WebPDemuxGetChunk(kParams.dmux, "ICCP", 1, &kParams.iccp)) goto Error; printf("VP8X: Found color profile\n"); #else - fprintf(stderr, "Warning: color profile present, but qcms is unavailable!\n" + fprintf(stderr, + "Warning: color profile present, but qcms is unavailable!\n" "Build libqcms from Mozilla or Chromium and define WEBP_HAVE_QCMS " "before building.\n"); #endif @@ -614,8 +611,8 @@ int main(int argc, char* argv[]) { kParams.has_animation = (curr->num_frames > 1); kParams.loop_count = (int)WebPDemuxGetI(kParams.dmux, WEBP_FF_LOOP_COUNT); kParams.bg_color = WebPDemuxGetI(kParams.dmux, WEBP_FF_BACKGROUND_COLOR); - printf("VP8X: Found %d images in file (loop count = %d)\n", - curr->num_frames, kParams.loop_count); + printf("VP8X: Found %d images in file (loop count = %d)\n", curr->num_frames, + kParams.loop_count); // Decode first frame if (!Decode()) goto Error; @@ -645,12 +642,12 @@ int main(int argc, char* argv[]) { ClearParams(); FREE_WARGV_AND_RETURN(EXIT_SUCCESS); - Error: +Error: ClearParams(); FREE_WARGV_AND_RETURN(EXIT_FAILURE); } -#else // !WEBP_HAVE_GL +#else // !WEBP_HAVE_GL int main(int argc, const char* argv[]) { fprintf(stderr, "OpenGL support not enabled in %s.\n", argv[0]); diff --git a/examples/webpinfo.c b/examples/webpinfo.c index 01052443..ebe30d19 100644 --- a/examples/webpinfo.c +++ b/examples/webpinfo.c @@ -47,25 +47,13 @@ ++webp_info->num_warnings; \ } while (0) -static const char* const kFormats[3] = { - "Unknown", - "Lossy", - "Lossless" -}; +static const char* const kFormats[3] = {"Unknown", "Lossy", "Lossless"}; static const char* const kLosslessTransforms[4] = { - "Predictor", - "Cross Color", - "Subtract Green", - "Color Indexing" -}; + "Predictor", "Cross Color", "Subtract Green", "Color Indexing"}; -static const char* const kAlphaFilterMethods[4] = { - "None", - "Horizontal", - "Vertical", - "Gradient" -}; +static const char* const kAlphaFilterMethods[4] = {"None", "Horizontal", + "Vertical", "Gradient"}; typedef enum { WEBP_INFO_OK = 0, @@ -129,15 +117,15 @@ static void WebPInfoInit(WebPInfo* const webp_info) { } static const uint32_t kWebPChunkTags[CHUNK_TYPES] = { - MKFOURCC('V', 'P', '8', ' '), - MKFOURCC('V', 'P', '8', 'L'), - MKFOURCC('V', 'P', '8', 'X'), - MKFOURCC('A', 'L', 'P', 'H'), - MKFOURCC('A', 'N', 'I', 'M'), - MKFOURCC('A', 'N', 'M', 'F'), - MKFOURCC('I', 'C', 'C', 'P'), - MKFOURCC('E', 'X', 'I', 'F'), - MKFOURCC('X', 'M', 'P', ' '), + MKFOURCC('V', 'P', '8', ' '), // + MKFOURCC('V', 'P', '8', 'L'), // + MKFOURCC('V', 'P', '8', 'X'), // + MKFOURCC('A', 'L', 'P', 'H'), // + MKFOURCC('A', 'N', 'I', 'M'), // + MKFOURCC('A', 'N', 'M', 'F'), // + MKFOURCC('I', 'C', 'C', 'P'), // + MKFOURCC('E', 'X', 'I', 'F'), // + MKFOURCC('X', 'M', 'P', ' '), // }; // ----------------------------------------------------------------------------- @@ -200,9 +188,7 @@ static const uint8_t* GetBuffer(MemBuffer* const mem) { return mem->buf + mem->start; } -static void Skip(MemBuffer* const mem, size_t size) { - mem->start += size; -} +static void Skip(MemBuffer* const mem, size_t size) { mem->start += size; } static uint32_t ReadMemBufLE32(MemBuffer* const mem) { const uint8_t* const data = mem->buf + mem->start; @@ -266,9 +252,10 @@ static WebPInfoStatus ParseLossySegmentHeader(const WebPInfo* const webp_info, int update_map, update_data; GET_BITS(update_map, 1); GET_BITS(update_data, 1); - printf(" Update map: %d\n" - " Update data: %d\n", - update_map, update_data); + printf( + " Update map: %d\n" + " Update data: %d\n", + update_map, update_data); if (update_data) { int i, a_delta; int quantizer[4] = {0, 0, 0, 0}; @@ -298,8 +285,8 @@ static WebPInfoStatus ParseLossySegmentHeader(const WebPInfo* const webp_info, GET_BITS(bit, 1); if (bit) GET_BITS(prob_segment[i], 8); } - printf(" Prob segment: %d %d %d\n", - prob_segment[0], prob_segment[1], prob_segment[2]); + printf(" Prob segment: %d %d %d\n", prob_segment[0], prob_segment[1], + prob_segment[2]); } } return WEBP_INFO_OK; @@ -371,12 +358,13 @@ static WebPInfoStatus ParseLossyHeader(const ChunkData* const chunk_data, LOG_ERROR("Invalid lossy bitstream signature."); return WEBP_INFO_BITSTREAM_ERROR; } - printf(" Width: %d\n" - " X scale: %d\n" - " Height: %d\n" - " Y scale: %d\n", - ((data[4] << 8) | data[3]) & 0x3fff, data[4] >> 6, - ((data[6] << 8) | data[5]) & 0x3fff, data[6] >> 6); + printf( + " Width: %d\n" + " X scale: %d\n" + " Height: %d\n" + " Y scale: %d\n", + ((data[4] << 8) | data[3]) & 0x3fff, data[4] >> 6, + ((data[6] << 8) | data[5]) & 0x3fff, data[6] >> 6); data += 7; data_size -= 7; } else { @@ -479,7 +467,7 @@ static int LLGetBits(const uint8_t* const data, size_t data_size, size_t nb, static WebPInfoStatus ParseLosslessTransform(WebPInfo* const webp_info, const uint8_t* const data, size_t data_size, - uint64_t* const bit_pos) { + uint64_t* const bit_pos) { int use_transform, block_size, n_colors; LL_GET_BITS(use_transform, 1); printf(" Use transform: %s\n", use_transform ? "Yes" : "No"); @@ -499,7 +487,8 @@ static WebPInfoStatus ParseLosslessTransform(WebPInfo* const webp_info, n_colors += 1; printf(" No. of colors: %d\n", n_colors); break; - default: break; + default: + break; } } return WEBP_INFO_OK; @@ -556,8 +545,8 @@ static WebPInfoStatus ParseAlphaHeader(const ChunkData* const chunk_data, const int pre_processing = (data[0] >> 4) & 0x03; const int reserved_bits = (data[0] >> 6) & 0x03; printf(" Compression: %d\n", compression_method); - printf(" Filter: %s (%d)\n", - kAlphaFilterMethods[filter], filter); + printf(" Filter: %s (%d)\n", kAlphaFilterMethods[filter], + filter); printf(" Pre-processing: %d\n", pre_processing); if (compression_method > ALPHA_LOSSLESS_COMPRESSION) { LOG_ERROR("Invalid Alpha compression method."); @@ -642,7 +631,7 @@ static WebPInfoStatus ParseChunk(const WebPInfo* const webp_info, LOG_ERROR("Size of chunk payload is over limit."); return WEBP_INFO_INVALID_PARAM; } - if (payload_size_padded > MemDataSize(mem)){ + if (payload_size_padded > MemDataSize(mem)) { LOG_ERROR("Truncated data detected when parsing chunk payload."); return WEBP_INFO_TRUNCATED_DATA; } @@ -695,8 +684,8 @@ static WebPInfoStatus ProcessVP8XChunk(const ChunkData* const chunk_data, (webp_info->feature_flags & EXIF_FLAG) != 0, (webp_info->feature_flags & XMP_FLAG) != 0, (webp_info->feature_flags & ANIMATION_FLAG) != 0); - printf(" Canvas size %d x %d\n", - webp_info->canvas_width, webp_info->canvas_height); + printf(" Canvas size %d x %d\n", webp_info->canvas_width, + webp_info->canvas_height); } if (webp_info->canvas_width > MAX_CANVAS_SIZE) { LOG_WARN("Canvas width is out of range in VP8X chunk."); @@ -727,10 +716,8 @@ static WebPInfoStatus ProcessANIMChunk(const ChunkData* const chunk_data, ++webp_info->chunk_counts[CHUNK_ANIM]; if (!webp_info->quiet) { printf(" Background color:(ARGB) %02x %02x %02x %02x\n", - (webp_info->bgcolor >> 24) & 0xff, - (webp_info->bgcolor >> 16) & 0xff, - (webp_info->bgcolor >> 8) & 0xff, - webp_info->bgcolor & 0xff); + (webp_info->bgcolor >> 24) & 0xff, (webp_info->bgcolor >> 16) & 0xff, + (webp_info->bgcolor >> 8) & 0xff, webp_info->bgcolor & 0xff); printf(" Loop count : %d\n", webp_info->loop_count); } if (webp_info->loop_count > MAX_LOOP_COUNT) { @@ -765,9 +752,10 @@ static WebPInfoStatus ProcessANMFChunk(const ChunkData* const chunk_data, blend = (temp >> 1) & 1; ++webp_info->chunk_counts[CHUNK_ANMF]; if (!webp_info->quiet) { - printf(" Offset_X: %d\n Offset_Y: %d\n Width: %d\n Height: %d\n" - " Duration: %d\n Dispose: %d\n Blend: %d\n", - offset_x, offset_y, width, height, duration, dispose, blend); + printf( + " Offset_X: %d\n Offset_Y: %d\n Width: %d\n Height: %d\n" + " Duration: %d\n Dispose: %d\n Blend: %d\n", + offset_x, offset_y, width, height, duration, dispose, blend); } if (duration > MAX_DURATION) { LOG_ERROR("Invalid duration parameter in ANMF chunk."); @@ -804,10 +792,11 @@ static WebPInfoStatus ProcessImageChunk(const ChunkData* const chunk_data, } if (!webp_info->quiet) { assert(features.format >= 0 && features.format <= 2); - printf(" Width: %d\n Height: %d\n Alpha: %d\n Animation: %d\n" - " Format: %s (%d)\n", - features.width, features.height, features.has_alpha, - features.has_animation, kFormats[features.format], features.format); + printf( + " Width: %d\n Height: %d\n Alpha: %d\n Animation: %d\n" + " Format: %s (%d)\n", + features.width, features.height, features.has_alpha, + features.has_animation, kFormats[features.format], features.format); } if (webp_info->is_processing_anim_frame) { ++webp_info->anmf_subchunk_counts[chunk_data->id == CHUNK_VP8 ? 0 : 1]; @@ -831,8 +820,7 @@ static WebPInfoStatus ProcessImageChunk(const ChunkData* const chunk_data, LOG_ERROR("Multiple VP8/VP8L chunks detected."); return WEBP_INFO_PARSE_ERROR; } - if (chunk_data->id == CHUNK_VP8L && - webp_info->chunk_counts[CHUNK_ALPHA]) { + if (chunk_data->id == CHUNK_VP8L && webp_info->chunk_counts[CHUNK_ALPHA]) { LOG_WARN("Both VP8L and ALPH chunks are detected."); } if (webp_info->chunk_counts[CHUNK_ANIM] || @@ -882,8 +870,9 @@ static WebPInfoStatus ProcessALPHChunk(const ChunkData* const chunk_data, webp_info->seen_alpha_subchunk = 1; if (webp_info->seen_image_subchunk) { - LOG_ERROR("ALPHA sub-chunk detected after VP8 sub-chunk " - "in an ANMF chunk."); + LOG_ERROR( + "ALPHA sub-chunk detected after VP8 sub-chunk " + "in an ANMF chunk."); return WEBP_INFO_PARSE_ERROR; } } else { @@ -938,7 +927,7 @@ static WebPInfoStatus ProcessChunk(const ChunkData* const chunk_data, if (chunk_data->id == CHUNK_UNKNOWN) { char error_message[50]; snprintf(error_message, 50, "Unknown chunk at offset %6d, length %6d", - (int)chunk_data->offset, (int)chunk_data->size); + (int)chunk_data->offset, (int)chunk_data->size); LOG_WARN(error_message); } else { if (!webp_info->quiet) { @@ -949,9 +938,8 @@ static WebPInfoStatus ProcessChunk(const ChunkData* const chunk_data, ((fourcc << 8) & 0xff0000) | (fourcc << 24); #endif memcpy(tag, &fourcc, sizeof(tag)); - printf("Chunk %c%c%c%c at offset %6d, length %6d\n", - tag[0], tag[1], tag[2], tag[3], (int)chunk_data->offset, - (int)chunk_data->size); + printf("Chunk %c%c%c%c at offset %6d, length %6d\n", tag[0], tag[1], + tag[2], tag[3], (int)chunk_data->offset, (int)chunk_data->size); } } switch (id) { @@ -1048,7 +1036,7 @@ static WebPInfoStatus Validate(WebPInfo* const webp_info) { return WEBP_INFO_PARSE_ERROR; } if (animation && (!webp_info->chunk_counts[CHUNK_ANIM] || - !webp_info->chunk_counts[CHUNK_ANMF])) { + !webp_info->chunk_counts[CHUNK_ANMF])) { LOG_ERROR("No ANIM/ANMF chunk detected in animation file."); return WEBP_INFO_PARSE_ERROR; } @@ -1060,14 +1048,14 @@ static void ShowSummary(const WebPInfo* const webp_info) { int i; printf("Summary:\n"); printf("Number of frames: %d\n", webp_info->num_frames); - printf("Chunk type : VP8 VP8L VP8X ALPH ANIM ANMF(VP8 /VP8L/ALPH) ICCP " + printf( + "Chunk type : VP8 VP8L VP8X ALPH ANIM ANMF(VP8 /VP8L/ALPH) ICCP " "EXIF XMP\n"); printf("Chunk counts: "); for (i = 0; i < CHUNK_TYPES; ++i) { printf("%4d ", webp_info->chunk_counts[i]); if (i == CHUNK_ANMF) { - printf("%4d %4d %4d ", - webp_info->anmf_subchunk_counts[0], + printf("%4d %4d %4d ", webp_info->anmf_subchunk_counts[0], webp_info->anmf_subchunk_counts[1], webp_info->anmf_subchunk_counts[2]); } @@ -1097,7 +1085,7 @@ static WebPInfoStatus AnalyzeWebP(WebPInfo* const webp_info, // Final check. webp_info_status = Validate(webp_info); - Error: +Error: if (!webp_info->quiet) { if (webp_info_status == WEBP_INFO_OK) { printf("No error detected.\n"); @@ -1112,15 +1100,16 @@ static WebPInfoStatus AnalyzeWebP(WebPInfo* const webp_info, } static void Help(void) { - printf("Usage: webpinfo [options] in_files\n" - "Note: there could be multiple input files;\n" - " options must come before input files.\n" - "Options:\n" - " -version ........... Print version number and exit.\n" - " -quiet ............. Do not show chunk parsing information.\n" - " -diag .............. Show parsing error diagnosis.\n" - " -summary ........... Show chunk stats summary.\n" - " -bitstream_info .... Parse bitstream header.\n"); + printf( + "Usage: webpinfo [options] in_files\n" + "Note: there could be multiple input files;\n" + " options must come before input files.\n" + "Options:\n" + " -version ........... Print version number and exit.\n" + " -quiet ............. Do not show chunk parsing information.\n" + " -diag .............. Show parsing error diagnosis.\n" + " -summary ........... Show chunk stats summary.\n" + " -bitstream_info .... Parse bitstream header.\n"); } // Returns EXIT_SUCCESS on success, EXIT_FAILURE on failure. @@ -1153,8 +1142,8 @@ int main(int argc, const char* argv[]) { parse_bitstream = 1; } else if (!strcmp(argv[c], "-version")) { const int version = WebPGetDecoderVersion(); - printf("WebP Decoder version: %d.%d.%d\n", - (version >> 16) & 0xff, (version >> 8) & 0xff, version & 0xff); + printf("WebP Decoder version: %d.%d.%d\n", (version >> 16) & 0xff, + (version >> 8) & 0xff, version & 0xff); FREE_WARGV_AND_RETURN(EXIT_SUCCESS); } else { // Assume the remaining are all input files. break; diff --git a/examples/webpmux.c b/examples/webpmux.c index be9da672..2471206b 100644 --- a/examples/webpmux.c +++ b/examples/webpmux.c @@ -106,14 +106,11 @@ typedef enum { LAST_FEATURE } FeatureType; -static const char* const kFourccList[LAST_FEATURE] = { - NULL, "EXIF", "XMP ", "ICCP", "ANMF" -}; +static const char* const kFourccList[LAST_FEATURE] = {NULL, "EXIF", "XMP ", + "ICCP", "ANMF"}; static const char* const kDescriptions[LAST_FEATURE] = { - NULL, "EXIF metadata", "XMP metadata", "ICC profile", - "Animation frame" -}; + NULL, "EXIF metadata", "XMP metadata", "ICC profile", "Animation frame"}; typedef struct { CommandLineArguments cmd_args; @@ -143,50 +140,49 @@ static int CountOccurrences(const CommandLineArguments* const args, } static const char* const kErrorMessages[-WEBP_MUX_NOT_ENOUGH_DATA + 1] = { - "WEBP_MUX_NOT_FOUND", "WEBP_MUX_INVALID_ARGUMENT", "WEBP_MUX_BAD_DATA", - "WEBP_MUX_MEMORY_ERROR", "WEBP_MUX_NOT_ENOUGH_DATA" -}; + "WEBP_MUX_NOT_FOUND", "WEBP_MUX_INVALID_ARGUMENT", "WEBP_MUX_BAD_DATA", + "WEBP_MUX_MEMORY_ERROR", "WEBP_MUX_NOT_ENOUGH_DATA"}; static const char* ErrorString(WebPMuxError err) { assert(err <= WEBP_MUX_NOT_FOUND && err >= WEBP_MUX_NOT_ENOUGH_DATA); return kErrorMessages[-err]; } -#define RETURN_IF_ERROR(ERR_MSG) \ - do { \ - if (err != WEBP_MUX_OK) { \ - fprintf(stderr, ERR_MSG); \ - return err; \ - } \ +#define RETURN_IF_ERROR(ERR_MSG) \ + do { \ + if (err != WEBP_MUX_OK) { \ + fprintf(stderr, ERR_MSG); \ + return err; \ + } \ } while (0) -#define RETURN_IF_ERROR3(ERR_MSG, FORMAT_STR1, FORMAT_STR2) \ - do { \ - if (err != WEBP_MUX_OK) { \ - fprintf(stderr, ERR_MSG, FORMAT_STR1, FORMAT_STR2); \ - return err; \ - } \ +#define RETURN_IF_ERROR3(ERR_MSG, FORMAT_STR1, FORMAT_STR2) \ + do { \ + if (err != WEBP_MUX_OK) { \ + fprintf(stderr, ERR_MSG, FORMAT_STR1, FORMAT_STR2); \ + return err; \ + } \ } while (0) -#define ERROR_GOTO1(ERR_MSG, LABEL) \ - do { \ - fprintf(stderr, ERR_MSG); \ - ok = 0; \ - goto LABEL; \ +#define ERROR_GOTO1(ERR_MSG, LABEL) \ + do { \ + fprintf(stderr, ERR_MSG); \ + ok = 0; \ + goto LABEL; \ } while (0) -#define ERROR_GOTO2(ERR_MSG, FORMAT_STR, LABEL) \ - do { \ - fprintf(stderr, ERR_MSG, FORMAT_STR); \ - ok = 0; \ - goto LABEL; \ +#define ERROR_GOTO2(ERR_MSG, FORMAT_STR, LABEL) \ + do { \ + fprintf(stderr, ERR_MSG, FORMAT_STR); \ + ok = 0; \ + goto LABEL; \ } while (0) -#define ERROR_GOTO3(ERR_MSG, FORMAT_STR1, FORMAT_STR2, LABEL) \ - do { \ - fprintf(stderr, ERR_MSG, FORMAT_STR1, FORMAT_STR2); \ - ok = 0; \ - goto LABEL; \ +#define ERROR_GOTO3(ERR_MSG, FORMAT_STR1, FORMAT_STR2, LABEL) \ + do { \ + fprintf(stderr, ERR_MSG, FORMAT_STR1, FORMAT_STR2); \ + ok = 0; \ + goto LABEL; \ } while (0) static WebPMuxError DisplayInfo(const WebPMux* mux) { @@ -208,10 +204,10 @@ static WebPMuxError DisplayInfo(const WebPMux* mux) { // Print the features present. printf("Features present:"); if (flag & ANIMATION_FLAG) printf(" animation"); - if (flag & ICCP_FLAG) printf(" ICC profile"); - if (flag & EXIF_FLAG) printf(" EXIF metadata"); - if (flag & XMP_FLAG) printf(" XMP metadata"); - if (flag & ALPHA_FLAG) printf(" transparency"); + if (flag & ICCP_FLAG) printf(" ICC profile"); + if (flag & EXIF_FLAG) printf(" EXIF metadata"); + if (flag & XMP_FLAG) printf(" XMP metadata"); + if (flag & ALPHA_FLAG) printf(" transparency"); printf("\n"); if (flag & ANIMATION_FLAG) { @@ -222,8 +218,8 @@ static WebPMuxError DisplayInfo(const WebPMux* mux) { WebPMuxAnimParams params; err = WebPMuxGetAnimationParams(mux, ¶ms); assert(err == WEBP_MUX_OK); - printf("Background color : 0x%.8X Loop Count : %d\n", - params.bgcolor, params.loop_count); + printf("Background color : 0x%.8X Loop Count : %d\n", params.bgcolor, + params.loop_count); err = WebPMuxNumChunks(mux, id, &nFrames); assert(err == WEBP_MUX_OK); @@ -255,9 +251,9 @@ static WebPMuxError DisplayInfo(const WebPMux* mux) { printf("%8d %10s %5s ", frame.duration, dispose, blend); } printf("%10d %11s\n", (int)frame.bitstream.size, - (features.format == 1) ? "lossy" : - (features.format == 2) ? "lossless" : - "undefined"); + (features.format == 1) ? "lossy" + : (features.format == 2) ? "lossless" + : "undefined"); } WebPDataClear(&frame.bitstream); RETURN_IF_ERROR3("Failed to retrieve %s#%d\n", type_str, i); @@ -305,8 +301,9 @@ static void PrintHelp(void) { printf(" webpmux -duration DURATION_OPTIONS [-duration ...]\n"); printf(" INPUT -o OUTPUT\n"); printf(" webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT\n"); - printf(" webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT]" - "\n"); + printf( + " webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT]" + "\n"); printf(" [-bgcolor BACKGROUND_COLOR] -o OUTPUT\n"); printf(" webpmux -info INPUT\n"); printf(" webpmux [-h|-help]\n"); @@ -360,8 +357,9 @@ static void PrintHelp(void) { printf(" 'di' is the pause duration before next frame,\n"); printf(" 'xi','yi' specify the image offset for this frame,\n"); printf(" 'mi' is the dispose method for this frame (0 or 1),\n"); - printf(" 'bi' is the blending method for this frame (+b or -b)" - "\n"); + printf( + " 'bi' is the blending method for this frame (+b or -b)" + "\n"); printf("\n"); printf("LOOP_COUNT:\n"); @@ -372,27 +370,33 @@ static void PrintHelp(void) { printf("BACKGROUND_COLOR:\n"); printf(" Background color of the canvas.\n"); printf(" A,R,G,B\n"); - printf(" where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 " - "specifying\n"); - printf(" the Alpha, Red, Green and Blue component values " - "respectively\n"); + printf( + " where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 " + "specifying\n"); + printf( + " the Alpha, Red, Green and Blue component values " + "respectively\n"); printf(" [Default: 255,255,255,255]\n"); printf("\nINPUT & OUTPUT are in WebP format.\n"); printf("\nNote: The nature of EXIF, XMP and ICC data is not checked"); printf(" and is assumed to be\nvalid.\n"); - printf("\nNote: if a single file name is passed as the argument, the " - "arguments will be\n"); - printf("tokenized from this file. The file name must not start with " - "the character '-'.\n"); + printf( + "\nNote: if a single file name is passed as the argument, the " + "arguments will be\n"); + printf( + "tokenized from this file. The file name must not start with " + "the character '-'.\n"); } static void WarnAboutOddOffset(const WebPMuxFrameInfo* const info) { if ((info->x_offset | info->y_offset) & 1) { - fprintf(stderr, "Warning: odd offsets will be snapped to even values" - " (%d, %d) -> (%d, %d)\n", info->x_offset, info->y_offset, - info->x_offset & ~1, info->y_offset & ~1); + fprintf(stderr, + "Warning: odd offsets will be snapped to even values" + " (%d, %d) -> (%d, %d)\n", + info->x_offset, info->y_offset, info->x_offset & ~1, + info->y_offset & ~1); } } @@ -420,8 +424,8 @@ static int WriteData(const char* filename, const WebPData* const webpdata) { if (fwrite(webpdata->bytes, webpdata->size, 1, fout) != 1) { WFPRINTF(stderr, "Error writing file %s!\n", (const W_CHAR*)filename); } else { - WFPRINTF(stderr, "Saved file %s (%d bytes)\n", - (const W_CHAR*)filename, (int)webpdata->size); + WFPRINTF(stderr, "Saved file %s (%d bytes)\n", (const W_CHAR*)filename, + (int)webpdata->size); ok = 1; } if (fout != stdout) fclose(fout); @@ -454,8 +458,8 @@ static WebPMux* DuplicateMuxHeader(const WebPMux* const mux) { if (err == WEBP_MUX_OK) { err = WebPMuxSetAnimationParams(new_mux, &p); if (err != WEBP_MUX_OK) { - ERROR_GOTO2("Error (%s) handling animation params.\n", - ErrorString(err), End); + ERROR_GOTO2("Error (%s) handling animation params.\n", ErrorString(err), + End); } } else { /* it might not be an animation. Just keep moving. */ @@ -473,7 +477,7 @@ static WebPMux* DuplicateMuxHeader(const WebPMux* const mux) { } } - End: +End: if (!ok) { WebPMuxDelete(new_mux); new_mux = NULL; @@ -511,8 +515,7 @@ static int ParseFrameArgs(const char* args, WebPMuxFrameInfo* const info) { if (blend_method != 'b') return 0; if (plus_minus != '-' && plus_minus != '+') return 0; - info->blend_method = - (plus_minus == '+') ? WEBP_MUX_BLEND : WEBP_MUX_NO_BLEND; + info->blend_method = (plus_minus == '+') ? WEBP_MUX_BLEND : WEBP_MUX_NO_BLEND; return 1; } @@ -584,8 +587,10 @@ static int ValidateCommandLine(const CommandLineArguments* const cmd_args, } if ((num_frame_args == 0) && (num_loop_args + num_bgcolor_args > 0)) { - ERROR_GOTO1("ERROR: Loop count and background color are relevant only in " - "case of animation.\n", ErrValidate); + ERROR_GOTO1( + "ERROR: Loop count and background color are relevant only in " + "case of animation.\n", + ErrValidate); } if (num_durations_args > 0 && num_frame_args != 0) { ERROR_GOTO1("ERROR: Can not combine -duration and -frame commands.\n", @@ -603,7 +608,7 @@ static int ValidateCommandLine(const CommandLineArguments* const cmd_args, *num_feature_args = num_frame_args + num_loop_args + num_bgcolor_args; } - ErrValidate: +ErrValidate: return ok; } @@ -611,12 +616,12 @@ static int ValidateCommandLine(const CommandLineArguments* const cmd_args, #define FEATURETYPE_IS_NIL (config->type == NIL_FEATURE) -#define CHECK_NUM_ARGS_AT_LEAST(NUM, LABEL) \ - do { \ - if (argc < i + (NUM)) { \ - fprintf(stderr, "ERROR: Too few arguments for '%s'.\n", argv[i]); \ - goto LABEL; \ - } \ +#define CHECK_NUM_ARGS_AT_LEAST(NUM, LABEL) \ + do { \ + if (argc < i + (NUM)) { \ + fprintf(stderr, "ERROR: Too few arguments for '%s'.\n", argv[i]); \ + goto LABEL; \ + } \ } while (0) #define CHECK_NUM_ARGS_AT_MOST(NUM, LABEL) \ @@ -627,10 +632,10 @@ static int ValidateCommandLine(const CommandLineArguments* const cmd_args, } \ } while (0) -#define CHECK_NUM_ARGS_EXACTLY(NUM, LABEL) \ - do { \ - CHECK_NUM_ARGS_AT_LEAST(NUM, LABEL); \ - CHECK_NUM_ARGS_AT_MOST(NUM, LABEL); \ +#define CHECK_NUM_ARGS_EXACTLY(NUM, LABEL) \ + do { \ + CHECK_NUM_ARGS_AT_LEAST(NUM, LABEL); \ + CHECK_NUM_ARGS_AT_MOST(NUM, LABEL); \ } while (0) // Parses command-line arguments to fill up config object. Also performs some @@ -739,8 +744,8 @@ static int ParseCommandLine(Config* config, const W_CHAR** const unicode_argv) { exit(0); } else if (!strcmp(argv[i], "-version")) { const int version = WebPGetMuxVersion(); - printf("%d.%d.%d\n", - (version >> 16) & 0xff, (version >> 8) & 0xff, version & 0xff); + printf("%d.%d.%d\n", (version >> 16) & 0xff, (version >> 8) & 0xff, + version & 0xff); DeleteConfig(config); LOCAL_FREE((W_CHAR**)unicode_argv); exit(0); @@ -771,8 +776,9 @@ static int ParseCommandLine(Config* config, const W_CHAR** const unicode_argv) { if (!strcmp(argv[i], "icc") || !strcmp(argv[i], "exif") || !strcmp(argv[i], "xmp")) { if (FEATURETYPE_IS_NIL) { - config->type = (!strcmp(argv[i], "icc")) ? FEATURE_ICCP : - (!strcmp(argv[i], "exif")) ? FEATURE_EXIF : FEATURE_XMP; + config->type = (!strcmp(argv[i], "icc")) ? FEATURE_ICCP + : (!strcmp(argv[i], "exif")) ? FEATURE_EXIF + : FEATURE_XMP; } else { ERROR_GOTO1("ERROR: Multiple features specified.\n", ErrParse); } @@ -826,7 +832,7 @@ static int ParseCommandLine(Config* config, const W_CHAR** const unicode_argv) { } } } - ErrParse: +ErrParse: return ok; } @@ -858,7 +864,7 @@ static int ValidateConfig(Config* const config) { ERROR_GOTO1("ERROR: No output file specified.\n", ErrValidate2); } - ErrValidate2: +ErrValidate2: return ok; } @@ -889,7 +895,7 @@ static int InitializeConfig(int argc, const char* argv[], Config* const config, ERROR_GOTO1("Exiting due to command-line parsing error.\n", Err1); } - Err1: +Err1: return ok; } @@ -921,8 +927,8 @@ static int GetFrame(const WebPMux* mux, const Config* config) { err = WebPMuxGetFrame(mux, num, &info); if (err == WEBP_MUX_OK && info.id != id) err = WEBP_MUX_NOT_FOUND; if (err != WEBP_MUX_OK) { - ERROR_GOTO3("ERROR (%s): Could not get frame %d.\n", - ErrorString(err), num, ErrGet); + ERROR_GOTO3("ERROR (%s): Could not get frame %d.\n", ErrorString(err), num, + ErrGet); } mux_single = WebPMuxNew(); @@ -939,7 +945,7 @@ static int GetFrame(const WebPMux* mux, const Config* config) { ok = WriteWebP(mux_single, config->output); - ErrGet: +ErrGet: WebPDataClear(&info.bitstream); WebPMuxDelete(mux_single); return ok && !parse_error; @@ -966,8 +972,8 @@ static int Process(const Config* config) { case FEATURE_XMP: err = WebPMuxGetChunk(mux, kFourccList[config->type], &chunk); if (err != WEBP_MUX_OK) { - ERROR_GOTO3("ERROR (%s): Could not get the %s.\n", - ErrorString(err), kDescriptions[config->type], Err2); + ERROR_GOTO3("ERROR (%s): Could not get the %s.\n", ErrorString(err), + kDescriptions[config->type], Err2); } ok = WriteData(config->output, &chunk); break; @@ -982,7 +988,7 @@ static int Process(const Config* config) { switch (config->type) { case FEATURE_ANMF: { int i; - WebPMuxAnimParams params = { 0xFFFFFFFF, 0 }; + WebPMuxAnimParams params = {0xFFFFFFFF, 0}; mux = WebPMuxNew(); if (mux == NULL) { ERROR_GOTO2("ERROR (%s): Could not allocate a mux object.\n", @@ -1008,8 +1014,10 @@ static int Process(const Config* config) { // Note: This is only a 'necessary' condition for loop_count // to be valid. The 'sufficient' conditioned in checked in // WebPMuxSetAnimationParams() method called later. - ERROR_GOTO1("ERROR: Loop count must be in the range 0 to " - "65535.\n", Err2); + ERROR_GOTO1( + "ERROR: Loop count must be in the range 0 to " + "65535.\n", + Err2); } ok = !parse_error; if (!ok) goto Err2; @@ -1031,8 +1039,10 @@ static int Process(const Config* config) { err = WebPMuxPushFrame(mux, &frame, 1); WebPDataClear(&frame.bitstream); if (err != WEBP_MUX_OK) { - ERROR_GOTO3("ERROR (%s): Could not add a frame at index %d." - "\n", ErrorString(err), i, Err2); + ERROR_GOTO3( + "ERROR (%s): Could not add a frame at index %d." + "\n", + ErrorString(err), i, Err2); } break; } @@ -1060,13 +1070,13 @@ static int Process(const Config* config) { err = WebPMuxSetChunk(mux, kFourccList[config->type], &chunk, 1); WebPDataClear(&chunk); if (err != WEBP_MUX_OK) { - ERROR_GOTO3("ERROR (%s): Could not set the %s.\n", - ErrorString(err), kDescriptions[config->type], Err2); + ERROR_GOTO3("ERROR (%s): Could not set the %s.\n", ErrorString(err), + kDescriptions[config->type], Err2); } break; } case FEATURE_LOOP: { - WebPMuxAnimParams params = { 0xFFFFFFFF, 0 }; + WebPMuxAnimParams params = {0xFFFFFFFF, 0}; int parse_error = 0; const int loop_count = ExUtilGetInt(config->args[0].params, 10, &parse_error); @@ -1091,12 +1101,11 @@ static int Process(const Config* config) { break; } case FEATURE_BGCOLOR: { - WebPMuxAnimParams params = { 0xFFFFFFFF, 0 }; + WebPMuxAnimParams params = {0xFFFFFFFF, 0}; uint32_t bgcolor; ok = ParseBgcolorArgs(config->args[0].params, &bgcolor); if (!ok) { - ERROR_GOTO1("ERROR: Could not parse the background color.\n", - Err2); + ERROR_GOTO1("ERROR: Could not parse the background color.\n", Err2); } ok = CreateMux(config->input, &mux); if (!ok) goto Err2; @@ -1132,8 +1141,9 @@ static int Process(const Config* config) { ERROR_GOTO1("ERROR: can not parse the number of frames.\n", Err2); } if (num_frames == 0) { - fprintf(stderr, "Doesn't look like the source is animated. " - "Skipping duration setting.\n"); + fprintf(stderr, + "Doesn't look like the source is animated. " + "Skipping duration setting.\n"); ok = WriteWebP(mux, config->output); if (!ok) goto Err2; } else { @@ -1150,8 +1160,8 @@ static int Process(const Config* config) { int k; int args[3]; int duration, start, end; - const int nb_args = ExUtilGetInts(config->args[i].params, - 10, 3, args); + const int nb_args = + ExUtilGetInts(config->args[i].params, 10, 3, args); ok = (nb_args >= 1); if (!ok) goto Err3; duration = args[0]; @@ -1159,7 +1169,7 @@ static int Process(const Config* config) { ERROR_GOTO1("ERROR: duration must be strictly positive.\n", Err3); } - if (nb_args == 1) { // only duration is present -> use full interval + if (nb_args == 1) { // only duration is present -> use full interval start = 1; end = num_frames; } else { @@ -1198,7 +1208,7 @@ static int Process(const Config* config) { mux = new_mux; // transfer for the WebPMuxDelete() call new_mux = NULL; - Err3: + Err3: WebPFree(durations); WebPMuxDelete(new_mux); if (!ok) goto Err2; @@ -1212,8 +1222,8 @@ static int Process(const Config* config) { config->type == FEATURE_XMP) { err = WebPMuxDeleteChunk(mux, kFourccList[config->type]); if (err != WEBP_MUX_OK) { - ERROR_GOTO3("ERROR (%s): Could not strip the %s.\n", - ErrorString(err), kDescriptions[config->type], Err2); + ERROR_GOTO3("ERROR (%s): Could not strip the %s.\n", ErrorString(err), + kDescriptions[config->type], Err2); } } else { ERROR_GOTO1("ERROR: Invalid feature for action 'strip'.\n", Err2); @@ -1234,7 +1244,7 @@ static int Process(const Config* config) { } } - Err2: +Err2: WebPMuxDelete(mux); return ok; } diff --git a/extras/extras.c b/extras/extras.c index b679a750..73da0110 100644 --- a/extras/extras.c +++ b/extras/extras.c @@ -45,7 +45,7 @@ int WebPImportGray(const uint8_t* gray_data, WebPPicture* pic) { uv_width = (width + 1) >> 1; for (y = 0; y < pic->height; ++y) { memcpy(pic->y + y * pic->y_stride, gray_data, width); - gray_data += width; // <- we could use some 'data_stride' here if needed + gray_data += width; // <- we could use some 'data_stride' here if needed if ((y & 1) == 0) { memset(pic->u + (y >> 1) * pic->uv_stride, 128, uv_width); memset(pic->v + (y >> 1) * pic->uv_stride, 128, uv_width); diff --git a/extras/extras.h b/extras/extras.h index 516b60e6..57597671 100644 --- a/extras/extras.h +++ b/extras/extras.h @@ -22,7 +22,7 @@ extern "C" { #include "sharpyuv/sharpyuv.h" #include "webp/encode.h" -#define WEBP_EXTRAS_ABI_VERSION 0x0003 // MAJOR(8b) + MINOR(8b) +#define WEBP_EXTRAS_ABI_VERSION 0x0003 // MAJOR(8b) + MINOR(8b) //------------------------------------------------------------------------------ @@ -49,10 +49,10 @@ WEBP_EXTERN int WebPImportRGB4444(const uint8_t* rgb4444, WebPPicture* pic); // MAX_PALETTE_SIZE. 'pic' must have been initialized. Its content, if any, // will be discarded. Returns 'false' in case of error, or if indexed[] contains // invalid indices. -WEBP_EXTERN int -WebPImportColorMappedARGB(const uint8_t* indexed, int indexed_stride, - const uint32_t palette[], int palette_size, - WebPPicture* pic); +WEBP_EXTERN int WebPImportColorMappedARGB(const uint8_t* indexed, + int indexed_stride, + const uint32_t palette[], + int palette_size, WebPPicture* pic); // Convert the ARGB content of 'pic' from associated to unassociated. // 'pic' can be for instance the result of calling of some WebPPictureImportXXX @@ -98,15 +98,17 @@ WEBP_EXTERN int VP8EstimateQuality(const uint8_t* const data, size_t size); // currently supported. // width, height: width and height of the image in pixels // Returns 0 on failure. -WEBP_EXTERN int SharpYuvEstimate420Risk( - const void* r_ptr, const void* g_ptr, const void* b_ptr, int rgb_step, - int rgb_stride, int rgb_bit_depth, int width, int height, - const SharpYuvOptions* options, float* score); +WEBP_EXTERN int SharpYuvEstimate420Risk(const void* r_ptr, const void* g_ptr, + const void* b_ptr, int rgb_step, + int rgb_stride, int rgb_bit_depth, + int width, int height, + const SharpYuvOptions* options, + float* score); //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_EXTRAS_EXTRAS_H_ diff --git a/extras/get_disto.c b/extras/get_disto.c index 0fe76f51..12786c2c 100644 --- a/extras/get_disto.c +++ b/extras/get_disto.c @@ -48,7 +48,7 @@ static size_t ReadPicture(const char* const filename, WebPPicture* const pic, reader = WebPGuessImageReader(data, data_size); ok = reader(data, data_size, pic, keep_alpha, NULL); - End: +End: if (!ok) { WFPRINTF(stderr, "Error! Could not process file %s\n", (const W_CHAR*)filename); @@ -57,8 +57,8 @@ static size_t ReadPicture(const char* const filename, WebPPicture* const pic, return ok ? data_size : 0; } -static void RescalePlane(uint8_t* plane, int width, int height, - int x_stride, int y_stride, int max) { +static void RescalePlane(uint8_t* plane, int width, int height, int x_stride, + int y_stride, int max) { const uint32_t factor = (max > 0) ? (255u << 16) / max : 0; int x, y; for (y = 0; y < height; ++y) { @@ -71,9 +71,9 @@ static void RescalePlane(uint8_t* plane, int width, int height, } // Return the max absolute difference. -static int DiffScaleChannel(uint8_t* src1, int stride1, - const uint8_t* src2, int stride2, - int x_stride, int w, int h, int do_scaling) { +static int DiffScaleChannel(uint8_t* src1, int stride1, const uint8_t* src2, + int stride2, int x_stride, int w, int h, + int do_scaling) { int x, y; int max = 0; for (y = 0; y < h; ++y) { @@ -95,7 +95,7 @@ static int DiffScaleChannel(uint8_t* src1, int stride1, // breaking the library's hidden visibility. This code duplication avoids the // bigger annoyance of having to open up internal details of libdsp... -#define SSIM_KERNEL 3 // total size of the kernel: 2 * SSIM_KERNEL + 1 +#define SSIM_KERNEL 3 // total size of the kernel: 2 * SSIM_KERNEL + 1 // struct for accumulating statistical moments typedef struct { @@ -105,19 +105,19 @@ typedef struct { } DistoStats; // hat-shaped filter. Sum of coefficients is equal to 16. -static const uint32_t kWeight[2 * SSIM_KERNEL + 1] = { 1, 2, 3, 4, 3, 2, 1 }; +static const uint32_t kWeight[2 * SSIM_KERNEL + 1] = {1, 2, 3, 4, 3, 2, 1}; static WEBP_INLINE double SSIMCalculation(const DistoStats* const stats) { const uint32_t N = stats->w; - const uint32_t w2 = N * N; + const uint32_t w2 = N * N; const uint32_t C1 = 20 * w2; const uint32_t C2 = 60 * w2; - const uint32_t C3 = 8 * 8 * w2; // 'dark' limit ~= 6 + const uint32_t C3 = 8 * 8 * w2; // 'dark' limit ~= 6 const uint64_t xmxm = (uint64_t)stats->xm * stats->xm; const uint64_t ymym = (uint64_t)stats->ym * stats->ym; if (xmxm + ymym >= C3) { const int64_t xmym = (int64_t)stats->xm * stats->ym; - const int64_t sxy = (int64_t)stats->xym * N - xmym; // can be negative + const int64_t sxy = (int64_t)stats->xym * N - xmym; // can be negative const uint64_t sxx = (uint64_t)stats->xxm * N - xmxm; const uint64_t syy = (uint64_t)stats->yym * N - ymym; // we descale by 8 to prevent overflow during the fnum/fden multiply. @@ -129,13 +129,13 @@ static WEBP_INLINE double SSIMCalculation(const DistoStats* const stats) { assert(r >= 0. && r <= 1.0); return r; } - return 1.; // area is too dark to contribute meaningfully + return 1.; // area is too dark to contribute meaningfully } static double SSIMGetClipped(const uint8_t* src1, int stride1, - const uint8_t* src2, int stride2, - int xo, int yo, int W, int H) { - DistoStats stats = { 0, 0, 0, 0, 0, 0 }; + const uint8_t* src2, int stride2, int xo, int yo, + int W, int H) { + DistoStats stats = {0, 0, 0, 0, 0, 0}; const int ymin = (yo - SSIM_KERNEL < 0) ? 0 : yo - SSIM_KERNEL; const int ymax = (yo + SSIM_KERNEL > H - 1) ? H - 1 : yo + SSIM_KERNEL; const int xmin = (xo - SSIM_KERNEL < 0) ? 0 : xo - SSIM_KERNEL; @@ -145,13 +145,13 @@ static double SSIMGetClipped(const uint8_t* src1, int stride1, src2 += ymin * stride2; for (y = ymin; y <= ymax; ++y, src1 += stride1, src2 += stride2) { for (x = xmin; x <= xmax; ++x) { - const uint32_t w = kWeight[SSIM_KERNEL + x - xo] - * kWeight[SSIM_KERNEL + y - yo]; + const uint32_t w = + kWeight[SSIM_KERNEL + x - xo] * kWeight[SSIM_KERNEL + y - yo]; const uint32_t s1 = src1[x]; const uint32_t s2 = src2[x]; - stats.w += w; - stats.xm += w * s1; - stats.ym += w * s2; + stats.w += w; + stats.xm += w * s1; + stats.ym += w * s2; stats.xxm += w * s1 * s1; stats.xym += w * s1 * s2; stats.yym += w * s2 * s2; @@ -161,9 +161,9 @@ static double SSIMGetClipped(const uint8_t* src1, int stride1, } // Compute SSIM-score map. Return -1 in case of error, max diff otherwise. -static int SSIMScaleChannel(uint8_t* src1, int stride1, - const uint8_t* src2, int stride2, - int x_stride, int w, int h, int do_scaling) { +static int SSIMScaleChannel(uint8_t* src1, int stride1, const uint8_t* src2, + int stride2, int x_stride, int w, int h, + int do_scaling) { int x, y; int max = 0; uint8_t* const plane1 = (uint8_t*)malloc(2 * w * h * sizeof(*plane1)); @@ -205,8 +205,8 @@ static void ConvertToGray(WebPPicture* const pic) { for (x = 0; x < pic->width; ++x) { const uint32_t argb = row[x]; const uint32_t r = (argb >> 16) & 0xff; - const uint32_t g = (argb >> 8) & 0xff; - const uint32_t b = (argb >> 0) & 0xff; + const uint32_t g = (argb >> 8) & 0xff; + const uint32_t b = (argb >> 0) & 0xff; // We use BT.709 for converting to luminance. const uint32_t Y = (uint32_t)(0.2126 * r + 0.7152 * g + 0.0722 * b + .5); row[x] = (argb & 0xff000000u) | (Y * 0x010101u); @@ -297,8 +297,7 @@ int main(int argc, const char* argv[]) { fprintf(stderr, "Error while computing the distortion.\n"); goto End; } - printf("%u %.2f %.2f %.2f %.2f %.2f [ %.2f bpp ]\n", - (unsigned int)size1, + printf("%u %.2f %.2f %.2f %.2f %.2f [ %.2f bpp ]\n", (unsigned int)size1, disto[4], disto[0], disto[1], disto[2], disto[3], 8.f * size1 / pic1.width / pic1.height); @@ -306,21 +305,25 @@ int main(int argc, const char* argv[]) { uint8_t* data = NULL; size_t data_size = 0; if (pic1.use_argb != pic2.use_argb) { - fprintf(stderr, "Pictures are not in the same argb format. " - "Can't save the difference map.\n"); + fprintf(stderr, + "Pictures are not in the same argb format. " + "Can't save the difference map.\n"); goto End; } if (pic1.use_argb) { int n; fprintf(stderr, "max differences per channel: "); - for (n = 0; n < 3; ++n) { // skip the alpha channel - const int range = (type == 1) ? - SSIMScaleChannel((uint8_t*)pic1.argb + n, pic1.argb_stride * 4, - (const uint8_t*)pic2.argb + n, pic2.argb_stride * 4, - 4, pic1.width, pic1.height, scale) : - DiffScaleChannel((uint8_t*)pic1.argb + n, pic1.argb_stride * 4, - (const uint8_t*)pic2.argb + n, pic2.argb_stride * 4, - 4, pic1.width, pic1.height, scale); + for (n = 0; n < 3; ++n) { // skip the alpha channel + const int range = + (type == 1) + ? SSIMScaleChannel( + (uint8_t*)pic1.argb + n, pic1.argb_stride * 4, + (const uint8_t*)pic2.argb + n, pic2.argb_stride * 4, 4, + pic1.width, pic1.height, scale) + : DiffScaleChannel( + (uint8_t*)pic1.argb + n, pic1.argb_stride * 4, + (const uint8_t*)pic2.argb + n, pic2.argb_stride * 4, 4, + pic1.width, pic1.height, scale); if (range < 0) fprintf(stderr, "\nError computing diff map\n"); fprintf(stderr, "[%d]", range); } @@ -331,10 +334,9 @@ int main(int argc, const char* argv[]) { goto End; } #if !defined(WEBP_REDUCE_CSP) - data_size = WebPEncodeLosslessBGRA((const uint8_t*)pic1.argb, - pic1.width, pic1.height, - pic1.argb_stride * 4, - &data); + data_size = + WebPEncodeLosslessBGRA((const uint8_t*)pic1.argb, pic1.width, + pic1.height, pic1.argb_stride * 4, &data); if (data_size == 0) { fprintf(stderr, "Error during lossless encoding.\n"); goto End; @@ -346,14 +348,15 @@ int main(int argc, const char* argv[]) { #else (void)data; (void)data_size; - fprintf(stderr, "Cannot save the difference map. Please recompile " - "without the WEBP_REDUCE_CSP flag.\n"); + fprintf(stderr, + "Cannot save the difference map. Please recompile " + "without the WEBP_REDUCE_CSP flag.\n"); goto End; #endif // WEBP_REDUCE_CSP } ret = EXIT_SUCCESS; - End: +End: WebPPictureFree(&pic1); WebPPictureFree(&pic2); FREE_WARGV_AND_RETURN(ret); diff --git a/extras/quality_estimate.c b/extras/quality_estimate.c index 7b69b1b6..973d8000 100644 --- a/extras/quality_estimate.c +++ b/extras/quality_estimate.c @@ -54,10 +54,10 @@ int VP8EstimateQuality(const uint8_t* const data, size_t size) { if (data == NULL) return -1; if (WebPGetFeatures(data, size, &features) != VP8_STATUS_OK) { - return -1; // invalid file + return -1; // invalid file } - if (features.format == 2) return 101; // lossless - if (features.format == 0 || features.has_animation) return -1; // mixed + if (features.format == 2) return 101; // lossless + if (features.format == 0 || features.has_animation) return -1; // mixed while (pos < size) { sig = (sig >> 8) | ((uint64_t)data[pos++] << 40); @@ -78,29 +78,29 @@ int VP8EstimateQuality(const uint8_t* const data, size_t size) { GET_BIT(2); // colorspace + clamp type // Segment header - if (GET_BIT(1)) { // use_segment + if (GET_BIT(1)) { // use_segment int s; const int update_map = GET_BIT(1); - if (GET_BIT(1)) { // update data + if (GET_BIT(1)) { // update data const int absolute_delta = GET_BIT(1); - int q[4] = { 0, 0, 0, 0 }; + int q[4] = {0, 0, 0, 0}; for (s = 0; s < 4; ++s) { if (GET_BIT(1)) { q[s] = GET_BIT(7); - if (GET_BIT(1)) q[s] = -q[s]; // sign + if (GET_BIT(1)) q[s] = -q[s]; // sign } } if (absolute_delta) Q = q[0]; // just use the first segment's quantizer - for (s = 0; s < 4; ++s) CONDITIONAL_SKIP(7); // filter strength + for (s = 0; s < 4; ++s) CONDITIONAL_SKIP(7); // filter strength } if (update_map) { for (s = 0; s < 3; ++s) CONDITIONAL_SKIP(8); } } // Filter header - GET_BIT(1 + 6 + 3); // simple + level + sharpness - if (GET_BIT(1)) { // use_lf_delta - if (GET_BIT(1)) { // update lf_delta? + GET_BIT(1 + 6 + 3); // simple + level + sharpness + if (GET_BIT(1)) { // use_lf_delta + if (GET_BIT(1)) { // update lf_delta? int n; for (n = 0; n < 4 + 4; ++n) CONDITIONAL_SKIP(6); } diff --git a/extras/vwebp_sdl.c b/extras/vwebp_sdl.c index 1906bf39..8fb03ca2 100644 --- a/extras/vwebp_sdl.c +++ b/extras/vwebp_sdl.c @@ -23,10 +23,10 @@ #if defined(WEBP_HAVE_SDL) -#include "webp_to_sdl.h" -#include "webp/decode.h" -#include "imageio/imageio_util.h" #include "../examples/unicode.h" +#include "imageio/imageio_util.h" +#include "webp/decode.h" +#include "webp_to_sdl.h" #if defined(WEBP_HAVE_JUST_SDL_H) #include @@ -41,11 +41,15 @@ static void ProcessEvents(void) { switch (event.type) { case SDL_KEYUP: switch (event.key.keysym.sym) { - case SDLK_q: done = 1; break; - default: break; + case SDLK_q: + done = 1; + break; + default: + break; } break; - default: break; + default: + break; } } } @@ -93,7 +97,7 @@ int main(int argc, char* argv[]) { } ok = 1; - Error: +Error: SDL_Quit(); FREE_WARGV_AND_RETURN(ok ? EXIT_SUCCESS : EXIT_FAILURE); } diff --git a/extras/webp_quality.c b/extras/webp_quality.c index b0725863..3a750abc 100644 --- a/extras/webp_quality.c +++ b/extras/webp_quality.c @@ -12,9 +12,9 @@ #include #include "../examples/unicode.h" -#include "src/webp/types.h" #include "extras/extras.h" #include "imageio/imageio_util.h" +#include "src/webp/types.h" // Returns EXIT_SUCCESS on success, EXIT_FAILURE on failure. int main(int argc, const char* argv[]) { @@ -46,7 +46,7 @@ int main(int argc, const char* argv[]) { if (!quiet) { printf("Estimated quality factor: %d\n", q); } else { - printf("%d\n", q); // just print the number + printf("%d\n", q); // just print the number } } free((void*)data); diff --git a/extras/webp_to_sdl.c b/extras/webp_to_sdl.c index 971ffc88..10e728e3 100644 --- a/extras/webp_to_sdl.c +++ b/extras/webp_to_sdl.c @@ -17,11 +17,10 @@ #if defined(WEBP_HAVE_SDL) -#include "webp_to_sdl.h" - #include #include "src/webp/decode.h" +#include "webp_to_sdl.h" #if defined(WEBP_HAVE_JUST_SDL_H) #include @@ -67,11 +66,11 @@ int WebPToSDL(const char* data, unsigned int data_size) { } #if SDL_BYTEORDER == SDL_BIG_ENDIAN - output = WebPDecodeBGRA((const uint8_t*)data, (size_t)data_size, &width, - &height); + output = + WebPDecodeBGRA((const uint8_t*)data, (size_t)data_size, &width, &height); #else - output = WebPDecodeRGBA((const uint8_t*)data, (size_t)data_size, &width, - &height); + output = + WebPDecodeRGBA((const uint8_t*)data, (size_t)data_size, &width, &height); #endif if (output == NULL) { fprintf(stderr, "Error decoding image (%d)\n", status); @@ -84,7 +83,7 @@ int WebPToSDL(const char* data, unsigned int data_size) { SDL_RenderPresent(renderer); ok = 1; - Error: +Error: // We should call SDL_DestroyWindow(window) but that makes .js fail. SDL_DestroyRenderer(renderer); SDL_DestroyTexture(texture); diff --git a/imageio/image_dec.c b/imageio/image_dec.c index 82bf632a..02ec2da9 100644 --- a/imageio/image_dec.c +++ b/imageio/image_dec.c @@ -9,9 +9,10 @@ // // Generic image-type guessing. +#include "./image_dec.h" + #include -#include "./image_dec.h" #include "./metadata.h" #include "webp/encode.h" #include "webp/types.h" @@ -62,8 +63,8 @@ WebPInputFileFormat WebPGuessImageType(const uint8_t* const data, } static int FailReader(const uint8_t* const data, size_t data_size, - struct WebPPicture* const pic, - int keep_alpha, struct Metadata* const metadata) { + struct WebPPicture* const pic, int keep_alpha, + struct Metadata* const metadata) { (void)data; (void)data_size; (void)pic; @@ -74,12 +75,18 @@ static int FailReader(const uint8_t* const data, size_t data_size, WebPImageReader WebPGetImageReader(WebPInputFileFormat format) { switch (format) { - case WEBP_PNG_FORMAT: return ReadPNG; - case WEBP_JPEG_FORMAT: return ReadJPEG; - case WEBP_TIFF_FORMAT: return ReadTIFF; - case WEBP_WEBP_FORMAT: return ReadWebP; - case WEBP_PNM_FORMAT: return ReadPNM; - default: return FailReader; + case WEBP_PNG_FORMAT: + return ReadPNG; + case WEBP_JPEG_FORMAT: + return ReadJPEG; + case WEBP_TIFF_FORMAT: + return ReadTIFF; + case WEBP_WEBP_FORMAT: + return ReadWebP; + case WEBP_PNM_FORMAT: + return ReadPNM; + default: + return FailReader; } } diff --git a/imageio/image_dec.h b/imageio/image_dec.h index a5915466..636999fa 100644 --- a/imageio/image_dec.h +++ b/imageio/image_dec.h @@ -22,8 +22,8 @@ #include "webp/config.h" #endif -#include "./metadata.h" #include "./jpegdec.h" +#include "./metadata.h" #include "./pngdec.h" #include "./pnmdec.h" #include "./tiffdec.h" @@ -53,8 +53,8 @@ WebPInputFileFormat WebPGuessImageType(const uint8_t* const data, // Signature for common image-reading functions (ReadPNG, ReadJPEG, ...) typedef int (*WebPImageReader)(const uint8_t* const data, size_t data_size, - struct WebPPicture* const pic, - int keep_alpha, struct Metadata* const metadata); + struct WebPPicture* const pic, int keep_alpha, + struct Metadata* const metadata); // Return the reader associated to a given file format. WebPImageReader WebPGetImageReader(WebPInputFileFormat format); @@ -66,7 +66,7 @@ WebPImageReader WebPGuessImageReader(const uint8_t* const data, size_t data_size); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_IMAGEIO_IMAGE_DEC_H_ diff --git a/imageio/image_enc.c b/imageio/image_enc.c index 298a866d..46002077 100644 --- a/imageio/image_enc.c +++ b/imageio/image_enc.c @@ -17,7 +17,7 @@ #ifdef WEBP_HAVE_PNG #include -#include // note: this must be included *after* png.h +#include // note: this must be included *after* png.h #endif #ifdef HAVE_WINCODEC_H @@ -26,13 +26,14 @@ #endif #define CINTERFACE #define COBJMACROS -#define _WIN32_IE 0x500 // Workaround bug in shlwapi.h when compiling C++ - // code with COBJMACROS. +#define _WIN32_IE \ + 0x500 // Workaround bug in shlwapi.h when compiling C++ + // code with COBJMACROS. #include // CreateStreamOnHGlobal() #include #include -#include #include +#include #endif #include "../examples/unicode.h" @@ -45,12 +46,12 @@ #ifdef HAVE_WINCODEC_H -#define IFS(fn) \ - do { \ - if (SUCCEEDED(hr)) { \ - hr = (fn); \ - if (FAILED(hr)) fprintf(stderr, #fn " failed %08lx\n", hr); \ - } \ +#define IFS(fn) \ + do { \ + if (SUCCEEDED(hr)) { \ + hr = (fn); \ + if (FAILED(hr)) fprintf(stderr, #fn " failed %08lx\n", hr); \ + } \ } while (0) #ifdef __cplusplus @@ -59,8 +60,8 @@ #define MAKE_REFGUID(x) &(x) #endif -static HRESULT CreateOutputStream(const char* out_file_name, - int write_to_mem, IStream** stream) { +static HRESULT CreateOutputStream(const char* out_file_name, int write_to_mem, + IStream** stream) { HRESULT hr = S_OK; if (write_to_mem) { // Output to a memory buffer. This is freed when 'stream' is released. @@ -77,24 +78,22 @@ static HRESULT CreateOutputStream(const char* out_file_name, } static HRESULT WriteUsingWIC(const char* out_file_name, int use_stdout, - REFGUID container_guid, - uint8_t* rgb, int stride, + REFGUID container_guid, uint8_t* rgb, int stride, uint32_t width, uint32_t height, int has_alpha) { HRESULT hr = S_OK; IWICImagingFactory* factory = NULL; IWICBitmapFrameEncode* frame = NULL; IWICBitmapEncoder* encoder = NULL; IStream* stream = NULL; - WICPixelFormatGUID pixel_format = has_alpha ? GUID_WICPixelFormat32bppBGRA - : GUID_WICPixelFormat24bppBGR; + WICPixelFormatGUID pixel_format = + has_alpha ? GUID_WICPixelFormat32bppBGRA : GUID_WICPixelFormat24bppBGR; if (out_file_name == NULL || rgb == NULL) return E_INVALIDARG; IFS(CoInitialize(NULL)); - IFS(CoCreateInstance(MAKE_REFGUID(CLSID_WICImagingFactory), NULL, - CLSCTX_INPROC_SERVER, - MAKE_REFGUID(IID_IWICImagingFactory), - (LPVOID*)&factory)); + IFS(CoCreateInstance( + MAKE_REFGUID(CLSID_WICImagingFactory), NULL, CLSCTX_INPROC_SERVER, + MAKE_REFGUID(IID_IWICImagingFactory), (LPVOID*)&factory)); if (hr == REGDB_E_CLASSNOTREG) { fprintf(stderr, "Couldn't access Windows Imaging Component (are you running " @@ -104,14 +103,13 @@ static HRESULT WriteUsingWIC(const char* out_file_name, int use_stdout, IFS(CreateOutputStream(out_file_name, use_stdout, &stream)); IFS(IWICImagingFactory_CreateEncoder(factory, container_guid, NULL, &encoder)); - IFS(IWICBitmapEncoder_Initialize(encoder, stream, - WICBitmapEncoderNoCache)); + IFS(IWICBitmapEncoder_Initialize(encoder, stream, WICBitmapEncoderNoCache)); IFS(IWICBitmapEncoder_CreateNewFrame(encoder, &frame, NULL)); IFS(IWICBitmapFrameEncode_Initialize(frame, NULL)); IFS(IWICBitmapFrameEncode_SetSize(frame, width, height)); IFS(IWICBitmapFrameEncode_SetPixelFormat(frame, &pixel_format)); - IFS(IWICBitmapFrameEncode_WritePixels(frame, height, stride, - height * stride, rgb)); + IFS(IWICBitmapFrameEncode_WritePixels(frame, height, stride, height * stride, + rgb)); IFS(IWICBitmapFrameEncode_Commit(frame)); IFS(IWICBitmapEncoder_Commit(encoder)); @@ -153,11 +151,11 @@ int WebPWritePNG(const char* out_file_name, int use_stdout, const int has_alpha = WebPIsAlphaMode(buffer->colorspace); return SUCCEEDED(WriteUsingWIC(out_file_name, use_stdout, - MAKE_REFGUID(GUID_ContainerFormatPng), - rgb, stride, width, height, has_alpha)); + MAKE_REFGUID(GUID_ContainerFormatPng), rgb, + stride, width, height, has_alpha)); } -#elif defined(WEBP_HAVE_PNG) // !HAVE_WINCODEC_H +#elif defined(WEBP_HAVE_PNG) // !HAVE_WINCODEC_H static void PNGAPI PNGErrorFunction(png_structp png, png_const_charp unused) { (void)unused; // remove variable-unused warning longjmp(png_jmpbuf(png), 1); @@ -169,8 +167,8 @@ int WebPWritePNG(FILE* out_file, const WebPDecBuffer* const buffer) { if (out_file == NULL || buffer == NULL) return 0; - png = png_create_write_struct(PNG_LIBPNG_VER_STRING, - NULL, PNGErrorFunction, NULL); + png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, PNGErrorFunction, + NULL); if (png == NULL) { return 0; } @@ -206,11 +204,12 @@ int WebPWritePNG(FILE* out_file, const WebPDecBuffer* const buffer) { png_destroy_write_struct((png_structpp)&png, (png_infopp)&info); return 1; } -#else // !HAVE_WINCODEC_H && !WEBP_HAVE_PNG +#else // !HAVE_WINCODEC_H && !WEBP_HAVE_PNG int WebPWritePNG(FILE* fout, const WebPDecBuffer* const buffer) { if (fout == NULL || buffer == NULL) return 0; - fprintf(stderr, "PNG support not compiled. Please install the libpng " + fprintf(stderr, + "PNG support not compiled. Please install the libpng " "development package before building.\n"); fprintf(stderr, "You can run with -ppm flag to decode in PPM format.\n"); return 0; @@ -235,8 +234,10 @@ static int WritePPMPAM(FILE* fout, const WebPDecBuffer* const buffer, if (row == NULL) return 0; if (alpha) { - fprintf(fout, "P7\nWIDTH %u\nHEIGHT %u\nDEPTH 4\nMAXVAL 255\n" - "TUPLTYPE RGB_ALPHA\nENDHDR\n", width, height); + fprintf(fout, + "P7\nWIDTH %u\nHEIGHT %u\nDEPTH 4\nMAXVAL 255\n" + "TUPLTYPE RGB_ALPHA\nENDHDR\n", + width, height); } else { fprintf(fout, "P6\n%u %u\n255\n", width, height); } @@ -297,7 +298,7 @@ static void PutLE16(uint8_t* const dst, uint32_t value) { } static void PutLE32(uint8_t* const dst, uint32_t value) { - PutLE16(dst + 0, (value >> 0) & 0xffff); + PutLE16(dst + 0, (value >> 0) & 0xffff); PutLE16(dst + 2, (value >> 16) & 0xffff); } @@ -310,7 +311,7 @@ int WebPWriteBMP(FILE* fout, const WebPDecBuffer* const buffer) { int stride; uint32_t y; uint32_t bytes_per_px, line_size, image_size, bmp_stride, total_size; - uint8_t bmp_header[BMP_HEADER_SIZE + BMP_HEADER_ALPHA_EXTRA_SIZE] = { 0 }; + uint8_t bmp_header[BMP_HEADER_SIZE + BMP_HEADER_ALPHA_EXTRA_SIZE] = {0}; if (fout == NULL || buffer == NULL) return 0; @@ -329,27 +330,27 @@ int WebPWriteBMP(FILE* fout, const WebPDecBuffer* const buffer) { if (rgba == NULL) return 0; // bitmap file header - PutLE16(bmp_header + 0, 0x4d42); // signature 'BM' - PutLE32(bmp_header + 2, total_size); // size including header - PutLE32(bmp_header + 6, 0); // reserved - PutLE32(bmp_header + 10, header_size); // offset to pixel array + PutLE16(bmp_header + 0, 0x4d42); // signature 'BM' + PutLE32(bmp_header + 2, total_size); // size including header + PutLE32(bmp_header + 6, 0); // reserved + PutLE32(bmp_header + 10, header_size); // offset to pixel array // bitmap info header - PutLE32(bmp_header + 14, header_size - 14); // DIB header size - PutLE32(bmp_header + 18, width); // dimensions - PutLE32(bmp_header + 22, height); // no vertical flip - PutLE16(bmp_header + 26, 1); // number of planes - PutLE16(bmp_header + 28, bytes_per_px * 8); // bits per pixel - PutLE32(bmp_header + 30, has_alpha ? 3 : 0); // BI_BITFIELDS or BI_RGB + PutLE32(bmp_header + 14, header_size - 14); // DIB header size + PutLE32(bmp_header + 18, width); // dimensions + PutLE32(bmp_header + 22, height); // no vertical flip + PutLE16(bmp_header + 26, 1); // number of planes + PutLE16(bmp_header + 28, bytes_per_px * 8); // bits per pixel + PutLE32(bmp_header + 30, has_alpha ? 3 : 0); // BI_BITFIELDS or BI_RGB PutLE32(bmp_header + 34, image_size); - PutLE32(bmp_header + 38, 2400); // x pixels/meter - PutLE32(bmp_header + 42, 2400); // y pixels/meter - PutLE32(bmp_header + 46, 0); // number of palette colors - PutLE32(bmp_header + 50, 0); // important color count - if (has_alpha) { // BITMAPV3INFOHEADER complement - PutLE32(bmp_header + 54, 0x00ff0000); // red mask - PutLE32(bmp_header + 58, 0x0000ff00); // green mask - PutLE32(bmp_header + 62, 0x000000ff); // blue mask - PutLE32(bmp_header + 66, 0xff000000); // alpha mask + PutLE32(bmp_header + 38, 2400); // x pixels/meter + PutLE32(bmp_header + 42, 2400); // y pixels/meter + PutLE32(bmp_header + 46, 0); // number of palette colors + PutLE32(bmp_header + 50, 0); // important color count + if (has_alpha) { // BITMAPV3INFOHEADER complement + PutLE32(bmp_header + 54, 0x00ff0000); // red mask + PutLE32(bmp_header + 58, 0x0000ff00); // green mask + PutLE32(bmp_header + 62, 0x000000ff); // blue mask + PutLE32(bmp_header + 66, 0xff000000); // alpha mask } // TODO(skal): color profile @@ -367,7 +368,7 @@ int WebPWriteBMP(FILE* fout, const WebPDecBuffer* const buffer) { } // write padding zeroes if (bmp_stride != line_size) { - const uint8_t zeroes[3] = { 0 }; + const uint8_t zeroes[3] = {0}; if (fwrite(zeroes, bmp_stride - line_size, 1, fout) != 1) { return 0; } @@ -397,35 +398,35 @@ int WebPWriteTIFF(FILE* fout, const WebPDecBuffer* const buffer) { // For non-alpha case, we omit tag 0x152 (ExtraSamples). const uint8_t num_ifd_entries = 0; uint8_t tiff_header[TIFF_HEADER_SIZE] = { - 0x49, 0x49, 0x2a, 0x00, // little endian signature - 8, 0, 0, 0, // offset to the unique IFD that follows - // IFD (offset = 8). Entries must be written in increasing tag order. - num_ifd_entries, 0, // Number of entries in the IFD (12 bytes each). - 0x00, 0x01, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, // 10: Width (TBD) - 0x01, 0x01, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, // 22: Height (TBD) - 0x02, 0x01, 3, 0, bytes_per_px, 0, 0, 0, // 34: BitsPerSample: 8888 - EXTRA_DATA_OFFSET + 0, 0, 0, 0, - 0x03, 0x01, 3, 0, 1, 0, 0, 0, 1, 0, 0, 0, // 46: Compression: none - 0x06, 0x01, 3, 0, 1, 0, 0, 0, 2, 0, 0, 0, // 58: Photometric: RGB - 0x11, 0x01, 4, 0, 1, 0, 0, 0, // 70: Strips offset: - TIFF_HEADER_SIZE, 0, 0, 0, // data follows header - 0x12, 0x01, 3, 0, 1, 0, 0, 0, 1, 0, 0, 0, // 82: Orientation: topleft - 0x15, 0x01, 3, 0, 1, 0, 0, 0, // 94: SamplesPerPixels - bytes_per_px, 0, 0, 0, - 0x16, 0x01, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, // 106: Rows per strip (TBD) - 0x17, 0x01, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, // 118: StripByteCount (TBD) - 0x1a, 0x01, 5, 0, 1, 0, 0, 0, // 130: X-resolution - EXTRA_DATA_OFFSET + 8, 0, 0, 0, - 0x1b, 0x01, 5, 0, 1, 0, 0, 0, // 142: Y-resolution - EXTRA_DATA_OFFSET + 8, 0, 0, 0, - 0x1c, 0x01, 3, 0, 1, 0, 0, 0, 1, 0, 0, 0, // 154: PlanarConfiguration - 0x28, 0x01, 3, 0, 1, 0, 0, 0, 2, 0, 0, 0, // 166: ResolutionUnit (inch) - 0x52, 0x01, 3, 0, 1, 0, 0, 0, - assoc_alpha, 0, 0, 0, // 178: ExtraSamples: rgbA/RGBA - 0, 0, 0, 0, // 190: IFD terminator - // EXTRA_DATA_OFFSET: - 8, 0, 8, 0, 8, 0, 8, 0, // BitsPerSample - 72, 0, 0, 0, 1, 0, 0, 0 // 72 pixels/inch, for X/Y-resolution + 0x49, 0x49, 0x2a, 0x00, // little endian signature + 8, 0, 0, 0, // offset to the unique IFD that follows + // IFD (offset = 8). Entries must be written in increasing tag order. + num_ifd_entries, 0, // Number of entries in the IFD (12 bytes each). + 0x00, 0x01, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, // 10: Width (TBD) + 0x01, 0x01, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, // 22: Height (TBD) + 0x02, 0x01, 3, 0, bytes_per_px, 0, 0, 0, // 34: BitsPerSample: 8888 + EXTRA_DATA_OFFSET + 0, 0, 0, 0, 0x03, 0x01, 3, 0, 1, 0, 0, 0, 1, 0, 0, + 0, // 46: Compression: none + 0x06, 0x01, 3, 0, 1, 0, 0, 0, 2, 0, 0, 0, // 58: Photometric: RGB + 0x11, 0x01, 4, 0, 1, 0, 0, 0, // 70: Strips offset: + TIFF_HEADER_SIZE, 0, 0, 0, // data follows header + 0x12, 0x01, 3, 0, 1, 0, 0, 0, 1, 0, 0, 0, // 82: Orientation: topleft + 0x15, 0x01, 3, 0, 1, 0, 0, 0, // 94: SamplesPerPixels + bytes_per_px, 0, 0, 0, 0x16, 0x01, 3, 0, 1, 0, 0, 0, 0, 0, 0, + 0, // 106: Rows per strip (TBD) + 0x17, 0x01, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, // 118: StripByteCount (TBD) + 0x1a, 0x01, 5, 0, 1, 0, 0, 0, // 130: X-resolution + EXTRA_DATA_OFFSET + 8, 0, 0, 0, 0x1b, 0x01, 5, 0, 1, 0, 0, + 0, // 142: Y-resolution + EXTRA_DATA_OFFSET + 8, 0, 0, 0, 0x1c, 0x01, 3, 0, 1, 0, 0, 0, 1, 0, 0, + 0, // 154: PlanarConfiguration + 0x28, 0x01, 3, 0, 1, 0, 0, 0, 2, 0, 0, 0, // 166: ResolutionUnit (inch) + 0x52, 0x01, 3, 0, 1, 0, 0, 0, assoc_alpha, 0, 0, + 0, // 178: ExtraSamples: rgbA/RGBA + 0, 0, 0, 0, // 190: IFD terminator + // EXTRA_DATA_OFFSET: + 8, 0, 8, 0, 8, 0, 8, 0, // BitsPerSample + 72, 0, 0, 0, 1, 0, 0, 0 // 72 pixels/inch, for X/Y-resolution }; uint32_t y; @@ -517,11 +518,11 @@ int WebPWritePGM(FILE* fout, const WebPDecBuffer* const buffer) { if (src_y == NULL || src_u == NULL || src_v == NULL) return 0; - fprintf(fout, "P5\n%d %d\n255\n", - (width + 1) & ~1, height + uv_height + a_height); + fprintf(fout, "P5\n%d %d\n255\n", (width + 1) & ~1, + height + uv_height + a_height); for (y = 0; ok && y < height; ++y) { ok &= (fwrite(src_y, width, 1, fout) == 1); - if (width & 1) fputc(0, fout); // padding byte + if (width & 1) fputc(0, fout); // padding byte src_y += yuv->y_stride; } for (y = 0; ok && y < uv_height; ++y) { @@ -532,7 +533,7 @@ int WebPWritePGM(FILE* fout, const WebPDecBuffer* const buffer) { } for (y = 0; ok && y < a_height; ++y) { ok &= (fwrite(src_a, width, 1, fout) == 1); - if (width & 1) fputc(0, fout); // padding byte + if (width & 1) fputc(0, fout); // padding byte src_a += yuv->a_stride; } return ok; @@ -609,8 +610,7 @@ int WebPSaveImage(const WebPDecBuffer* const buffer, } } - if (format == PNG || - format == RGBA || format == BGRA || format == ARGB || + if (format == PNG || format == RGBA || format == BGRA || format == ARGB || format == rgbA || format == bgrA || format == Argb) { #ifdef HAVE_WINCODEC_H ok &= WebPWritePNG(out_file_name, use_stdout, buffer); diff --git a/imageio/image_enc.h b/imageio/image_enc.h index d31e4bd3..b4b40882 100644 --- a/imageio/image_enc.h +++ b/imageio/image_enc.h @@ -20,8 +20,8 @@ #include "webp/config.h" #endif -#include "webp/types.h" #include "webp/decode.h" +#include "webp/types.h" #ifdef __cplusplus extern "C" { @@ -38,10 +38,19 @@ typedef enum { RAW_YUV, ALPHA_PLANE_ONLY, // this is for experimenting only // forced colorspace output (for testing, mostly) - RGB, RGBA, BGR, BGRA, ARGB, - RGBA_4444, RGB_565, - rgbA, bgrA, Argb, rgbA_4444, - YUV, YUVA + RGB, + RGBA, + BGR, + BGRA, + ARGB, + RGBA_4444, + RGB_565, + rgbA, + bgrA, + Argb, + rgbA_4444, + YUV, + YUVA } WebPOutputFileFormat; // General all-purpose call. @@ -90,7 +99,7 @@ int WebPWriteYUV(FILE* fout, const struct WebPDecBuffer* const buffer); int WebPWrite16bAsPGM(FILE* fout, const struct WebPDecBuffer* const buffer); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_IMAGEIO_IMAGE_ENC_H_ diff --git a/imageio/imageio_util.c b/imageio/imageio_util.c index 372778fd..15dff672 100644 --- a/imageio/imageio_util.c +++ b/imageio/imageio_util.c @@ -13,15 +13,15 @@ #include "./imageio_util.h" #if defined(_WIN32) -#include // for _O_BINARY -#include // for _setmode() +#include // for _O_BINARY +#include // for _setmode() #endif #include #include #include -#include "webp/types.h" #include "../examples/unicode.h" +#include "webp/types.h" // ----------------------------------------------------------------------------- // File I/O @@ -65,14 +65,14 @@ int ImgIoUtilReadFromStdin(const uint8_t** data, size_t* data_size) { *data_size = size; return 1; - Error: +Error: free(input); fprintf(stderr, "Could not read from stdin\n"); return 0; } -int ImgIoUtilReadFile(const char* const file_name, - const uint8_t** data, size_t* data_size) { +int ImgIoUtilReadFile(const char* const file_name, const uint8_t** data, + size_t* data_size) { int ok; uint8_t* file_data; size_t file_size; @@ -123,8 +123,8 @@ int ImgIoUtilReadFile(const char* const file_name, // ----------------------------------------------------------------------------- -int ImgIoUtilWriteFile(const char* const file_name, - const uint8_t* data, size_t data_size) { +int ImgIoUtilWriteFile(const char* const file_name, const uint8_t* data, + size_t data_size) { int ok; FILE* out; const int to_stdout = (file_name == NULL) || !WSTRCMP(file_name, "-"); @@ -145,8 +145,8 @@ int ImgIoUtilWriteFile(const char* const file_name, // ----------------------------------------------------------------------------- -void ImgIoUtilCopyPlane(const uint8_t* src, int src_stride, - uint8_t* dst, int dst_stride, int width, int height) { +void ImgIoUtilCopyPlane(const uint8_t* src, int src_stride, uint8_t* dst, + int dst_stride, int width, int height) { while (height-- > 0) { memcpy(dst, src, width * sizeof(*dst)); src += src_stride; diff --git a/imageio/imageio_util.h b/imageio/imageio_util.h index 277eb7a7..3bdea38e 100644 --- a/imageio/imageio_util.h +++ b/imageio/imageio_util.h @@ -36,22 +36,22 @@ FILE* ImgIoUtilSetBinaryMode(FILE* file); // to be used as a C-string. // If 'file_name' is NULL or equal to "-", input is read from stdin by calling // the function ImgIoUtilReadFromStdin(). -int ImgIoUtilReadFile(const char* const file_name, - const uint8_t** data, size_t* data_size); +int ImgIoUtilReadFile(const char* const file_name, const uint8_t** data, + size_t* data_size); // Same as ImgIoUtilReadFile(), but reads until EOF from stdin instead. int ImgIoUtilReadFromStdin(const uint8_t** data, size_t* data_size); // Write a data segment into a file named 'file_name'. Returns true if ok. // If 'file_name' is NULL or equal to "-", output is written to stdout. -int ImgIoUtilWriteFile(const char* const file_name, - const uint8_t* data, size_t data_size); +int ImgIoUtilWriteFile(const char* const file_name, const uint8_t* data, + size_t data_size); //------------------------------------------------------------------------------ // Copy width x height pixels from 'src' to 'dst' honoring the strides. -void ImgIoUtilCopyPlane(const uint8_t* src, int src_stride, - uint8_t* dst, int dst_stride, int width, int height); +void ImgIoUtilCopyPlane(const uint8_t* src, int src_stride, uint8_t* dst, + int dst_stride, int width, int height); //------------------------------------------------------------------------------ @@ -59,7 +59,7 @@ void ImgIoUtilCopyPlane(const uint8_t* src, int src_stride, int ImgIoUtilCheckSizeArgumentsOverflow(uint64_t stride, size_t height); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_IMAGEIO_IMAGEIO_UTIL_H_ diff --git a/imageio/jpegdec.c b/imageio/jpegdec.c index e464542d..691c518c 100644 --- a/imageio/jpegdec.c +++ b/imageio/jpegdec.c @@ -18,8 +18,8 @@ #include #ifdef WEBP_HAVE_JPEG -#include #include +#include #include #include #include @@ -33,10 +33,10 @@ // Metadata processing #ifndef JPEG_APP1 -# define JPEG_APP1 (JPEG_APP0 + 1) +#define JPEG_APP1 (JPEG_APP0 + 1) #endif #ifndef JPEG_APP2 -# define JPEG_APP2 (JPEG_APP0 + 2) +#define JPEG_APP2 (JPEG_APP0 + 2) #endif typedef struct { @@ -64,7 +64,7 @@ static int StoreICCP(j_decompress_ptr dinfo, MetadataPayload* const iccp) { // ICC.1:2010-12 (4.3.0.0) Annex B.4 Embedding ICC Profiles in JPEG files static const char kICCPSignature[] = "ICC_PROFILE"; static const size_t kICCPSignatureLength = 12; // signature includes '\0' - static const size_t kICCPSkipLength = 14; // signature + seq & count + static const size_t kICCPSkipLength = 14; // signature + seq & count int expected_count = 0; int actual_count = 0; int seq_max = 0; @@ -74,8 +74,7 @@ static int StoreICCP(j_decompress_ptr dinfo, MetadataPayload* const iccp) { memset(iccp_segments, 0, sizeof(iccp_segments)); for (marker = dinfo->marker_list; marker != NULL; marker = marker->next) { - if (marker->marker == JPEG_APP2 && - marker->data_length > kICCPSkipLength && + if (marker->marker == JPEG_APP2 && marker->data_length > kICCPSkipLength && !memcmp(marker->data, kICCPSignature, kICCPSignatureLength)) { // ICC_PROFILE\0; 'seq' starts at 1. const int seq = marker->data[kICCPSignatureLength]; @@ -84,8 +83,9 @@ static int StoreICCP(j_decompress_ptr dinfo, MetadataPayload* const iccp) { ICCPSegment* segment; if (segment_size == 0 || count == 0 || seq == 0) { - fprintf(stderr, "[ICCP] size (%d) / count (%d) / sequence number (%d)" - " cannot be 0!\n", + fprintf(stderr, + "[ICCP] size (%d) / count (%d) / sequence number (%d)" + " cannot be 0!\n", (int)segment_size, seq, count); return 0; } @@ -100,7 +100,7 @@ static int StoreICCP(j_decompress_ptr dinfo, MetadataPayload* const iccp) { segment = iccp_segments + seq - 1; if (segment->data_length != 0) { - fprintf(stderr, "[ICCP] Duplicate segment number (%d)!\n" , seq); + fprintf(stderr, "[ICCP] Duplicate segment number (%d)!\n", seq); return 0; } @@ -138,8 +138,8 @@ static int StoreICCP(j_decompress_ptr dinfo, MetadataPayload* const iccp) { int i; size_t offset = 0; for (i = 0; i < seq_max; ++i) { - memcpy(iccp->bytes + offset, - iccp_segments[i].data, iccp_segments[i].data_length); + memcpy(iccp->bytes + offset, iccp_segments[i].data, + iccp_segments[i].data_length); offset += iccp_segments[i].data_length; } } @@ -156,12 +156,12 @@ static int ExtractMetadataFromJPEG(j_decompress_ptr dinfo, size_t signature_length; size_t storage_offset; } kJPEGMetadataMap[] = { - // Exif 2.2 Section 4.7.2 Interoperability Structure of APP1 ... - { JPEG_APP1, "Exif\0", 6, METADATA_OFFSET(exif) }, - // XMP Specification Part 3 Section 3 Embedding XMP Metadata ... #JPEG - // TODO(jzern) Add support for 'ExtendedXMP' - { JPEG_APP1, "http://ns.adobe.com/xap/1.0/", 29, METADATA_OFFSET(xmp) }, - { 0, NULL, 0, 0 }, + // Exif 2.2 Section 4.7.2 Interoperability Structure of APP1 ... + {JPEG_APP1, "Exif\0", 6, METADATA_OFFSET(exif)}, + // XMP Specification Part 3 Section 3 Embedding XMP Metadata ... #JPEG + // TODO(jzern) Add support for 'ExtendedXMP' + {JPEG_APP1, "http://ns.adobe.com/xap/1.0/", 29, METADATA_OFFSET(xmp)}, + {0, NULL, 0, 0}, }; jpeg_saved_marker_ptr marker; // Treat ICC profiles separately as they may be segmented and out of order. @@ -179,8 +179,8 @@ static int ExtractMetadataFromJPEG(j_decompress_ptr dinfo, kJPEGMetadataMap[i].storage_offset); if (payload->bytes == NULL) { - const char* marker_data = (const char*)marker->data + - kJPEGMetadataMap[i].signature_length; + const char* marker_data = + (const char*)marker->data + kJPEGMetadataMap[i].signature_length; const size_t marker_data_length = marker->data_length - kJPEGMetadataMap[i].signature_length; if (!MetadataCopy(marker_data, marker_data_length, payload)) return 0; @@ -250,9 +250,7 @@ static void ContextSkip(j_decompress_ptr cinfo, long jump_size) { ctx->pub.next_input_byte += jump; } -static void ContextTerm(j_decompress_ptr cinfo) { - (void)cinfo; -} +static void ContextTerm(j_decompress_ptr cinfo) { (void)cinfo; } static void ContextSetup(volatile struct jpeg_decompress_struct* const cinfo, JPEGReadContext* const ctx) { @@ -267,8 +265,7 @@ static void ContextSetup(volatile struct jpeg_decompress_struct* const cinfo, } int ReadJPEG(const uint8_t* const data, size_t data_size, - WebPPicture* const pic, int keep_alpha, - Metadata* const metadata) { + WebPPicture* const pic, int keep_alpha, Metadata* const metadata) { volatile int ok = 0; int width, height; int64_t stride; @@ -285,12 +282,12 @@ int ReadJPEG(const uint8_t* const data, size_t data_size, ctx.data = data; ctx.data_size = data_size; - memset((j_decompress_ptr)&dinfo, 0, sizeof(dinfo)); // for setjmp safety + memset((j_decompress_ptr)&dinfo, 0, sizeof(dinfo)); // for setjmp safety dinfo.err = jpeg_std_error(&jerr.pub); jerr.pub.error_exit = my_error_exit; if (setjmp(jerr.setjmp_buffer)) { - Error: + Error: MetadataFree(metadata); jpeg_destroy_decompress((j_decompress_ptr)&dinfo); goto End; @@ -353,11 +350,11 @@ int ReadJPEG(const uint8_t* const data, size_t data_size, MetadataFree(metadata); // In case the caller forgets to free it on error. } - End: +End: free(rgb); return ok; } -#else // !WEBP_HAVE_JPEG +#else // !WEBP_HAVE_JPEG int ReadJPEG(const uint8_t* const data, size_t data_size, struct WebPPicture* const pic, int keep_alpha, struct Metadata* const metadata) { @@ -366,7 +363,8 @@ int ReadJPEG(const uint8_t* const data, size_t data_size, (void)pic; (void)keep_alpha; (void)metadata; - fprintf(stderr, "JPEG support not compiled. Please install the libjpeg " + fprintf(stderr, + "JPEG support not compiled. Please install the libjpeg " "development package before building.\n"); return 0; } diff --git a/imageio/jpegdec.h b/imageio/jpegdec.h index 97304bc7..805837d6 100644 --- a/imageio/jpegdec.h +++ b/imageio/jpegdec.h @@ -33,7 +33,7 @@ int ReadJPEG(const uint8_t* const data, size_t data_size, struct Metadata* const metadata); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_IMAGEIO_JPEGDEC_H_ diff --git a/imageio/metadata.h b/imageio/metadata.h index ba479e7f..9e9d62e0 100644 --- a/imageio/metadata.h +++ b/imageio/metadata.h @@ -43,7 +43,7 @@ int MetadataCopy(const char* metadata, size_t metadata_len, MetadataPayload* const payload); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_IMAGEIO_METADATA_H_ diff --git a/imageio/pngdec.c b/imageio/pngdec.c index e04719ea..380e6053 100644 --- a/imageio/pngdec.c +++ b/imageio/pngdec.c @@ -22,8 +22,7 @@ #define PNG_USER_MEM_SUPPORTED // for png_create_read_struct_2 #endif #include - -#include // note: this must be included *after* png.h +#include // note: this must be included *after* png.h #include #include @@ -33,15 +32,14 @@ #include "webp/types.h" #define LOCAL_PNG_VERSION ((PNG_LIBPNG_VER_MAJOR << 8) | PNG_LIBPNG_VER_MINOR) -#define LOCAL_PNG_PREREQ(maj, min) \ - (LOCAL_PNG_VERSION >= (((maj) << 8) | (min))) +#define LOCAL_PNG_PREREQ(maj, min) (LOCAL_PNG_VERSION >= (((maj) << 8) | (min))) static void PNGAPI error_function(png_structp png, png_const_charp error) { if (error != NULL) fprintf(stderr, "libpng error: %s\n", error); longjmp(png_jmpbuf(png), 1); } -#if LOCAL_PNG_PREREQ(1,4) +#if LOCAL_PNG_PREREQ(1, 4) typedef png_alloc_size_t LocalPngAllocSize; #else typedef png_size_t LocalPngAllocSize; @@ -113,7 +111,8 @@ static int ProcessRawProfile(const char* profile, size_t profile_len, } ++src; // skip the profile name and extract the length. - while (*src != '\0' && *src++ != '\n') {} + while (*src != '\0' && *src++ != '\n') { + } expected_length = (int)strtol(src, &end, 10); if (*end != '\n') { fprintf(stderr, "Malformed raw profile, expected '\\n' got '\\x%.2X'\n", @@ -135,30 +134,29 @@ static const struct { MetadataPayload* const payload); size_t storage_offset; } kPNGMetadataMap[] = { - // https://exiftool.org/TagNames/PNG.html#TextualData - // See also: ExifTool on CPAN. - { "Raw profile type exif", ProcessRawProfile, METADATA_OFFSET(exif) }, - { "Raw profile type xmp", ProcessRawProfile, METADATA_OFFSET(xmp) }, - // Exiftool puts exif data in APP1 chunk, too. - { "Raw profile type APP1", ProcessRawProfile, METADATA_OFFSET(exif) }, - // ImageMagick uses lowercase app1. - { "Raw profile type app1", ProcessRawProfile, METADATA_OFFSET(exif) }, - // XMP Specification Part 3, Section 3 #PNG - { "XML:com.adobe.xmp", MetadataCopy, METADATA_OFFSET(xmp) }, - { NULL, NULL, 0 }, + // https://exiftool.org/TagNames/PNG.html#TextualData + // See also: ExifTool on CPAN. + {"Raw profile type exif", ProcessRawProfile, METADATA_OFFSET(exif)}, + {"Raw profile type xmp", ProcessRawProfile, METADATA_OFFSET(xmp)}, + // Exiftool puts exif data in APP1 chunk, too. + {"Raw profile type APP1", ProcessRawProfile, METADATA_OFFSET(exif)}, + // ImageMagick uses lowercase app1. + {"Raw profile type app1", ProcessRawProfile, METADATA_OFFSET(exif)}, + // XMP Specification Part 3, Section 3 #PNG + {"XML:com.adobe.xmp", MetadataCopy, METADATA_OFFSET(xmp)}, + {NULL, NULL, 0}, }; // Looks for metadata at both the beginning and end of the PNG file, giving // preference to the head. // Returns true on success. The caller must use MetadataFree() on 'metadata' in // all cases. -static int ExtractMetadataFromPNG(png_structp png, - png_infop const head_info, +static int ExtractMetadataFromPNG(png_structp png, png_infop const head_info, png_infop const end_info, Metadata* const metadata) { int p; - for (p = 0; p < 2; ++p) { + for (p = 0; p < 2; ++p) { png_infop const info = (p == 0) ? head_info : end_info; png_textp text = NULL; const png_uint_32 num = png_get_text(png, info, &text, NULL); @@ -215,15 +213,15 @@ static int ExtractMetadataFromPNG(png_structp png, { png_charp name; int comp_type; -#if LOCAL_PNG_PREREQ(1,5) +#if LOCAL_PNG_PREREQ(1, 5) png_bytep profile; #else png_charp profile; #endif png_uint_32 len; - if (png_get_iCCP(png, info, - &name, &comp_type, &profile, &len) == PNG_INFO_iCCP) { + if (png_get_iCCP(png, info, &name, &comp_type, &profile, &len) == + PNG_INFO_iCCP) { if (!MetadataCopy((const char*)profile, len, &metadata->iccp)) return 0; } } @@ -248,12 +246,12 @@ static void ReadFunc(png_structp png_ptr, png_bytep data, png_size_t length) { } int ReadPNG(const uint8_t* const data, size_t data_size, - struct WebPPicture* const pic, - int keep_alpha, struct Metadata* const metadata) { + struct WebPPicture* const pic, int keep_alpha, + struct Metadata* const metadata) { volatile png_structp png = NULL; volatile png_infop info = NULL; volatile png_infop end_info = NULL; - PNGReadContext context = { NULL, 0, 0 }; + PNGReadContext context = {NULL, 0, 0}; int color_type, bit_depth, interlaced; int num_channels; int num_passes; @@ -268,19 +266,19 @@ int ReadPNG(const uint8_t* const data, size_t data_size, context.data = data; context.data_size = data_size; - png = png_create_read_struct_2(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL, - NULL, MallocFunc, FreeFunc); + png = png_create_read_struct_2(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL, NULL, + MallocFunc, FreeFunc); if (png == NULL) goto End; png_set_error_fn(png, 0, error_function, NULL); if (setjmp(png_jmpbuf(png))) { - Error: + Error: MetadataFree(metadata); goto End; } -#if LOCAL_PNG_PREREQ(1,5) || \ - (LOCAL_PNG_PREREQ(1,4) && PNG_LIBPNG_VER_RELEASE >= 1) +#if LOCAL_PNG_PREREQ(1, 5) || \ + (LOCAL_PNG_PREREQ(1, 4) && PNG_LIBPNG_VER_RELEASE >= 1) // If it looks like the bitstream is going to need more memory than libpng's // internal limit (default: 8M), try to (reasonably) raise it. if (data_size > png_get_chunk_malloc_max(png) && data_size < (1u << 24)) { @@ -295,9 +293,9 @@ int ReadPNG(const uint8_t* const data, size_t data_size, png_set_read_fn(png, &context, ReadFunc); png_read_info(png, info); - if (!png_get_IHDR(png, info, - &width, &height, &bit_depth, &color_type, &interlaced, - NULL, NULL)) goto Error; + if (!png_get_IHDR(png, info, &width, &height, &bit_depth, &color_type, + &interlaced, NULL, NULL)) + goto Error; png_set_strip_16(png); png_set_packing(png); @@ -368,24 +366,25 @@ int ReadPNG(const uint8_t* const data, size_t data_size, goto Error; } - End: +End: if (png != NULL) { - png_destroy_read_struct((png_structpp)&png, - (png_infopp)&info, (png_infopp)&end_info); + png_destroy_read_struct((png_structpp)&png, (png_infopp)&info, + (png_infopp)&end_info); } free(rgb); return ok; } -#else // !WEBP_HAVE_PNG +#else // !WEBP_HAVE_PNG int ReadPNG(const uint8_t* const data, size_t data_size, - struct WebPPicture* const pic, - int keep_alpha, struct Metadata* const metadata) { + struct WebPPicture* const pic, int keep_alpha, + struct Metadata* const metadata) { (void)data; (void)data_size; (void)pic; (void)keep_alpha; (void)metadata; - fprintf(stderr, "PNG support not compiled. Please install the libpng " + fprintf(stderr, + "PNG support not compiled. Please install the libpng " "development package before building.\n"); return 0; } diff --git a/imageio/pngdec.h b/imageio/pngdec.h index 06d98977..9a7306fa 100644 --- a/imageio/pngdec.h +++ b/imageio/pngdec.h @@ -29,11 +29,11 @@ struct WebPPicture; // or YUVA. Otherwise, alpha channel is dropped and output is RGB or YUV. // Returns true on success. int ReadPNG(const uint8_t* const data, size_t data_size, - struct WebPPicture* const pic, - int keep_alpha, struct Metadata* const metadata); + struct WebPPicture* const pic, int keep_alpha, + struct Metadata* const metadata); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_IMAGEIO_PNGDEC_H_ diff --git a/imageio/pnmdec.c b/imageio/pnmdec.c index a6cabf13..cad7b140 100644 --- a/imageio/pnmdec.c +++ b/imageio/pnmdec.c @@ -26,11 +26,11 @@ #endif typedef enum { - WIDTH_FLAG = 1 << 0, - HEIGHT_FLAG = 1 << 1, - DEPTH_FLAG = 1 << 2, - MAXVAL_FLAG = 1 << 3, - TUPLE_FLAG = 1 << 4, + WIDTH_FLAG = 1 << 0, + HEIGHT_FLAG = 1 << 1, + DEPTH_FLAG = 1 << 2, + MAXVAL_FLAG = 1 << 3, + TUPLE_FLAG = 1 << 4, ALL_NEEDED_FLAGS = WIDTH_FLAG | HEIGHT_FLAG | DEPTH_FLAG | MAXVAL_FLAG } PNMFlags; @@ -39,9 +39,9 @@ typedef struct { size_t data_size; int width, height; int bytes_per_px; - int depth; // 1 (grayscale), 2 (grayscale + alpha), 3 (rgb), 4 (rgba) + int depth; // 1 (grayscale), 2 (grayscale + alpha), 3 (rgb), 4 (rgba) int max_value; - int type; // 5, 6 or 7 + int type; // 5, 6 or 7 int seen_flags; } PNMInfo; @@ -55,7 +55,7 @@ static size_t ReadLine(const uint8_t* const data, size_t off, size_t data_size, char out[MAX_LINE_SIZE + 1], size_t* const out_size) { size_t i = 0; *out_size = 0; - redo: +redo: for (i = 0; i < MAX_LINE_SIZE && off < data_size; ++i) { out[i] = data[off++]; if (out[i] == '\n') break; @@ -64,7 +64,7 @@ static size_t ReadLine(const uint8_t* const data, size_t off, size_t data_size, if (i == 0) goto redo; // empty line if (out[0] == '#') goto redo; // skip comment } - out[i] = 0; // safety sentinel + out[i] = 0; // safety sentinel *out_size = i; return off; } @@ -173,9 +173,8 @@ static size_t ReadHeader(PNMInfo* const info) { info->depth = (info->type == 5) ? 1 : 3; } // perform some basic numerical validation - if (info->width <= 0 || info->height <= 0 || - info->type <= 0 || info->type >= 9 || - info->depth <= 0 || info->depth > 4 || + if (info->width <= 0 || info->height <= 0 || info->type <= 0 || + info->type >= 9 || info->depth <= 0 || info->depth > 4 || info->max_value <= 0 || info->max_value >= 65536) { return 0; } @@ -183,13 +182,12 @@ static size_t ReadHeader(PNMInfo* const info) { return off; } -int ReadPNM(const uint8_t* const data, size_t data_size, - WebPPicture* const pic, int keep_alpha, - struct Metadata* const metadata) { +int ReadPNM(const uint8_t* const data, size_t data_size, WebPPicture* const pic, + int keep_alpha, struct Metadata* const metadata) { int ok = 0; int i, j; uint64_t stride, pixel_bytes, sample_size, depth; - uint8_t* rgb = NULL, *tmp_rgb; + uint8_t *rgb = NULL, *tmp_rgb; size_t offset; PNMInfo info; @@ -209,8 +207,8 @@ int ReadPNM(const uint8_t* const data, size_t data_size, // Some basic validations. if (pic == NULL) goto End; if (info.width > WEBP_MAX_DIMENSION || info.height > WEBP_MAX_DIMENSION) { - fprintf(stderr, "Invalid %dx%d dimension for PNM\n", - info.width, info.height); + fprintf(stderr, "Invalid %dx%d dimension for PNM\n", info.width, + info.height); goto End; } @@ -258,8 +256,8 @@ int ReadPNM(const uint8_t* const data, size_t data_size, const uint32_t round = info.max_value / 2; int k = 0; for (i = 0; i < info.width * info.depth; ++i) { - uint32_t v = (sample_size == 2) ? 256u * in[2 * i + 0] + in[2 * i + 1] - : in[i]; + uint32_t v = + (sample_size == 2) ? 256u * in[2 * i + 0] + in[2 * i + 1] : in[i]; if (info.max_value != 255) v = (v * 255u + round) / info.max_value; if (v > 255u) v = 255u; if (info.depth > 2) { @@ -291,7 +289,7 @@ int ReadPNM(const uint8_t* const data, size_t data_size, if (!ok) goto End; ok = 1; - End: +End: free((void*)rgb); (void)metadata; diff --git a/imageio/pnmdec.h b/imageio/pnmdec.h index e496e6bf..3a0008bf 100644 --- a/imageio/pnmdec.h +++ b/imageio/pnmdec.h @@ -33,7 +33,7 @@ int ReadPNM(const uint8_t* const data, size_t data_size, struct Metadata* const metadata); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_IMAGEIO_PNMDEC_H_ diff --git a/imageio/tiffdec.c b/imageio/tiffdec.c index 656ed557..3967f11c 100644 --- a/imageio/tiffdec.c +++ b/imageio/tiffdec.c @@ -31,9 +31,9 @@ static const struct { ttag_t tag; size_t storage_offset; } kTIFFMetadataMap[] = { - { TIFFTAG_ICCPROFILE, METADATA_OFFSET(iccp) }, - { TIFFTAG_XMLPACKET, METADATA_OFFSET(xmp) }, - { 0, 0 }, + {TIFFTAG_ICCPROFILE, METADATA_OFFSET(iccp)}, + {TIFFTAG_XMLPACKET, METADATA_OFFSET(xmp)}, + {0, 0}, }; // Returns true on success. The caller must use MetadataFree() on 'metadata' in @@ -86,9 +86,9 @@ static toff_t MySize(thandle_t opaque) { static toff_t MySeek(thandle_t opaque, toff_t offset, int whence) { MyData* const my_data = (MyData*)opaque; - offset += (whence == SEEK_CUR) ? my_data->pos - : (whence == SEEK_SET) ? 0 - : my_data->size; + offset += (whence == SEEK_CUR) ? my_data->pos + : (whence == SEEK_SET) ? 0 + : my_data->size; if (offset > my_data->size) return (toff_t)-1; my_data->pos = offset; return offset; @@ -120,7 +120,7 @@ static tsize_t MyRead(thandle_t opaque, void* dst, tsize_t size) { // Unmultiply Argb data. Taken from dsp/alpha_processing // (we don't want to force a dependency to a libdspdec library). -#define MFIX 24 // 24bit fixed-point arithmetic +#define MFIX 24 // 24bit fixed-point arithmetic #define HALF ((1u << MFIX) >> 1) static uint32_t Unmult(uint8_t x, uint32_t mult) { @@ -128,9 +128,7 @@ static uint32_t Unmult(uint8_t x, uint32_t mult) { return (v > 255u) ? 255u : v; } -static WEBP_INLINE uint32_t GetScale(uint32_t a) { - return (255u << MFIX) / a; -} +static WEBP_INLINE uint32_t GetScale(uint32_t a) { return (255u << MFIX) / a; } #undef MFIX #undef HALF @@ -140,7 +138,7 @@ static void MultARGBRow(uint8_t* ptr, int width) { for (x = 0; x < width; ++x, ptr += 4) { const uint32_t alpha = ptr[3]; if (alpha < 255) { - if (alpha == 0) { // alpha == 0 + if (alpha == 0) { // alpha == 0 ptr[0] = ptr[1] = ptr[2] = 0; } else { const uint32_t scale = GetScale(alpha); @@ -153,9 +151,8 @@ static void MultARGBRow(uint8_t* ptr, int width) { } int ReadTIFF(const uint8_t* const data, size_t data_size, - WebPPicture* const pic, int keep_alpha, - Metadata* const metadata) { - MyData my_data = { data, (toff_t)data_size, 0 }; + WebPPicture* const pic, int keep_alpha, Metadata* const metadata) { + MyData my_data = {data, (toff_t)data_size, 0}; TIFF* tif; uint32_t image_width, image_height, tile_width, tile_height; uint64_t stride; @@ -171,8 +168,7 @@ int ReadTIFF(const uint8_t* const data, size_t data_size, return 0; } - tif = TIFFClientOpen("Memory", "r", &my_data, - MyRead, MyRead, MySeek, MyClose, + tif = TIFFClientOpen("Memory", "r", &my_data, MyRead, MyRead, MySeek, MyClose, MySize, MyMapFile, MyUnmapFile); if (tif == NULL) { fprintf(stderr, "Error! Cannot parse TIFF file\n"); @@ -181,9 +177,10 @@ int ReadTIFF(const uint8_t* const data, size_t data_size, dircount = TIFFNumberOfDirectories(tif); if (dircount > 1) { - fprintf(stderr, "Warning: multi-directory TIFF files are not supported.\n" - "Only the first will be used, %d will be ignored.\n", - dircount - 1); + fprintf(stderr, + "Warning: multi-directory TIFF files are not supported.\n" + "Only the first will be used, %d will be ignored.\n", + dircount - 1); } if (!TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLESPERPIXEL, &samples_per_px)) { fprintf(stderr, "Error! Cannot retrieve TIFF samples-per-pixel info.\n"); @@ -253,9 +250,10 @@ int ReadTIFF(const uint8_t* const data, size_t data_size, tmp += stride; } } - ok = keep_alpha - ? WebPPictureImportRGBA(pic, (const uint8_t*)raster, (int)stride) - : WebPPictureImportRGBX(pic, (const uint8_t*)raster, (int)stride); + ok = + keep_alpha + ? WebPPictureImportRGBA(pic, (const uint8_t*)raster, (int)stride) + : WebPPictureImportRGBX(pic, (const uint8_t*)raster, (int)stride); } _TIFFfree(raster); } else { @@ -272,11 +270,11 @@ int ReadTIFF(const uint8_t* const data, size_t data_size, } } } - End: +End: TIFFClose(tif); return ok; } -#else // !WEBP_HAVE_TIFF +#else // !WEBP_HAVE_TIFF int ReadTIFF(const uint8_t* const data, size_t data_size, struct WebPPicture* const pic, int keep_alpha, struct Metadata* const metadata) { @@ -285,7 +283,8 @@ int ReadTIFF(const uint8_t* const data, size_t data_size, (void)pic; (void)keep_alpha; (void)metadata; - fprintf(stderr, "TIFF support not compiled. Please install the libtiff " + fprintf(stderr, + "TIFF support not compiled. Please install the libtiff " "development package before building.\n"); return 0; } diff --git a/imageio/tiffdec.h b/imageio/tiffdec.h index 3be830d0..8950891f 100644 --- a/imageio/tiffdec.h +++ b/imageio/tiffdec.h @@ -33,7 +33,7 @@ int ReadTIFF(const uint8_t* const data, size_t data_size, struct Metadata* const metadata); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_IMAGEIO_TIFFDEC_H_ diff --git a/imageio/webpdec.c b/imageio/webpdec.c index 72dc02bf..2ae8a97c 100644 --- a/imageio/webpdec.c +++ b/imageio/webpdec.c @@ -31,9 +31,14 @@ // WebP decoding static const char* const kStatusMessages[VP8_STATUS_NOT_ENOUGH_DATA + 1] = { - "OK", "OUT_OF_MEMORY", "INVALID_PARAM", "BITSTREAM_ERROR", - "UNSUPPORTED_FEATURE", "SUSPENDED", "USER_ABORT", "NOT_ENOUGH_DATA" -}; + "OK", + "OUT_OF_MEMORY", + "INVALID_PARAM", + "BITSTREAM_ERROR", + "UNSUPPORTED_FEATURE", + "SUSPENDED", + "USER_ABORT", + "NOT_ENOUGH_DATA"}; static void PrintAnimationWarning(const WebPDecoderConfig* const config) { if (config->input.has_animation) { @@ -53,8 +58,7 @@ void PrintWebPError(const char* const in_file, int status) { fprintf(stderr, "\n"); } -int LoadWebP(const char* const in_file, - const uint8_t** data, size_t* data_size, +int LoadWebP(const char* const in_file, const uint8_t** data, size_t* data_size, WebPBitstreamFeatures* bitstream) { VP8StatusCode status; WebPBitstreamFeatures local_features; @@ -84,9 +88,8 @@ VP8StatusCode DecodeWebP(const uint8_t* const data, size_t data_size, return WebPDecode(data, data_size, config); } -VP8StatusCode DecodeWebPIncremental( - const uint8_t* const data, size_t data_size, - WebPDecoderConfig* const config) { +VP8StatusCode DecodeWebPIncremental(const uint8_t* const data, size_t data_size, + WebPDecoderConfig* const config) { VP8StatusCode status = VP8_STATUS_OK; if (config == NULL) return VP8_STATUS_INVALID_PARAM; @@ -111,7 +114,7 @@ VP8StatusCode DecodeWebPIncremental( static int ExtractMetadata(const uint8_t* const data, size_t data_size, Metadata* const metadata) { - WebPData webp_data = { data, data_size }; + WebPData webp_data = {data, data_size}; WebPDemuxer* const demux = WebPDemux(&webp_data); WebPChunkIterator chunk_iter; uint32_t flags; @@ -143,8 +146,7 @@ static int ExtractMetadata(const uint8_t* const data, size_t data_size, // ----------------------------------------------------------------------------- int ReadWebP(const uint8_t* const data, size_t data_size, - WebPPicture* const pic, - int keep_alpha, Metadata* const metadata) { + WebPPicture* const pic, int keep_alpha, Metadata* const metadata) { int ok = 0; VP8StatusCode status = VP8_STATUS_OK; WebPDecoderConfig config; @@ -223,7 +225,7 @@ int ReadWebP(const uint8_t* const data, size_t data_size, argb += pic->argb_stride; } } - } while (0); // <- so we can 'break' out of the loop + } while (0); // <- so we can 'break' out of the loop if (status != VP8_STATUS_OK) { PrintWebPError("input data", status); diff --git a/imageio/webpdec.h b/imageio/webpdec.h index d1c6521b..f27f4bcd 100644 --- a/imageio/webpdec.h +++ b/imageio/webpdec.h @@ -35,8 +35,7 @@ void PrintWebPError(const char* const in_file, int status); // Reads a WebP from 'in_file', returning the contents and size in 'data' and // 'data_size'. If not NULL, 'bitstream' is populated using WebPGetFeatures(). // Returns true on success. -int LoadWebP(const char* const in_file, - const uint8_t** data, size_t* data_size, +int LoadWebP(const char* const in_file, const uint8_t** data, size_t* data_size, WebPBitstreamFeatures* bitstream); // Decodes the WebP contained in 'data'. @@ -48,9 +47,8 @@ VP8StatusCode DecodeWebP(const uint8_t* const data, size_t data_size, WebPDecoderConfig* const config); // Same as DecodeWebP(), but using the incremental decoder. -VP8StatusCode DecodeWebPIncremental( - const uint8_t* const data, size_t data_size, - WebPDecoderConfig* const config); +VP8StatusCode DecodeWebPIncremental(const uint8_t* const data, size_t data_size, + WebPDecoderConfig* const config); //------------------------------------------------------------------------------ @@ -60,11 +58,11 @@ VP8StatusCode DecodeWebPIncremental( // or YUVA. Otherwise, alpha channel is dropped and output is RGB or YUV. // Returns true on success. int ReadWebP(const uint8_t* const data, size_t data_size, - struct WebPPicture* const pic, - int keep_alpha, struct Metadata* const metadata); + struct WebPPicture* const pic, int keep_alpha, + struct Metadata* const metadata); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_IMAGEIO_WEBPDEC_H_ diff --git a/imageio/wicdec.c b/imageio/wicdec.c index 42001c6e..84e46cf7 100644 --- a/imageio/wicdec.c +++ b/imageio/wicdec.c @@ -25,31 +25,31 @@ #endif #define CINTERFACE #define COBJMACROS -#define _WIN32_IE 0x500 // Workaround bug in shlwapi.h when compiling C++ - // code with COBJMACROS. +#define _WIN32_IE \ + 0x500 // Workaround bug in shlwapi.h when compiling C++ + // code with COBJMACROS. #include // CreateStreamOnHGlobal() #include #include -#include #include +#include #include "../examples/unicode.h" #include "./imageio_util.h" #include "./metadata.h" #include "webp/encode.h" -#define IFS(fn) \ - do { \ - if (SUCCEEDED(hr)) { \ - hr = (fn); \ - if (FAILED(hr)) fprintf(stderr, #fn " failed %08lx\n", hr); \ - } \ +#define IFS(fn) \ + do { \ + if (SUCCEEDED(hr)) { \ + hr = (fn); \ + if (FAILED(hr)) fprintf(stderr, #fn " failed %08lx\n", hr); \ + } \ } while (0) // modified version of DEFINE_GUID from guiddef.h. #define WEBP_DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - static const GUID name = \ - { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } + static const GUID name = {l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}} #ifdef __cplusplus #define MAKE_REFGUID(x) (x) @@ -66,23 +66,17 @@ typedef struct WICFormatImporter { // From Microsoft SDK 7.0a -- wincodec.h // Create local copies for compatibility when building against earlier // versions of the SDK. -WEBP_DEFINE_GUID(GUID_WICPixelFormat24bppBGR_, - 0x6fddc324, 0x4e03, 0x4bfe, - 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0c); -WEBP_DEFINE_GUID(GUID_WICPixelFormat24bppRGB_, - 0x6fddc324, 0x4e03, 0x4bfe, - 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0d); -WEBP_DEFINE_GUID(GUID_WICPixelFormat32bppBGRA_, - 0x6fddc324, 0x4e03, 0x4bfe, +WEBP_DEFINE_GUID(GUID_WICPixelFormat24bppBGR_, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, + 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0c); +WEBP_DEFINE_GUID(GUID_WICPixelFormat24bppRGB_, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, + 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0d); +WEBP_DEFINE_GUID(GUID_WICPixelFormat32bppBGRA_, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0f); -WEBP_DEFINE_GUID(GUID_WICPixelFormat32bppRGBA_, - 0xf5c7ad2d, 0x6a8d, 0x43dd, +WEBP_DEFINE_GUID(GUID_WICPixelFormat32bppRGBA_, 0xf5c7ad2d, 0x6a8d, 0x43dd, 0xa7, 0xa8, 0xa2, 0x99, 0x35, 0x26, 0x1a, 0xe9); -WEBP_DEFINE_GUID(GUID_WICPixelFormat64bppBGRA_, - 0x1562ff7c, 0xd352, 0x46f9, +WEBP_DEFINE_GUID(GUID_WICPixelFormat64bppBGRA_, 0x1562ff7c, 0xd352, 0x46f9, 0x97, 0x9e, 0x42, 0x97, 0x6b, 0x79, 0x22, 0x46); -WEBP_DEFINE_GUID(GUID_WICPixelFormat64bppRGBA_, - 0x6fddc324, 0x4e03, 0x4bfe, +WEBP_DEFINE_GUID(GUID_WICPixelFormat64bppRGBA_, 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x16); static HRESULT OpenInputStream(const char* filename, IStream** stream) { @@ -147,8 +141,7 @@ static HRESULT ExtractICCP(IWICImagingFactory* const factory, if (SUCCEEDED(hr)) { UINT num_color_contexts; - IFS(IWICBitmapFrameDecode_GetColorContexts(frame, - count, color_contexts, + IFS(IWICBitmapFrameDecode_GetColorContexts(frame, count, color_contexts, &num_color_contexts)); assert(FAILED(hr) || num_color_contexts <= count); for (i = 0; SUCCEEDED(hr) && i < num_color_contexts; ++i) { @@ -156,8 +149,8 @@ static HRESULT ExtractICCP(IWICImagingFactory* const factory, IFS(IWICColorContext_GetType(color_contexts[i], &type)); if (SUCCEEDED(hr) && type == WICColorContextProfile) { UINT size; - IFS(IWICColorContext_GetProfileBytes(color_contexts[i], - 0, NULL, &size)); + IFS(IWICColorContext_GetProfileBytes(color_contexts[i], 0, NULL, + &size)); if (SUCCEEDED(hr) && size > 0) { iccp->bytes = (uint8_t*)malloc(size); if (iccp->bytes == NULL) { @@ -165,9 +158,8 @@ static HRESULT ExtractICCP(IWICImagingFactory* const factory, break; } iccp->size = size; - IFS(IWICColorContext_GetProfileBytes(color_contexts[i], - (UINT)iccp->size, iccp->bytes, - &size)); + IFS(IWICColorContext_GetProfileBytes( + color_contexts[i], (UINT)iccp->size, iccp->bytes, &size)); if (SUCCEEDED(hr) && size != iccp->size) { fprintf(stderr, "Warning! ICC profile size (%u) != expected (%u)\n", size, (uint32_t)iccp->size); @@ -209,8 +201,7 @@ static int HasPalette(GUID pixel_format) { static int HasAlpha(IWICImagingFactory* const factory, IWICBitmapDecoder* const decoder, - IWICBitmapFrameDecode* const frame, - GUID pixel_format) { + IWICBitmapFrameDecode* const frame, GUID pixel_format) { int has_alpha; if (HasPalette(pixel_format)) { IWICPalette* frame_palette = NULL; @@ -245,21 +236,20 @@ static int HasAlpha(IWICImagingFactory* const factory, return has_alpha; } -int ReadPictureWithWIC(const char* const filename, - WebPPicture* const pic, int keep_alpha, - Metadata* const metadata) { +int ReadPictureWithWIC(const char* const filename, WebPPicture* const pic, + int keep_alpha, Metadata* const metadata) { // From Microsoft SDK 6.0a -- ks.h // Define a local copy to avoid link errors under mingw. WEBP_DEFINE_GUID(GUID_NULL_, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); static const WICFormatImporter kAlphaFormatImporters[] = { - { &GUID_WICPixelFormat32bppBGRA_, 4, WebPPictureImportBGRA }, - { &GUID_WICPixelFormat32bppRGBA_, 4, WebPPictureImportRGBA }, - { NULL, 0, NULL }, + {&GUID_WICPixelFormat32bppBGRA_, 4, WebPPictureImportBGRA}, + {&GUID_WICPixelFormat32bppRGBA_, 4, WebPPictureImportRGBA}, + {NULL, 0, NULL}, }; static const WICFormatImporter kNonAlphaFormatImporters[] = { - { &GUID_WICPixelFormat24bppBGR_, 3, WebPPictureImportBGR }, - { &GUID_WICPixelFormat24bppRGB_, 3, WebPPictureImportRGB }, - { NULL, 0, NULL }, + {&GUID_WICPixelFormat24bppBGR_, 3, WebPPictureImportBGR}, + {&GUID_WICPixelFormat24bppRGB_, 3, WebPPictureImportRGB}, + {NULL, 0, NULL}, }; HRESULT hr = S_OK; IWICBitmapFrameDecode* frame = NULL; @@ -274,26 +264,20 @@ int ReadPictureWithWIC(const char* const filename, const WICFormatImporter* importer = NULL; GUID src_container_format = GUID_NULL_; // From Windows Kits\10\Include\10.0.19041.0\um\wincodec.h - WEBP_DEFINE_GUID(GUID_ContainerFormatWebp_, - 0xe094b0e2, 0x67f2, 0x45b3, - 0xb0, 0xea, 0x11, 0x53, 0x37, 0xca, 0x7c, 0xf3); + WEBP_DEFINE_GUID(GUID_ContainerFormatWebp_, 0xe094b0e2, 0x67f2, 0x45b3, 0xb0, + 0xea, 0x11, 0x53, 0x37, 0xca, 0x7c, 0xf3); static const GUID* kAlphaContainers[] = { - &GUID_ContainerFormatBmp, - &GUID_ContainerFormatPng, - &GUID_ContainerFormatTiff, - &GUID_ContainerFormatWebp_, - NULL - }; + &GUID_ContainerFormatBmp, &GUID_ContainerFormatPng, + &GUID_ContainerFormatTiff, &GUID_ContainerFormatWebp_, NULL}; int has_alpha = 0; int64_t stride; if (filename == NULL || pic == NULL) return 0; IFS(CoInitialize(NULL)); - IFS(CoCreateInstance(MAKE_REFGUID(CLSID_WICImagingFactory), NULL, - CLSCTX_INPROC_SERVER, - MAKE_REFGUID(IID_IWICImagingFactory), - (LPVOID*)&factory)); + IFS(CoCreateInstance( + MAKE_REFGUID(CLSID_WICImagingFactory), NULL, CLSCTX_INPROC_SERVER, + MAKE_REFGUID(IID_IWICImagingFactory), (LPVOID*)&factory)); if (hr == REGDB_E_CLASSNOTREG) { fprintf(stderr, "Couldn't access Windows Imaging Component (are you running " @@ -303,8 +287,7 @@ int ReadPictureWithWIC(const char* const filename, // Prepare for image decoding. IFS(OpenInputStream(filename, &stream)); IFS(IWICImagingFactory_CreateDecoderFromStream( - factory, stream, NULL, - WICDecodeMetadataCacheOnDemand, &decoder)); + factory, stream, NULL, WICDecodeMetadataCacheOnDemand, &decoder)); IFS(IWICBitmapDecoder_GetFrameCount(decoder, &frame_count)); if (SUCCEEDED(hr)) { if (frame_count == 0) { @@ -338,18 +321,15 @@ int ReadPictureWithWIC(const char* const filename, hr == S_OK && importer->import != NULL; ++importer) { BOOL can_convert; const HRESULT cchr = IWICFormatConverter_CanConvert( - converter, - MAKE_REFGUID(src_pixel_format), - MAKE_REFGUID(*importer->pixel_format), - &can_convert); + converter, MAKE_REFGUID(src_pixel_format), + MAKE_REFGUID(*importer->pixel_format), &can_convert); if (SUCCEEDED(cchr) && can_convert) break; } if (importer->import == NULL) hr = E_FAIL; - IFS(IWICFormatConverter_Initialize(converter, (IWICBitmapSource*)frame, - importer->pixel_format, - WICBitmapDitherTypeNone, - NULL, 0.0, WICBitmapPaletteTypeCustom)); + IFS(IWICFormatConverter_Initialize( + converter, (IWICBitmapSource*)frame, importer->pixel_format, + WICBitmapDitherTypeNone, NULL, 0.0, WICBitmapPaletteTypeCustom)); // Decode. IFS(IWICFormatConverter_GetSize(converter, &width, &height)); @@ -361,18 +341,17 @@ int ReadPictureWithWIC(const char* const filename, if (SUCCEEDED(hr)) { rgb = (BYTE*)malloc((size_t)stride * height); - if (rgb == NULL) - hr = E_OUTOFMEMORY; + if (rgb == NULL) hr = E_OUTOFMEMORY; } - IFS(IWICFormatConverter_CopyPixels(converter, NULL, - (UINT)stride, (UINT)stride * height, rgb)); + IFS(IWICFormatConverter_CopyPixels(converter, NULL, (UINT)stride, + (UINT)stride * height, rgb)); // WebP conversion. if (SUCCEEDED(hr)) { int ok; pic->width = width; pic->height = height; - pic->use_argb = 1; // For WIC, we always force to argb + pic->use_argb = 1; // For WIC, we always force to argb ok = importer->import(pic, rgb, (int)stride); if (!ok) hr = E_FAIL; } @@ -394,7 +373,7 @@ int ReadPictureWithWIC(const char* const filename, free(rgb); return SUCCEEDED(hr); } -#else // !HAVE_WINCODEC_H +#else // !HAVE_WINCODEC_H int ReadPictureWithWIC(const char* const filename, struct WebPPicture* const pic, int keep_alpha, struct Metadata* const metadata) { @@ -402,10 +381,11 @@ int ReadPictureWithWIC(const char* const filename, (void)pic; (void)keep_alpha; (void)metadata; - fprintf(stderr, "Windows Imaging Component (WIC) support not compiled. " - "Visual Studio and mingw-w64 builds support WIC. Make sure " - "wincodec.h detection is working correctly if using autoconf " - "and HAVE_WINCODEC_H is defined before building.\n"); + fprintf(stderr, + "Windows Imaging Component (WIC) support not compiled. " + "Visual Studio and mingw-w64 builds support WIC. Make sure " + "wincodec.h detection is working correctly if using autoconf " + "and HAVE_WINCODEC_H is defined before building.\n"); return 0; } #endif // HAVE_WINCODEC_H diff --git a/imageio/wicdec.h b/imageio/wicdec.h index d9eeca82..a7bce87d 100644 --- a/imageio/wicdec.h +++ b/imageio/wicdec.h @@ -28,7 +28,7 @@ int ReadPictureWithWIC(const char* const filename, struct Metadata* const metadata); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_IMAGEIO_WICDEC_H_ diff --git a/sharpyuv/sharpyuv.c b/sharpyuv/sharpyuv.c index 25b842dd..f5363aa4 100644 --- a/sharpyuv/sharpyuv.c +++ b/sharpyuv/sharpyuv.c @@ -26,9 +26,7 @@ //------------------------------------------------------------------------------ -int SharpYuvGetVersion(void) { - return SHARPYUV_VERSION; -} +int SharpYuvGetVersion(void) { return SHARPYUV_VERSION; } //------------------------------------------------------------------------------ // Sharp RGB->YUV conversion @@ -49,8 +47,8 @@ static int GetPrecisionShift(int rgb_bit_depth) { : (kMaxBitDepth - rgb_bit_depth); } -typedef int16_t fixed_t; // signed type with extra precision for UV -typedef uint16_t fixed_y_t; // unsigned type with extra precision for W +typedef int16_t fixed_t; // signed type with extra precision for UV +typedef uint16_t fixed_y_t; // unsigned type with extra precision for W //------------------------------------------------------------------------------ @@ -121,7 +119,7 @@ static void UpdateChroma(const fixed_y_t* src1, const fixed_y_t* src2, dst[0 * uv_w] = (fixed_t)(r - W); dst[1 * uv_w] = (fixed_t)(g - W); dst[2 * uv_w] = (fixed_t)(b - W); - dst += 1; + dst += 1; src1 += 2; src2 += 2; } while (++i < uv_w); @@ -148,12 +146,9 @@ static WEBP_INLINE int Shift(int v, int shift) { return (shift >= 0) ? (v << shift) : (v >> -shift); } -static void ImportOneRow(const uint8_t* const r_ptr, - const uint8_t* const g_ptr, - const uint8_t* const b_ptr, - int rgb_step, - int rgb_bit_depth, - int pic_width, +static void ImportOneRow(const uint8_t* const r_ptr, const uint8_t* const g_ptr, + const uint8_t* const b_ptr, int rgb_step, + int rgb_bit_depth, int pic_width, fixed_y_t* const dst) { // Convert the rgb_step from a number of bytes to a number of uint8_t or // uint16_t values depending the bit depth. @@ -181,18 +176,14 @@ static void ImportOneRow(const uint8_t* const r_ptr, } static void InterpolateTwoRows(const fixed_y_t* const best_y, - const fixed_t* prev_uv, - const fixed_t* cur_uv, - const fixed_t* next_uv, - int w, - fixed_y_t* out1, - fixed_y_t* out2, - int rgb_bit_depth) { + const fixed_t* prev_uv, const fixed_t* cur_uv, + const fixed_t* next_uv, int w, fixed_y_t* out1, + fixed_y_t* out2, int rgb_bit_depth) { const int uv_w = w >> 1; - const int len = (w - 1) >> 1; // length to filter + const int len = (w - 1) >> 1; // length to filter int k = 3; const int bit_depth = rgb_bit_depth + GetPrecisionShift(rgb_bit_depth); - while (k-- > 0) { // process each R/G/B segments in turn + while (k-- > 0) { // process each R/G/B segments in turn // special boundary case for i==0 out1[0] = Filter2(cur_uv[0], prev_uv[0], best_y[0], bit_depth); out2[0] = Filter2(cur_uv[0], next_uv[0], best_y[w], bit_depth); @@ -212,7 +203,7 @@ static void InterpolateTwoRows(const fixed_y_t* const best_y, out1 += w; out2 += w; prev_uv += uv_w; - cur_uv += uv_w; + cur_uv += uv_w; next_uv += uv_w; } } @@ -220,16 +211,16 @@ static void InterpolateTwoRows(const fixed_y_t* const best_y, static WEBP_INLINE int RGBToYUVComponent(int r, int g, int b, const int coeffs[4], int sfix) { const int srounder = 1 << (YUV_FIX + sfix - 1); - const int luma = coeffs[0] * r + coeffs[1] * g + coeffs[2] * b + - coeffs[3] + srounder; + const int luma = + coeffs[0] * r + coeffs[1] * g + coeffs[2] * b + coeffs[3] + srounder; return (luma >> (YUV_FIX + sfix)); } static int ConvertWRGBToYUV(const fixed_y_t* best_y, const fixed_t* best_uv, uint8_t* y_ptr, int y_stride, uint8_t* u_ptr, int u_stride, uint8_t* v_ptr, int v_stride, - int rgb_bit_depth, - int yuv_bit_depth, int width, int height, + int rgb_bit_depth, int yuv_bit_depth, int width, + int height, const SharpYuvConversionMatrix* yuv_matrix) { int i, j; const fixed_t* const best_uv_base = best_uv; @@ -319,7 +310,7 @@ static int DoSharpArgbToYuv(const uint8_t* r_ptr, const uint8_t* g_ptr, // TODO(skal): allocate one big memory chunk. But for now, it's easier // for valgrind debugging to have several chunks. - fixed_y_t* const tmp_buffer = SAFE_ALLOC(w * 3, 2, fixed_y_t); // scratch + fixed_y_t* const tmp_buffer = SAFE_ALLOC(w * 3, 2, fixed_y_t); // scratch fixed_y_t* const best_y_base = SAFE_ALLOC(w, h, fixed_y_t); fixed_y_t* const target_y_base = SAFE_ALLOC(w, h, fixed_y_t); fixed_y_t* const best_rgb_y = SAFE_ALLOC(w, 2, fixed_y_t); @@ -335,9 +326,8 @@ static int DoSharpArgbToYuv(const uint8_t* r_ptr, const uint8_t* g_ptr, assert(w > 0); assert(h > 0); - if (best_y_base == NULL || best_uv_base == NULL || - target_y_base == NULL || target_uv_base == NULL || - best_rgb_y == NULL || best_rgb_uv == NULL || + if (best_y_base == NULL || best_uv_base == NULL || target_y_base == NULL || + target_uv_base == NULL || best_rgb_y == NULL || best_rgb_uv == NULL || tmp_buffer == NULL) { ok = 0; goto End; @@ -350,8 +340,7 @@ static int DoSharpArgbToYuv(const uint8_t* r_ptr, const uint8_t* g_ptr, fixed_y_t* const src2 = tmp_buffer + 3 * w; // prepare two rows of input - ImportOneRow(r_ptr, g_ptr, b_ptr, rgb_step, rgb_bit_depth, width, - src1); + ImportOneRow(r_ptr, g_ptr, b_ptr, rgb_step, rgb_bit_depth, width, src1); if (!is_last_row) { ImportOneRow(r_ptr + rgb_stride, g_ptr + rgb_stride, b_ptr + rgb_stride, rgb_step, rgb_bit_depth, width, src2); @@ -390,8 +379,8 @@ static int DoSharpArgbToYuv(const uint8_t* r_ptr, const uint8_t* g_ptr, fixed_y_t* const src2 = tmp_buffer + 3 * w; { const fixed_t* const next_uv = cur_uv + ((j < h - 2) ? 3 * uv_w : 0); - InterpolateTwoRows(best_y, prev_uv, cur_uv, next_uv, w, - src1, src2, rgb_bit_depth); + InterpolateTwoRows(best_y, prev_uv, cur_uv, next_uv, w, src1, src2, + rgb_bit_depth); prev_uv = cur_uv; cur_uv = next_uv; } @@ -424,7 +413,7 @@ static int DoSharpArgbToYuv(const uint8_t* r_ptr, const uint8_t* g_ptr, u_stride, v_ptr, v_stride, rgb_bit_depth, yuv_bit_depth, width, height, yuv_matrix); - End: +End: free(best_y_base); free(best_uv_base); free(target_y_base); @@ -440,16 +429,18 @@ static int DoSharpArgbToYuv(const uint8_t* r_ptr, const uint8_t* g_ptr, #if defined(WEBP_USE_THREAD) && !defined(_WIN32) #include // NOLINT -#define LOCK_ACCESS \ - static pthread_mutex_t sharpyuv_lock = PTHREAD_MUTEX_INITIALIZER; \ - if (pthread_mutex_lock(&sharpyuv_lock)) return -#define UNLOCK_ACCESS_AND_RETURN \ - do { \ - (void)pthread_mutex_unlock(&sharpyuv_lock); \ - return; \ - } while (0) +#define LOCK_ACCESS \ + static pthread_mutex_t sharpyuv_lock = PTHREAD_MUTEX_INITIALIZER; \ + if (pthread_mutex_lock(&sharpyuv_lock)) return +#define UNLOCK_ACCESS_AND_RETURN \ + do { \ + (void)pthread_mutex_unlock(&sharpyuv_lock); \ + return; \ + } while (0) #else // !(defined(WEBP_USE_THREAD) && !defined(_WIN32)) -#define LOCK_ACCESS do {} while (0) +#define LOCK_ACCESS \ + do { \ + } while (0) #define UNLOCK_ACCESS_AND_RETURN return #endif // defined(WEBP_USE_THREAD) && !defined(_WIN32) diff --git a/sharpyuv/sharpyuv_csp.c b/sharpyuv/sharpyuv_csp.c index 9714130e..d36cab98 100644 --- a/sharpyuv/sharpyuv_csp.c +++ b/sharpyuv/sharpyuv_csp.c @@ -67,33 +67,33 @@ void SharpYuvComputeConversionMatrix(const SharpYuvColorSpace* yuv_color_space, // U = -0.1483 * R - 0.2911 * G + 0.4394 * B + 128 // V = 0.4394 * R - 0.3679 * G - 0.0715 * B + 128 static const SharpYuvConversionMatrix kWebpMatrix = { - {16839, 33059, 6420, 16 << 16}, - {-9719, -19081, 28800, 128 << 16}, - {28800, -24116, -4684, 128 << 16}, + {16839, 33059, 6420, 16 << 16}, + {-9719, -19081, 28800, 128 << 16}, + {28800, -24116, -4684, 128 << 16}, }; // Kr=0.2990f Kb=0.1140f bit_depth=8 range=kSharpYuvRangeLimited static const SharpYuvConversionMatrix kRec601LimitedMatrix = { - {16829, 33039, 6416, 16 << 16}, - {-9714, -19071, 28784, 128 << 16}, - {28784, -24103, -4681, 128 << 16}, + {16829, 33039, 6416, 16 << 16}, + {-9714, -19071, 28784, 128 << 16}, + {28784, -24103, -4681, 128 << 16}, }; // Kr=0.2990f Kb=0.1140f bit_depth=8 range=kSharpYuvRangeFull static const SharpYuvConversionMatrix kRec601FullMatrix = { - {19595, 38470, 7471, 0}, - {-11058, -21710, 32768, 128 << 16}, - {32768, -27439, -5329, 128 << 16}, + {19595, 38470, 7471, 0}, + {-11058, -21710, 32768, 128 << 16}, + {32768, -27439, -5329, 128 << 16}, }; // Kr=0.2126f Kb=0.0722f bit_depth=8 range=kSharpYuvRangeLimited static const SharpYuvConversionMatrix kRec709LimitedMatrix = { - {11966, 40254, 4064, 16 << 16}, - {-6596, -22189, 28784, 128 << 16}, - {28784, -26145, -2639, 128 << 16}, + {11966, 40254, 4064, 16 << 16}, + {-6596, -22189, 28784, 128 << 16}, + {28784, -26145, -2639, 128 << 16}, }; // Kr=0.2126f Kb=0.0722f bit_depth=8 range=kSharpYuvRangeFull static const SharpYuvConversionMatrix kRec709FullMatrix = { - {13933, 46871, 4732, 0}, - {-7509, -25259, 32768, 128 << 16}, - {32768, -29763, -3005, 128 << 16}, + {13933, 46871, 4732, 0}, + {-7509, -25259, 32768, 128 << 16}, + {32768, -29763, -3005, 128 << 16}, }; const SharpYuvConversionMatrix* SharpYuvGetConversionMatrix( diff --git a/sharpyuv/sharpyuv_csp.h b/sharpyuv/sharpyuv_csp.h index efc01053..2ad325ff 100644 --- a/sharpyuv/sharpyuv_csp.h +++ b/sharpyuv/sharpyuv_csp.h @@ -20,8 +20,8 @@ extern "C" { // Range of YUV values. typedef enum { - kSharpYuvRangeFull, // YUV values between [0;255] (for 8 bit) - kSharpYuvRangeLimited // Y in [16;235], YUV in [16;240] (for 8 bit) + kSharpYuvRangeFull, // YUV values between [0;255] (for 8 bit) + kSharpYuvRangeLimited // Y in [16;235], YUV in [16;240] (for 8 bit) } SharpYuvRange; // Constants that define a YUV color space. diff --git a/sharpyuv/sharpyuv_gamma.c b/sharpyuv/sharpyuv_gamma.c index f72be4b8..e69c89fd 100644 --- a/sharpyuv/sharpyuv_gamma.c +++ b/sharpyuv/sharpyuv_gamma.c @@ -67,8 +67,7 @@ void SharpYuvInitGammaTables(void) { } else { value = (1. + a) * pow(g, 1. / kGammaF) - a; } - kLinearToGammaTabS[v] = - (uint32_t)(final_scale * value + 0.5); + kLinearToGammaTabS[v] = (uint32_t)(final_scale * value + 0.5); } // to prevent small rounding errors to cause read-overflow: kLinearToGammaTabS[LINEAR_TO_GAMMA_TAB_SIZE + 1] = @@ -198,7 +197,7 @@ static float ToLinearLog100(float gamma) { // The function is non-bijective so choose the middle of [0, 0.01]. const float mid_interval = 0.01f / 2.f; return (gamma <= 0.0f) ? mid_interval - : Powf(10.0f, 2.f * (MIN(gamma, 1.f) - 1.0f)); + : Powf(10.0f, 2.f * (MIN(gamma, 1.f) - 1.0f)); } static float FromLinearLog100(float linear) { @@ -209,12 +208,12 @@ static float ToLinearLog100Sqrt10(float gamma) { // The function is non-bijective so choose the middle of [0, 0.00316227766f[. const float mid_interval = 0.00316227766f / 2.f; return (gamma <= 0.0f) ? mid_interval - : Powf(10.0f, 2.5f * (MIN(gamma, 1.f) - 1.0f)); + : Powf(10.0f, 2.5f * (MIN(gamma, 1.f) - 1.0f)); } static float FromLinearLog100Sqrt10(float linear) { return (linear < 0.00316227766f) ? 0.0f - : 1.0f + Log10f(MIN(linear, 1.f)) / 2.5f; + : 1.0f + Log10f(MIN(linear, 1.f)) / 2.5f; } static float ToLinearIec61966(float gamma) { diff --git a/sharpyuv/sharpyuv_neon.c b/sharpyuv/sharpyuv_neon.c index 58409148..36a0a66a 100644 --- a/sharpyuv/sharpyuv_neon.c +++ b/sharpyuv/sharpyuv_neon.c @@ -14,9 +14,9 @@ #include "sharpyuv/sharpyuv_dsp.h" #if defined(WEBP_USE_NEON) +#include #include #include -#include static uint16_t clip_NEON(int v, int max) { return (v < 0) ? 0 : (v > max) ? max : (uint16_t)v; @@ -35,11 +35,11 @@ static uint64_t SharpYuvUpdateY_NEON(const uint16_t* ref, const uint16_t* src, const int16x8_t A = vreinterpretq_s16_u16(vld1q_u16(ref + i)); const int16x8_t B = vreinterpretq_s16_u16(vld1q_u16(src + i)); const int16x8_t C = vreinterpretq_s16_u16(vld1q_u16(dst + i)); - const int16x8_t D = vsubq_s16(A, B); // diff_y - const int16x8_t F = vaddq_s16(C, D); // new_y + const int16x8_t D = vsubq_s16(A, B); // diff_y + const int16x8_t F = vaddq_s16(C, D); // new_y const uint16x8_t H = vreinterpretq_u16_s16(vmaxq_s16(vminq_s16(F, max), zero)); - const int16x8_t I = vabsq_s16(D); // abs(diff_y) + const int16x8_t I = vabsq_s16(D); // abs(diff_y) vst1q_u16(dst + i, H); sum = vpadalq_u32(sum, vpaddlq_u16(vreinterpretq_u16_s16(I))); } @@ -60,8 +60,8 @@ static void SharpYuvUpdateRGB_NEON(const int16_t* ref, const int16_t* src, const int16x8_t A = vld1q_s16(ref + i); const int16x8_t B = vld1q_s16(src + i); const int16x8_t C = vld1q_s16(dst + i); - const int16x8_t D = vsubq_s16(A, B); // diff_uv - const int16x8_t E = vaddq_s16(C, D); // new_uv + const int16x8_t D = vsubq_s16(A, B); // diff_uv + const int16x8_t E = vaddq_s16(C, D); // new_uv vst1q_s16(dst + i, E); } for (; i < len; ++i) { diff --git a/sharpyuv/sharpyuv_sse2.c b/sharpyuv/sharpyuv_sse2.c index e085c43e..3f33a4f3 100644 --- a/sharpyuv/sharpyuv_sse2.c +++ b/sharpyuv/sharpyuv_sse2.c @@ -15,7 +15,6 @@ #if defined(WEBP_USE_SSE2) #include - #include #include "src/dsp/cpu.h" @@ -45,7 +44,7 @@ static uint64_t SharpYuvUpdateY_SSE2(const uint16_t* ref, const uint16_t* src, const __m128i F = _mm_add_epi16(C, D); // new_y const __m128i G = _mm_or_si128(E, one); // -1 or 1 const __m128i H = _mm_max_epi16(_mm_min_epi16(F, max), zero); - const __m128i I = _mm_madd_epi16(D, G); // sum(abs(...)) + const __m128i I = _mm_madd_epi16(D, G); // sum(abs(...)) _mm_storeu_si128((__m128i*)(dst + i), H); sum = _mm_add_epi32(sum, I); } @@ -67,8 +66,8 @@ static void SharpYuvUpdateRGB_SSE2(const int16_t* ref, const int16_t* src, const __m128i A = _mm_loadu_si128((const __m128i*)(ref + i)); const __m128i B = _mm_loadu_si128((const __m128i*)(src + i)); const __m128i C = _mm_loadu_si128((const __m128i*)(dst + i)); - const __m128i D = _mm_sub_epi16(A, B); // diff_uv - const __m128i E = _mm_add_epi16(C, D); // new_uv + const __m128i D = _mm_sub_epi16(A, B); // diff_uv + const __m128i E = _mm_add_epi16(C, D); // new_uv _mm_storeu_si128((__m128i*)(dst + i), E); } for (; i < len; ++i) { @@ -94,8 +93,8 @@ static void SharpYuvFilterRow16_SSE2(const int16_t* A, const int16_t* B, const __m128i a1b0 = _mm_add_epi16(a1, b0); const __m128i a0a1b0b1 = _mm_add_epi16(a0b1, a1b0); // A0+A1+B0+B1 const __m128i a0a1b0b1_8 = _mm_add_epi16(a0a1b0b1, kCst8); - const __m128i a0b1_2 = _mm_add_epi16(a0b1, a0b1); // 2*(A0+B1) - const __m128i a1b0_2 = _mm_add_epi16(a1b0, a1b0); // 2*(A1+B0) + const __m128i a0b1_2 = _mm_add_epi16(a0b1, a0b1); // 2*(A0+B1) + const __m128i a1b0_2 = _mm_add_epi16(a1b0, a1b0); // 2*(A1+B0) const __m128i c0 = _mm_srai_epi16(_mm_add_epi16(a0b1_2, a0a1b0b1_8), 3); const __m128i c1 = _mm_srai_epi16(_mm_add_epi16(a1b0_2, a0a1b0b1_8), 3); const __m128i d0 = _mm_add_epi16(c1, a0); diff --git a/src/dec/alpha_dec.c b/src/dec/alpha_dec.c index d90bfd2b..b3cb4edf 100644 --- a/src/dec/alpha_dec.c +++ b/src/dec/alpha_dec.c @@ -79,8 +79,7 @@ WEBP_NODISCARD static int ALPHInit(ALPHDecoder* const dec, const uint8_t* data, if (dec->method < ALPHA_NO_COMPRESSION || dec->method > ALPHA_LOSSLESS_COMPRESSION || dec->filter >= WEBP_FILTER_LAST || - dec->pre_processing > ALPHA_PREPROCESSED_LEVELS || - rsrv != 0) { + dec->pre_processing > ALPHA_PREPROCESSED_LEVELS || rsrv != 0) { return 0; } @@ -189,7 +188,7 @@ WEBP_NODISCARD const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec, } if (!dec->is_alpha_decoded) { - if (dec->alph_dec == NULL) { // Initialize decoder. + if (dec->alph_dec == NULL) { // Initialize decoder. dec->alph_dec = ALPHNew(); if (dec->alph_dec == NULL) { VP8SetError(dec, VP8_STATUS_OUT_OF_MEMORY, @@ -197,20 +196,20 @@ WEBP_NODISCARD const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec, return NULL; } if (!AllocateAlphaPlane(dec, io)) goto Error; - if (!ALPHInit(dec->alph_dec, dec->alpha_data, dec->alpha_data_size, - io, dec->alpha_plane)) { + if (!ALPHInit(dec->alph_dec, dec->alpha_data, dec->alpha_data_size, io, + dec->alpha_plane)) { VP8LDecoder* const vp8l_dec = dec->alph_dec->vp8l_dec; - VP8SetError(dec, - (vp8l_dec == NULL) ? VP8_STATUS_OUT_OF_MEMORY - : vp8l_dec->status, - "Alpha decoder initialization failed."); + VP8SetError( + dec, + (vp8l_dec == NULL) ? VP8_STATUS_OUT_OF_MEMORY : vp8l_dec->status, + "Alpha decoder initialization failed."); goto Error; } // if we allowed use of alpha dithering, check whether it's needed at all if (dec->alph_dec->pre_processing != ALPHA_PREPROCESSED_LEVELS) { - dec->alpha_dithering = 0; // disable dithering + dec->alpha_dithering = 0; // disable dithering } else { - num_rows = height - row; // decode everything in one pass + num_rows = height - row; // decode everything in one pass } } @@ -218,16 +217,15 @@ WEBP_NODISCARD const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec, assert(row + num_rows <= height); if (!ALPHDecode(dec, row, num_rows)) goto Error; - if (dec->is_alpha_decoded) { // finished? + if (dec->is_alpha_decoded) { // finished? ALPHDelete(dec->alph_dec); dec->alph_dec = NULL; if (dec->alpha_dithering > 0) { - uint8_t* const alpha = dec->alpha_plane + io->crop_top * width - + io->crop_left; - if (!WebPDequantizeLevels(alpha, - io->crop_right - io->crop_left, - io->crop_bottom - io->crop_top, - width, dec->alpha_dithering)) { + uint8_t* const alpha = + dec->alpha_plane + io->crop_top * width + io->crop_left; + if (!WebPDequantizeLevels(alpha, io->crop_right - io->crop_left, + io->crop_bottom - io->crop_top, width, + dec->alpha_dithering)) { goto Error; } } @@ -237,7 +235,7 @@ WEBP_NODISCARD const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec, // Return a pointer to the current decoded row. return dec->alpha_plane + row * width; - Error: +Error: WebPDeallocateAlphaMemory(dec); return NULL; } diff --git a/src/dec/alphai_dec.h b/src/dec/alphai_dec.h index 49150318..6dfe5a96 100644 --- a/src/dec/alphai_dec.h +++ b/src/dec/alphai_dec.h @@ -15,10 +15,10 @@ #define WEBP_DEC_ALPHAI_DEC_H_ #include "src/dec/vp8_dec.h" -#include "src/webp/types.h" #include "src/dec/webpi_dec.h" #include "src/dsp/dsp.h" #include "src/utils/filters_utils.h" +#include "src/webp/types.h" #ifdef __cplusplus extern "C" { @@ -35,11 +35,11 @@ struct ALPHDecoder { int pre_processing; struct VP8LDecoder* vp8l_dec; VP8Io io; - int use_8b_decode; // Although alpha channel requires only 1 byte per - // pixel, sometimes VP8LDecoder may need to allocate - // 4 bytes per pixel internally during decode. + int use_8b_decode; // Although alpha channel requires only 1 byte per + // pixel, sometimes VP8LDecoder may need to allocate + // 4 bytes per pixel internally during decode. uint8_t* output; - const uint8_t* prev_line; // last output row (or NULL) + const uint8_t* prev_line; // last output row (or NULL) }; //------------------------------------------------------------------------------ @@ -51,7 +51,7 @@ void WebPDeallocateAlphaMemory(VP8Decoder* const dec); //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_DEC_ALPHAI_DEC_H_ diff --git a/src/dec/buffer_dec.c b/src/dec/buffer_dec.c index 290f7ab3..5a4a3862 100644 --- a/src/dec/buffer_dec.c +++ b/src/dec/buffer_dec.c @@ -26,10 +26,9 @@ // WebPDecBuffer // Number of bytes per pixel for the different color-spaces. -static const uint8_t kModeBpp[MODE_LAST] = { - 3, 4, 3, 4, 4, 2, 2, - 4, 4, 4, 2, // pre-multiplied modes - 1, 1 }; +static const uint8_t kModeBpp[MODE_LAST] = {3, 4, 3, 4, 4, 2, 2, // + 4, 4, 4, 2, // pre-multiplied modes + 1, 1}; // Convert to an integer to handle both the unsigned/signed enum cases // without the need for casting to remove type limit warnings. @@ -39,8 +38,8 @@ int IsValidColorspace(int webp_csp_mode) { // strictly speaking, the very last (or first, if flipped) row // doesn't require padding. -#define MIN_BUFFER_SIZE(WIDTH, HEIGHT, STRIDE) \ - ((uint64_t)(STRIDE) * ((HEIGHT) - 1) + (WIDTH)) +#define MIN_BUFFER_SIZE(WIDTH, HEIGHT, STRIDE) \ + ((uint64_t)(STRIDE) * ((HEIGHT) - 1) + (WIDTH)) static VP8StatusCode CheckDecBuffer(const WebPDecBuffer* const buffer) { int ok = 1; @@ -49,9 +48,9 @@ static VP8StatusCode CheckDecBuffer(const WebPDecBuffer* const buffer) { const int height = buffer->height; if (!IsValidColorspace(mode)) { ok = 0; - } else if (!WebPIsRGBMode(mode)) { // YUV checks + } else if (!WebPIsRGBMode(mode)) { // YUV checks const WebPYUVABuffer* const buf = &buffer->u.YUVA; - const int uv_width = (width + 1) / 2; + const int uv_width = (width + 1) / 2; const int uv_height = (height + 1) / 2; const int y_stride = abs(buf->y_stride); const int u_stride = abs(buf->u_stride); @@ -75,7 +74,7 @@ static VP8StatusCode CheckDecBuffer(const WebPDecBuffer* const buffer) { ok &= (a_size <= buf->a_size); ok &= (buf->a != NULL); } - } else { // RGB checks + } else { // RGB checks const WebPRGBABuffer* const buf = &buffer->u.RGBA; const int stride = abs(buf->stride); const uint64_t size = @@ -127,7 +126,7 @@ static VP8StatusCode AllocateBuffer(WebPDecBuffer* const buffer) { } buffer->private_memory = output; - if (!WebPIsRGBMode(mode)) { // YUVA initialization + if (!WebPIsRGBMode(mode)) { // YUVA initialization WebPYUVABuffer* const buf = &buffer->u.YUVA; buf->y = output; buf->y_stride = stride; @@ -185,14 +184,14 @@ VP8StatusCode WebPAllocateDecBuffer(int width, int height, if (buffer == NULL || width <= 0 || height <= 0) { return VP8_STATUS_INVALID_PARAM; } - if (options != NULL) { // First, apply options if there is any. + if (options != NULL) { // First, apply options if there is any. if (options->use_cropping) { const int cw = options->crop_width; const int ch = options->crop_height; const int x = options->crop_left & ~1; const int y = options->crop_top & ~1; if (!WebPCheckCropDimensions(width, height, x, y, cw, ch)) { - return VP8_STATUS_INVALID_PARAM; // out of frame boundary. + return VP8_STATUS_INVALID_PARAM; // out of frame boundary. } width = cw; height = ch; @@ -202,14 +201,14 @@ VP8StatusCode WebPAllocateDecBuffer(int width, int height, #if !defined(WEBP_REDUCE_SIZE) int scaled_width = options->scaled_width; int scaled_height = options->scaled_height; - if (!WebPRescalerGetScaledDimensions( - width, height, &scaled_width, &scaled_height)) { + if (!WebPRescalerGetScaledDimensions(width, height, &scaled_width, + &scaled_height)) { return VP8_STATUS_INVALID_PARAM; } width = scaled_width; height = scaled_height; #else - return VP8_STATUS_INVALID_PARAM; // rescaling not supported + return VP8_STATUS_INVALID_PARAM; // rescaling not supported #endif } } @@ -253,7 +252,7 @@ void WebPCopyDecBuffer(const WebPDecBuffer* const src, if (src != NULL && dst != NULL) { *dst = *src; if (src->private_memory != NULL) { - dst->is_external_memory = 1; // dst buffer doesn't own the memory. + dst->is_external_memory = 1; // dst buffer doesn't own the memory. dst->private_memory = NULL; } } @@ -264,7 +263,7 @@ void WebPGrabDecBuffer(WebPDecBuffer* const src, WebPDecBuffer* const dst) { if (src != NULL && dst != NULL) { *dst = *src; if (src->private_memory != NULL) { - src->is_external_memory = 1; // src relinquishes ownership + src->is_external_memory = 1; // src relinquishes ownership src->private_memory = NULL; } } @@ -289,8 +288,8 @@ VP8StatusCode WebPCopyDecBufferPixels(const WebPDecBuffer* const src_buf, } else { const WebPYUVABuffer* const src = &src_buf->u.YUVA; const WebPYUVABuffer* const dst = &dst_buf->u.YUVA; - WebPCopyPlane(src->y, src->y_stride, dst->y, dst->y_stride, - src_buf->width, src_buf->height); + WebPCopyPlane(src->y, src->y_stride, dst->y, dst->y_stride, src_buf->width, + src_buf->height); WebPCopyPlane(src->u, src->u_stride, dst->u, dst->u_stride, (src_buf->width + 1) / 2, (src_buf->height + 1) / 2); WebPCopyPlane(src->v, src->v_stride, dst->v, dst->v_stride, diff --git a/src/dec/common_dec.h b/src/dec/common_dec.h index 4a581cb3..5b2f429a 100644 --- a/src/dec/common_dec.h +++ b/src/dec/common_dec.h @@ -15,41 +15,46 @@ #define WEBP_DEC_COMMON_DEC_H_ // intra prediction modes -enum { B_DC_PRED = 0, // 4x4 modes - B_TM_PRED = 1, - B_VE_PRED = 2, - B_HE_PRED = 3, - B_RD_PRED = 4, - B_VR_PRED = 5, - B_LD_PRED = 6, - B_VL_PRED = 7, - B_HD_PRED = 8, - B_HU_PRED = 9, - NUM_BMODES = B_HU_PRED + 1 - B_DC_PRED, // = 10 +enum { + B_DC_PRED = 0, // 4x4 modes + B_TM_PRED = 1, + B_VE_PRED = 2, + B_HE_PRED = 3, + B_RD_PRED = 4, + B_VR_PRED = 5, + B_LD_PRED = 6, + B_VL_PRED = 7, + B_HD_PRED = 8, + B_HU_PRED = 9, + NUM_BMODES = B_HU_PRED + 1 - B_DC_PRED, // = 10 - // Luma16 or UV modes - DC_PRED = B_DC_PRED, V_PRED = B_VE_PRED, - H_PRED = B_HE_PRED, TM_PRED = B_TM_PRED, - B_PRED = NUM_BMODES, // refined I4x4 mode - NUM_PRED_MODES = 4, + // Luma16 or UV modes + DC_PRED = B_DC_PRED, + V_PRED = B_VE_PRED, + H_PRED = B_HE_PRED, + TM_PRED = B_TM_PRED, + B_PRED = NUM_BMODES, // refined I4x4 mode + NUM_PRED_MODES = 4, - // special modes - B_DC_PRED_NOTOP = 4, - B_DC_PRED_NOLEFT = 5, - B_DC_PRED_NOTOPLEFT = 6, - NUM_B_DC_MODES = 7 }; + // special modes + B_DC_PRED_NOTOP = 4, + B_DC_PRED_NOLEFT = 5, + B_DC_PRED_NOTOPLEFT = 6, + NUM_B_DC_MODES = 7 +}; -enum { MB_FEATURE_TREE_PROBS = 3, - NUM_MB_SEGMENTS = 4, - NUM_REF_LF_DELTAS = 4, - NUM_MODE_LF_DELTAS = 4, // I4x4, ZERO, *, SPLIT - MAX_NUM_PARTITIONS = 8, - // Probabilities - NUM_TYPES = 4, // 0: i16-AC, 1: i16-DC, 2:chroma-AC, 3:i4-AC - NUM_BANDS = 8, - NUM_CTX = 3, - NUM_PROBAS = 11 - }; +enum { + MB_FEATURE_TREE_PROBS = 3, + NUM_MB_SEGMENTS = 4, + NUM_REF_LF_DELTAS = 4, + NUM_MODE_LF_DELTAS = 4, // I4x4, ZERO, *, SPLIT + MAX_NUM_PARTITIONS = 8, + // Probabilities + NUM_TYPES = 4, // 0: i16-AC, 1: i16-DC, 2:chroma-AC, 3:i4-AC + NUM_BANDS = 8, + NUM_CTX = 3, + NUM_PROBAS = 11 +}; // Check that webp_csp_mode is within the bounds of WEBP_CSP_MODE. int IsValidColorspace(int webp_csp_mode); diff --git a/src/dec/frame_dec.c b/src/dec/frame_dec.c index 8042f2c2..dcb691e9 100644 --- a/src/dec/frame_dec.c +++ b/src/dec/frame_dec.c @@ -30,11 +30,10 @@ // Main reconstruction function. static const uint16_t kScan[16] = { - 0 + 0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS, - 0 + 4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS, - 0 + 8 * BPS, 4 + 8 * BPS, 8 + 8 * BPS, 12 + 8 * BPS, - 0 + 12 * BPS, 4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS -}; + 0 + 0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS, + 0 + 4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS, + 0 + 8 * BPS, 4 + 8 * BPS, 8 + 8 * BPS, 12 + 8 * BPS, + 0 + 12 * BPS, 4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS}; static int CheckMode(int mb_x, int mb_y, int mode) { if (mode == B_DC_PRED) { @@ -70,9 +69,9 @@ static WEBP_INLINE void DoTransform(uint32_t bits, const int16_t* const src, static void DoUVTransform(uint32_t bits, const int16_t* const src, uint8_t* const dst) { - if (bits & 0xff) { // any non-zero coeff at all? - if (bits & 0xaa) { // any non-zero AC coefficient? - VP8TransformUV(src, dst); // note we don't use the AC3 variant for U/V + if (bits & 0xff) { // any non-zero coeff at all? + if (bits & 0xaa) { // any non-zero AC coefficient? + VP8TransformUV(src, dst); // note we don't use the AC3 variant for U/V } else { VP8TransformDCUV(src, dst); } @@ -138,11 +137,11 @@ static void ReconstructRow(const VP8Decoder* const dec, } // predict and add residuals - if (block->is_i4x4) { // 4x4 + if (block->is_i4x4) { // 4x4 uint32_t* const top_right = (uint32_t*)(y_dst - BPS + 16); if (mb_y > 0) { - if (mb_x >= dec->mb_w - 1) { // on rightmost border + if (mb_x >= dec->mb_w - 1) { // on rightmost border memset(top_right, top_yuv[0].y[15], sizeof(*top_right)); } else { memcpy(top_right, top_yuv[1].y, sizeof(*top_right)); @@ -157,7 +156,7 @@ static void ReconstructRow(const VP8Decoder* const dec, VP8PredLuma4[block->imodes[n]](dst); DoTransform(bits, coeffs + n * 16, dst); } - } else { // 16x16 + } else { // 16x16 const int pred_func = CheckMode(mb_x, mb_y, block->imodes[0]); VP8PredLuma16[pred_func](y_dst); if (bits != 0) { @@ -179,8 +178,8 @@ static void ReconstructRow(const VP8Decoder* const dec, // stash away top samples for next block if (mb_y < dec->mb_h - 1) { memcpy(top_yuv[0].y, y_dst + 15 * BPS, 16); - memcpy(top_yuv[0].u, u_dst + 7 * BPS, 8); - memcpy(top_yuv[0].v, v_dst + 7 * BPS, 8); + memcpy(top_yuv[0].u, u_dst + 7 * BPS, 8); + memcpy(top_yuv[0].v, v_dst + 7 * BPS, 8); } } // Transfer reconstructed samples from yuv_b cache to final destination. @@ -209,7 +208,7 @@ static void ReconstructRow(const VP8Decoder* const dec, // Simple filter: up to 2 luma samples are read and 1 is written. // Complex filter: up to 4 luma samples are read and 3 are written. Same for // U/V, so it's 8 samples total (because of the 2x upsampling). -static const uint8_t kFilterExtraRows[3] = { 0, 2, 8 }; +static const uint8_t kFilterExtraRows[3] = {0, 2, 8}; static void DoFilter(const VP8Decoder* const dec, int mb_x, int mb_y) { const VP8ThreadContext* const ctx = &dec->thread_ctx; @@ -223,7 +222,7 @@ static void DoFilter(const VP8Decoder* const dec, int mb_x, int mb_y) { return; } assert(limit >= 3); - if (dec->filter_type == 1) { // simple + if (dec->filter_type == 1) { // simple if (mb_x > 0) { VP8SimpleHFilter16(y_dst, y_bps, limit + 4); } @@ -236,7 +235,7 @@ static void DoFilter(const VP8Decoder* const dec, int mb_x, int mb_y) { if (f_info->f_inner) { VP8SimpleVFilter16i(y_dst, y_bps, limit); } - } else { // complex + } else { // complex const int uv_bps = dec->cache_uv_stride; uint8_t* const u_dst = dec->cache_u + cache_id * 8 * uv_bps + mb_x * 8; uint8_t* const v_dst = dec->cache_v + cache_id * 8 * uv_bps + mb_x * 8; @@ -332,9 +331,8 @@ static void PrecomputeFilterStrengths(VP8Decoder* const dec) { #define DITHER_AMP_TAB_SIZE 12 static const uint8_t kQuantToDitherAmp[DITHER_AMP_TAB_SIZE] = { - // roughly, it's dqm->uv_mat[1] - 8, 7, 6, 4, 4, 2, 2, 2, 1, 1, 1, 1 -}; + // roughly, it's dqm->uv_mat[1] + 8, 7, 6, 4, 4, 2, 2, 2, 1, 1, 1, 1}; void VP8InitDithering(const WebPDecoderOptions* const options, VP8Decoder* const dec) { @@ -407,7 +405,7 @@ static void DitherRow(VP8Decoder* const dec) { // * we must clip the remaining pixels against the cropping area. The VP8Io // struct must have the following fields set correctly before calling put(): -#define MACROBLOCK_VPOS(mb_y) ((mb_y) * 16) // vertical position of a MB +#define MACROBLOCK_VPOS(mb_y) ((mb_y) * 16) // vertical position of a MB // Finalize and transmit a complete row. Return false in case of user-abort. static int FinishRow(void* arg1, void* arg2) { @@ -458,7 +456,7 @@ static int FinishRow(void* arg1, void* arg2) { y_end -= extra_y_rows; } if (y_end > io->crop_bottom) { - y_end = io->crop_bottom; // make sure we don't overflow on last row. + y_end = io->crop_bottom; // make sure we don't overflow on last row. } // If dec->alpha_data is not NULL, we have some alpha plane present. io->a = NULL; @@ -512,9 +510,9 @@ static int FinishRow(void* arg1, void* arg2) { int VP8ProcessRow(VP8Decoder* const dec, VP8Io* const io) { int ok = 1; VP8ThreadContext* const ctx = &dec->thread_ctx; - const int filter_row = - (dec->filter_type > 0) && - (dec->mb_y >= dec->tl_mb_y) && (dec->mb_y <= dec->br_mb_y); + const int filter_row = (dec->filter_type > 0) && + (dec->mb_y >= dec->tl_mb_y) && + (dec->mb_y <= dec->br_mb_y); if (dec->mt_method == 0) { // ctx->id and ctx->f_info are already set ctx->mb_y = dec->mb_y; @@ -526,7 +524,7 @@ int VP8ProcessRow(VP8Decoder* const dec, VP8Io* const io) { // Finish previous job *before* updating context ok &= WebPGetWorkerInterface()->Sync(worker); assert(worker->status == OK); - if (ok) { // spawn a new deblocking/output job + if (ok) { // spawn a new deblocking/output job ctx->io = *io; ctx->id = dec->cache_id; ctx->mb_y = dec->mb_y; @@ -539,7 +537,7 @@ int VP8ProcessRow(VP8Decoder* const dec, VP8Io* const io) { // perform reconstruction directly in main thread ReconstructRow(dec, ctx); } - if (filter_row) { // swap filter info + if (filter_row) { // swap filter info VP8FInfo* const tmp = ctx->f_info; ctx->f_info = dec->f_info; dec->f_info = tmp; @@ -646,7 +644,7 @@ int VP8ExitCritical(VP8Decoder* const dec, VP8Io* const io) { // io->put: [ 0..15][16..31][ 0..15][... #define MT_CACHE_LINES 3 -#define ST_CACHE_LINES 1 // 1 cache row only for single-threaded case +#define ST_CACHE_LINES 1 // 1 cache row only for single-threaded case // Initialize multi/single-thread worker static int InitThreadContext(VP8Decoder* const dec) { @@ -669,8 +667,8 @@ static int InitThreadContext(VP8Decoder* const dec) { } int VP8GetThreadMethod(const WebPDecoderOptions* const options, - const WebPHeaderStructure* const headers, - int width, int height) { + const WebPHeaderStructure* const headers, int width, + int height) { if (options == NULL || options->use_threads == 0) { return 0; } @@ -698,22 +696,23 @@ static int AllocateMemory(VP8Decoder* const dec) { const size_t top_size = sizeof(VP8TopSamples) * mb_w; const size_t mb_info_size = (mb_w + 1) * sizeof(VP8MB); const size_t f_info_size = - (dec->filter_type > 0) ? - mb_w * (dec->mt_method > 0 ? 2 : 1) * sizeof(VP8FInfo) - : 0; + (dec->filter_type > 0) + ? mb_w * (dec->mt_method > 0 ? 2 : 1) * sizeof(VP8FInfo) + : 0; const size_t yuv_size = YUV_SIZE * sizeof(*dec->yuv_b); const size_t mb_data_size = (dec->mt_method == 2 ? 2 : 1) * mb_w * sizeof(*dec->mb_data); - const size_t cache_height = (16 * num_caches - + kFilterExtraRows[dec->filter_type]) * 3 / 2; + const size_t cache_height = + (16 * num_caches + kFilterExtraRows[dec->filter_type]) * 3 / 2; const size_t cache_size = top_size * cache_height; // alpha_size is the only one that scales as width x height. - const uint64_t alpha_size = (dec->alpha_data != NULL) ? - (uint64_t)dec->pic_hdr.width * dec->pic_hdr.height : 0ULL; - const uint64_t needed = (uint64_t)intra_pred_mode_size - + top_size + mb_info_size + f_info_size - + yuv_size + mb_data_size - + cache_size + alpha_size + WEBP_ALIGN_CST; + const uint64_t alpha_size = + (dec->alpha_data != NULL) + ? (uint64_t)dec->pic_hdr.width * dec->pic_hdr.height + : 0ULL; + const uint64_t needed = (uint64_t)intra_pred_mode_size + top_size + + mb_info_size + f_info_size + yuv_size + mb_data_size + + cache_size + alpha_size + WEBP_ALIGN_CST; uint8_t* mem; if (!CheckSizeOverflow(needed)) return 0; // check for overflow @@ -769,10 +768,10 @@ static int AllocateMemory(VP8Decoder* const dec) { const int extra_y = extra_rows * dec->cache_y_stride; const int extra_uv = (extra_rows / 2) * dec->cache_uv_stride; dec->cache_y = mem + extra_y; - dec->cache_u = dec->cache_y - + 16 * num_caches * dec->cache_y_stride + extra_uv; - dec->cache_v = dec->cache_u - + 8 * num_caches * dec->cache_uv_stride + extra_uv; + dec->cache_u = + dec->cache_y + 16 * num_caches * dec->cache_y_stride + extra_uv; + dec->cache_v = + dec->cache_u + 8 * num_caches * dec->cache_uv_stride + extra_uv; dec->cache_id = 0; } mem += cache_size; @@ -784,7 +783,7 @@ static int AllocateMemory(VP8Decoder* const dec) { // note: left/top-info is initialized once for all. memset(dec->mb_info - 1, 0, mb_info_size); - VP8InitScanline(dec); // initialize left too. + VP8InitScanline(dec); // initialize left too. // initialize top memset(dec->intra_t, B_DC_PRED, intra_pred_mode_size); diff --git a/src/dec/idec_dec.c b/src/dec/idec_dec.c index cf8a33a4..3eab0acb 100644 --- a/src/dec/idec_dec.c +++ b/src/dec/idec_dec.c @@ -51,11 +51,7 @@ typedef enum { } DecState; // Operating state for the MemBuffer -typedef enum { - MEM_MODE_NONE = 0, - MEM_MODE_APPEND, - MEM_MODE_MAP -} MemBufferMode; +typedef enum { MEM_MODE_NONE = 0, MEM_MODE_APPEND, MEM_MODE_MAP } MemBufferMode; // storage for partition #0 and partial data (in a rolling fashion) typedef struct { @@ -70,19 +66,19 @@ typedef struct { } MemBuffer; struct WebPIDecoder { - DecState state; // current decoding state - WebPDecParams params; // Params to store output info - int is_lossless; // for down-casting 'dec'. - void* dec; // either a VP8Decoder or a VP8LDecoder instance + DecState state; // current decoding state + WebPDecParams params; // Params to store output info + int is_lossless; // for down-casting 'dec'. + void* dec; // either a VP8Decoder or a VP8LDecoder instance VP8Io io; - MemBuffer mem; // input memory buffer. - WebPDecBuffer output; // output buffer (when no external one is supplied, - // or if the external one has slow-memory) + MemBuffer mem; // input memory buffer. + WebPDecBuffer output; // output buffer (when no external one is supplied, + // or if the external one has slow-memory) WebPDecBuffer* final_output; // Slow-memory output to copy to eventually. - size_t chunk_size; // Compressed VP8/VP8L size extracted from Header. + size_t chunk_size; // Compressed VP8/VP8L size extracted from Header. - int last_mb_y; // last row reached for intra-mode decoding + int last_mb_y; // last row reached for intra-mode decoding }; // MB context to restore in case VP8DecodeMB() fails @@ -165,7 +161,7 @@ static void DoRemap(WebPIDecoder* const idec, ptrdiff_t offset) { } } } - } else { // Resize lossless bitreader + } else { // Resize lossless bitreader VP8LDecoder* const dec = (VP8LDecoder*)idec->dec; VP8LBitReaderSetBuffer(&dec->br, new_base, MemDataSize(mem)); } @@ -237,10 +233,10 @@ WEBP_NODISCARD static int RemapMemBuffer(WebPIDecoder* const idec, } static void InitMemBuffer(MemBuffer* const mem) { - mem->mode = MEM_MODE_NONE; - mem->buf = NULL; - mem->buf_size = 0; - mem->part0_buf = NULL; + mem->mode = MEM_MODE_NONE; + mem->buf = NULL; + mem->buf_size = 0; + mem->part0_buf = NULL; mem->part0_size = 0; } @@ -255,11 +251,11 @@ static void ClearMemBuffer(MemBuffer* const mem) { WEBP_NODISCARD static int CheckMemBufferMode(MemBuffer* const mem, MemBufferMode expected) { if (mem->mode == MEM_MODE_NONE) { - mem->mode = expected; // switch to the expected mode + mem->mode = expected; // switch to the expected mode } else if (mem->mode != expected) { - return 0; // we mixed the modes => error + return 0; // we mixed the modes => error } - assert(mem->mode == expected); // mode is ok + assert(mem->mode == expected); // mode is ok return 1; } @@ -396,7 +392,7 @@ static VP8StatusCode CopyParts0Data(WebPIDecoder* const idec) { assert(mem->part0_buf == NULL); // the following is a format limitation, no need for runtime check: assert(part_size <= mem->part0_size); - if (part_size == 0) { // can't have zero-size partition #0 + if (part_size == 0) { // can't have zero-size partition #0 return VP8_STATUS_BITSTREAM_ERROR; } if (mem->mode == MEM_MODE_APPEND) { @@ -437,14 +433,14 @@ static VP8StatusCode DecodePartition0(WebPIDecoder* const idec) { } // Allocate/Verify output buffer now - dec->status = WebPAllocateDecBuffer(io->width, io->height, params->options, - output); + dec->status = + WebPAllocateDecBuffer(io->width, io->height, params->options, output); if (dec->status != VP8_STATUS_OK) { return IDecError(idec, dec->status); } // This change must be done before calling VP8InitFrame() - dec->mt_method = VP8GetThreadMethod(params->options, NULL, - io->width, io->height); + dec->mt_method = + VP8GetThreadMethod(params->options, NULL, io->width, io->height); VP8InitDithering(params->options, dec); dec->status = CopyParts0Data(idec); @@ -512,7 +508,7 @@ static VP8StatusCode DecodeRemaining(WebPIDecoder* const idec) { assert(idec->mem.start <= idec->mem.end); } } - VP8InitScanline(dec); // Prepare for next scanline + VP8InitScanline(dec); // Prepare for next scanline // Reconstruct, filter and emit the row. if (!VP8ProcessRow(dec, io)) { @@ -558,8 +554,8 @@ static VP8StatusCode DecodeVP8LHeader(WebPIDecoder* const idec) { return ErrorStatusLossless(idec, dec->status); } // Allocate/verify output buffer now. - dec->status = WebPAllocateDecBuffer(io->width, io->height, params->options, - output); + dec->status = + WebPAllocateDecBuffer(io->width, io->height, params->options, output); if (dec->status != VP8_STATUS_OK) { return IDecError(idec, dec->status); } @@ -584,7 +580,7 @@ static VP8StatusCode DecodeVP8LData(WebPIDecoder* const idec) { : FinishDecoding(idec); } - // Main decoding loop +// Main decoding loop static VP8StatusCode IDecode(WebPIDecoder* idec) { VP8StatusCode status = VP8_STATUS_SUSPENDED; @@ -592,7 +588,7 @@ static VP8StatusCode IDecode(WebPIDecoder* idec) { status = DecodeWebPHeaders(idec); } else { if (idec->dec == NULL) { - return VP8_STATUS_SUSPENDED; // can't continue if we have no decoder. + return VP8_STATUS_SUSPENDED; // can't continue if we have no decoder. } } if (idec->state == STATE_VP8_HEADER) { @@ -718,12 +714,12 @@ WebPIDecoder* WebPINewRGB(WEBP_CSP_MODE csp, uint8_t* output_buffer, WebPIDecoder* idec; if (csp >= MODE_YUV) return NULL; - if (is_external_memory == 0) { // Overwrite parameters to sane values. + if (is_external_memory == 0) { // Overwrite parameters to sane values. output_buffer_size = 0; output_stride = 0; } else { // A buffer was passed. Validate the other params. if (output_stride == 0 || output_buffer_size == 0) { - return NULL; // invalid parameter. + return NULL; // invalid parameter. } } idec = WebPINewDecoder(NULL); @@ -737,14 +733,14 @@ WebPIDecoder* WebPINewRGB(WEBP_CSP_MODE csp, uint8_t* output_buffer, } WebPIDecoder* WebPINewYUVA(uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride, - uint8_t* a, size_t a_size, int a_stride) { + uint8_t* u, size_t u_size, int u_stride, uint8_t* v, + size_t v_size, int v_stride, uint8_t* a, + size_t a_size, int a_stride) { const int is_external_memory = (luma != NULL) ? 1 : 0; WebPIDecoder* idec; WEBP_CSP_MODE colorspace; - if (is_external_memory == 0) { // Overwrite parameters to sane values. + if (is_external_memory == 0) { // Overwrite parameters to sane values. luma_size = u_size = v_size = a_size = 0; luma_stride = u_stride = v_stride = a_stride = 0; u = v = a = NULL; @@ -780,12 +776,10 @@ WebPIDecoder* WebPINewYUVA(uint8_t* luma, size_t luma_size, int luma_stride, } WebPIDecoder* WebPINewYUV(uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride) { - return WebPINewYUVA(luma, luma_size, luma_stride, - u, u_size, u_stride, - v, v_size, v_stride, - NULL, 0, 0); + uint8_t* u, size_t u_size, int u_stride, uint8_t* v, + size_t v_size, int v_stride) { + return WebPINewYUVA(luma, luma_size, luma_stride, u, u_size, u_stride, v, + v_size, v_stride, NULL, 0, 0); } //------------------------------------------------------------------------------ @@ -801,8 +795,8 @@ static VP8StatusCode IDecCheckStatus(const WebPIDecoder* const idec) { return VP8_STATUS_SUSPENDED; } -VP8StatusCode WebPIAppend(WebPIDecoder* idec, - const uint8_t* data, size_t data_size) { +VP8StatusCode WebPIAppend(WebPIDecoder* idec, const uint8_t* data, + size_t data_size) { VP8StatusCode status; if (idec == NULL || data == NULL) { return VP8_STATUS_INVALID_PARAM; @@ -822,8 +816,8 @@ VP8StatusCode WebPIAppend(WebPIDecoder* idec, return IDecode(idec); } -VP8StatusCode WebPIUpdate(WebPIDecoder* idec, - const uint8_t* data, size_t data_size) { +VP8StatusCode WebPIUpdate(WebPIDecoder* idec, const uint8_t* data, + size_t data_size) { VP8StatusCode status; if (idec == NULL || data == NULL) { return VP8_STATUS_INVALID_PARAM; @@ -853,14 +847,13 @@ static const WebPDecBuffer* GetOutputBuffer(const WebPIDecoder* const idec) { return NULL; } if (idec->final_output != NULL) { - return NULL; // not yet slow-copied + return NULL; // not yet slow-copied } return idec->params.output; } -const WebPDecBuffer* WebPIDecodedArea(const WebPIDecoder* idec, - int* left, int* top, - int* width, int* height) { +const WebPDecBuffer* WebPIDecodedArea(const WebPIDecoder* idec, int* left, + int* top, int* width, int* height) { const WebPDecBuffer* const src = GetOutputBuffer(idec); if (left != NULL) *left = 0; if (top != NULL) *top = 0; @@ -913,10 +906,8 @@ WEBP_NODISCARD uint8_t* WebPIDecGetYUVA(const WebPIDecoder* idec, int* last_y, return src->u.YUVA.y; } -int WebPISetIOHooks(WebPIDecoder* const idec, - VP8IoPutHook put, - VP8IoSetupHook setup, - VP8IoTeardownHook teardown, +int WebPISetIOHooks(WebPIDecoder* const idec, VP8IoPutHook put, + VP8IoSetupHook setup, VP8IoTeardownHook teardown, void* user_data) { if (idec == NULL || idec->state > STATE_WEBP_HEADER) { return 0; diff --git a/src/dec/io_dec.c b/src/dec/io_dec.c index b6e720ed..8230f6bf 100644 --- a/src/dec/io_dec.c +++ b/src/dec/io_dec.c @@ -17,7 +17,6 @@ #include #include "src/dec/vp8_dec.h" -#include "src/webp/types.h" #include "src/dec/vp8i_dec.h" #include "src/dec/webpi_dec.h" #include "src/dsp/cpu.h" @@ -26,6 +25,7 @@ #include "src/utils/rescaler_utils.h" #include "src/utils/utils.h" #include "src/webp/decode.h" +#include "src/webp/types.h" //------------------------------------------------------------------------------ // Main YUV<->RGB conversion functions @@ -51,9 +51,8 @@ static int EmitSampledRGB(const VP8Io* const io, WebPDecParams* const p) { WebPDecBuffer* const output = p->output; WebPRGBABuffer* const buf = &output->u.RGBA; uint8_t* const dst = buf->rgba + (ptrdiff_t)io->mb_y * buf->stride; - WebPSamplerProcessPlane(io->y, io->y_stride, - io->u, io->v, io->uv_stride, - dst, buf->stride, io->mb_w, io->mb_h, + WebPSamplerProcessPlane(io->y, io->y_stride, io->u, io->v, io->uv_stride, dst, + buf->stride, io->mb_w, io->mb_h, WebPSamplers[output->colorspace]); return io->mb_h; } @@ -63,7 +62,7 @@ static int EmitSampledRGB(const VP8Io* const io, WebPDecParams* const p) { #ifdef FANCY_UPSAMPLING static int EmitFancyRGB(const VP8Io* const io, WebPDecParams* const p) { - int num_lines_out = io->mb_h; // a priori guess + int num_lines_out = io->mb_h; // a priori guess const WebPRGBABuffer* const buf = &p->output->u.RGBA; uint8_t* dst = buf->rgba + (ptrdiff_t)io->mb_y * buf->stride; WebPUpsampleLinePairFunc upsample = WebPUpsamplers[p->output->colorspace]; @@ -82,8 +81,8 @@ static int EmitFancyRGB(const VP8Io* const io, WebPDecParams* const p) { upsample(cur_y, NULL, cur_u, cur_v, cur_u, cur_v, dst, NULL, mb_w); } else { // We can finish the left-over line from previous call. - upsample(p->tmp_y, cur_y, top_u, top_v, cur_u, cur_v, - dst - buf->stride, dst, mb_w); + upsample(p->tmp_y, cur_y, top_u, top_v, cur_u, cur_v, dst - buf->stride, + dst, mb_w); ++num_lines_out; } // Loop over each output pairs of row. @@ -94,8 +93,7 @@ static int EmitFancyRGB(const VP8Io* const io, WebPDecParams* const p) { cur_v += io->uv_stride; dst += 2 * buf->stride; cur_y += 2 * io->y_stride; - upsample(cur_y - io->y_stride, cur_y, - top_u, top_v, cur_u, cur_v, + upsample(cur_y - io->y_stride, cur_y, top_u, top_v, cur_u, cur_v, dst - buf->stride, dst, mb_w); } // move to last row @@ -111,14 +109,14 @@ static int EmitFancyRGB(const VP8Io* const io, WebPDecParams* const p) { } else { // Process the very last row of even-sized picture if (!(y_end & 1)) { - upsample(cur_y, NULL, cur_u, cur_v, cur_u, cur_v, - dst + buf->stride, NULL, mb_w); + upsample(cur_y, NULL, cur_u, cur_v, cur_u, cur_v, dst + buf->stride, NULL, + mb_w); } } return num_lines_out; } -#endif /* FANCY_UPSAMPLING */ +#endif /* FANCY_UPSAMPLING */ //------------------------------------------------------------------------------ @@ -153,8 +151,8 @@ static int EmitAlphaYUV(const VP8Io* const io, WebPDecParams* const p, return 0; } -static int GetAlphaSourceRow(const VP8Io* const io, - const uint8_t** alpha, int* const num_rows) { +static int GetAlphaSourceRow(const VP8Io* const io, const uint8_t** alpha, + int* const num_rows) { int start_y = io->mb_y; *num_rows = io->mb_h; @@ -192,14 +190,14 @@ static int EmitAlphaRGB(const VP8Io* const io, WebPDecParams* const p, const int start_y = GetAlphaSourceRow(io, &alpha, &num_rows); uint8_t* const base_rgba = buf->rgba + (ptrdiff_t)start_y * buf->stride; uint8_t* const dst = base_rgba + (alpha_first ? 0 : 3); - const int has_alpha = WebPDispatchAlpha(alpha, io->width, mb_w, - num_rows, dst, buf->stride); + const int has_alpha = + WebPDispatchAlpha(alpha, io->width, mb_w, num_rows, dst, buf->stride); (void)expected_num_lines_out; assert(expected_num_lines_out == num_rows); // has_alpha is true if there's non-trivial alpha to premultiply with. if (has_alpha && WebPIsPremultipliedMode(colorspace)) { - WebPApplyAlphaMultiply(base_rgba, alpha_first, - mb_w, num_rows, buf->stride); + WebPApplyAlphaMultiply(base_rgba, alpha_first, mb_w, num_rows, + buf->stride); } } return 0; @@ -245,14 +243,14 @@ static int EmitAlphaRGBA4444(const VP8Io* const io, WebPDecParams* const p, // YUV rescaling (no final RGB conversion needed) #if !defined(WEBP_REDUCE_SIZE) -static int Rescale(const uint8_t* src, int src_stride, - int new_lines, WebPRescaler* const wrk) { +static int Rescale(const uint8_t* src, int src_stride, int new_lines, + WebPRescaler* const wrk) { int num_lines_out = 0; - while (new_lines > 0) { // import new contributions of source rows. + while (new_lines > 0) { // import new contributions of source rows. const int lines_in = WebPRescalerImport(wrk, new_lines, src, src_stride); src += lines_in * src_stride; new_lines -= lines_in; - num_lines_out += WebPRescalerExport(wrk); // emit output row(s) + num_lines_out += WebPRescalerExport(wrk); // emit output row(s) } return num_lines_out; } @@ -267,8 +265,8 @@ static int EmitRescaledYUV(const VP8Io* const io, WebPDecParams* const p) { // internal buffer. This is OK since these samples are not used for // intra-prediction (the top samples are saved in cache_y/u/v). // But we need to cast the const away, though. - WebPMultRows((uint8_t*)io->y, io->y_stride, - io->a, io->width, io->mb_w, mb_h, 0); + WebPMultRows((uint8_t*)io->y, io->y_stride, io->a, io->width, io->mb_w, + mb_h, 0); } num_lines_out = Rescale(io->y, io->y_stride, mb_h, scaler); Rescale(io->u, io->uv_stride, uv_mb_h, p->scaler_u); @@ -284,7 +282,7 @@ static int EmitRescaledAlphaYUV(const VP8Io* const io, WebPDecParams* const p, uint8_t* const dst_y = buf->y + (ptrdiff_t)p->last_y * buf->y_stride; const int num_lines_out = Rescale(io->a, io->width, io->mb_h, p->scaler_a); assert(expected_num_lines_out == num_lines_out); - if (num_lines_out > 0) { // unmultiply the Y + if (num_lines_out > 0) { // unmultiply the Y WebPMultRows(dst_y, buf->y_stride, dst_a, buf->a_stride, p->scaler_a->dst_width, num_lines_out, 1); } @@ -300,11 +298,11 @@ static int EmitRescaledAlphaYUV(const VP8Io* const io, WebPDecParams* const p, static int InitYUVRescaler(const VP8Io* const io, WebPDecParams* const p) { const int has_alpha = WebPIsAlphaMode(p->output->colorspace); const WebPYUVABuffer* const buf = &p->output->u.YUVA; - const int out_width = io->scaled_width; + const int out_width = io->scaled_width; const int out_height = io->scaled_height; - const int uv_out_width = (out_width + 1) >> 1; + const int uv_out_width = (out_width + 1) >> 1; const int uv_out_height = (out_height + 1) >> 1; - const int uv_in_width = (io->mb_w + 1) >> 1; + const int uv_in_width = (io->mb_w + 1) >> 1; const int uv_in_height = (io->mb_h + 1) >> 1; // scratch memory for luma rescaler const size_t work_size = 2 * (size_t)out_width; @@ -327,33 +325,32 @@ static int InitYUVRescaler(const VP8Io* const io, WebPDecParams* const p) { p->memory = WebPSafeMalloc(1ULL, (size_t)total_size); if (p->memory == NULL) { - return 0; // memory error + return 0; // memory error } work = (rescaler_t*)p->memory; - scalers = (WebPRescaler*)WEBP_ALIGN( - (const uint8_t*)work + total_size - rescaler_size); + scalers = (WebPRescaler*)WEBP_ALIGN((const uint8_t*)work + total_size - + rescaler_size); p->scaler_y = &scalers[0]; p->scaler_u = &scalers[1]; p->scaler_v = &scalers[2]; p->scaler_a = has_alpha ? &scalers[3] : NULL; - if (!WebPRescalerInit(p->scaler_y, io->mb_w, io->mb_h, - buf->y, out_width, out_height, buf->y_stride, 1, - work) || - !WebPRescalerInit(p->scaler_u, uv_in_width, uv_in_height, - buf->u, uv_out_width, uv_out_height, buf->u_stride, 1, + if (!WebPRescalerInit(p->scaler_y, io->mb_w, io->mb_h, buf->y, out_width, + out_height, buf->y_stride, 1, work) || + !WebPRescalerInit(p->scaler_u, uv_in_width, uv_in_height, buf->u, + uv_out_width, uv_out_height, buf->u_stride, 1, work + work_size) || - !WebPRescalerInit(p->scaler_v, uv_in_width, uv_in_height, - buf->v, uv_out_width, uv_out_height, buf->v_stride, 1, + !WebPRescalerInit(p->scaler_v, uv_in_width, uv_in_height, buf->v, + uv_out_width, uv_out_height, buf->v_stride, 1, work + work_size + uv_work_size)) { return 0; } p->emit = EmitRescaledYUV; if (has_alpha) { - if (!WebPRescalerInit(p->scaler_a, io->mb_w, io->mb_h, - buf->a, out_width, out_height, buf->a_stride, 1, + if (!WebPRescalerInit(p->scaler_a, io->mb_w, io->mb_h, buf->a, out_width, + out_height, buf->a_stride, 1, work + work_size + 2 * uv_work_size)) { return 0; } @@ -381,8 +378,8 @@ static int ExportRGB(WebPDecParams* const p, int y_pos) { WebPRescalerExportRow(p->scaler_y); WebPRescalerExportRow(p->scaler_u); WebPRescalerExportRow(p->scaler_v); - convert(p->scaler_y->dst, p->scaler_u->dst, p->scaler_v->dst, - dst, p->scaler_y->dst_width); + convert(p->scaler_y->dst, p->scaler_u->dst, p->scaler_v->dst, dst, + p->scaler_y->dst_width); dst += buf->stride; ++num_lines_out; } @@ -406,7 +403,7 @@ static int EmitRescaledRGB(const VP8Io* const io, WebPDecParams* const p) { const int v_lines_in = WebPRescalerImport( p->scaler_v, uv_mb_h - uv_j, io->v + (ptrdiff_t)uv_j * io->uv_stride, io->uv_stride); - (void)v_lines_in; // remove a gcc warning + (void)v_lines_in; // remove a gcc warning assert(u_lines_in == v_lines_in); uv_j += u_lines_in; } @@ -419,8 +416,7 @@ static int ExportAlpha(WebPDecParams* const p, int y_pos, int max_lines_out) { const WebPRGBABuffer* const buf = &p->output->u.RGBA; uint8_t* const base_rgba = buf->rgba + (ptrdiff_t)y_pos * buf->stride; const WEBP_CSP_MODE colorspace = p->output->colorspace; - const int alpha_first = - (colorspace == MODE_ARGB || colorspace == MODE_Argb); + const int alpha_first = (colorspace == MODE_ARGB || colorspace == MODE_Argb); uint8_t* dst = base_rgba + (alpha_first ? 0 : 3); int num_lines_out = 0; const int is_premult_alpha = WebPIsPremultipliedMode(colorspace); @@ -436,8 +432,8 @@ static int ExportAlpha(WebPDecParams* const p, int y_pos, int max_lines_out) { ++num_lines_out; } if (is_premult_alpha && non_opaque) { - WebPApplyAlphaMultiply(base_rgba, alpha_first, - width, num_lines_out, buf->stride); + WebPApplyAlphaMultiply(base_rgba, alpha_first, width, num_lines_out, + buf->stride); } return num_lines_out; } @@ -495,14 +491,14 @@ static int EmitRescaledAlphaRGB(const VP8Io* const io, WebPDecParams* const p, static int InitRGBRescaler(const VP8Io* const io, WebPDecParams* const p) { const int has_alpha = WebPIsAlphaMode(p->output->colorspace); - const int out_width = io->scaled_width; + const int out_width = io->scaled_width; const int out_height = io->scaled_height; - const int uv_in_width = (io->mb_w + 1) >> 1; + const int uv_in_width = (io->mb_w + 1) >> 1; const int uv_in_height = (io->mb_h + 1) >> 1; // scratch memory for one rescaler const size_t work_size = 2 * (size_t)out_width; rescaler_t* work; // rescalers work area - uint8_t* tmp; // tmp storage for scaled YUV444 samples before RGB conversion + uint8_t* tmp; // tmp storage for scaled YUV444 samples before RGB conversion uint64_t tmp_size1, tmp_size2, total_size; size_t rescaler_size; WebPRescaler* scalers; @@ -519,21 +515,20 @@ static int InitRGBRescaler(const VP8Io* const io, WebPDecParams* const p) { p->memory = WebPSafeMalloc(1ULL, (size_t)total_size); if (p->memory == NULL) { - return 0; // memory error + return 0; // memory error } work = (rescaler_t*)p->memory; tmp = (uint8_t*)(work + tmp_size1); - scalers = (WebPRescaler*)WEBP_ALIGN( - (const uint8_t*)work + total_size - rescaler_size); + scalers = (WebPRescaler*)WEBP_ALIGN((const uint8_t*)work + total_size - + rescaler_size); p->scaler_y = &scalers[0]; p->scaler_u = &scalers[1]; p->scaler_v = &scalers[2]; p->scaler_a = has_alpha ? &scalers[3] : NULL; - if (!WebPRescalerInit(p->scaler_y, io->mb_w, io->mb_h, - tmp + 0 * out_width, out_width, out_height, 0, 1, - work + 0 * work_size) || + if (!WebPRescalerInit(p->scaler_y, io->mb_w, io->mb_h, tmp + 0 * out_width, + out_width, out_height, 0, 1, work + 0 * work_size) || !WebPRescalerInit(p->scaler_u, uv_in_width, uv_in_height, tmp + 1 * out_width, out_width, out_height, 0, 1, work + 1 * work_size) || @@ -546,9 +541,8 @@ static int InitRGBRescaler(const VP8Io* const io, WebPDecParams* const p) { WebPInitYUV444Converters(); if (has_alpha) { - if (!WebPRescalerInit(p->scaler_a, io->mb_w, io->mb_h, - tmp + 3 * out_width, out_width, out_height, 0, 1, - work + 3 * work_size)) { + if (!WebPRescalerInit(p->scaler_a, io->mb_w, io->mb_h, tmp + 3 * out_width, + out_width, out_height, 0, 1, work + 3 * work_size)) { return 0; } p->emit_alpha = EmitRescaledAlphaRGB; @@ -588,21 +582,21 @@ static int CustomSetup(VP8Io* io) { #if !defined(WEBP_REDUCE_SIZE) const int ok = is_rgb ? InitRGBRescaler(io, p) : InitYUVRescaler(io, p); if (!ok) { - return 0; // memory error + return 0; // memory error } #else - return 0; // rescaling support not compiled + return 0; // rescaling support not compiled #endif } else { if (is_rgb) { WebPInitSamplers(); - p->emit = EmitSampledRGB; // default + p->emit = EmitSampledRGB; // default if (io->fancy_upsampling) { #ifdef FANCY_UPSAMPLING const int uv_width = (io->mb_w + 1) >> 1; p->memory = WebPSafeMalloc(1ULL, (size_t)(io->mb_w + 2 * uv_width)); if (p->memory == NULL) { - return 0; // memory error. + return 0; // memory error. } p->tmp_y = (uint8_t*)p->memory; p->tmp_u = p->tmp_y + io->mb_w; @@ -616,10 +610,10 @@ static int CustomSetup(VP8Io* io) { } if (is_alpha) { // need transparency output p->emit_alpha = - (colorspace == MODE_RGBA_4444 || colorspace == MODE_rgbA_4444) ? - EmitAlphaRGBA4444 + (colorspace == MODE_RGBA_4444 || colorspace == MODE_rgbA_4444) + ? EmitAlphaRGBA4444 : is_rgb ? EmitAlphaRGB - : EmitAlphaYUV; + : EmitAlphaYUV; if (is_rgb) { WebPInitAlphaProcessing(); } @@ -661,10 +655,10 @@ static void CustomTeardown(const VP8Io* io) { // Main entry point void WebPInitCustomIo(WebPDecParams* const params, VP8Io* const io) { - io->put = CustomPut; - io->setup = CustomSetup; + io->put = CustomPut; + io->setup = CustomSetup; io->teardown = CustomTeardown; - io->opaque = params; + io->opaque = params; } //------------------------------------------------------------------------------ diff --git a/src/dec/quant_dec.c b/src/dec/quant_dec.c index 977bec56..31b2e5b4 100644 --- a/src/dec/quant_dec.c +++ b/src/dec/quant_dec.c @@ -17,48 +17,30 @@ #include "src/utils/bit_reader_utils.h" #include "src/webp/types.h" -static WEBP_INLINE int clip(int v, int M) { - return v < 0 ? 0 : v > M ? M : v; -} +static WEBP_INLINE int clip(int v, int M) { return v < 0 ? 0 : v > M ? M : v; } // Paragraph 14.1 static const uint8_t kDcTable[128] = { - 4, 5, 6, 7, 8, 9, 10, 10, - 11, 12, 13, 14, 15, 16, 17, 17, - 18, 19, 20, 20, 21, 21, 22, 22, - 23, 23, 24, 25, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, - 37, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, - 91, 93, 95, 96, 98, 100, 101, 102, - 104, 106, 108, 110, 112, 114, 116, 118, - 122, 124, 126, 128, 130, 132, 134, 136, - 138, 140, 143, 145, 148, 151, 154, 157 -}; + 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, + 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 91, 93, 95, 96, 98, 100, 101, 102, 104, + 106, 108, 110, 112, 114, 116, 118, 122, 124, 126, 128, 130, 132, 134, 136, + 138, 140, 143, 145, 148, 151, 154, 157}; static const uint16_t kAcTable[128] = { - 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 60, - 62, 64, 66, 68, 70, 72, 74, 76, - 78, 80, 82, 84, 86, 88, 90, 92, - 94, 96, 98, 100, 102, 104, 106, 108, - 110, 112, 114, 116, 119, 122, 125, 128, - 131, 134, 137, 140, 143, 146, 149, 152, - 155, 158, 161, 164, 167, 170, 173, 177, - 181, 185, 189, 193, 197, 201, 205, 209, - 213, 217, 221, 225, 229, 234, 239, 245, - 249, 254, 259, 264, 269, 274, 279, 284 -}; + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 66, 68, + 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, + 100, 102, 104, 106, 108, 110, 112, 114, 116, 119, 122, 125, 128, 131, 134, + 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 177, 181, + 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 234, 239, 245, + 249, 254, 259, 264, 269, 274, 279, 284}; //------------------------------------------------------------------------------ // Paragraph 9.6 @@ -66,16 +48,21 @@ static const uint16_t kAcTable[128] = { void VP8ParseQuant(VP8Decoder* const dec) { VP8BitReader* const br = &dec->br; const int base_q0 = VP8GetValue(br, 7, "global-header"); - const int dqy1_dc = VP8Get(br, "global-header") ? - VP8GetSignedValue(br, 4, "global-header") : 0; - const int dqy2_dc = VP8Get(br, "global-header") ? - VP8GetSignedValue(br, 4, "global-header") : 0; - const int dqy2_ac = VP8Get(br, "global-header") ? - VP8GetSignedValue(br, 4, "global-header") : 0; - const int dquv_dc = VP8Get(br, "global-header") ? - VP8GetSignedValue(br, 4, "global-header") : 0; - const int dquv_ac = VP8Get(br, "global-header") ? - VP8GetSignedValue(br, 4, "global-header") : 0; + const int dqy1_dc = VP8Get(br, "global-header") + ? VP8GetSignedValue(br, 4, "global-header") + : 0; + const int dqy2_dc = VP8Get(br, "global-header") + ? VP8GetSignedValue(br, 4, "global-header") + : 0; + const int dqy2_ac = VP8Get(br, "global-header") + ? VP8GetSignedValue(br, 4, "global-header") + : 0; + const int dquv_dc = VP8Get(br, "global-header") + ? VP8GetSignedValue(br, 4, "global-header") + : 0; + const int dquv_ac = VP8Get(br, "global-header") + ? VP8GetSignedValue(br, 4, "global-header") + : 0; const VP8SegmentHeader* const hdr = &dec->segment_hdr; int i; @@ -98,7 +85,7 @@ void VP8ParseQuant(VP8Decoder* const dec) { { VP8QuantMatrix* const m = &dec->dqm[i]; m->y1_mat[0] = kDcTable[clip(q + dqy1_dc, 127)]; - m->y1_mat[1] = kAcTable[clip(q + 0, 127)]; + m->y1_mat[1] = kAcTable[clip(q + 0, 127)]; m->y2_mat[0] = kDcTable[clip(q + dqy2_dc, 127)] * 2; // For all x in [0..284], x*155/100 is bitwise equal to (x*101581) >> 16. @@ -110,7 +97,7 @@ void VP8ParseQuant(VP8Decoder* const dec) { m->uv_mat[0] = kDcTable[clip(q + dquv_dc, 117)]; m->uv_mat[1] = kAcTable[clip(q + dquv_ac, 127)]; - m->uv_quant = q + dquv_ac; // for dithering strength evaluation + m->uv_quant = q + dquv_ac; // for dithering strength evaluation } } } diff --git a/src/dec/tree_dec.c b/src/dec/tree_dec.c index a3b00ef7..58c8e040 100644 --- a/src/dec/tree_dec.c +++ b/src/dec/tree_dec.c @@ -14,18 +14,17 @@ #include #include "src/dec/common_dec.h" -#include "src/webp/types.h" #include "src/dec/vp8_dec.h" #include "src/dec/vp8i_dec.h" #include "src/dsp/cpu.h" #include "src/utils/bit_reader_inl_utils.h" #include "src/utils/bit_reader_utils.h" +#include "src/webp/types.h" #if !defined(USE_GENERIC_TREE) -#if !defined(__arm__) && !defined(_M_ARM) && !WEBP_AARCH64 && \ - !defined(__wasm__) +#if !defined(__arm__) && !defined(_M_ARM) && !WEBP_AARCH64 && !defined(__wasm__) // using a table is ~1-2% slower on ARM. Prefer the coded-tree approach then. -#define USE_GENERIC_TREE 1 // ALTERNATE_CODE +#define USE_GENERIC_TREE 1 // ALTERNATE_CODE #else #define USE_GENERIC_TREE 0 #endif @@ -33,269 +32,227 @@ #if (USE_GENERIC_TREE == 1) static const int8_t kYModesIntra4[18] = { - -B_DC_PRED, 1, - -B_TM_PRED, 2, - -B_VE_PRED, 3, - 4, 6, - -B_HE_PRED, 5, - -B_RD_PRED, -B_VR_PRED, - -B_LD_PRED, 7, - -B_VL_PRED, 8, - -B_HD_PRED, -B_HU_PRED -}; + -B_DC_PRED, 1, -B_TM_PRED, 2, -B_VE_PRED, 3, + 4, 6, -B_HE_PRED, 5, -B_RD_PRED, -B_VR_PRED, + -B_LD_PRED, 7, -B_VL_PRED, 8, -B_HD_PRED, -B_HU_PRED}; #endif //------------------------------------------------------------------------------ // Default probabilities // Paragraph 13.5 -static const uint8_t - CoeffsProba0[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS] = { - { { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128 }, - { 189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128 }, - { 106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128 } - }, - { { 1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128 }, - { 181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128 }, - { 78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128 }, - }, - { { 1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128 }, - { 184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128 }, - { 77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128 }, - }, - { { 1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128 }, - { 170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128 }, - { 37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128 } - }, - { { 1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128 }, - { 207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128 }, - { 102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128 } - }, - { { 1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128 }, - { 177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128 }, - { 80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128 } - }, - { { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } - } - }, - { { { 198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62 }, - { 131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1 }, - { 68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128 } - }, - { { 1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128 }, - { 184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128 }, - { 81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128 } - }, - { { 1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128 }, - { 99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128 }, - { 23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128 } - }, - { { 1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128 }, - { 109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128 }, - { 44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128 } - }, - { { 1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128 }, - { 94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128 }, - { 22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128 } - }, - { { 1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128 }, - { 124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128 }, - { 35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128 } - }, - { { 1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128 }, - { 121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128 }, - { 45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128 } - }, - { { 1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128 }, - { 203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128 } - } - }, - { { { 253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128 }, - { 175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128 }, - { 73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128 } - }, - { { 1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128 }, - { 239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128 }, - { 155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128 } - }, - { { 1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128 }, - { 201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128 }, - { 69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128 } - }, - { { 1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128 }, - { 141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128 } - }, - { { 1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128 }, - { 149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } - } - }, - { { { 202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255 }, - { 126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128 }, - { 61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128 } - }, - { { 1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128 }, - { 166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128 }, - { 39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128 } - }, - { { 1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128 }, - { 124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128 }, - { 24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128 } - }, - { { 1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128 }, - { 149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128 }, - { 28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128 } - }, - { { 1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128 }, - { 123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128 }, - { 20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128 } - }, - { { 1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128 }, - { 168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128 }, - { 47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128 } - }, - { { 1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128 }, - { 141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128 }, - { 42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128 } - }, - { { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - } - } -}; +static const uint8_t CoeffsProba0[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS] = { + {{{128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, + {128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, + {128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}}, + {{253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128}, + {189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128}, + {106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128}}, + { + {1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128}, + {181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128}, + {78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128}, + }, + { + {1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128}, + {184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128}, + {77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128}, + }, + {{1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128}, + {170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128}, + {37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128}}, + {{1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128}, + {207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128}, + {102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128}}, + {{1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128}, + {177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128}, + {80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128}}, + {{1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128}, + {246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128}, + {255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}}}, + {{{198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62}, + {131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1}, + {68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128}}, + {{1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128}, + {184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128}, + {81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128}}, + {{1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128}, + {99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128}, + {23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128}}, + {{1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128}, + {109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128}, + {44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128}}, + {{1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128}, + {94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128}, + {22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128}}, + {{1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128}, + {124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128}, + {35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128}}, + {{1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128}, + {121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128}, + {45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128}}, + {{1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128}, + {203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128}, + {137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128}}}, + {{{253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128}, + {175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128}, + {73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128}}, + {{1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128}, + {239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128}, + {155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128}}, + {{1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128}, + {201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128}, + {69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128}}, + {{1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128}, + {223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128}, + {141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128}}, + {{1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128}, + {190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128}, + {149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128}}, + {{1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128}, + {247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128}, + {240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128}}, + {{1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128}, + {213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128}, + {55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128}}, + {{128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, + {128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, + {128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}}}, + {{{202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255}, + {126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128}, + {61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128}}, + {{1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128}, + {166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128}, + {39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128}}, + {{1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128}, + {124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128}, + {24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128}}, + {{1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128}, + {149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128}, + {28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128}}, + {{1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128}, + {123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128}, + {20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128}}, + {{1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128}, + {168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128}, + {47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128}}, + {{1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128}, + {141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128}, + {42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128}}, + {{1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128}, + {244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128}, + {238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128}}}}; // Paragraph 11.5 static const uint8_t kBModesProba[NUM_BMODES][NUM_BMODES][NUM_BMODES - 1] = { - { { 231, 120, 48, 89, 115, 113, 120, 152, 112 }, - { 152, 179, 64, 126, 170, 118, 46, 70, 95 }, - { 175, 69, 143, 80, 85, 82, 72, 155, 103 }, - { 56, 58, 10, 171, 218, 189, 17, 13, 152 }, - { 114, 26, 17, 163, 44, 195, 21, 10, 173 }, - { 121, 24, 80, 195, 26, 62, 44, 64, 85 }, - { 144, 71, 10, 38, 171, 213, 144, 34, 26 }, - { 170, 46, 55, 19, 136, 160, 33, 206, 71 }, - { 63, 20, 8, 114, 114, 208, 12, 9, 226 }, - { 81, 40, 11, 96, 182, 84, 29, 16, 36 } }, - { { 134, 183, 89, 137, 98, 101, 106, 165, 148 }, - { 72, 187, 100, 130, 157, 111, 32, 75, 80 }, - { 66, 102, 167, 99, 74, 62, 40, 234, 128 }, - { 41, 53, 9, 178, 241, 141, 26, 8, 107 }, - { 74, 43, 26, 146, 73, 166, 49, 23, 157 }, - { 65, 38, 105, 160, 51, 52, 31, 115, 128 }, - { 104, 79, 12, 27, 217, 255, 87, 17, 7 }, - { 87, 68, 71, 44, 114, 51, 15, 186, 23 }, - { 47, 41, 14, 110, 182, 183, 21, 17, 194 }, - { 66, 45, 25, 102, 197, 189, 23, 18, 22 } }, - { { 88, 88, 147, 150, 42, 46, 45, 196, 205 }, - { 43, 97, 183, 117, 85, 38, 35, 179, 61 }, - { 39, 53, 200, 87, 26, 21, 43, 232, 171 }, - { 56, 34, 51, 104, 114, 102, 29, 93, 77 }, - { 39, 28, 85, 171, 58, 165, 90, 98, 64 }, - { 34, 22, 116, 206, 23, 34, 43, 166, 73 }, - { 107, 54, 32, 26, 51, 1, 81, 43, 31 }, - { 68, 25, 106, 22, 64, 171, 36, 225, 114 }, - { 34, 19, 21, 102, 132, 188, 16, 76, 124 }, - { 62, 18, 78, 95, 85, 57, 50, 48, 51 } }, - { { 193, 101, 35, 159, 215, 111, 89, 46, 111 }, - { 60, 148, 31, 172, 219, 228, 21, 18, 111 }, - { 112, 113, 77, 85, 179, 255, 38, 120, 114 }, - { 40, 42, 1, 196, 245, 209, 10, 25, 109 }, - { 88, 43, 29, 140, 166, 213, 37, 43, 154 }, - { 61, 63, 30, 155, 67, 45, 68, 1, 209 }, - { 100, 80, 8, 43, 154, 1, 51, 26, 71 }, - { 142, 78, 78, 16, 255, 128, 34, 197, 171 }, - { 41, 40, 5, 102, 211, 183, 4, 1, 221 }, - { 51, 50, 17, 168, 209, 192, 23, 25, 82 } }, - { { 138, 31, 36, 171, 27, 166, 38, 44, 229 }, - { 67, 87, 58, 169, 82, 115, 26, 59, 179 }, - { 63, 59, 90, 180, 59, 166, 93, 73, 154 }, - { 40, 40, 21, 116, 143, 209, 34, 39, 175 }, - { 47, 15, 16, 183, 34, 223, 49, 45, 183 }, - { 46, 17, 33, 183, 6, 98, 15, 32, 183 }, - { 57, 46, 22, 24, 128, 1, 54, 17, 37 }, - { 65, 32, 73, 115, 28, 128, 23, 128, 205 }, - { 40, 3, 9, 115, 51, 192, 18, 6, 223 }, - { 87, 37, 9, 115, 59, 77, 64, 21, 47 } }, - { { 104, 55, 44, 218, 9, 54, 53, 130, 226 }, - { 64, 90, 70, 205, 40, 41, 23, 26, 57 }, - { 54, 57, 112, 184, 5, 41, 38, 166, 213 }, - { 30, 34, 26, 133, 152, 116, 10, 32, 134 }, - { 39, 19, 53, 221, 26, 114, 32, 73, 255 }, - { 31, 9, 65, 234, 2, 15, 1, 118, 73 }, - { 75, 32, 12, 51, 192, 255, 160, 43, 51 }, - { 88, 31, 35, 67, 102, 85, 55, 186, 85 }, - { 56, 21, 23, 111, 59, 205, 45, 37, 192 }, - { 55, 38, 70, 124, 73, 102, 1, 34, 98 } }, - { { 125, 98, 42, 88, 104, 85, 117, 175, 82 }, - { 95, 84, 53, 89, 128, 100, 113, 101, 45 }, - { 75, 79, 123, 47, 51, 128, 81, 171, 1 }, - { 57, 17, 5, 71, 102, 57, 53, 41, 49 }, - { 38, 33, 13, 121, 57, 73, 26, 1, 85 }, - { 41, 10, 67, 138, 77, 110, 90, 47, 114 }, - { 115, 21, 2, 10, 102, 255, 166, 23, 6 }, - { 101, 29, 16, 10, 85, 128, 101, 196, 26 }, - { 57, 18, 10, 102, 102, 213, 34, 20, 43 }, - { 117, 20, 15, 36, 163, 128, 68, 1, 26 } }, - { { 102, 61, 71, 37, 34, 53, 31, 243, 192 }, - { 69, 60, 71, 38, 73, 119, 28, 222, 37 }, - { 68, 45, 128, 34, 1, 47, 11, 245, 171 }, - { 62, 17, 19, 70, 146, 85, 55, 62, 70 }, - { 37, 43, 37, 154, 100, 163, 85, 160, 1 }, - { 63, 9, 92, 136, 28, 64, 32, 201, 85 }, - { 75, 15, 9, 9, 64, 255, 184, 119, 16 }, - { 86, 6, 28, 5, 64, 255, 25, 248, 1 }, - { 56, 8, 17, 132, 137, 255, 55, 116, 128 }, - { 58, 15, 20, 82, 135, 57, 26, 121, 40 } }, - { { 164, 50, 31, 137, 154, 133, 25, 35, 218 }, - { 51, 103, 44, 131, 131, 123, 31, 6, 158 }, - { 86, 40, 64, 135, 148, 224, 45, 183, 128 }, - { 22, 26, 17, 131, 240, 154, 14, 1, 209 }, - { 45, 16, 21, 91, 64, 222, 7, 1, 197 }, - { 56, 21, 39, 155, 60, 138, 23, 102, 213 }, - { 83, 12, 13, 54, 192, 255, 68, 47, 28 }, - { 85, 26, 85, 85, 128, 128, 32, 146, 171 }, - { 18, 11, 7, 63, 144, 171, 4, 4, 246 }, - { 35, 27, 10, 146, 174, 171, 12, 26, 128 } }, - { { 190, 80, 35, 99, 180, 80, 126, 54, 45 }, - { 85, 126, 47, 87, 176, 51, 41, 20, 32 }, - { 101, 75, 128, 139, 118, 146, 116, 128, 85 }, - { 56, 41, 15, 176, 236, 85, 37, 9, 62 }, - { 71, 30, 17, 119, 118, 255, 17, 18, 138 }, - { 101, 38, 60, 138, 55, 70, 43, 26, 142 }, - { 146, 36, 19, 30, 171, 255, 97, 27, 20 }, - { 138, 45, 61, 62, 219, 1, 81, 188, 64 }, - { 32, 41, 20, 117, 151, 142, 20, 21, 163 }, - { 112, 19, 12, 61, 195, 128, 48, 4, 24 } } -}; + {{231, 120, 48, 89, 115, 113, 120, 152, 112}, + {152, 179, 64, 126, 170, 118, 46, 70, 95}, + {175, 69, 143, 80, 85, 82, 72, 155, 103}, + {56, 58, 10, 171, 218, 189, 17, 13, 152}, + {114, 26, 17, 163, 44, 195, 21, 10, 173}, + {121, 24, 80, 195, 26, 62, 44, 64, 85}, + {144, 71, 10, 38, 171, 213, 144, 34, 26}, + {170, 46, 55, 19, 136, 160, 33, 206, 71}, + {63, 20, 8, 114, 114, 208, 12, 9, 226}, + {81, 40, 11, 96, 182, 84, 29, 16, 36}}, + {{134, 183, 89, 137, 98, 101, 106, 165, 148}, + {72, 187, 100, 130, 157, 111, 32, 75, 80}, + {66, 102, 167, 99, 74, 62, 40, 234, 128}, + {41, 53, 9, 178, 241, 141, 26, 8, 107}, + {74, 43, 26, 146, 73, 166, 49, 23, 157}, + {65, 38, 105, 160, 51, 52, 31, 115, 128}, + {104, 79, 12, 27, 217, 255, 87, 17, 7}, + {87, 68, 71, 44, 114, 51, 15, 186, 23}, + {47, 41, 14, 110, 182, 183, 21, 17, 194}, + {66, 45, 25, 102, 197, 189, 23, 18, 22}}, + {{88, 88, 147, 150, 42, 46, 45, 196, 205}, + {43, 97, 183, 117, 85, 38, 35, 179, 61}, + {39, 53, 200, 87, 26, 21, 43, 232, 171}, + {56, 34, 51, 104, 114, 102, 29, 93, 77}, + {39, 28, 85, 171, 58, 165, 90, 98, 64}, + {34, 22, 116, 206, 23, 34, 43, 166, 73}, + {107, 54, 32, 26, 51, 1, 81, 43, 31}, + {68, 25, 106, 22, 64, 171, 36, 225, 114}, + {34, 19, 21, 102, 132, 188, 16, 76, 124}, + {62, 18, 78, 95, 85, 57, 50, 48, 51}}, + {{193, 101, 35, 159, 215, 111, 89, 46, 111}, + {60, 148, 31, 172, 219, 228, 21, 18, 111}, + {112, 113, 77, 85, 179, 255, 38, 120, 114}, + {40, 42, 1, 196, 245, 209, 10, 25, 109}, + {88, 43, 29, 140, 166, 213, 37, 43, 154}, + {61, 63, 30, 155, 67, 45, 68, 1, 209}, + {100, 80, 8, 43, 154, 1, 51, 26, 71}, + {142, 78, 78, 16, 255, 128, 34, 197, 171}, + {41, 40, 5, 102, 211, 183, 4, 1, 221}, + {51, 50, 17, 168, 209, 192, 23, 25, 82}}, + {{138, 31, 36, 171, 27, 166, 38, 44, 229}, + {67, 87, 58, 169, 82, 115, 26, 59, 179}, + {63, 59, 90, 180, 59, 166, 93, 73, 154}, + {40, 40, 21, 116, 143, 209, 34, 39, 175}, + {47, 15, 16, 183, 34, 223, 49, 45, 183}, + {46, 17, 33, 183, 6, 98, 15, 32, 183}, + {57, 46, 22, 24, 128, 1, 54, 17, 37}, + {65, 32, 73, 115, 28, 128, 23, 128, 205}, + {40, 3, 9, 115, 51, 192, 18, 6, 223}, + {87, 37, 9, 115, 59, 77, 64, 21, 47}}, + {{104, 55, 44, 218, 9, 54, 53, 130, 226}, + {64, 90, 70, 205, 40, 41, 23, 26, 57}, + {54, 57, 112, 184, 5, 41, 38, 166, 213}, + {30, 34, 26, 133, 152, 116, 10, 32, 134}, + {39, 19, 53, 221, 26, 114, 32, 73, 255}, + {31, 9, 65, 234, 2, 15, 1, 118, 73}, + {75, 32, 12, 51, 192, 255, 160, 43, 51}, + {88, 31, 35, 67, 102, 85, 55, 186, 85}, + {56, 21, 23, 111, 59, 205, 45, 37, 192}, + {55, 38, 70, 124, 73, 102, 1, 34, 98}}, + {{125, 98, 42, 88, 104, 85, 117, 175, 82}, + {95, 84, 53, 89, 128, 100, 113, 101, 45}, + {75, 79, 123, 47, 51, 128, 81, 171, 1}, + {57, 17, 5, 71, 102, 57, 53, 41, 49}, + {38, 33, 13, 121, 57, 73, 26, 1, 85}, + {41, 10, 67, 138, 77, 110, 90, 47, 114}, + {115, 21, 2, 10, 102, 255, 166, 23, 6}, + {101, 29, 16, 10, 85, 128, 101, 196, 26}, + {57, 18, 10, 102, 102, 213, 34, 20, 43}, + {117, 20, 15, 36, 163, 128, 68, 1, 26}}, + {{102, 61, 71, 37, 34, 53, 31, 243, 192}, + {69, 60, 71, 38, 73, 119, 28, 222, 37}, + {68, 45, 128, 34, 1, 47, 11, 245, 171}, + {62, 17, 19, 70, 146, 85, 55, 62, 70}, + {37, 43, 37, 154, 100, 163, 85, 160, 1}, + {63, 9, 92, 136, 28, 64, 32, 201, 85}, + {75, 15, 9, 9, 64, 255, 184, 119, 16}, + {86, 6, 28, 5, 64, 255, 25, 248, 1}, + {56, 8, 17, 132, 137, 255, 55, 116, 128}, + {58, 15, 20, 82, 135, 57, 26, 121, 40}}, + {{164, 50, 31, 137, 154, 133, 25, 35, 218}, + {51, 103, 44, 131, 131, 123, 31, 6, 158}, + {86, 40, 64, 135, 148, 224, 45, 183, 128}, + {22, 26, 17, 131, 240, 154, 14, 1, 209}, + {45, 16, 21, 91, 64, 222, 7, 1, 197}, + {56, 21, 39, 155, 60, 138, 23, 102, 213}, + {83, 12, 13, 54, 192, 255, 68, 47, 28}, + {85, 26, 85, 85, 128, 128, 32, 146, 171}, + {18, 11, 7, 63, 144, 171, 4, 4, 246}, + {35, 27, 10, 146, 174, 171, 12, 26, 128}}, + {{190, 80, 35, 99, 180, 80, 126, 54, 45}, + {85, 126, 47, 87, 176, 51, 41, 20, 32}, + {101, 75, 128, 139, 118, 146, 116, 128, 85}, + {56, 41, 15, 176, 236, 85, 37, 9, 62}, + {71, 30, 17, 119, 118, 255, 17, 18, 138}, + {101, 38, 60, 138, 55, 70, 43, 26, 142}, + {146, 36, 19, 30, 171, 255, 97, 27, 20}, + {138, 45, 61, 62, 219, 1, 81, 188, 64}, + {32, 41, 20, 117, 151, 142, 20, 21, 163}, + {112, 19, 12, 61, 195, 128, 48, 4, 24}}}; void VP8ResetProba(VP8Proba* const proba) { memset(proba->segments, 255u, sizeof(proba->segments)); // proba->bands[][] is initialized later } -static void ParseIntraMode(VP8BitReader* const br, - VP8Decoder* const dec, int mb_x) { +static void ParseIntraMode(VP8BitReader* const br, VP8Decoder* const dec, + int mb_x) { uint8_t* const top = dec->intra_t + 4 * mb_x; uint8_t* const left = dec->intra_l; VP8MBData* const block = dec->mb_data + mb_x; @@ -304,9 +261,10 @@ static void ParseIntraMode(VP8BitReader* const br, // to decode more than 1 keyframe. if (dec->segment_hdr.update_map) { // Hardcoded tree parsing - block->segment = !VP8GetBit(br, dec->proba.segments[0], "segments") - ? VP8GetBit(br, dec->proba.segments[1], "segments") - : VP8GetBit(br, dec->proba.segments[2], "segments") + 2; + block->segment = + !VP8GetBit(br, dec->proba.segments[0], "segments") + ? VP8GetBit(br, dec->proba.segments[1], "segments") + : VP8GetBit(br, dec->proba.segments[2], "segments") + 2; } else { block->segment = 0; // default for intra } @@ -316,9 +274,9 @@ static void ParseIntraMode(VP8BitReader* const br, if (!block->is_i4x4) { // Hardcoded 16x16 intra-mode decision tree. const int ymode = - VP8GetBit(br, 156, "pred-modes") ? - (VP8GetBit(br, 128, "pred-modes") ? TM_PRED : H_PRED) : - (VP8GetBit(br, 163, "pred-modes") ? V_PRED : DC_PRED); + VP8GetBit(br, 156, "pred-modes") + ? (VP8GetBit(br, 128, "pred-modes") ? TM_PRED : H_PRED) + : (VP8GetBit(br, 163, "pred-modes") ? V_PRED : DC_PRED); block->imodes[0] = ymode; memset(top, ymode, 4 * sizeof(*top)); memset(left, ymode, 4 * sizeof(*left)); @@ -339,18 +297,22 @@ static void ParseIntraMode(VP8BitReader* const br, ymode = -i; #else // Hardcoded tree parsing - ymode = !VP8GetBit(br, prob[0], "pred-modes") ? B_DC_PRED : - !VP8GetBit(br, prob[1], "pred-modes") ? B_TM_PRED : - !VP8GetBit(br, prob[2], "pred-modes") ? B_VE_PRED : - !VP8GetBit(br, prob[3], "pred-modes") ? - (!VP8GetBit(br, prob[4], "pred-modes") ? B_HE_PRED : - (!VP8GetBit(br, prob[5], "pred-modes") ? B_RD_PRED - : B_VR_PRED)) : - (!VP8GetBit(br, prob[6], "pred-modes") ? B_LD_PRED : - (!VP8GetBit(br, prob[7], "pred-modes") ? B_VL_PRED : - (!VP8GetBit(br, prob[8], "pred-modes") ? B_HD_PRED - : B_HU_PRED)) - ); + ymode = + !VP8GetBit(br, prob[0], "pred-modes") ? B_DC_PRED + : !VP8GetBit(br, prob[1], "pred-modes") ? B_TM_PRED + : !VP8GetBit(br, prob[2], "pred-modes") ? B_VE_PRED + : !VP8GetBit(br, prob[3], "pred-modes") + ? (!VP8GetBit(br, prob[4], "pred-modes") + ? B_HE_PRED + : (!VP8GetBit(br, prob[5], "pred-modes") ? B_RD_PRED + : B_VR_PRED)) + : (!VP8GetBit(br, prob[6], "pred-modes") + ? B_LD_PRED + : (!VP8GetBit(br, prob[7], "pred-modes") + ? B_VL_PRED + : (!VP8GetBit(br, prob[8], "pred-modes") + ? B_HD_PRED + : B_HU_PRED))); #endif // USE_GENERIC_TREE top[x] = ymode; } @@ -360,9 +322,10 @@ static void ParseIntraMode(VP8BitReader* const br, } } // Hardcoded UVMode decision tree - block->uvmode = !VP8GetBit(br, 142, "pred-modes-uv") ? DC_PRED - : !VP8GetBit(br, 114, "pred-modes-uv") ? V_PRED - : VP8GetBit(br, 183, "pred-modes-uv") ? TM_PRED : H_PRED; + block->uvmode = !VP8GetBit(br, 142, "pred-modes-uv") ? DC_PRED + : !VP8GetBit(br, 114, "pred-modes-uv") ? V_PRED + : VP8GetBit(br, 183, "pred-modes-uv") ? TM_PRED + : H_PRED; } int VP8ParseIntraModeRow(VP8BitReader* const br, VP8Decoder* const dec) { @@ -378,145 +341,108 @@ int VP8ParseIntraModeRow(VP8BitReader* const br, VP8Decoder* const dec) { static const uint8_t CoeffsUpdateProba[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS] = { - { { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255 }, - { 250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - }, - { { { 217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255 }, - { 234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255 } - }, - { { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - }, - { { { 186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255 } - }, - { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - }, - { { { 248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255 }, - { 248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - } -}; + {{{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255}, + {249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255}, + {234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255}, + {250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255}, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}}, + {{{217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255}, + {234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255}}, + {{255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255}, + {250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}}, + {{{186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255}, + {234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255}, + {251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255}}, + {{255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255}}, + {{255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}}, + {{{248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255}, + {248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255}, + {246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255}, + {252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255}}, + {{255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255}, + {248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255}, + {253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255}, + {252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255}, + {250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}}}; // Paragraph 9.9 static const uint8_t kBands[16 + 1] = { - 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, - 0 // extra entry as sentinel + 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 0 // extra entry as sentinel }; void VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec) { @@ -527,9 +453,9 @@ void VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec) { for (c = 0; c < NUM_CTX; ++c) { for (p = 0; p < NUM_PROBAS; ++p) { const int v = - VP8GetBit(br, CoeffsUpdateProba[t][b][c][p], "global-header") ? - VP8GetValue(br, 8, "global-header") : - CoeffsProba0[t][b][c][p]; + VP8GetBit(br, CoeffsUpdateProba[t][b][c][p], "global-header") + ? VP8GetValue(br, 8, "global-header") + : CoeffsProba0[t][b][c][p]; proba->bands[t][b].probas[c][p] = v; } } diff --git a/src/dec/vp8_dec.c b/src/dec/vp8_dec.c index b1df3a0a..3225cb98 100644 --- a/src/dec/vp8_dec.c +++ b/src/dec/vp8_dec.c @@ -11,13 +11,14 @@ // // Author: Skal (pascal.massimino@gmail.com) +#include "src/dec/vp8_dec.h" + #include #include #include #include "src/dec/alphai_dec.h" #include "src/dec/common_dec.h" -#include "src/dec/vp8_dec.h" #include "src/dec/vp8i_dec.h" #include "src/dec/vp8li_dec.h" #include "src/dec/webpi_dec.h" @@ -41,8 +42,8 @@ int WebPGetDecoderVersion(void) { // Signature and pointer-to-function for GetCoeffs() variants below. typedef int (*GetCoeffsFunc)(VP8BitReader* const br, - const VP8BandProbas* const prob[], - int ctx, const quant_t dq, int n, int16_t* out); + const VP8BandProbas* const prob[], int ctx, + const quant_t dq, int n, int16_t* out); static volatile GetCoeffsFunc GetCoeffs = NULL; static void InitGetCoeffs(void); @@ -95,8 +96,8 @@ void VP8Delete(VP8Decoder* const dec) { } } -int VP8SetError(VP8Decoder* const dec, - VP8StatusCode error, const char* const msg) { +int VP8SetError(VP8Decoder* const dec, VP8StatusCode error, + const char* const msg) { // VP8_STATUS_SUSPENDED is only meaningful in incremental decoding. assert(dec->incremental || error != VP8_STATUS_SUSPENDED); // The oldest error reported takes precedence over the new one. @@ -111,39 +112,39 @@ int VP8SetError(VP8Decoder* const dec, //------------------------------------------------------------------------------ int VP8CheckSignature(const uint8_t* const data, size_t data_size) { - return (data_size >= 3 && - data[0] == 0x9d && data[1] == 0x01 && data[2] == 0x2a); + return (data_size >= 3 && data[0] == 0x9d && data[1] == 0x01 && + data[2] == 0x2a); } int VP8GetInfo(const uint8_t* data, size_t data_size, size_t chunk_size, int* const width, int* const height) { if (data == NULL || data_size < VP8_FRAME_HEADER_SIZE) { - return 0; // not enough data + return 0; // not enough data } // check signature if (!VP8CheckSignature(data + 3, data_size - 3)) { - return 0; // Wrong signature. + return 0; // Wrong signature. } else { const uint32_t bits = data[0] | (data[1] << 8) | (data[2] << 16); const int key_frame = !(bits & 1); const int w = ((data[7] << 8) | data[6]) & 0x3fff; const int h = ((data[9] << 8) | data[8]) & 0x3fff; - if (!key_frame) { // Not a keyframe. + if (!key_frame) { // Not a keyframe. return 0; } if (((bits >> 1) & 7) > 3) { - return 0; // unknown profile + return 0; // unknown profile } if (!((bits >> 4) & 1)) { - return 0; // first frame is invisible! + return 0; // first frame is invisible! } if (((bits >> 5)) >= chunk_size) { // partition_length - return 0; // inconsistent size information. + return 0; // inconsistent size information. } if (w == 0 || h == 0) { - return 0; // We don't support both width and height to be zero. + return 0; // We don't support both width and height to be zero. } if (width) { @@ -170,30 +171,34 @@ static void ResetSegmentHeader(VP8SegmentHeader* const hdr) { } // Paragraph 9.3 -static int ParseSegmentHeader(VP8BitReader* br, - VP8SegmentHeader* hdr, VP8Proba* proba) { +static int ParseSegmentHeader(VP8BitReader* br, VP8SegmentHeader* hdr, + VP8Proba* proba) { assert(br != NULL); assert(hdr != NULL); hdr->use_segment = VP8Get(br, "global-header"); if (hdr->use_segment) { hdr->update_map = VP8Get(br, "global-header"); - if (VP8Get(br, "global-header")) { // update data + if (VP8Get(br, "global-header")) { // update data int s; hdr->absolute_delta = VP8Get(br, "global-header"); for (s = 0; s < NUM_MB_SEGMENTS; ++s) { - hdr->quantizer[s] = VP8Get(br, "global-header") ? - VP8GetSignedValue(br, 7, "global-header") : 0; + hdr->quantizer[s] = VP8Get(br, "global-header") + ? VP8GetSignedValue(br, 7, "global-header") + : 0; } for (s = 0; s < NUM_MB_SEGMENTS; ++s) { - hdr->filter_strength[s] = VP8Get(br, "global-header") ? - VP8GetSignedValue(br, 6, "global-header") : 0; + hdr->filter_strength[s] = + VP8Get(br, "global-header") + ? VP8GetSignedValue(br, 6, "global-header") + : 0; } } if (hdr->update_map) { int s; for (s = 0; s < MB_FEATURE_TREE_PROBS; ++s) { - proba->segments[s] = VP8Get(br, "global-header") ? - VP8GetValue(br, 8, "global-header") : 255u; + proba->segments[s] = VP8Get(br, "global-header") + ? VP8GetValue(br, 8, "global-header") + : 255u; } } } else { @@ -211,8 +216,8 @@ static int ParseSegmentHeader(VP8BitReader* br, // If we don't even have the partitions' sizes, then VP8_STATUS_NOT_ENOUGH_DATA // is returned, and this is an unrecoverable error. // If the partitions were positioned ok, VP8_STATUS_OK is returned. -static VP8StatusCode ParsePartitions(VP8Decoder* const dec, - const uint8_t* buf, size_t size) { +static VP8StatusCode ParsePartitions(VP8Decoder* const dec, const uint8_t* buf, + size_t size) { VP8BitReader* const br = &dec->br; const uint8_t* sz = buf; const uint8_t* buf_end = buf + size; @@ -247,12 +252,12 @@ static VP8StatusCode ParsePartitions(VP8Decoder* const dec, // Paragraph 9.4 static int ParseFilterHeader(VP8BitReader* br, VP8Decoder* const dec) { VP8FilterHeader* const hdr = &dec->filter_hdr; - hdr->simple = VP8Get(br, "global-header"); - hdr->level = VP8GetValue(br, 6, "global-header"); + hdr->simple = VP8Get(br, "global-header"); + hdr->level = VP8GetValue(br, 6, "global-header"); hdr->sharpness = VP8GetValue(br, 3, "global-header"); hdr->use_lf_delta = VP8Get(br, "global-header"); if (hdr->use_lf_delta) { - if (VP8Get(br, "global-header")) { // update lf-delta? + if (VP8Get(br, "global-header")) { // update lf-delta? int i; for (i = 0; i < NUM_REF_LF_DELTAS; ++i) { if (VP8Get(br, "global-header")) { @@ -290,8 +295,7 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) { buf = io->data; buf_size = io->data_size; if (buf_size < 4) { - return VP8SetError(dec, VP8_STATUS_NOT_ENOUGH_DATA, - "Truncated header."); + return VP8SetError(dec, VP8_STATUS_NOT_ENOUGH_DATA, "Truncated header."); } // Paragraph 9.1 @@ -322,11 +326,10 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) { "cannot parse picture header"); } if (!VP8CheckSignature(buf, buf_size)) { - return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR, - "Bad code word"); + return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR, "Bad code word"); } pic_hdr->width = ((buf[4] << 8) | buf[3]) & 0x3fff; - pic_hdr->xscale = buf[4] >> 6; // ratio: 1, 5/4 5/3 or 2 + pic_hdr->xscale = buf[4] >> 6; // ratio: 1, 5/4 5/3 or 2 pic_hdr->height = ((buf[6] << 8) | buf[5]) & 0x3fff; pic_hdr->yscale = buf[6] >> 6; buf += 7; @@ -342,11 +345,11 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) { // So they can be used interchangeably without always testing for // 'use_cropping'. io->use_cropping = 0; - io->crop_top = 0; + io->crop_top = 0; io->crop_left = 0; - io->crop_right = io->width; + io->crop_right = io->width; io->crop_bottom = io->height; - io->use_scaling = 0; + io->use_scaling = 0; io->scaled_width = io->width; io->scaled_height = io->height; @@ -360,8 +363,7 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) { // Check if we have all the partition #0 available, and initialize dec->br // to read this partition (and this partition only). if (frm_hdr->partition_length > buf_size) { - return VP8SetError(dec, VP8_STATUS_NOT_ENOUGH_DATA, - "bad partition length"); + return VP8SetError(dec, VP8_STATUS_NOT_ENOUGH_DATA, "bad partition length"); } br = &dec->br; @@ -392,11 +394,10 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) { // Frame buffer marking if (!frm_hdr->key_frame) { - return VP8SetError(dec, VP8_STATUS_UNSUPPORTED_FEATURE, - "Not a key frame."); + return VP8SetError(dec, VP8_STATUS_UNSUPPORTED_FEATURE, "Not a key frame."); } - VP8Get(br, "global-header"); // ignore the value of 'update_proba' + VP8Get(br, "global-header"); // ignore the value of 'update_proba' VP8ParseProba(br, dec); @@ -408,15 +409,14 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) { //------------------------------------------------------------------------------ // Residual decoding (Paragraph 13.2 / 13.3) -static const uint8_t kCat3[] = { 173, 148, 140, 0 }; -static const uint8_t kCat4[] = { 176, 155, 140, 135, 0 }; -static const uint8_t kCat5[] = { 180, 157, 141, 134, 130, 0 }; -static const uint8_t kCat6[] = - { 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0 }; -static const uint8_t* const kCat3456[] = { kCat3, kCat4, kCat5, kCat6 }; -static const uint8_t kZigzag[16] = { - 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15 -}; +static const uint8_t kCat3[] = {173, 148, 140, 0}; +static const uint8_t kCat4[] = {176, 155, 140, 135, 0}; +static const uint8_t kCat5[] = {180, 157, 141, 134, 130, 0}; +static const uint8_t kCat6[] = {254, 254, 243, 230, 196, 177, + 153, 140, 133, 130, 129, 0}; +static const uint8_t* const kCat3456[] = {kCat3, kCat4, kCat5, kCat6}; +static const uint8_t kZigzag[16] = {0, 1, 4, 8, 5, 2, 3, 6, + 9, 12, 13, 10, 7, 11, 14, 15}; // See section 13-2: https://datatracker.ietf.org/doc/html/rfc6386#section-13.2 static int GetLargeValue(VP8BitReader* const br, const uint8_t* const p) { @@ -452,18 +452,18 @@ static int GetLargeValue(VP8BitReader* const br, const uint8_t* const p) { // Returns the position of the last non-zero coeff plus one static int GetCoeffsFast(VP8BitReader* const br, - const VP8BandProbas* const prob[], - int ctx, const quant_t dq, int n, int16_t* out) { + const VP8BandProbas* const prob[], int ctx, + const quant_t dq, int n, int16_t* out) { const uint8_t* p = prob[n]->probas[ctx]; for (; n < 16; ++n) { if (!VP8GetBit(br, p[0], "coeffs")) { return n; // previous coeff was last non-zero coeff } - while (!VP8GetBit(br, p[1], "coeffs")) { // sequence of zero coeffs + while (!VP8GetBit(br, p[1], "coeffs")) { // sequence of zero coeffs p = prob[++n]->probas[0]; if (n == 16) return 16; } - { // non zero coeff + { // non zero coeff const VP8ProbaArray* const p_ctx = &prob[n + 1]->probas[0]; int v; if (!VP8GetBit(br, p[2], "coeffs")) { @@ -482,18 +482,18 @@ static int GetCoeffsFast(VP8BitReader* const br, // This version of GetCoeffs() uses VP8GetBitAlt() which is an alternate version // of VP8GetBitAlt() targeting specific platforms. static int GetCoeffsAlt(VP8BitReader* const br, - const VP8BandProbas* const prob[], - int ctx, const quant_t dq, int n, int16_t* out) { + const VP8BandProbas* const prob[], int ctx, + const quant_t dq, int n, int16_t* out) { const uint8_t* p = prob[n]->probas[ctx]; for (; n < 16; ++n) { if (!VP8GetBitAlt(br, p[0], "coeffs")) { return n; // previous coeff was last non-zero coeff } - while (!VP8GetBitAlt(br, p[1], "coeffs")) { // sequence of zero coeffs + while (!VP8GetBitAlt(br, p[1], "coeffs")) { // sequence of zero coeffs p = prob[++n]->probas[0]; if (n == 16) return 16; } - { // non zero coeff + { // non zero coeff const VP8ProbaArray* const p_ctx = &prob[n + 1]->probas[0]; int v; if (!VP8GetBitAlt(br, p[2], "coeffs")) { @@ -525,10 +525,10 @@ static WEBP_INLINE uint32_t NzCodeBits(uint32_t nz_coeffs, int nz, int dc_nz) { return nz_coeffs; } -static int ParseResiduals(VP8Decoder* const dec, - VP8MB* const mb, VP8BitReader* const token_br) { - const VP8BandProbas* (* const bands)[16 + 1] = dec->proba.bands_ptr; - const VP8BandProbas* const * ac_proba; +static int ParseResiduals(VP8Decoder* const dec, VP8MB* const mb, + VP8BitReader* const token_br) { + const VP8BandProbas*(*const bands)[16 + 1] = dec->proba.bands_ptr; + const VP8BandProbas* const* ac_proba; VP8MBData* const block = dec->mb_data + dec->mb_x; const VP8QuantMatrix* const q = &dec->dqm[block->segment]; int16_t* dst = block->coeffs; @@ -541,14 +541,14 @@ static int ParseResiduals(VP8Decoder* const dec, int first; memset(dst, 0, 384 * sizeof(*dst)); - if (!block->is_i4x4) { // parse DC - int16_t dc[16] = { 0 }; + if (!block->is_i4x4) { // parse DC + int16_t dc[16] = {0}; const int ctx = mb->nz_dc + left_mb->nz_dc; const int nz = GetCoeffs(token_br, bands[1], ctx, q->y2_mat, 0, dc); mb->nz_dc = left_mb->nz_dc = (nz > 0); - if (nz > 1) { // more than just the DC -> perform the full transform + if (nz > 1) { // more than just the DC -> perform the full transform VP8TransformWHT(dc, dst); - } else { // only DC is non-zero -> inlined simplified transform + } else { // only DC is non-zero -> inlined simplified transform int i; const int dc0 = (dc[0] + 3) >> 3; for (i = 0; i < 16 * 16; i += 16) dst[i] = dc0; @@ -669,7 +669,7 @@ static int ParseFrame(VP8Decoder* const dec, VP8Io* io) { "Premature end-of-file encountered."); } } - VP8InitScanline(dec); // Prepare for next scanline + VP8InitScanline(dec); // Prepare for next scanline // Reconstruct, filter and emit the row. if (!VP8ProcessRow(dec, io)) { @@ -703,7 +703,7 @@ int VP8Decode(VP8Decoder* const dec, VP8Io* const io) { // Finish setting up the decoding parameter. Will call io->setup(). ok = (VP8EnterCritical(dec, io) == VP8_STATUS_OK); - if (ok) { // good to go. + if (ok) { // good to go. // Will allocate memory and prepare everything. if (ok) ok = VP8InitFrame(dec, io); diff --git a/src/dec/vp8_dec.h b/src/dec/vp8_dec.h index eb292b14..2be0d799 100644 --- a/src/dec/vp8_dec.h +++ b/src/dec/vp8_dec.h @@ -49,20 +49,20 @@ typedef void (*VP8IoTeardownHook)(const VP8Io* io); struct VP8Io { // set by VP8GetHeaders() - int width, height; // picture dimensions, in pixels (invariable). - // These are the original, uncropped dimensions. - // The actual area passed to put() is stored - // in mb_w / mb_h fields. + int width, height; // picture dimensions, in pixels (invariable). + // These are the original, uncropped dimensions. + // The actual area passed to put() is stored + // in mb_w / mb_h fields. // set before calling put() int mb_y; // position of the current rows (in pixels) int mb_w; // number of columns in the sample int mb_h; // number of rows in the sample - const uint8_t* y, *u, *v; // rows to copy (in yuv420 format) + const uint8_t *y, *u, *v; // rows to copy (in yuv420 format) int y_stride; // row stride for luma int uv_stride; // row stride for chroma - void* opaque; // user data + void* opaque; // user data // called when fresh samples are available. Currently, samples are in // YUV420 format, and can be up to width x 24 in size (depending on the @@ -165,8 +165,8 @@ WEBP_EXTERN int VP8CheckSignature(const uint8_t* const data, size_t data_size); // can be passed NULL. WEBP_EXTERN int VP8GetInfo( const uint8_t* data, - size_t data_size, // data available so far - size_t chunk_size, // total data size expected in the chunk + size_t data_size, // data available so far + size_t chunk_size, // total data size expected in the chunk int* const width, int* const height); // Returns true if the next byte(s) in data is a VP8L signature. @@ -175,12 +175,13 @@ WEBP_EXTERN int VP8LCheckSignature(const uint8_t* const data, size_t size); // Validates the VP8L data-header and retrieves basic header information viz // width, height and alpha. Returns 0 in case of formatting error. // width/height/has_alpha can be passed NULL. -WEBP_EXTERN int VP8LGetInfo( - const uint8_t* data, size_t data_size, // data available so far - int* const width, int* const height, int* const has_alpha); +WEBP_EXTERN int VP8LGetInfo(const uint8_t* data, + size_t data_size, // data available so far + int* const width, int* const height, + int* const has_alpha); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_DEC_VP8_DEC_H_ diff --git a/src/dec/vp8i_dec.h b/src/dec/vp8i_dec.h index 6d4c092b..62720ac7 100644 --- a/src/dec/vp8i_dec.h +++ b/src/dec/vp8i_dec.h @@ -14,7 +14,7 @@ #ifndef WEBP_DEC_VP8I_DEC_H_ #define WEBP_DEC_VP8I_DEC_H_ -#include // for memcpy() +#include // for memcpy() #include "src/dec/common_dec.h" #include "src/dec/vp8_dec.h" @@ -62,9 +62,9 @@ extern "C" { // '|' = left sample, '-' = top sample, '+' = top-left sample // 't' = extra top-right sample for 4x4 modes #define YUV_SIZE (BPS * 17 + BPS * 9) -#define Y_OFF (BPS * 1 + 8) -#define U_OFF (Y_OFF + BPS * 16 + BPS) -#define V_OFF (U_OFF + 16) +#define Y_OFF (BPS * 1 + 8) +#define U_OFF (Y_OFF + BPS * 16 + BPS) +#define V_OFF (U_OFF + 16) // minimal width under which lossy multi-threading is always disabled #define MIN_WIDTH_FOR_THREADS 512 @@ -84,15 +84,15 @@ typedef struct { uint16_t height; uint8_t xscale; uint8_t yscale; - uint8_t colorspace; // 0 = YCbCr + uint8_t colorspace; // 0 = YCbCr uint8_t clamp_type; } VP8PictureHeader; // segment features typedef struct { int use_segment; - int update_map; // whether to update the segment map or not - int absolute_delta; // absolute or delta values for quantizer and filter + int update_map; // whether to update the segment map or not + int absolute_delta; // absolute or delta values for quantizer and filter int8_t quantizer[NUM_MB_SEGMENTS]; // quantization changes int8_t filter_strength[NUM_MB_SEGMENTS]; // filter strength for segments } VP8SegmentHeader; @@ -100,7 +100,7 @@ typedef struct { // probas associated to one of the contexts typedef uint8_t VP8ProbaArray[NUM_PROBAS]; -typedef struct { // all the probas associated to one band +typedef struct { // all the probas associated to one band VP8ProbaArray probas[NUM_CTX]; } VP8BandProbas; @@ -114,9 +114,9 @@ typedef struct { // Filter parameters typedef struct { - int simple; // 0=complex, 1=simple - int level; // [0..63] - int sharpness; // [0..7] + int simple; // 0=complex, 1=simple + int level; // [0..63] + int sharpness; // [0..7] int use_lf_delta; int ref_lf_delta[NUM_REF_LF_DELTAS]; int mode_lf_delta[NUM_MODE_LF_DELTAS]; @@ -125,33 +125,33 @@ typedef struct { //------------------------------------------------------------------------------ // Informations about the macroblocks. -typedef struct { // filter specs - uint8_t f_limit; // filter limit in [3..189], or 0 if no filtering - uint8_t f_ilevel; // inner limit in [1..63] - uint8_t f_inner; // do inner filtering? - uint8_t hev_thresh; // high edge variance threshold in [0..2] +typedef struct { // filter specs + uint8_t f_limit; // filter limit in [3..189], or 0 if no filtering + uint8_t f_ilevel; // inner limit in [1..63] + uint8_t f_inner; // do inner filtering? + uint8_t hev_thresh; // high edge variance threshold in [0..2] } VP8FInfo; typedef struct { // Top/Left Contexts used for syntax-parsing - uint8_t nz; // non-zero AC/DC coeffs (4bit for luma + 4bit for chroma) - uint8_t nz_dc; // non-zero DC coeff (1bit) + uint8_t nz; // non-zero AC/DC coeffs (4bit for luma + 4bit for chroma) + uint8_t nz_dc; // non-zero DC coeff (1bit) } VP8MB; // Dequantization matrices -typedef int quant_t[2]; // [DC / AC]. Can be 'uint16_t[2]' too (~slower). +typedef int quant_t[2]; // [DC / AC]. Can be 'uint16_t[2]' too (~slower). typedef struct { quant_t y1_mat, y2_mat, uv_mat; - int uv_quant; // U/V quantizer value - int dither; // dithering amplitude (0 = off, max=255) + int uv_quant; // U/V quantizer value + int dither; // dithering amplitude (0 = off, max=255) } VP8QuantMatrix; // Data needed to reconstruct a macroblock typedef struct { - int16_t coeffs[384]; // 384 coeffs = (16+4+4) * 4*4 - uint8_t is_i4x4; // true if intra4x4 - uint8_t imodes[16]; // one 16x16 mode (#0) or sixteen 4x4 modes - uint8_t uvmode; // chroma prediction mode + int16_t coeffs[384]; // 384 coeffs = (16+4+4) * 4*4 + uint8_t is_i4x4; // true if intra4x4 + uint8_t imodes[16]; // one 16x16 mode (#0) or sixteen 4x4 modes + uint8_t uvmode; // chroma prediction mode // bit-wise info about the content of each sub-4x4 blocks (in decoding order). // Each of the 4x4 blocks for y/u/v is associated with a 2b code according to: // code=0 -> no coefficient @@ -161,7 +161,7 @@ typedef struct { // This allows to call specialized transform functions. uint32_t non_zero_y; uint32_t non_zero_uv; - uint8_t dither; // local dithering strength (deduced from non_zero*) + uint8_t dither; // local dithering strength (deduced from non_zero*) uint8_t skip; uint8_t segment; } VP8MBData; @@ -186,7 +186,7 @@ typedef struct { struct VP8Decoder { VP8StatusCode status; - int ready; // true if ready to decode a picture with VP8Decode() + int ready; // true if ready to decode a picture with VP8Decode() const char* error_msg; // set when status is not OK. // Main data source @@ -194,17 +194,17 @@ struct VP8Decoder { int incremental; // if true, incremental decoding is expected // headers - VP8FrameHeader frm_hdr; + VP8FrameHeader frm_hdr; VP8PictureHeader pic_hdr; - VP8FilterHeader filter_hdr; + VP8FilterHeader filter_hdr; VP8SegmentHeader segment_hdr; // Worker WebPWorker worker; - int mt_method; // multi-thread method: 0=off, 1=[parse+recon][filter] - // 2=[parse][recon+filter] - int cache_id; // current cache row - int num_caches; // number of cached rows of 16 pixels (1, 2 or 3) + int mt_method; // multi-thread method: 0=off, 1=[parse+recon][filter] + // 2=[parse][recon+filter] + int cache_id; // current cache row + int num_caches; // number of cached rows of 16 pixels (1, 2 or 3) VP8ThreadContext thread_ctx; // Thread context // dimension, in macroblock units. @@ -220,8 +220,8 @@ struct VP8Decoder { VP8BitReader parts[MAX_NUM_PARTITIONS]; // Dithering strength, deduced from decoding options - int dither; // whether to use dithering or not - VP8Random dithering_rg; // random generator for dithering + int dither; // whether to use dithering or not + VP8Random dithering_rg; // random generator for dithering // dequantization (one set of DC/AC dequant factor per segment) VP8QuantMatrix dqm[NUM_MB_SEGMENTS]; @@ -232,16 +232,16 @@ struct VP8Decoder { uint8_t skip_p; // Boundary data cache and persistent buffers. - uint8_t* intra_t; // top intra modes values: 4 * mb_w - uint8_t intra_l[4]; // left intra modes values + uint8_t* intra_t; // top intra modes values: 4 * mb_w + uint8_t intra_l[4]; // left intra modes values VP8TopSamples* yuv_t; // top y/u/v samples - VP8MB* mb_info; // contextual macroblock info (mb_w + 1) - VP8FInfo* f_info; // filter strength info - uint8_t* yuv_b; // main block for Y/U/V (size = YUV_SIZE) + VP8MB* mb_info; // contextual macroblock info (mb_w + 1) + VP8FInfo* f_info; // filter strength info + uint8_t* yuv_b; // main block for Y/U/V (size = YUV_SIZE) - uint8_t* cache_y; // macroblock row for storing unfiltered samples + uint8_t* cache_y; // macroblock row for storing unfiltered samples uint8_t* cache_u; uint8_t* cache_v; int cache_y_stride; @@ -252,8 +252,8 @@ struct VP8Decoder { size_t mem_size; // Per macroblock non-persistent infos. - int mb_x, mb_y; // current position, in macroblock units - VP8MBData* mb_data; // parsed reconstruction data + int mb_x, mb_y; // current position, in macroblock units + VP8MBData* mb_data; // parsed reconstruction data // Filtering side-info int filter_type; // 0=off, 1=simple, 2=complex @@ -267,15 +267,15 @@ struct VP8Decoder { uint8_t* alpha_plane_mem; // memory allocated for alpha_plane uint8_t* alpha_plane; // output. Persistent, contains the whole data. const uint8_t* alpha_prev_line; // last decoded alpha row (or NULL) - int alpha_dithering; // derived from decoding options (0=off, 100=full) + int alpha_dithering; // derived from decoding options (0=off, 100=full) }; //------------------------------------------------------------------------------ // internal functions. Not public. // in vp8.c -int VP8SetError(VP8Decoder* const dec, - VP8StatusCode error, const char* const msg); +int VP8SetError(VP8Decoder* const dec, VP8StatusCode error, + const char* const msg); // in tree.c void VP8ResetProba(VP8Proba* const proba); @@ -299,8 +299,8 @@ WEBP_NODISCARD int VP8ExitCritical(VP8Decoder* const dec, VP8Io* const io); // Return the multi-threading method to use (0=off), depending // on options and bitstream size. Only for lossy decoding. int VP8GetThreadMethod(const WebPDecoderOptions* const options, - const WebPHeaderStructure* const headers, - int width, int height); + const WebPHeaderStructure* const headers, int width, + int height); // Initialize dithering post-process if needed. void VP8InitDithering(const WebPDecoderOptions* const options, VP8Decoder* const dec); @@ -314,13 +314,13 @@ WEBP_NODISCARD int VP8DecodeMB(VP8Decoder* const dec, // in alpha.c const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec, - const VP8Io* const io, - int row, int num_rows); + const VP8Io* const io, int row, + int num_rows); //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_DEC_VP8I_DEC_H_ diff --git a/src/dec/vp8l_dec.c b/src/dec/vp8l_dec.c index cf8cd82c..2e4f888d 100644 --- a/src/dec/vp8l_dec.c +++ b/src/dec/vp8l_dec.c @@ -33,12 +33,12 @@ #include "src/webp/format_constants.h" #include "src/webp/types.h" -#define NUM_ARGB_CACHE_ROWS 16 +#define NUM_ARGB_CACHE_ROWS 16 static const int kCodeLengthLiterals = 16; static const int kCodeLengthRepeatCode = 16; -static const uint8_t kCodeLengthExtraBits[3] = { 2, 3, 7 }; -static const uint8_t kCodeLengthRepeatOffsets[3] = { 3, 3, 11 }; +static const uint8_t kCodeLengthExtraBits[3] = {2, 3, 7}; +static const uint8_t kCodeLengthRepeatOffsets[3] = {3, 3, 11}; // ----------------------------------------------------------------------------- // Five Huffman codes are used at each meta code: @@ -47,44 +47,30 @@ static const uint8_t kCodeLengthRepeatOffsets[3] = { 3, 3, 11 }; // 3. red, // 4. blue, and, // 5. distance prefix codes. -typedef enum { - GREEN = 0, - RED = 1, - BLUE = 2, - ALPHA = 3, - DIST = 4 -} HuffIndex; +typedef enum { GREEN = 0, RED = 1, BLUE = 2, ALPHA = 3, DIST = 4 } HuffIndex; static const uint16_t kAlphabetSize[HUFFMAN_CODES_PER_META_CODE] = { - NUM_LITERAL_CODES + NUM_LENGTH_CODES, - NUM_LITERAL_CODES, NUM_LITERAL_CODES, NUM_LITERAL_CODES, - NUM_DISTANCE_CODES -}; + NUM_LITERAL_CODES + NUM_LENGTH_CODES, NUM_LITERAL_CODES, NUM_LITERAL_CODES, + NUM_LITERAL_CODES, NUM_DISTANCE_CODES}; -static const uint8_t kLiteralMap[HUFFMAN_CODES_PER_META_CODE] = { - 0, 1, 1, 1, 0 -}; +static const uint8_t kLiteralMap[HUFFMAN_CODES_PER_META_CODE] = {0, 1, 1, 1, 0}; -#define NUM_CODE_LENGTH_CODES 19 +#define NUM_CODE_LENGTH_CODES 19 static const uint8_t kCodeLengthCodeOrder[NUM_CODE_LENGTH_CODES] = { - 17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 -}; + 17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; -#define CODE_TO_PLANE_CODES 120 +#define CODE_TO_PLANE_CODES 120 static const uint8_t kCodeToPlane[CODE_TO_PLANE_CODES] = { - 0x18, 0x07, 0x17, 0x19, 0x28, 0x06, 0x27, 0x29, 0x16, 0x1a, - 0x26, 0x2a, 0x38, 0x05, 0x37, 0x39, 0x15, 0x1b, 0x36, 0x3a, - 0x25, 0x2b, 0x48, 0x04, 0x47, 0x49, 0x14, 0x1c, 0x35, 0x3b, - 0x46, 0x4a, 0x24, 0x2c, 0x58, 0x45, 0x4b, 0x34, 0x3c, 0x03, - 0x57, 0x59, 0x13, 0x1d, 0x56, 0x5a, 0x23, 0x2d, 0x44, 0x4c, - 0x55, 0x5b, 0x33, 0x3d, 0x68, 0x02, 0x67, 0x69, 0x12, 0x1e, - 0x66, 0x6a, 0x22, 0x2e, 0x54, 0x5c, 0x43, 0x4d, 0x65, 0x6b, - 0x32, 0x3e, 0x78, 0x01, 0x77, 0x79, 0x53, 0x5d, 0x11, 0x1f, - 0x64, 0x6c, 0x42, 0x4e, 0x76, 0x7a, 0x21, 0x2f, 0x75, 0x7b, - 0x31, 0x3f, 0x63, 0x6d, 0x52, 0x5e, 0x00, 0x74, 0x7c, 0x41, - 0x4f, 0x10, 0x20, 0x62, 0x6e, 0x30, 0x73, 0x7d, 0x51, 0x5f, - 0x40, 0x72, 0x7e, 0x61, 0x6f, 0x50, 0x71, 0x7f, 0x60, 0x70 -}; + 0x18, 0x07, 0x17, 0x19, 0x28, 0x06, 0x27, 0x29, 0x16, 0x1a, 0x26, 0x2a, + 0x38, 0x05, 0x37, 0x39, 0x15, 0x1b, 0x36, 0x3a, 0x25, 0x2b, 0x48, 0x04, + 0x47, 0x49, 0x14, 0x1c, 0x35, 0x3b, 0x46, 0x4a, 0x24, 0x2c, 0x58, 0x45, + 0x4b, 0x34, 0x3c, 0x03, 0x57, 0x59, 0x13, 0x1d, 0x56, 0x5a, 0x23, 0x2d, + 0x44, 0x4c, 0x55, 0x5b, 0x33, 0x3d, 0x68, 0x02, 0x67, 0x69, 0x12, 0x1e, + 0x66, 0x6a, 0x22, 0x2e, 0x54, 0x5c, 0x43, 0x4d, 0x65, 0x6b, 0x32, 0x3e, + 0x78, 0x01, 0x77, 0x79, 0x53, 0x5d, 0x11, 0x1f, 0x64, 0x6c, 0x42, 0x4e, + 0x76, 0x7a, 0x21, 0x2f, 0x75, 0x7b, 0x31, 0x3f, 0x63, 0x6d, 0x52, 0x5e, + 0x00, 0x74, 0x7c, 0x41, 0x4f, 0x10, 0x20, 0x62, 0x6e, 0x30, 0x73, 0x7d, + 0x51, 0x5f, 0x40, 0x72, 0x7e, 0x61, 0x6f, 0x50, 0x71, 0x7f, 0x60, 0x70}; // Memory needed for lookup tables of one Huffman tree group. Red, blue, alpha // and distance alphabets are constant (256 for red, blue and alpha, 40 for @@ -96,19 +82,10 @@ static const uint8_t kCodeToPlane[CODE_TO_PLANE_CODES] = { // https://github.com/madler/zlib/blob/v1.2.5/examples/enough.c #define FIXED_TABLE_SIZE (630 * 3 + 410) static const uint16_t kTableSize[12] = { - FIXED_TABLE_SIZE + 654, - FIXED_TABLE_SIZE + 656, - FIXED_TABLE_SIZE + 658, - FIXED_TABLE_SIZE + 662, - FIXED_TABLE_SIZE + 670, - FIXED_TABLE_SIZE + 686, - FIXED_TABLE_SIZE + 718, - FIXED_TABLE_SIZE + 782, - FIXED_TABLE_SIZE + 912, - FIXED_TABLE_SIZE + 1168, - FIXED_TABLE_SIZE + 1680, - FIXED_TABLE_SIZE + 2704 -}; + FIXED_TABLE_SIZE + 654, FIXED_TABLE_SIZE + 656, FIXED_TABLE_SIZE + 658, + FIXED_TABLE_SIZE + 662, FIXED_TABLE_SIZE + 670, FIXED_TABLE_SIZE + 686, + FIXED_TABLE_SIZE + 718, FIXED_TABLE_SIZE + 782, FIXED_TABLE_SIZE + 912, + FIXED_TABLE_SIZE + 1168, FIXED_TABLE_SIZE + 1680, FIXED_TABLE_SIZE + 2704}; static int VP8LSetError(VP8LDecoder* const dec, VP8StatusCode error) { // The oldest error reported takes precedence over the new one. @@ -118,22 +95,19 @@ static int VP8LSetError(VP8LDecoder* const dec, VP8StatusCode error) { return 0; } -static int DecodeImageStream(int xsize, int ysize, - int is_level0, +static int DecodeImageStream(int xsize, int ysize, int is_level0, VP8LDecoder* const dec, uint32_t** const decoded_data); //------------------------------------------------------------------------------ int VP8LCheckSignature(const uint8_t* const data, size_t size) { - return (size >= VP8L_FRAME_HEADER_SIZE && - data[0] == VP8L_MAGIC_BYTE && + return (size >= VP8L_FRAME_HEADER_SIZE && data[0] == VP8L_MAGIC_BYTE && (data[4] >> 5) == 0); // version } -static int ReadImageInfo(VP8LBitReader* const br, - int* const width, int* const height, - int* const has_alpha) { +static int ReadImageInfo(VP8LBitReader* const br, int* const width, + int* const height, int* const has_alpha) { if (VP8LReadBits(br, 8) != VP8L_MAGIC_BYTE) return 0; *width = VP8LReadBits(br, VP8L_IMAGE_SIZE_BITS) + 1; *height = VP8LReadBits(br, VP8L_IMAGE_SIZE_BITS) + 1; @@ -142,12 +116,12 @@ static int ReadImageInfo(VP8LBitReader* const br, return !br->eos; } -int VP8LGetInfo(const uint8_t* data, size_t data_size, - int* const width, int* const height, int* const has_alpha) { +int VP8LGetInfo(const uint8_t* data, size_t data_size, int* const width, + int* const height, int* const has_alpha) { if (data == NULL || data_size < VP8L_FRAME_HEADER_SIZE) { - return 0; // not enough data + return 0; // not enough data } else if (!VP8LCheckSignature(data, data_size)) { - return 0; // bad signature + return 0; // bad signature } else { int w, h, a; VP8LBitReader br; @@ -262,9 +236,9 @@ static void BuildPackedTable(HTreeGroup* const htree_group) { } } -static int ReadHuffmanCodeLengths( - VP8LDecoder* const dec, const int* const code_length_code_lengths, - int num_symbols, int* const code_lengths) { +static int ReadHuffmanCodeLengths(VP8LDecoder* const dec, + const int* const code_length_code_lengths, + int num_symbols, int* const code_lengths) { int ok = 0; VP8LBitReader* const br = &dec->br; int symbol; @@ -278,7 +252,7 @@ static int ReadHuffmanCodeLengths( goto End; } - if (VP8LReadBits(br, 1)) { // use length + if (VP8LReadBits(br, 1)) { // use length const int length_nbits = 2 + 2 * VP8LReadBits(br, 3); max_symbol = 2 + VP8LReadBits(br, length_nbits); if (max_symbol > num_symbols) { @@ -316,7 +290,7 @@ static int ReadHuffmanCodeLengths( } ok = 1; - End: +End: VP8LHuffmanTablesDeallocate(&tables); if (!ok) return VP8LSetError(dec, VP8_STATUS_BITSTREAM_ERROR); return ok; @@ -348,7 +322,7 @@ static int ReadHuffmanCode(int alphabet_size, VP8LDecoder* const dec, ok = 1; } else { // Decode Huffman-coded code lengths. int i; - int code_length_code_lengths[NUM_CODE_LENGTH_CODES] = { 0 }; + int code_length_code_lengths[NUM_CODE_LENGTH_CODES] = {0}; const int num_codes = VP8LReadBits(br, 4) + 4; assert(num_codes <= NUM_CODE_LENGTH_CODES); @@ -361,8 +335,8 @@ static int ReadHuffmanCode(int alphabet_size, VP8LDecoder* const dec, ok = ok && !br->eos; if (ok) { - size = VP8LBuildHuffmanTable(table, HUFFMAN_TABLE_BITS, - code_lengths, alphabet_size); + size = VP8LBuildHuffmanTable(table, HUFFMAN_TABLE_BITS, code_lengths, + alphabet_size); } if (!ok || size == 0) { return VP8LSetError(dec, VP8_STATUS_BITSTREAM_ERROR); @@ -449,7 +423,7 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize, hdr->num_htree_groups = num_htree_groups; hdr->htree_groups = htree_groups; - Error: +Error: WebPSafeFree(mapping); if (!ok) { WebPSafeFree(huffman_image); @@ -554,7 +528,7 @@ int ReadHuffmanCodesHelper(int color_cache_bits, int num_htree_groups, } ok = 1; - Error: +Error: WebPSafeFree(code_lengths); if (!ok) { VP8LHuffmanTablesDeallocate(huffman_tables); @@ -575,7 +549,7 @@ static int AllocateAndInitRescaler(VP8LDecoder* const dec, VP8Io* const io) { const int in_height = io->mb_h; const int out_height = io->scaled_height; const uint64_t work_size = 2 * num_channels * (uint64_t)out_width; - rescaler_t* work; // Rescaler work area. + rescaler_t* work; // Rescaler work area. const uint64_t scaled_data_size = (uint64_t)out_width; uint32_t* scaled_data; // Temporary storage for scaled BGRA data. const uint64_t memory_size = sizeof(*dec->rescaler) + @@ -595,13 +569,13 @@ static int AllocateAndInitRescaler(VP8LDecoder* const dec, VP8Io* const io) { scaled_data = (uint32_t*)memory; if (!WebPRescalerInit(dec->rescaler, in_width, in_height, - (uint8_t*)scaled_data, out_width, out_height, - 0, num_channels, work)) { + (uint8_t*)scaled_data, out_width, out_height, 0, + num_channels, work)) { return 0; } return 1; } -#endif // WEBP_REDUCE_SIZE +#endif // WEBP_REDUCE_SIZE //------------------------------------------------------------------------------ // Export to ARGB @@ -626,9 +600,9 @@ static int Export(WebPRescaler* const rescaler, WEBP_CSP_MODE colorspace, } // Emit scaled rows. -static int EmitRescaledRowsRGBA(const VP8LDecoder* const dec, - uint8_t* in, int in_stride, int mb_h, - uint8_t* const out, int out_stride) { +static int EmitRescaledRowsRGBA(const VP8LDecoder* const dec, uint8_t* in, + int in_stride, int mb_h, uint8_t* const out, + int out_stride) { const WEBP_CSP_MODE colorspace = dec->output->colorspace; int num_lines_in = 0; int num_lines_out = 0; @@ -639,8 +613,8 @@ static int EmitRescaledRowsRGBA(const VP8LDecoder* const dec, const int needed_lines = WebPRescaleNeededLines(dec->rescaler, lines_left); int lines_imported; assert(needed_lines > 0 && needed_lines <= lines_left); - WebPMultARGBRows(row_in, in_stride, - dec->rescaler->src_width, needed_lines, 0); + WebPMultARGBRows(row_in, in_stride, dec->rescaler->src_width, needed_lines, + 0); lines_imported = WebPRescalerImport(dec->rescaler, lines_left, row_in, in_stride); assert(lines_imported == needed_lines); @@ -650,13 +624,12 @@ static int EmitRescaledRowsRGBA(const VP8LDecoder* const dec, return num_lines_out; } -#endif // WEBP_REDUCE_SIZE +#endif // WEBP_REDUCE_SIZE // Emit rows without any scaling. -static int EmitRows(WEBP_CSP_MODE colorspace, - const uint8_t* row_in, int in_stride, - int mb_w, int mb_h, - uint8_t* const out, int out_stride) { +static int EmitRows(WEBP_CSP_MODE colorspace, const uint8_t* row_in, + int in_stride, int mb_w, int mb_h, uint8_t* const out, + int out_stride) { int lines = mb_h; uint8_t* row_out = out; while (lines-- > 0) { @@ -711,8 +684,8 @@ static int ExportYUVA(const VP8LDecoder* const dec, int y_pos) { return num_lines_out; } -static int EmitRescaledRowsYUVA(const VP8LDecoder* const dec, - uint8_t* in, int in_stride, int mb_h) { +static int EmitRescaledRowsYUVA(const VP8LDecoder* const dec, uint8_t* in, + int in_stride, int mb_h) { int num_lines_in = 0; int y_pos = dec->last_out_row; while (num_lines_in < mb_h) { @@ -730,9 +703,8 @@ static int EmitRescaledRowsYUVA(const VP8LDecoder* const dec, return y_pos; } -static int EmitRowsYUVA(const VP8LDecoder* const dec, - const uint8_t* in, int in_stride, - int mb_w, int num_rows) { +static int EmitRowsYUVA(const VP8LDecoder* const dec, const uint8_t* in, + int in_stride, int mb_w, int num_rows) { int y_pos = dec->last_out_row; while (num_rows-- > 0) { ConvertToYUVA((const uint32_t*)in, mb_w, y_pos, dec->output); @@ -774,8 +746,8 @@ static int SetCropWindow(VP8Io* const io, int y_start, int y_end, //------------------------------------------------------------------------------ -static WEBP_INLINE int GetMetaIndex( - const uint32_t* const image, int xsize, int bits, int x, int y) { +static WEBP_INLINE int GetMetaIndex(const uint32_t* const image, int xsize, + int bits, int x, int y) { if (bits == 0) return 0; return image[xsize * (y >> bits) + (x >> bits)]; } @@ -793,9 +765,8 @@ static WEBP_INLINE HTreeGroup* GetHtreeGroupForPos(VP8LMetadata* const hdr, typedef void (*ProcessRowsFunc)(VP8LDecoder* const dec, int row); -static void ApplyInverseTransforms(VP8LDecoder* const dec, - int start_row, int num_rows, - const uint32_t* const rows) { +static void ApplyInverseTransforms(VP8LDecoder* const dec, int start_row, + int num_rows, const uint32_t* const rows) { int n = dec->next_transform; const int cache_pixs = dec->width * num_rows; const int end_row = start_row + num_rows; @@ -824,7 +795,7 @@ static void ProcessRows(VP8LDecoder* const dec, int row) { // We can't process more than NUM_ARGB_CACHE_ROWS at a time (that's the size // of argb_cache), but we currently don't need more than that. assert(num_rows <= NUM_ARGB_CACHE_ROWS); - if (num_rows > 0) { // Emit output. + if (num_rows > 0) { // Emit output. VP8Io* const io = dec->io; uint8_t* rows_data = (uint8_t*)dec->argb_cache; const int in_stride = io->width * sizeof(uint32_t); // in unit of RGBA @@ -839,18 +810,19 @@ static void ProcessRows(VP8LDecoder* const dec, int row) { buf->rgba + (ptrdiff_t)dec->last_out_row * buf->stride; const int num_rows_out = #if !defined(WEBP_REDUCE_SIZE) - io->use_scaling ? - EmitRescaledRowsRGBA(dec, rows_data, in_stride, io->mb_h, - rgba, buf->stride) : + io->use_scaling ? EmitRescaledRowsRGBA(dec, rows_data, in_stride, + io->mb_h, rgba, buf->stride) + : #endif // WEBP_REDUCE_SIZE - EmitRows(output->colorspace, rows_data, in_stride, - io->mb_w, io->mb_h, rgba, buf->stride); + EmitRows(output->colorspace, rows_data, in_stride, + io->mb_w, io->mb_h, rgba, buf->stride); // Update 'last_out_row'. dec->last_out_row += num_rows_out; - } else { // convert to YUVA - dec->last_out_row = io->use_scaling ? - EmitRescaledRowsYUVA(dec, rows_data, in_stride, io->mb_h) : - EmitRowsYUVA(dec, rows_data, in_stride, io->mb_w, io->mb_h); + } else { // convert to YUVA + dec->last_out_row = + io->use_scaling + ? EmitRescaledRowsYUVA(dec, rows_data, in_stride, io->mb_h) + : EmitRowsYUVA(dec, rows_data, in_stride, io->mb_w, io->mb_h); } assert(dec->last_out_row <= output->height); } @@ -877,9 +849,8 @@ static int Is8bOptimizable(const VP8LMetadata* const hdr) { return 1; } -static void AlphaApplyFilter(ALPHDecoder* const alph_dec, - int first_row, int last_row, - uint8_t* out, int stride) { +static void AlphaApplyFilter(ALPHDecoder* const alph_dec, int first_row, + int last_row, uint8_t* out, int stride) { if (alph_dec->filter != WEBP_FILTER_NONE) { int y; const uint8_t* prev_line = alph_dec->prev_line; @@ -897,23 +868,22 @@ static void ExtractPalettedAlphaRows(VP8LDecoder* const dec, int last_row) { // For vertical and gradient filtering, we need to decode the part above the // crop_top row, in order to have the correct spatial predictors. ALPHDecoder* const alph_dec = (ALPHDecoder*)dec->io->opaque; - const int top_row = - (alph_dec->filter == WEBP_FILTER_NONE || - alph_dec->filter == WEBP_FILTER_HORIZONTAL) ? dec->io->crop_top - : dec->last_row; + const int top_row = (alph_dec->filter == WEBP_FILTER_NONE || + alph_dec->filter == WEBP_FILTER_HORIZONTAL) + ? dec->io->crop_top + : dec->last_row; const int first_row = (dec->last_row < top_row) ? top_row : dec->last_row; assert(last_row <= dec->io->crop_bottom); if (last_row > first_row) { // Special method for paletted alpha data. We only process the cropped area. const int width = dec->io->width; uint8_t* out = alph_dec->output + width * first_row; - const uint8_t* const in = - (uint8_t*)dec->pixels + dec->width * first_row; + const uint8_t* const in = (uint8_t*)dec->pixels + dec->width * first_row; VP8LTransform* const transform = &dec->transforms[0]; assert(dec->next_transform == 1); assert(transform->type == COLOR_INDEXING_TRANSFORM); - VP8LColorIndexInverseTransformAlpha(transform, first_row, last_row, - in, out); + VP8LColorIndexInverseTransformAlpha(transform, first_row, last_row, in, + out); AlphaApplyFilter(alph_dec, first_row, last_row, out, width); } dec->last_row = dec->last_out_row = last_row; @@ -959,11 +929,11 @@ static WEBP_INLINE void CopyBlock8b(uint8_t* const dst, int dist, int length) { switch (dist) { case 1: pattern = src[0]; -#if defined(__arm__) || defined(_M_ARM) // arm doesn't like multiply that much +#if defined(__arm__) || defined(_M_ARM) // arm doesn't like multiply that much pattern |= pattern << 8; pattern |= pattern << 16; #elif defined(WEBP_USE_MIPS_DSP_R2) - __asm__ volatile ("replv.qb %0, %0" : "+r"(pattern)); + __asm__ volatile("replv.qb %0, %0" : "+r"(pattern)); #else pattern = 0x01010101u * pattern; #endif @@ -977,7 +947,7 @@ static WEBP_INLINE void CopyBlock8b(uint8_t* const dst, int dist, int length) { #if defined(__arm__) || defined(_M_ARM) pattern |= pattern << 16; #elif defined(WEBP_USE_MIPS_DSP_R2) - __asm__ volatile ("replv.ph %0, %0" : "+r"(pattern)); + __asm__ volatile("replv.ph %0, %0" : "+r"(pattern)); #else pattern = 0x00010001u * pattern; #endif @@ -991,7 +961,7 @@ static WEBP_INLINE void CopyBlock8b(uint8_t* const dst, int dist, int length) { CopySmallPattern8b(src, dst, length, pattern); return; } - Copy: +Copy: if (dist >= length) { // no overlap -> use memcpy() memcpy(dst, src, length * sizeof(*dst)); } else { @@ -1001,26 +971,25 @@ static WEBP_INLINE void CopyBlock8b(uint8_t* const dst, int dist, int length) { } // copy pattern of 1 or 2 uint32_t's -static WEBP_INLINE void CopySmallPattern32b(const uint32_t* src, - uint32_t* dst, +static WEBP_INLINE void CopySmallPattern32b(const uint32_t* src, uint32_t* dst, int length, uint64_t pattern) { int i; - if ((uintptr_t)dst & 4) { // Align 'dst' to 8-bytes boundary. + if ((uintptr_t)dst & 4) { // Align 'dst' to 8-bytes boundary. *dst++ = *src++; pattern = (pattern >> 32) | (pattern << 32); --length; } assert(0 == ((uintptr_t)dst & 7)); for (i = 0; i < (length >> 1); ++i) { - ((uint64_t*)dst)[i] = pattern; // Copy the pattern 8 bytes at a time. + ((uint64_t*)dst)[i] = pattern; // Copy the pattern 8 bytes at a time. } - if (length & 1) { // Finish with left-over. + if (length & 1) { // Finish with left-over. dst[i << 1] = src[i << 1]; } } -static WEBP_INLINE void CopyBlock32b(uint32_t* const dst, - int dist, int length) { +static WEBP_INLINE void CopyBlock32b(uint32_t* const dst, int dist, + int length) { const uint32_t* const src = dst - dist; if (dist <= 2 && length >= 4 && ((uintptr_t)dst & 3) == 0) { uint64_t pattern; @@ -1114,7 +1083,7 @@ static int DecodeAlphaData(VP8LDecoder* const dec, uint8_t* const data, // Process the remaining rows corresponding to last row-block. ExtractPalettedAlphaRows(dec, row > last_row ? last_row : row); - End: +End: br->eos = VP8LIsEndOfStream(br); if (!ok || (br->eos && pos < end)) { return VP8LSetError( @@ -1297,7 +1266,7 @@ static int DecodeImageData(VP8LDecoder* const dec, uint32_t* const data, } return 1; - Error: +Error: return VP8LSetError(dec, VP8_STATUS_BITSTREAM_ERROR); } @@ -1314,9 +1283,8 @@ static void ClearTransform(VP8LTransform* const transform) { static int ExpandColorMap(int num_colors, VP8LTransform* const transform) { int i; const int final_num_colors = 1 << (8 >> transform->bits); - uint32_t* const new_color_map = - (uint32_t*)WebPSafeMalloc((uint64_t)final_num_colors, - sizeof(*new_color_map)); + uint32_t* const new_color_map = (uint32_t*)WebPSafeMalloc( + (uint64_t)final_num_colors, sizeof(*new_color_map)); if (new_color_map == NULL) { return 0; } else { @@ -1362,31 +1330,30 @@ static int ReadTransform(int* const xsize, int const* ysize, case CROSS_COLOR_TRANSFORM: transform->bits = MIN_TRANSFORM_BITS + VP8LReadBits(br, NUM_TRANSFORM_BITS); - ok = DecodeImageStream(VP8LSubSampleSize(transform->xsize, - transform->bits), - VP8LSubSampleSize(transform->ysize, - transform->bits), - /*is_level0=*/0, dec, &transform->data); + ok = DecodeImageStream( + VP8LSubSampleSize(transform->xsize, transform->bits), + VP8LSubSampleSize(transform->ysize, transform->bits), + /*is_level0=*/0, dec, &transform->data); break; case COLOR_INDEXING_TRANSFORM: { - const int num_colors = VP8LReadBits(br, 8) + 1; - const int bits = (num_colors > 16) ? 0 - : (num_colors > 4) ? 1 - : (num_colors > 2) ? 2 - : 3; - *xsize = VP8LSubSampleSize(transform->xsize, bits); - transform->bits = bits; - ok = DecodeImageStream(num_colors, /*ysize=*/1, /*is_level0=*/0, dec, - &transform->data); - if (ok && !ExpandColorMap(num_colors, transform)) { - return VP8LSetError(dec, VP8_STATUS_OUT_OF_MEMORY); - } + const int num_colors = VP8LReadBits(br, 8) + 1; + const int bits = (num_colors > 16) ? 0 + : (num_colors > 4) ? 1 + : (num_colors > 2) ? 2 + : 3; + *xsize = VP8LSubSampleSize(transform->xsize, bits); + transform->bits = bits; + ok = DecodeImageStream(num_colors, /*ysize=*/1, /*is_level0=*/0, dec, + &transform->data); + if (ok && !ExpandColorMap(num_colors, transform)) { + return VP8LSetError(dec, VP8_STATUS_OUT_OF_MEMORY); + } break; } case SUBTRACT_GREEN_TRANSFORM: break; default: - assert(0); // can't happen + assert(0); // can't happen break; } @@ -1444,7 +1411,7 @@ static void VP8LClear(VP8LDecoder* const dec) { WebPSafeFree(dec->rescaler_memory); dec->rescaler_memory = NULL; - dec->output = NULL; // leave no trace behind + dec->output = NULL; // leave no trace behind } void VP8LDelete(VP8LDecoder* const dec) { @@ -1464,8 +1431,7 @@ static void UpdateDecoder(VP8LDecoder* const dec, int width, int height) { hdr->huffman_mask = (num_bits == 0) ? ~0 : (1 << num_bits) - 1; } -static int DecodeImageStream(int xsize, int ysize, - int is_level0, +static int DecodeImageStream(int xsize, int ysize, int is_level0, VP8LDecoder* const dec, uint32_t** const decoded_data) { int ok = 1; @@ -1513,7 +1479,7 @@ static int DecodeImageStream(int xsize, int ysize, } UpdateDecoder(dec, transform_xsize, transform_ysize); - if (is_level0) { // level 0 complete + if (is_level0) { // level 0 complete dec->state = READ_HDR; goto End; } @@ -1532,7 +1498,7 @@ static int DecodeImageStream(int xsize, int ysize, transform_ysize, NULL); ok = ok && !br->eos; - End: +End: if (!ok) { WebPSafeFree(data); ClearMetadata(hdr); @@ -1566,7 +1532,7 @@ static int AllocateInternalBuffers32b(VP8LDecoder* const dec, int final_width) { assert(dec->width <= final_width); dec->pixels = (uint32_t*)WebPSafeMalloc(total_num_pixels, sizeof(uint32_t)); if (dec->pixels == NULL) { - dec->argb_cache = NULL; // for soundness + dec->argb_cache = NULL; // for soundness return VP8LSetError(dec, VP8_STATUS_OUT_OF_MEMORY); } dec->argb_cache = dec->pixels + num_pixels + cache_top_pixels; @@ -1575,7 +1541,7 @@ static int AllocateInternalBuffers32b(VP8LDecoder* const dec, int final_width) { static int AllocateInternalBuffers8b(VP8LDecoder* const dec) { const uint64_t total_num_pixels = (uint64_t)dec->width * dec->height; - dec->argb_cache = NULL; // for soundness + dec->argb_cache = NULL; // for soundness dec->pixels = (uint32_t*)WebPSafeMalloc(total_num_pixels, sizeof(uint8_t)); if (dec->pixels == NULL) { return VP8LSetError(dec, VP8_STATUS_OUT_OF_MEMORY); @@ -1598,14 +1564,14 @@ static void ExtractAlphaRows(VP8LDecoder* const dec, int last_row) { // Extract alpha (which is stored in the green plane). ALPHDecoder* const alph_dec = (ALPHDecoder*)dec->io->opaque; uint8_t* const output = alph_dec->output; - const int width = dec->io->width; // the final width (!= dec->width) + const int width = dec->io->width; // the final width (!= dec->width) const int cache_pixs = width * num_rows_to_process; uint8_t* const dst = output + width * cur_row; const uint32_t* const src = dec->argb_cache; ApplyInverseTransforms(dec, cur_row, num_rows_to_process, in); WebPExtractGreen(src, dst, cache_pixs); - AlphaApplyFilter(alph_dec, - cur_row, cur_row + num_rows_to_process, dst, width); + AlphaApplyFilter(alph_dec, cur_row, cur_row + num_rows_to_process, dst, + width); num_rows -= num_rows_to_process; in += num_rows_to_process * dec->width; cur_row += num_rows_to_process; @@ -1658,7 +1624,7 @@ int VP8LDecodeAlphaHeader(ALPHDecoder* const alph_dec, alph_dec->vp8l_dec = dec; return 1; - Err: +Err: VP8LDelete(dec); return 0; } @@ -1675,11 +1641,11 @@ int VP8LDecodeAlphaImageStream(ALPHDecoder* const alph_dec, int last_row) { if (!alph_dec->use_8b_decode) WebPInitAlphaProcessing(); // Decode (with special row processing). - return alph_dec->use_8b_decode ? - DecodeAlphaData(dec, (uint8_t*)dec->pixels, dec->width, dec->height, - last_row) : - DecodeImageData(dec, dec->pixels, dec->width, dec->height, - last_row, ExtractAlphaRows); + return alph_dec->use_8b_decode + ? DecodeAlphaData(dec, (uint8_t*)dec->pixels, dec->width, + dec->height, last_row) + : DecodeImageData(dec, dec->pixels, dec->width, dec->height, + last_row, ExtractAlphaRows); } //------------------------------------------------------------------------------ @@ -1709,7 +1675,7 @@ int VP8LDecodeHeader(VP8LDecoder* const dec, VP8Io* const io) { } return 1; - Error: +Error: VP8LClear(dec); assert(dec->status != VP8_STATUS_OK); return 0; @@ -1781,7 +1747,7 @@ int VP8LDecodeImage(VP8LDecoder* const dec) { params->last_y = dec->last_out_row; return 1; - Err: +Err: VP8LClear(dec); assert(dec->status != VP8_STATUS_OK); return 0; diff --git a/src/dec/vp8li_dec.h b/src/dec/vp8li_dec.h index 4e2eadb3..07002941 100644 --- a/src/dec/vp8li_dec.h +++ b/src/dec/vp8li_dec.h @@ -15,7 +15,7 @@ #ifndef WEBP_DEC_VP8LI_DEC_H_ #define WEBP_DEC_VP8LI_DEC_H_ -#include // for memcpy() +#include // for memcpy() #include "src/dec/vp8_dec.h" #include "src/dec/webpi_dec.h" @@ -31,69 +31,65 @@ extern "C" { #endif -typedef enum { - READ_DATA = 0, - READ_HDR = 1, - READ_DIM = 2 -} VP8LDecodeState; +typedef enum { READ_DATA = 0, READ_HDR = 1, READ_DIM = 2 } VP8LDecodeState; typedef struct VP8LTransform VP8LTransform; struct VP8LTransform { - VP8LImageTransformType type; // transform type. - int bits; // subsampling bits defining transform window. - int xsize; // transform window X index. - int ysize; // transform window Y index. - uint32_t* data; // transform data. + VP8LImageTransformType type; // transform type. + int bits; // subsampling bits defining transform window. + int xsize; // transform window X index. + int ysize; // transform window Y index. + uint32_t* data; // transform data. }; typedef struct { - int color_cache_size; - VP8LColorCache color_cache; - VP8LColorCache saved_color_cache; // for incremental + int color_cache_size; + VP8LColorCache color_cache; + VP8LColorCache saved_color_cache; // for incremental - int huffman_mask; - int huffman_subsample_bits; - int huffman_xsize; - uint32_t* huffman_image; - int num_htree_groups; - HTreeGroup* htree_groups; - HuffmanTables huffman_tables; + int huffman_mask; + int huffman_subsample_bits; + int huffman_xsize; + uint32_t* huffman_image; + int num_htree_groups; + HTreeGroup* htree_groups; + HuffmanTables huffman_tables; } VP8LMetadata; typedef struct VP8LDecoder VP8LDecoder; struct VP8LDecoder { - VP8StatusCode status; - VP8LDecodeState state; - VP8Io* io; + VP8StatusCode status; + VP8LDecodeState state; + VP8Io* io; - const WebPDecBuffer* output; // shortcut to io->opaque->output + const WebPDecBuffer* output; // shortcut to io->opaque->output - uint32_t* pixels; // Internal data: either uint8_t* for alpha - // or uint32_t* for BGRA. - uint32_t* argb_cache; // Scratch buffer for temporary BGRA storage. + uint32_t* pixels; // Internal data: either uint8_t* for alpha + // or uint32_t* for BGRA. + uint32_t* argb_cache; // Scratch buffer for temporary BGRA storage. - VP8LBitReader br; - int incremental; // if true, incremental decoding is expected - VP8LBitReader saved_br; // note: could be local variables too - int saved_last_pixel; + VP8LBitReader br; + int incremental; // if true, incremental decoding is expected + VP8LBitReader saved_br; // note: could be local variables too + int saved_last_pixel; - int width; - int height; - int last_row; // last input row decoded so far. - int last_pixel; // last pixel decoded so far. However, it may - // not be transformed, scaled and - // color-converted yet. - int last_out_row; // last row output so far. + int width; + int height; + int last_row; // last input row decoded so far. + int last_pixel; // last pixel decoded so far. However, it may + // not be transformed, scaled and + // color-converted yet. + int last_out_row; // last row output so far. - VP8LMetadata hdr; + VP8LMetadata hdr; - int next_transform; - VP8LTransform transforms[NUM_TRANSFORMS]; + int next_transform; + VP8LTransform transforms[NUM_TRANSFORMS]; // or'd bitset storing the transforms types. - uint32_t transforms_seen; + uint32_t transforms_seen; - uint8_t* rescaler_memory; // Working memory for rescaling work. - WebPRescaler* rescaler; // Common rescaler for all channels. + uint8_t* rescaler_memory; // Working memory for rescaling work. + WebPRescaler* rescaler; // Common rescaler for all channels. }; //------------------------------------------------------------------------------ @@ -144,7 +140,7 @@ WEBP_NODISCARD int ReadHuffmanCodesHelper( //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_DEC_VP8LI_DEC_H_ diff --git a/src/dec/webp_dec.c b/src/dec/webp_dec.c index 5e7c23fe..dd1a6f6c 100644 --- a/src/dec/webp_dec.c +++ b/src/dec/webp_dec.c @@ -99,8 +99,7 @@ static VP8StatusCode ParseRIFF(const uint8_t** const data, // *height_ptr and *flags_ptr are set to the corresponding values extracted // from the VP8X chunk. static VP8StatusCode ParseVP8X(const uint8_t** const data, - size_t* const data_size, - int* const found_vp8x, + size_t* const data_size, int* const found_vp8x, int* const width_ptr, int* const height_ptr, uint32_t* const flags_ptr) { const uint32_t vp8x_size = CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE; @@ -173,7 +172,7 @@ static VP8StatusCode ParseOptionalChunks(const uint8_t** const data, while (1) { uint32_t chunk_size; - uint32_t disk_chunk_size; // chunk_size with padding + uint32_t disk_chunk_size; // chunk_size with padding *data = buf; *data_size = buf_size; @@ -184,7 +183,7 @@ static VP8StatusCode ParseOptionalChunks(const uint8_t** const data, chunk_size = GetLE32(buf + TAG_SIZE); if (chunk_size > MAX_CHUNK_PAYLOAD) { - return VP8_STATUS_BITSTREAM_ERROR; // Not a valid chunk size. + return VP8_STATUS_BITSTREAM_ERROR; // Not a valid chunk size. } // For odd-sized chunk-payload, there's one byte padding at the end. disk_chunk_size = (CHUNK_HEADER_SIZE + chunk_size + 1) & ~1u; @@ -192,23 +191,22 @@ static VP8StatusCode ParseOptionalChunks(const uint8_t** const data, // Check that total bytes skipped so far does not exceed riff_size. if (riff_size > 0 && (total_size > riff_size)) { - return VP8_STATUS_BITSTREAM_ERROR; // Not a valid chunk size. + return VP8_STATUS_BITSTREAM_ERROR; // Not a valid chunk size. } // Start of a (possibly incomplete) VP8/VP8L chunk implies that we have // parsed all the optional chunks. // Note: This check must occur before the check 'buf_size < disk_chunk_size' // below to allow incomplete VP8/VP8L chunks. - if (!memcmp(buf, "VP8 ", TAG_SIZE) || - !memcmp(buf, "VP8L", TAG_SIZE)) { + if (!memcmp(buf, "VP8 ", TAG_SIZE) || !memcmp(buf, "VP8L", TAG_SIZE)) { return VP8_STATUS_OK; } - if (buf_size < disk_chunk_size) { // Insufficient data. + if (buf_size < disk_chunk_size) { // Insufficient data. return VP8_STATUS_NOT_ENOUGH_DATA; } - if (!memcmp(buf, "ALPH", TAG_SIZE)) { // A valid ALPH header. + if (!memcmp(buf, "ALPH", TAG_SIZE)) { // A valid ALPH header. *alpha_data = buf + CHUNK_HEADER_SIZE; *alpha_size = chunk_size; } @@ -282,10 +280,8 @@ static VP8StatusCode ParseVP8Header(const uint8_t** const data_ptr, // RIFF + VP8X + (optional chunks) + VP8(L) // ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose. // VP8(L) <-- Not a valid WebP format: only allowed for internal purpose. -static VP8StatusCode ParseHeadersInternal(const uint8_t* data, - size_t data_size, - int* const width, - int* const height, +static VP8StatusCode ParseHeadersInternal(const uint8_t* data, size_t data_size, + int* const width, int* const height, int* const has_alpha, int* const has_animation, int* const format, @@ -312,15 +308,15 @@ static VP8StatusCode ParseHeadersInternal(const uint8_t* data, // Skip over RIFF header. status = ParseRIFF(&data, &data_size, have_all_data, &hdrs.riff_size); if (status != VP8_STATUS_OK) { - return status; // Wrong RIFF header / insufficient data. + return status; // Wrong RIFF header / insufficient data. } found_riff = (hdrs.riff_size > 0); // Skip over VP8X. { uint32_t flags = 0; - status = ParseVP8X(&data, &data_size, &found_vp8x, - &canvas_width, &canvas_height, &flags); + status = ParseVP8X(&data, &data_size, &found_vp8x, &canvas_width, + &canvas_height, &flags); if (status != VP8_STATUS_OK) { return status; // Wrong VP8X / insufficient data. } @@ -332,7 +328,7 @@ static VP8StatusCode ParseHeadersInternal(const uint8_t* data, } if (has_alpha != NULL) *has_alpha = !!(flags & ALPHA_FLAG); if (has_animation != NULL) *has_animation = animation_present; - if (format != NULL) *format = 0; // default = undefined + if (format != NULL) *format = 0; // default = undefined image_width = canvas_width; image_height = canvas_height; @@ -403,7 +399,7 @@ static VP8StatusCode ParseHeadersInternal(const uint8_t* data, assert((uint64_t)(data - headers->data) < MAX_CHUNK_PAYLOAD); assert(headers->offset == headers->data_size - data_size); } - ReturnWidthHeight: +ReturnWidthHeight: if (status == VP8_STATUS_OK || (status == VP8_STATUS_NOT_ENOUGH_DATA && found_vp8x && headers == NULL)) { if (has_alpha != NULL) { @@ -425,9 +421,8 @@ VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers) { int has_animation = 0; assert(headers != NULL); // fill out headers, ignore width/height/has_alpha. - status = ParseHeadersInternal(headers->data, headers->data_size, - NULL, NULL, NULL, &has_animation, - NULL, headers); + status = ParseHeadersInternal(headers->data, headers->data_size, NULL, NULL, + NULL, &has_animation, NULL, headers); if (status == VP8_STATUS_OK || status == VP8_STATUS_NOT_ENOUGH_DATA) { // The WebPDemux API + libwebp can be used to decode individual // uncomposited frames or the WebPAnimDecoder can be used to fully @@ -462,7 +457,7 @@ WEBP_NODISCARD static VP8StatusCode DecodeInto(const uint8_t* const data, headers.data = data; headers.data_size = data_size; headers.have_all_data = 1; - status = WebPParseHeaders(&headers); // Process Pre-VP8 chunks. + status = WebPParseHeaders(&headers); // Process Pre-VP8 chunks. if (status != VP8_STATUS_OK) { return status; } @@ -485,15 +480,15 @@ WEBP_NODISCARD static VP8StatusCode DecodeInto(const uint8_t* const data, // Decode bitstream header, update io->width/io->height. if (!VP8GetHeaders(dec, &io)) { - status = dec->status; // An error occurred. Grab error status. + status = dec->status; // An error occurred. Grab error status. } else { // Allocate/check output buffers. status = WebPAllocateDecBuffer(io.width, io.height, params->options, params->output); if (status == VP8_STATUS_OK) { // Decode // This change must be done before calling VP8Decode() - dec->mt_method = VP8GetThreadMethod(params->options, &headers, - io.width, io.height); + dec->mt_method = + VP8GetThreadMethod(params->options, &headers, io.width, io.height); VP8InitDithering(params->options, dec); if (!VP8Decode(dec, &io)) { status = dec->status; @@ -507,7 +502,7 @@ WEBP_NODISCARD static VP8StatusCode DecodeInto(const uint8_t* const data, return VP8_STATUS_OUT_OF_MEMORY; } if (!VP8LDecodeHeader(dec, &io)) { - status = dec->status; // An error occurred. Grab error status. + status = dec->status; // An error occurred. Grab error status. } else { // Allocate/check output buffers. status = WebPAllocateDecBuffer(io.width, io.height, params->options, @@ -546,10 +541,10 @@ WEBP_NODISCARD static uint8_t* DecodeIntoRGBABuffer(WEBP_CSP_MODE colorspace, } WebPResetDecParams(¶ms); params.output = &buf; - buf.colorspace = colorspace; - buf.u.RGBA.rgba = rgba; + buf.colorspace = colorspace; + buf.u.RGBA.rgba = rgba; buf.u.RGBA.stride = stride; - buf.u.RGBA.size = size; + buf.u.RGBA.size = size; buf.is_external_memory = 1; if (DecodeInto(data, data_size, ¶ms) != VP8_STATUS_OK) { return NULL; @@ -582,25 +577,25 @@ uint8_t* WebPDecodeBGRAInto(const uint8_t* data, size_t data_size, return DecodeIntoRGBABuffer(MODE_BGRA, data, data_size, output, stride, size); } -uint8_t* WebPDecodeYUVInto(const uint8_t* data, size_t data_size, - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride) { +uint8_t* WebPDecodeYUVInto(const uint8_t* data, size_t data_size, uint8_t* luma, + size_t luma_size, int luma_stride, uint8_t* u, + size_t u_size, int u_stride, uint8_t* v, + size_t v_size, int v_stride) { WebPDecParams params; WebPDecBuffer output; if (luma == NULL || !WebPInitDecBuffer(&output)) return NULL; WebPResetDecParams(¶ms); params.output = &output; - output.colorspace = MODE_YUV; - output.u.YUVA.y = luma; + output.colorspace = MODE_YUV; + output.u.YUVA.y = luma; output.u.YUVA.y_stride = luma_stride; - output.u.YUVA.y_size = luma_size; - output.u.YUVA.u = u; + output.u.YUVA.y_size = luma_size; + output.u.YUVA.u = u; output.u.YUVA.u_stride = u_stride; - output.u.YUVA.u_size = u_size; - output.u.YUVA.v = v; + output.u.YUVA.u_size = u_size; + output.u.YUVA.v = v; output.u.YUVA.v_stride = v_stride; - output.u.YUVA.v_size = v_size; + output.u.YUVA.v_size = v_size; output.is_external_memory = 1; if (DecodeInto(data, data_size, ¶ms) != VP8_STATUS_OK) { return NULL; @@ -636,50 +631,50 @@ WEBP_NODISCARD static uint8_t* Decode(WEBP_CSP_MODE mode, if (DecodeInto(data, data_size, ¶ms) != VP8_STATUS_OK) { return NULL; } - if (keep_info != NULL) { // keep track of the side-info + if (keep_info != NULL) { // keep track of the side-info WebPCopyDecBuffer(&output, keep_info); } // return decoded samples (don't clear 'output'!) return WebPIsRGBMode(mode) ? output.u.RGBA.rgba : output.u.YUVA.y; } -uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, - int* width, int* height) { +uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, int* width, + int* height) { return Decode(MODE_RGB, data, data_size, width, height, NULL); } -uint8_t* WebPDecodeRGBA(const uint8_t* data, size_t data_size, - int* width, int* height) { +uint8_t* WebPDecodeRGBA(const uint8_t* data, size_t data_size, int* width, + int* height) { return Decode(MODE_RGBA, data, data_size, width, height, NULL); } -uint8_t* WebPDecodeARGB(const uint8_t* data, size_t data_size, - int* width, int* height) { +uint8_t* WebPDecodeARGB(const uint8_t* data, size_t data_size, int* width, + int* height) { return Decode(MODE_ARGB, data, data_size, width, height, NULL); } -uint8_t* WebPDecodeBGR(const uint8_t* data, size_t data_size, - int* width, int* height) { +uint8_t* WebPDecodeBGR(const uint8_t* data, size_t data_size, int* width, + int* height) { return Decode(MODE_BGR, data, data_size, width, height, NULL); } -uint8_t* WebPDecodeBGRA(const uint8_t* data, size_t data_size, - int* width, int* height) { +uint8_t* WebPDecodeBGRA(const uint8_t* data, size_t data_size, int* width, + int* height) { return Decode(MODE_BGRA, data, data_size, width, height, NULL); } -uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size, - int* width, int* height, uint8_t** u, uint8_t** v, - int* stride, int* uv_stride) { +uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size, int* width, + int* height, uint8_t** u, uint8_t** v, int* stride, + int* uv_stride) { // data, width and height are checked by Decode(). if (u == NULL || v == NULL || stride == NULL || uv_stride == NULL) { return NULL; } { - WebPDecBuffer output; // only to preserve the side-infos - uint8_t* const out = Decode(MODE_YUV, data, data_size, - width, height, &output); + WebPDecBuffer output; // only to preserve the side-infos + uint8_t* const out = + Decode(MODE_YUV, data, data_size, width, height, &output); if (out != NULL) { const WebPYUVABuffer* const buf = &output.u.YUVA; @@ -706,17 +701,16 @@ static VP8StatusCode GetFeatures(const uint8_t* const data, size_t data_size, DefaultFeatures(features); // Only parse enough of the data to retrieve the features. - return ParseHeadersInternal(data, data_size, - &features->width, &features->height, - &features->has_alpha, &features->has_animation, - &features->format, NULL); + return ParseHeadersInternal( + data, data_size, &features->width, &features->height, + &features->has_alpha, &features->has_animation, &features->format, NULL); } //------------------------------------------------------------------------------ // WebPGetInfo() -int WebPGetInfo(const uint8_t* data, size_t data_size, - int* width, int* height) { +int WebPGetInfo(const uint8_t* data, size_t data_size, int* width, + int* height) { WebPBitstreamFeatures features; if (GetFeatures(data, data_size, &features) != VP8_STATUS_OK) { @@ -724,7 +718,7 @@ int WebPGetInfo(const uint8_t* data, size_t data_size, } if (width != NULL) { - *width = features.width; + *width = features.width; } if (height != NULL) { *height = features.height; @@ -736,10 +730,9 @@ int WebPGetInfo(const uint8_t* data, size_t data_size, //------------------------------------------------------------------------------ // Advance decoding API -int WebPInitDecoderConfigInternal(WebPDecoderConfig* config, - int version) { +int WebPInitDecoderConfigInternal(WebPDecoderConfig* config, int version) { if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DECODER_ABI_VERSION)) { - return 0; // version mismatch + return 0; // version mismatch } if (config == NULL) { return 0; @@ -811,7 +804,7 @@ VP8StatusCode WebPGetFeaturesInternal(const uint8_t* data, size_t data_size, WebPBitstreamFeatures* features, int version) { if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DECODER_ABI_VERSION)) { - return VP8_STATUS_INVALID_PARAM; // version mismatch + return VP8_STATUS_INVALID_PARAM; // version mismatch } if (features == NULL) { return VP8_STATUS_INVALID_PARAM; @@ -864,8 +857,8 @@ VP8StatusCode WebPDecode(const uint8_t* data, size_t data_size, //------------------------------------------------------------------------------ // Cropping and rescaling. -int WebPCheckCropDimensions(int image_width, int image_height, - int x, int y, int w, int h) { +int WebPCheckCropDimensions(int image_width, int image_height, int x, int y, + int w, int h) { return WebPCheckCropDimensionsBasic(x, y, w, h) && !(x >= image_width || w > image_width || w > image_width - x || y >= image_height || h > image_height || h > image_height - y); @@ -884,7 +877,7 @@ int WebPIoInitFromOptions(const WebPDecoderOptions* const options, h = options->crop_height; x = options->crop_left; y = options->crop_top; - if (!WebPIsRGBMode(src_colorspace)) { // only snap for YUV420 + if (!WebPIsRGBMode(src_colorspace)) { // only snap for YUV420 x &= ~1; y &= ~1; } @@ -892,9 +885,9 @@ int WebPIoInitFromOptions(const WebPDecoderOptions* const options, return 0; // out of frame boundary error } } - io->crop_left = x; - io->crop_top = y; - io->crop_right = x + w; + io->crop_left = x; + io->crop_top = y; + io->crop_right = x + w; io->crop_bottom = y + h; io->mb_w = w; io->mb_h = h; @@ -921,8 +914,8 @@ int WebPIoInitFromOptions(const WebPDecoderOptions* const options, if (io->use_scaling) { // disable filter (only for large downscaling ratio). - io->bypass_filtering |= (io->scaled_width < W * 3 / 4) && - (io->scaled_height < H * 3 / 4); + io->bypass_filtering |= + (io->scaled_width < W * 3 / 4) && (io->scaled_height < H * 3 / 4); io->fancy_upsampling = 0; } return 1; diff --git a/src/dec/webpi_dec.h b/src/dec/webpi_dec.h index 19297964..5aa9bc4d 100644 --- a/src/dec/webpi_dec.h +++ b/src/dec/webpi_dec.h @@ -36,15 +36,15 @@ typedef int (*OutputRowFunc)(WebPDecParams* const p, int y_pos, int max_out_lines); struct WebPDecParams { - WebPDecBuffer* output; // output buffer. - uint8_t* tmp_y, *tmp_u, *tmp_v; // cache for the fancy upsampler - // or used for tmp rescaling + WebPDecBuffer* output; // output buffer. + uint8_t *tmp_y, *tmp_u, *tmp_v; // cache for the fancy upsampler + // or used for tmp rescaling - int last_y; // coordinate of the line that was last output + int last_y; // coordinate of the line that was last output const WebPDecoderOptions* options; // if not NULL, use alt decoding features - WebPRescaler* scaler_y, *scaler_u, *scaler_v, *scaler_a; // rescalers - void* memory; // overall scratch memory for the output work. + WebPRescaler *scaler_y, *scaler_u, *scaler_v, *scaler_a; // rescalers + void* memory; // overall scratch memory for the output work. OutputFunc emit; // output RGB or YUV samples OutputAlphaFunc emit_alpha; // output alpha channel @@ -59,15 +59,15 @@ void WebPResetDecParams(WebPDecParams* const params); // Structure storing a description of the RIFF headers. typedef struct { - const uint8_t* data; // input buffer - size_t data_size; // input buffer size - int have_all_data; // true if all data is known to be available - size_t offset; // offset to main data chunk (VP8 or VP8L) - const uint8_t* alpha_data; // points to alpha chunk (if present) - size_t alpha_data_size; // alpha chunk size - size_t compressed_size; // VP8/VP8L compressed data size - size_t riff_size; // size of the riff payload (or 0 if absent) - int is_lossless; // true if a VP8L chunk is present + const uint8_t* data; // input buffer + size_t data_size; // input buffer size + int have_all_data; // true if all data is known to be available + size_t offset; // offset to main data chunk (VP8 or VP8L) + const uint8_t* alpha_data; // points to alpha chunk (if present) + size_t alpha_data_size; // alpha chunk size + size_t compressed_size; // VP8/VP8L compressed data size + size_t riff_size; // size of the riff payload (or 0 if absent) + int is_lossless; // true if a VP8L chunk is present } WebPHeaderStructure; // Skips over all valid chunks prior to the first VP8/VP8L frame header. @@ -82,8 +82,8 @@ VP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers); // Misc utils // Returns true if crop dimensions are within image bounds. -int WebPCheckCropDimensions(int image_width, int image_height, - int x, int y, int w, int h); +int WebPCheckCropDimensions(int image_width, int image_height, int x, int y, + int w, int h); // Initializes VP8Io with custom setup, io and teardown functions. The default // hooks will use the supplied 'params' as io->opaque handle. @@ -136,7 +136,7 @@ int WebPAvoidSlowMemory(const WebPDecBuffer* const output, //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_DEC_WEBPI_DEC_H_ diff --git a/src/demux/anim_decode.c b/src/demux/anim_decode.c index f046f506..01ef9ce8 100644 --- a/src/demux/anim_decode.c +++ b/src/demux/anim_decode.c @@ -41,19 +41,19 @@ static void BlendPixelRowPremult(uint32_t* const src, const uint32_t* const dst, int num_pixels); struct WebPAnimDecoder { - WebPDemuxer* demux; // Demuxer created from given WebP bitstream. - WebPDecoderConfig config; // Decoder config. + WebPDemuxer* demux; // Demuxer created from given WebP bitstream. + WebPDecoderConfig config; // Decoder config. // Note: we use a pointer to a function blending multiple pixels at a time to // allow possible inlining of per-pixel blending function. - BlendRowFunc blend_func; // Pointer to the chose blend row function. - WebPAnimInfo info; // Global info about the animation. - uint8_t* curr_frame; // Current canvas (not disposed). - uint8_t* prev_frame_disposed; // Previous canvas (properly disposed). - int prev_frame_timestamp; // Previous frame timestamp (milliseconds). - WebPIterator prev_iter; // Iterator object for previous frame. - int prev_frame_was_keyframe; // True if previous frame was a keyframe. - int next_frame; // Index of the next frame to be decoded - // (starting from 1). + BlendRowFunc blend_func; // Pointer to the chose blend row function. + WebPAnimInfo info; // Global info about the animation. + uint8_t* curr_frame; // Current canvas (not disposed). + uint8_t* prev_frame_disposed; // Previous canvas (properly disposed). + int prev_frame_timestamp; // Previous frame timestamp (milliseconds). + WebPIterator prev_iter; // Iterator object for previous frame. + int prev_frame_was_keyframe; // True if previous frame was a keyframe. + int next_frame; // Index of the next frame to be decoded + // (starting from 1). }; static void DefaultDecoderOptions(WebPAnimDecoderOptions* const dec_options) { @@ -79,8 +79,8 @@ WEBP_NODISCARD static int ApplyDecoderOptions( assert(dec_options != NULL); mode = dec_options->color_mode; - if (mode != MODE_RGBA && mode != MODE_BGRA && - mode != MODE_rgbA && mode != MODE_bgrA) { + if (mode != MODE_RGBA && mode != MODE_BGRA && mode != MODE_rgbA && + mode != MODE_bgrA) { return 0; } dec->blend_func = (mode == MODE_RGBA || mode == MODE_BGRA) @@ -145,7 +145,7 @@ WebPAnimDecoder* WebPAnimDecoderNewInternal( WebPAnimDecoderReset(dec); return dec; - Error: +Error: WebPAnimDecoderDelete(dec); return NULL; } @@ -197,13 +197,13 @@ WEBP_NODISCARD static int CopyCanvas(const uint8_t* src, uint8_t* dst, // Returns true if the current frame is a key-frame. static int IsKeyFrame(const WebPIterator* const curr, const WebPIterator* const prev, - int prev_frame_was_key_frame, - int canvas_width, int canvas_height) { + int prev_frame_was_key_frame, int canvas_width, + int canvas_height) { if (curr->frame_num == 1) { return 1; } else if ((!curr->has_alpha || curr->blend_method == WEBP_MUX_NO_BLEND) && - IsFullFrame(curr->width, curr->height, - canvas_width, canvas_height)) { + IsFullFrame(curr->width, curr->height, canvas_width, + canvas_height)) { return 1; } else { return (prev->dispose_method == WEBP_MUX_DISPOSE_BACKGROUND) && @@ -213,12 +213,11 @@ static int IsKeyFrame(const WebPIterator* const curr, } } - // Blend a single channel of 'src' over 'dst', given their alpha channel values. // 'src' and 'dst' are assumed to be NOT pre-multiplied by alpha. -static uint8_t BlendChannelNonPremult(uint32_t src, uint8_t src_a, - uint32_t dst, uint8_t dst_a, - uint32_t scale, int shift) { +static uint8_t BlendChannelNonPremult(uint32_t src, uint8_t src_a, uint32_t dst, + uint8_t dst_a, uint32_t scale, + int shift) { const uint8_t src_channel = (src >> shift) & 0xff; const uint8_t dst_channel = (dst >> shift) & 0xff; const uint32_t blend_unscaled = src_channel * src_a + dst_channel * dst_a; @@ -328,8 +327,8 @@ static void FindBlendRangeAtRow(const WebPIterator* const src, } } -int WebPAnimDecoderGetNext(WebPAnimDecoder* dec, - uint8_t** buf_ptr, int* timestamp_ptr) { +int WebPAnimDecoderGetNext(WebPAnimDecoder* dec, uint8_t** buf_ptr, + int* timestamp_ptr) { WebPIterator iter; uint32_t width; uint32_t height; @@ -358,8 +357,7 @@ int WebPAnimDecoderGetNext(WebPAnimDecoder* dec, goto Error; } } else { - if (!CopyCanvas(dec->prev_frame_disposed, dec->curr_frame, - width, height)) { + if (!CopyCanvas(dec->prev_frame_disposed, dec->curr_frame, width, height)) { goto Error; } } @@ -394,8 +392,7 @@ int WebPAnimDecoderGetNext(WebPAnimDecoder* dec, int y; // Blend transparent pixels with pixels in previous canvas. for (y = 0; y < iter.height; ++y) { - const size_t offset = - (iter.y_offset + y) * width + iter.x_offset; + const size_t offset = (iter.y_offset + y) * width + iter.x_offset; blend_row((uint32_t*)dec->curr_frame + offset, (uint32_t*)dec->prev_frame_disposed + offset, iter.width); } @@ -445,7 +442,7 @@ int WebPAnimDecoderGetNext(WebPAnimDecoder* dec, *timestamp_ptr = timestamp; return 1; - Error: +Error: WebPDemuxReleaseIterator(&iter); return 0; } diff --git a/src/demux/demux.c b/src/demux/demux.c index 7d4e23e2..c7c91d6b 100644 --- a/src/demux/demux.c +++ b/src/demux/demux.c @@ -19,7 +19,7 @@ #include #include "src/utils/utils.h" -#include "src/webp/decode.h" // WebPGetFeatures +#include "src/webp/decode.h" // WebPGetFeatures #include "src/webp/demux.h" #include "src/webp/format_constants.h" #include "src/webp/mux.h" @@ -31,10 +31,10 @@ #define DMUX_REV_VERSION 0 typedef struct { - size_t start; // start location of the data - size_t end; // end location - size_t riff_end; // riff chunk end location, can be > end. - size_t buf_size; // size of the buffer + size_t start; // start location of the data + size_t end; // end location + size_t riff_end; // riff chunk end location, can be > end. + size_t buf_size; // size of the buffer const uint8_t* buf; } MemBuffer; @@ -51,7 +51,7 @@ typedef struct Frame { WebPMuxAnimDispose dispose_method; WebPMuxAnimBlend blend_method; int frame_num; - int complete; // img_components contains a full image. + int complete; // img_components contains a full image. ChunkData img_components[2]; // 0=VP8{,L} 1=ALPH struct Frame* next; } Frame; @@ -76,11 +76,7 @@ struct WebPDemuxer { Chunk** chunks_tail; }; -typedef enum { - PARSE_OK, - PARSE_NEED_MORE_DATA, - PARSE_ERROR -} ParseStatus; +typedef enum { PARSE_OK, PARSE_NEED_MORE_DATA, PARSE_ERROR } ParseStatus; typedef struct ChunkParser { uint8_t id[4]; @@ -94,10 +90,10 @@ static int IsValidSimpleFormat(const WebPDemuxer* const dmux); static int IsValidExtendedFormat(const WebPDemuxer* const dmux); static const ChunkParser kMasterChunks[] = { - { { 'V', 'P', '8', ' ' }, ParseSingleImage, IsValidSimpleFormat }, - { { 'V', 'P', '8', 'L' }, ParseSingleImage, IsValidSimpleFormat }, - { { 'V', 'P', '8', 'X' }, ParseVP8X, IsValidExtendedFormat }, - { { '0', '0', '0', '0' }, NULL, NULL }, + {{'V', 'P', '8', ' '}, ParseSingleImage, IsValidSimpleFormat}, + {{'V', 'P', '8', 'L'}, ParseSingleImage, IsValidSimpleFormat}, + {{'V', 'P', '8', 'X'}, ParseVP8X, IsValidExtendedFormat}, + {{'0', '0', '0', '0'}, NULL, NULL}, }; //------------------------------------------------------------------------------ @@ -109,8 +105,8 @@ int WebPGetDemuxVersion(void) { // ----------------------------------------------------------------------------- // MemBuffer -static int RemapMemBuffer(MemBuffer* const mem, - const uint8_t* data, size_t size) { +static int RemapMemBuffer(MemBuffer* const mem, const uint8_t* data, + size_t size) { if (size < mem->buf_size) return 0; // can't remap to a shorter buffer! mem->buf = data; @@ -118,8 +114,8 @@ static int RemapMemBuffer(MemBuffer* const mem, return 1; } -static int InitMemBuffer(MemBuffer* const mem, - const uint8_t* data, size_t size) { +static int InitMemBuffer(MemBuffer* const mem, const uint8_t* data, + size_t size) { memset(mem, 0, sizeof(*mem)); return RemapMemBuffer(mem, data, size); } @@ -195,8 +191,8 @@ static int AddFrame(WebPDemuxer* const dmux, Frame* const frame) { return 1; } -static void SetFrameInfo(size_t start_offset, size_t size, - int frame_num, int complete, +static void SetFrameInfo(size_t start_offset, size_t size, int frame_num, + int complete, const WebPBitstreamFeatures* const features, Frame* const frame) { frame->img_components[0].offset = start_offset; @@ -214,8 +210,8 @@ static ParseStatus StoreFrame(int frame_num, uint32_t min_size, MemBuffer* const mem, Frame* const frame) { int alpha_chunks = 0; int image_chunks = 0; - int done = (MemDataSize(mem) < CHUNK_HEADER_SIZE || - MemDataSize(mem) < min_size); + int done = + (MemDataSize(mem) < CHUNK_HEADER_SIZE || MemDataSize(mem) < min_size); ParseStatus status = PARSE_OK; if (done) return PARSE_NEED_MORE_DATA; @@ -232,7 +228,8 @@ static ParseStatus StoreFrame(int frame_num, uint32_t min_size, payload_size_padded = payload_size + (payload_size & 1); payload_available = (payload_size_padded > MemDataSize(mem)) - ? MemDataSize(mem) : payload_size_padded; + ? MemDataSize(mem) + : payload_size_padded; chunk_size = CHUNK_HEADER_SIZE + payload_available; if (SizeIsInvalid(mem, payload_size_padded)) return PARSE_ERROR; if (payload_size_padded > MemDataSize(mem)) status = PARSE_NEED_MORE_DATA; @@ -258,9 +255,8 @@ static ParseStatus StoreFrame(int frame_num, uint32_t min_size, // Extract the bitstream features, tolerating failures when the data // is incomplete. WebPBitstreamFeatures features; - const VP8StatusCode vp8_status = - WebPGetFeatures(mem->buf + chunk_start_offset, chunk_size, - &features); + const VP8StatusCode vp8_status = WebPGetFeatures( + mem->buf + chunk_start_offset, chunk_size, &features); if (status == PARSE_NEED_MORE_DATA && vp8_status == VP8_STATUS_NOT_ENOUGH_DATA) { return PARSE_NEED_MORE_DATA; @@ -276,7 +272,7 @@ static ParseStatus StoreFrame(int frame_num, uint32_t min_size, goto Done; } break; - Done: + Done: default: // Restore fourcc/size when moving up one level in parsing. Rewind(mem, CHUNK_HEADER_SIZE); @@ -298,12 +294,11 @@ static ParseStatus StoreFrame(int frame_num, uint32_t min_size, // enough data ('min_size') to parse the payload. // Returns PARSE_OK on success with *frame pointing to the new Frame. // Returns PARSE_NEED_MORE_DATA with insufficient data, PARSE_ERROR otherwise. -static ParseStatus NewFrame(const MemBuffer* const mem, - uint32_t min_size, uint32_t actual_size, - Frame** frame) { +static ParseStatus NewFrame(const MemBuffer* const mem, uint32_t min_size, + uint32_t actual_size, Frame** frame) { if (SizeIsInvalid(mem, min_size)) return PARSE_ERROR; if (actual_size < min_size) return PARSE_ERROR; - if (MemDataSize(mem) < min_size) return PARSE_NEED_MORE_DATA; + if (MemDataSize(mem) < min_size) return PARSE_NEED_MORE_DATA; *frame = (Frame*)WebPSafeCalloc(1ULL, sizeof(**frame)); return (*frame == NULL) ? PARSE_ERROR : PARSE_OK; @@ -311,8 +306,8 @@ static ParseStatus NewFrame(const MemBuffer* const mem, // Parse a 'ANMF' chunk and any image bearing chunks that immediately follow. // 'frame_chunk_size' is the previously validated, padded chunk size. -static ParseStatus ParseAnimationFrame( - WebPDemuxer* const dmux, uint32_t frame_chunk_size) { +static ParseStatus ParseAnimationFrame(WebPDemuxer* const dmux, + uint32_t frame_chunk_size) { const int is_animation = !!(dmux->feature_flags & ANIMATION_FLAG); const uint32_t anmf_payload_size = frame_chunk_size - ANMF_CHUNK_SIZE; int added_frame = 0; @@ -320,15 +315,14 @@ static ParseStatus ParseAnimationFrame( MemBuffer* const mem = &dmux->mem; Frame* frame; size_t start_offset; - ParseStatus status = - NewFrame(mem, ANMF_CHUNK_SIZE, frame_chunk_size, &frame); + ParseStatus status = NewFrame(mem, ANMF_CHUNK_SIZE, frame_chunk_size, &frame); if (status != PARSE_OK) return status; - frame->x_offset = 2 * ReadLE24s(mem); - frame->y_offset = 2 * ReadLE24s(mem); - frame->width = 1 + ReadLE24s(mem); - frame->height = 1 + ReadLE24s(mem); - frame->duration = ReadLE24s(mem); + frame->x_offset = 2 * ReadLE24s(mem); + frame->y_offset = 2 * ReadLE24s(mem); + frame->width = 1 + ReadLE24s(mem); + frame->height = 1 + ReadLE24s(mem); + frame->duration = ReadLE24s(mem); bits = ReadByte(mem); frame->dispose_method = (bits & 1) ? WEBP_MUX_DISPOSE_BACKGROUND : WEBP_MUX_DISPOSE_NONE; @@ -362,8 +356,8 @@ static ParseStatus ParseAnimationFrame( // the user to request the payload via a fourcc string. 'size' includes the // header and the unpadded payload size. // Returns true on success, false otherwise. -static int StoreChunk(WebPDemuxer* const dmux, - size_t start_offset, uint32_t size) { +static int StoreChunk(WebPDemuxer* const dmux, size_t start_offset, + uint32_t size) { Chunk* const chunk = (Chunk*)WebPSafeCalloc(1ULL, sizeof(*chunk)); if (chunk == NULL) return 0; @@ -512,7 +506,7 @@ static ParseStatus ParseVP8XChunks(WebPDemuxer* const dmux) { store_chunk = !!(dmux->feature_flags & XMP_FLAG); goto Skip; } - Skip: + Skip: default: { if (chunk_size_padded <= MemDataSize(mem)) { if (store_chunk) { @@ -557,7 +551,7 @@ static ParseStatus ParseVP8X(WebPDemuxer* const dmux) { dmux->feature_flags = ReadByte(mem); Skip(mem, 3); // Reserved. - dmux->canvas_width = 1 + ReadLE24s(mem); + dmux->canvas_width = 1 + ReadLE24s(mem); dmux->canvas_height = 1 + ReadLE24s(mem); if (dmux->canvas_width * (uint64_t)dmux->canvas_height >= MAX_IMAGE_AREA) { return PARSE_ERROR; // image final dimension is too large @@ -647,8 +641,8 @@ static int IsValidExtendedFormat(const WebPDemuxer* const dmux) { } if (f->width > 0 && f->height > 0 && - !CheckFrameBounds(f, !is_animation, - dmux->canvas_width, dmux->canvas_height)) { + !CheckFrameBounds(f, !is_animation, dmux->canvas_width, + dmux->canvas_height)) { return 0; } } @@ -698,7 +692,7 @@ static ParseStatus CreateRawImageDemuxer(MemBuffer* const mem, *demuxer = dmux; return PARSE_OK; - Error: + Error: WebPSafeFree(dmux); WebPSafeFree(frame); return PARSE_ERROR; @@ -788,12 +782,18 @@ uint32_t WebPDemuxGetI(const WebPDemuxer* dmux, WebPFormatFeature feature) { if (dmux == NULL) return 0; switch (feature) { - case WEBP_FF_FORMAT_FLAGS: return dmux->feature_flags; - case WEBP_FF_CANVAS_WIDTH: return (uint32_t)dmux->canvas_width; - case WEBP_FF_CANVAS_HEIGHT: return (uint32_t)dmux->canvas_height; - case WEBP_FF_LOOP_COUNT: return (uint32_t)dmux->loop_count; - case WEBP_FF_BACKGROUND_COLOR: return dmux->bgcolor; - case WEBP_FF_FRAME_COUNT: return (uint32_t)dmux->num_frames; + case WEBP_FF_FORMAT_FLAGS: + return dmux->feature_flags; + case WEBP_FF_CANVAS_WIDTH: + return (uint32_t)dmux->canvas_width; + case WEBP_FF_CANVAS_HEIGHT: + return (uint32_t)dmux->canvas_height; + case WEBP_FF_LOOP_COUNT: + return (uint32_t)dmux->loop_count; + case WEBP_FF_BACKGROUND_COLOR: + return dmux->bgcolor; + case WEBP_FF_FRAME_COUNT: + return (uint32_t)dmux->num_frames; } return 0; } @@ -822,11 +822,11 @@ static const uint8_t* GetFramePayload(const uint8_t* const mem_buf, // if alpha exists it precedes image, update the size allowing for // intervening chunks. if (alpha->size > 0) { - const size_t inter_size = (image->offset > 0) - ? image->offset - (alpha->offset + alpha->size) + const size_t inter_size = + (image->offset > 0) ? image->offset - (alpha->offset + alpha->size) : 0; start_offset = alpha->offset; - *data_size += alpha->size + inter_size; + *data_size += alpha->size + inter_size; } return mem_buf + start_offset; } @@ -835,27 +835,26 @@ static const uint8_t* GetFramePayload(const uint8_t* const mem_buf, // Create a whole 'frame' from VP8 (+ alpha) or lossless. static int SynthesizeFrame(const WebPDemuxer* const dmux, - const Frame* const frame, - WebPIterator* const iter) { + const Frame* const frame, WebPIterator* const iter) { const uint8_t* const mem_buf = dmux->mem.buf; size_t payload_size = 0; const uint8_t* const payload = GetFramePayload(mem_buf, frame, &payload_size); if (payload == NULL) return 0; assert(frame != NULL); - iter->frame_num = frame->frame_num; - iter->num_frames = dmux->num_frames; - iter->x_offset = frame->x_offset; - iter->y_offset = frame->y_offset; - iter->width = frame->width; - iter->height = frame->height; - iter->has_alpha = frame->has_alpha; - iter->duration = frame->duration; + iter->frame_num = frame->frame_num; + iter->num_frames = dmux->num_frames; + iter->x_offset = frame->x_offset; + iter->y_offset = frame->y_offset; + iter->width = frame->width; + iter->height = frame->height; + iter->has_alpha = frame->has_alpha; + iter->duration = frame->duration; iter->dispose_method = frame->dispose_method; - iter->blend_method = frame->blend_method; - iter->complete = frame->complete; + iter->blend_method = frame->blend_method; + iter->complete = frame->complete; iter->fragment.bytes = payload; - iter->fragment.size = payload_size; + iter->fragment.size = payload_size; return 1; } @@ -891,9 +890,7 @@ int WebPDemuxPrevFrame(WebPIterator* iter) { return SetFrame(iter->frame_num - 1, iter); } -void WebPDemuxReleaseIterator(WebPIterator* iter) { - (void)iter; -} +void WebPDemuxReleaseIterator(WebPIterator* iter) { (void)iter; } // ----------------------------------------------------------------------------- // Chunk iteration @@ -936,17 +933,16 @@ static int SetChunk(const char fourcc[4], int chunk_num, const uint8_t* const mem_buf = dmux->mem.buf; const Chunk* const chunk = GetChunk(dmux, fourcc, chunk_num); iter->chunk.bytes = mem_buf + chunk->data.offset + CHUNK_HEADER_SIZE; - iter->chunk.size = chunk->data.size - CHUNK_HEADER_SIZE; - iter->num_chunks = count; - iter->chunk_num = chunk_num; + iter->chunk.size = chunk->data.size - CHUNK_HEADER_SIZE; + iter->num_chunks = count; + iter->chunk_num = chunk_num; return 1; } return 0; } -int WebPDemuxGetChunk(const WebPDemuxer* dmux, - const char fourcc[4], int chunk_num, - WebPChunkIterator* iter) { +int WebPDemuxGetChunk(const WebPDemuxer* dmux, const char fourcc[4], + int chunk_num, WebPChunkIterator* iter) { if (iter == NULL) return 0; memset(iter, 0, sizeof(*iter)); @@ -972,6 +968,4 @@ int WebPDemuxPrevChunk(WebPChunkIterator* iter) { return 0; } -void WebPDemuxReleaseChunkIterator(WebPChunkIterator* iter) { - (void)iter; -} +void WebPDemuxReleaseChunkIterator(WebPChunkIterator* iter) { (void)iter; } diff --git a/src/dsp/alpha_processing.c b/src/dsp/alpha_processing.c index 4927e73e..1d1ceea6 100644 --- a/src/dsp/alpha_processing.c +++ b/src/dsp/alpha_processing.c @@ -20,13 +20,12 @@ // Tables can be faster on some platform but incur some extra binary size (~2k). #if !defined(USE_TABLES_FOR_ALPHA_MULT) -#define USE_TABLES_FOR_ALPHA_MULT 0 // ALTERNATE_CODE +#define USE_TABLES_FOR_ALPHA_MULT 0 // ALTERNATE_CODE #endif - // ----------------------------------------------------------------------------- -#define MFIX 24 // 24bit fixed-point arithmetic +#define MFIX 24 // 24bit fixed-point arithmetic #define HALF ((1u << MFIX) >> 1) #define KINV_255 ((1u << MFIX) / 255u) @@ -39,95 +38,94 @@ static uint32_t Mult(uint8_t x, uint32_t mult) { #if (USE_TABLES_FOR_ALPHA_MULT == 1) static const uint32_t kMultTables[2][256] = { - { // (255u << MFIX) / alpha - 0x00000000, 0xff000000, 0x7f800000, 0x55000000, 0x3fc00000, 0x33000000, - 0x2a800000, 0x246db6db, 0x1fe00000, 0x1c555555, 0x19800000, 0x172e8ba2, - 0x15400000, 0x139d89d8, 0x1236db6d, 0x11000000, 0x0ff00000, 0x0f000000, - 0x0e2aaaaa, 0x0d6bca1a, 0x0cc00000, 0x0c249249, 0x0b9745d1, 0x0b1642c8, - 0x0aa00000, 0x0a333333, 0x09cec4ec, 0x0971c71c, 0x091b6db6, 0x08cb08d3, - 0x08800000, 0x0839ce73, 0x07f80000, 0x07ba2e8b, 0x07800000, 0x07492492, - 0x07155555, 0x06e45306, 0x06b5e50d, 0x0689d89d, 0x06600000, 0x063831f3, - 0x06124924, 0x05ee23b8, 0x05cba2e8, 0x05aaaaaa, 0x058b2164, 0x056cefa8, - 0x05500000, 0x05343eb1, 0x05199999, 0x05000000, 0x04e76276, 0x04cfb2b7, - 0x04b8e38e, 0x04a2e8ba, 0x048db6db, 0x0479435e, 0x04658469, 0x045270d0, - 0x04400000, 0x042e29f7, 0x041ce739, 0x040c30c3, 0x03fc0000, 0x03ec4ec4, - 0x03dd1745, 0x03ce540f, 0x03c00000, 0x03b21642, 0x03a49249, 0x03976fc6, - 0x038aaaaa, 0x037e3f1f, 0x03722983, 0x03666666, 0x035af286, 0x034fcace, - 0x0344ec4e, 0x033a5440, 0x03300000, 0x0325ed09, 0x031c18f9, 0x0312818a, - 0x03092492, 0x03000000, 0x02f711dc, 0x02ee5846, 0x02e5d174, 0x02dd7baf, - 0x02d55555, 0x02cd5cd5, 0x02c590b2, 0x02bdef7b, 0x02b677d4, 0x02af286b, - 0x02a80000, 0x02a0fd5c, 0x029a1f58, 0x029364d9, 0x028ccccc, 0x0286562d, - 0x02800000, 0x0279c952, 0x0273b13b, 0x026db6db, 0x0267d95b, 0x026217ec, - 0x025c71c7, 0x0256e62a, 0x0251745d, 0x024c1bac, 0x0246db6d, 0x0241b2f9, - 0x023ca1af, 0x0237a6f4, 0x0232c234, 0x022df2df, 0x02293868, 0x02249249, - 0x02200000, 0x021b810e, 0x021714fb, 0x0212bb51, 0x020e739c, 0x020a3d70, - 0x02061861, 0x02020408, 0x01fe0000, 0x01fa0be8, 0x01f62762, 0x01f25213, - 0x01ee8ba2, 0x01ead3ba, 0x01e72a07, 0x01e38e38, 0x01e00000, 0x01dc7f10, - 0x01d90b21, 0x01d5a3e9, 0x01d24924, 0x01cefa8d, 0x01cbb7e3, 0x01c880e5, - 0x01c55555, 0x01c234f7, 0x01bf1f8f, 0x01bc14e5, 0x01b914c1, 0x01b61eed, - 0x01b33333, 0x01b05160, 0x01ad7943, 0x01aaaaaa, 0x01a7e567, 0x01a5294a, - 0x01a27627, 0x019fcbd2, 0x019d2a20, 0x019a90e7, 0x01980000, 0x01957741, - 0x0192f684, 0x01907da4, 0x018e0c7c, 0x018ba2e8, 0x018940c5, 0x0186e5f0, - 0x01849249, 0x018245ae, 0x01800000, 0x017dc11f, 0x017b88ee, 0x0179574e, - 0x01772c23, 0x01750750, 0x0172e8ba, 0x0170d045, 0x016ebdd7, 0x016cb157, - 0x016aaaaa, 0x0168a9b9, 0x0166ae6a, 0x0164b8a7, 0x0162c859, 0x0160dd67, - 0x015ef7bd, 0x015d1745, 0x015b3bea, 0x01596596, 0x01579435, 0x0155c7b4, - 0x01540000, 0x01523d03, 0x01507eae, 0x014ec4ec, 0x014d0fac, 0x014b5edc, - 0x0149b26c, 0x01480a4a, 0x01466666, 0x0144c6af, 0x01432b16, 0x0141938b, - 0x01400000, 0x013e7063, 0x013ce4a9, 0x013b5cc0, 0x0139d89d, 0x01385830, - 0x0136db6d, 0x01356246, 0x0133ecad, 0x01327a97, 0x01310bf6, 0x012fa0be, - 0x012e38e3, 0x012cd459, 0x012b7315, 0x012a150a, 0x0128ba2e, 0x01276276, - 0x01260dd6, 0x0124bc44, 0x01236db6, 0x01222222, 0x0120d97c, 0x011f93bc, - 0x011e50d7, 0x011d10c4, 0x011bd37a, 0x011a98ef, 0x0119611a, 0x01182bf2, - 0x0116f96f, 0x0115c988, 0x01149c34, 0x0113716a, 0x01124924, 0x01112358, - 0x01100000, 0x010edf12, 0x010dc087, 0x010ca458, 0x010b8a7d, 0x010a72f0, - 0x01095da8, 0x01084a9f, 0x010739ce, 0x01062b2e, 0x01051eb8, 0x01041465, - 0x01030c30, 0x01020612, 0x01010204, 0x01000000 }, - { // alpha * KINV_255 - 0x00000000, 0x00010101, 0x00020202, 0x00030303, 0x00040404, 0x00050505, - 0x00060606, 0x00070707, 0x00080808, 0x00090909, 0x000a0a0a, 0x000b0b0b, - 0x000c0c0c, 0x000d0d0d, 0x000e0e0e, 0x000f0f0f, 0x00101010, 0x00111111, - 0x00121212, 0x00131313, 0x00141414, 0x00151515, 0x00161616, 0x00171717, - 0x00181818, 0x00191919, 0x001a1a1a, 0x001b1b1b, 0x001c1c1c, 0x001d1d1d, - 0x001e1e1e, 0x001f1f1f, 0x00202020, 0x00212121, 0x00222222, 0x00232323, - 0x00242424, 0x00252525, 0x00262626, 0x00272727, 0x00282828, 0x00292929, - 0x002a2a2a, 0x002b2b2b, 0x002c2c2c, 0x002d2d2d, 0x002e2e2e, 0x002f2f2f, - 0x00303030, 0x00313131, 0x00323232, 0x00333333, 0x00343434, 0x00353535, - 0x00363636, 0x00373737, 0x00383838, 0x00393939, 0x003a3a3a, 0x003b3b3b, - 0x003c3c3c, 0x003d3d3d, 0x003e3e3e, 0x003f3f3f, 0x00404040, 0x00414141, - 0x00424242, 0x00434343, 0x00444444, 0x00454545, 0x00464646, 0x00474747, - 0x00484848, 0x00494949, 0x004a4a4a, 0x004b4b4b, 0x004c4c4c, 0x004d4d4d, - 0x004e4e4e, 0x004f4f4f, 0x00505050, 0x00515151, 0x00525252, 0x00535353, - 0x00545454, 0x00555555, 0x00565656, 0x00575757, 0x00585858, 0x00595959, - 0x005a5a5a, 0x005b5b5b, 0x005c5c5c, 0x005d5d5d, 0x005e5e5e, 0x005f5f5f, - 0x00606060, 0x00616161, 0x00626262, 0x00636363, 0x00646464, 0x00656565, - 0x00666666, 0x00676767, 0x00686868, 0x00696969, 0x006a6a6a, 0x006b6b6b, - 0x006c6c6c, 0x006d6d6d, 0x006e6e6e, 0x006f6f6f, 0x00707070, 0x00717171, - 0x00727272, 0x00737373, 0x00747474, 0x00757575, 0x00767676, 0x00777777, - 0x00787878, 0x00797979, 0x007a7a7a, 0x007b7b7b, 0x007c7c7c, 0x007d7d7d, - 0x007e7e7e, 0x007f7f7f, 0x00808080, 0x00818181, 0x00828282, 0x00838383, - 0x00848484, 0x00858585, 0x00868686, 0x00878787, 0x00888888, 0x00898989, - 0x008a8a8a, 0x008b8b8b, 0x008c8c8c, 0x008d8d8d, 0x008e8e8e, 0x008f8f8f, - 0x00909090, 0x00919191, 0x00929292, 0x00939393, 0x00949494, 0x00959595, - 0x00969696, 0x00979797, 0x00989898, 0x00999999, 0x009a9a9a, 0x009b9b9b, - 0x009c9c9c, 0x009d9d9d, 0x009e9e9e, 0x009f9f9f, 0x00a0a0a0, 0x00a1a1a1, - 0x00a2a2a2, 0x00a3a3a3, 0x00a4a4a4, 0x00a5a5a5, 0x00a6a6a6, 0x00a7a7a7, - 0x00a8a8a8, 0x00a9a9a9, 0x00aaaaaa, 0x00ababab, 0x00acacac, 0x00adadad, - 0x00aeaeae, 0x00afafaf, 0x00b0b0b0, 0x00b1b1b1, 0x00b2b2b2, 0x00b3b3b3, - 0x00b4b4b4, 0x00b5b5b5, 0x00b6b6b6, 0x00b7b7b7, 0x00b8b8b8, 0x00b9b9b9, - 0x00bababa, 0x00bbbbbb, 0x00bcbcbc, 0x00bdbdbd, 0x00bebebe, 0x00bfbfbf, - 0x00c0c0c0, 0x00c1c1c1, 0x00c2c2c2, 0x00c3c3c3, 0x00c4c4c4, 0x00c5c5c5, - 0x00c6c6c6, 0x00c7c7c7, 0x00c8c8c8, 0x00c9c9c9, 0x00cacaca, 0x00cbcbcb, - 0x00cccccc, 0x00cdcdcd, 0x00cecece, 0x00cfcfcf, 0x00d0d0d0, 0x00d1d1d1, - 0x00d2d2d2, 0x00d3d3d3, 0x00d4d4d4, 0x00d5d5d5, 0x00d6d6d6, 0x00d7d7d7, - 0x00d8d8d8, 0x00d9d9d9, 0x00dadada, 0x00dbdbdb, 0x00dcdcdc, 0x00dddddd, - 0x00dedede, 0x00dfdfdf, 0x00e0e0e0, 0x00e1e1e1, 0x00e2e2e2, 0x00e3e3e3, - 0x00e4e4e4, 0x00e5e5e5, 0x00e6e6e6, 0x00e7e7e7, 0x00e8e8e8, 0x00e9e9e9, - 0x00eaeaea, 0x00ebebeb, 0x00ececec, 0x00ededed, 0x00eeeeee, 0x00efefef, - 0x00f0f0f0, 0x00f1f1f1, 0x00f2f2f2, 0x00f3f3f3, 0x00f4f4f4, 0x00f5f5f5, - 0x00f6f6f6, 0x00f7f7f7, 0x00f8f8f8, 0x00f9f9f9, 0x00fafafa, 0x00fbfbfb, - 0x00fcfcfc, 0x00fdfdfd, 0x00fefefe, 0x00ffffff } -}; + // (255u << MFIX) / alpha + {0x00000000, 0xff000000, 0x7f800000, 0x55000000, 0x3fc00000, 0x33000000, + 0x2a800000, 0x246db6db, 0x1fe00000, 0x1c555555, 0x19800000, 0x172e8ba2, + 0x15400000, 0x139d89d8, 0x1236db6d, 0x11000000, 0x0ff00000, 0x0f000000, + 0x0e2aaaaa, 0x0d6bca1a, 0x0cc00000, 0x0c249249, 0x0b9745d1, 0x0b1642c8, + 0x0aa00000, 0x0a333333, 0x09cec4ec, 0x0971c71c, 0x091b6db6, 0x08cb08d3, + 0x08800000, 0x0839ce73, 0x07f80000, 0x07ba2e8b, 0x07800000, 0x07492492, + 0x07155555, 0x06e45306, 0x06b5e50d, 0x0689d89d, 0x06600000, 0x063831f3, + 0x06124924, 0x05ee23b8, 0x05cba2e8, 0x05aaaaaa, 0x058b2164, 0x056cefa8, + 0x05500000, 0x05343eb1, 0x05199999, 0x05000000, 0x04e76276, 0x04cfb2b7, + 0x04b8e38e, 0x04a2e8ba, 0x048db6db, 0x0479435e, 0x04658469, 0x045270d0, + 0x04400000, 0x042e29f7, 0x041ce739, 0x040c30c3, 0x03fc0000, 0x03ec4ec4, + 0x03dd1745, 0x03ce540f, 0x03c00000, 0x03b21642, 0x03a49249, 0x03976fc6, + 0x038aaaaa, 0x037e3f1f, 0x03722983, 0x03666666, 0x035af286, 0x034fcace, + 0x0344ec4e, 0x033a5440, 0x03300000, 0x0325ed09, 0x031c18f9, 0x0312818a, + 0x03092492, 0x03000000, 0x02f711dc, 0x02ee5846, 0x02e5d174, 0x02dd7baf, + 0x02d55555, 0x02cd5cd5, 0x02c590b2, 0x02bdef7b, 0x02b677d4, 0x02af286b, + 0x02a80000, 0x02a0fd5c, 0x029a1f58, 0x029364d9, 0x028ccccc, 0x0286562d, + 0x02800000, 0x0279c952, 0x0273b13b, 0x026db6db, 0x0267d95b, 0x026217ec, + 0x025c71c7, 0x0256e62a, 0x0251745d, 0x024c1bac, 0x0246db6d, 0x0241b2f9, + 0x023ca1af, 0x0237a6f4, 0x0232c234, 0x022df2df, 0x02293868, 0x02249249, + 0x02200000, 0x021b810e, 0x021714fb, 0x0212bb51, 0x020e739c, 0x020a3d70, + 0x02061861, 0x02020408, 0x01fe0000, 0x01fa0be8, 0x01f62762, 0x01f25213, + 0x01ee8ba2, 0x01ead3ba, 0x01e72a07, 0x01e38e38, 0x01e00000, 0x01dc7f10, + 0x01d90b21, 0x01d5a3e9, 0x01d24924, 0x01cefa8d, 0x01cbb7e3, 0x01c880e5, + 0x01c55555, 0x01c234f7, 0x01bf1f8f, 0x01bc14e5, 0x01b914c1, 0x01b61eed, + 0x01b33333, 0x01b05160, 0x01ad7943, 0x01aaaaaa, 0x01a7e567, 0x01a5294a, + 0x01a27627, 0x019fcbd2, 0x019d2a20, 0x019a90e7, 0x01980000, 0x01957741, + 0x0192f684, 0x01907da4, 0x018e0c7c, 0x018ba2e8, 0x018940c5, 0x0186e5f0, + 0x01849249, 0x018245ae, 0x01800000, 0x017dc11f, 0x017b88ee, 0x0179574e, + 0x01772c23, 0x01750750, 0x0172e8ba, 0x0170d045, 0x016ebdd7, 0x016cb157, + 0x016aaaaa, 0x0168a9b9, 0x0166ae6a, 0x0164b8a7, 0x0162c859, 0x0160dd67, + 0x015ef7bd, 0x015d1745, 0x015b3bea, 0x01596596, 0x01579435, 0x0155c7b4, + 0x01540000, 0x01523d03, 0x01507eae, 0x014ec4ec, 0x014d0fac, 0x014b5edc, + 0x0149b26c, 0x01480a4a, 0x01466666, 0x0144c6af, 0x01432b16, 0x0141938b, + 0x01400000, 0x013e7063, 0x013ce4a9, 0x013b5cc0, 0x0139d89d, 0x01385830, + 0x0136db6d, 0x01356246, 0x0133ecad, 0x01327a97, 0x01310bf6, 0x012fa0be, + 0x012e38e3, 0x012cd459, 0x012b7315, 0x012a150a, 0x0128ba2e, 0x01276276, + 0x01260dd6, 0x0124bc44, 0x01236db6, 0x01222222, 0x0120d97c, 0x011f93bc, + 0x011e50d7, 0x011d10c4, 0x011bd37a, 0x011a98ef, 0x0119611a, 0x01182bf2, + 0x0116f96f, 0x0115c988, 0x01149c34, 0x0113716a, 0x01124924, 0x01112358, + 0x01100000, 0x010edf12, 0x010dc087, 0x010ca458, 0x010b8a7d, 0x010a72f0, + 0x01095da8, 0x01084a9f, 0x010739ce, 0x01062b2e, 0x01051eb8, 0x01041465, + 0x01030c30, 0x01020612, 0x01010204, 0x01000000}, + // alpha * KINV_255 + {0x00000000, 0x00010101, 0x00020202, 0x00030303, 0x00040404, 0x00050505, + 0x00060606, 0x00070707, 0x00080808, 0x00090909, 0x000a0a0a, 0x000b0b0b, + 0x000c0c0c, 0x000d0d0d, 0x000e0e0e, 0x000f0f0f, 0x00101010, 0x00111111, + 0x00121212, 0x00131313, 0x00141414, 0x00151515, 0x00161616, 0x00171717, + 0x00181818, 0x00191919, 0x001a1a1a, 0x001b1b1b, 0x001c1c1c, 0x001d1d1d, + 0x001e1e1e, 0x001f1f1f, 0x00202020, 0x00212121, 0x00222222, 0x00232323, + 0x00242424, 0x00252525, 0x00262626, 0x00272727, 0x00282828, 0x00292929, + 0x002a2a2a, 0x002b2b2b, 0x002c2c2c, 0x002d2d2d, 0x002e2e2e, 0x002f2f2f, + 0x00303030, 0x00313131, 0x00323232, 0x00333333, 0x00343434, 0x00353535, + 0x00363636, 0x00373737, 0x00383838, 0x00393939, 0x003a3a3a, 0x003b3b3b, + 0x003c3c3c, 0x003d3d3d, 0x003e3e3e, 0x003f3f3f, 0x00404040, 0x00414141, + 0x00424242, 0x00434343, 0x00444444, 0x00454545, 0x00464646, 0x00474747, + 0x00484848, 0x00494949, 0x004a4a4a, 0x004b4b4b, 0x004c4c4c, 0x004d4d4d, + 0x004e4e4e, 0x004f4f4f, 0x00505050, 0x00515151, 0x00525252, 0x00535353, + 0x00545454, 0x00555555, 0x00565656, 0x00575757, 0x00585858, 0x00595959, + 0x005a5a5a, 0x005b5b5b, 0x005c5c5c, 0x005d5d5d, 0x005e5e5e, 0x005f5f5f, + 0x00606060, 0x00616161, 0x00626262, 0x00636363, 0x00646464, 0x00656565, + 0x00666666, 0x00676767, 0x00686868, 0x00696969, 0x006a6a6a, 0x006b6b6b, + 0x006c6c6c, 0x006d6d6d, 0x006e6e6e, 0x006f6f6f, 0x00707070, 0x00717171, + 0x00727272, 0x00737373, 0x00747474, 0x00757575, 0x00767676, 0x00777777, + 0x00787878, 0x00797979, 0x007a7a7a, 0x007b7b7b, 0x007c7c7c, 0x007d7d7d, + 0x007e7e7e, 0x007f7f7f, 0x00808080, 0x00818181, 0x00828282, 0x00838383, + 0x00848484, 0x00858585, 0x00868686, 0x00878787, 0x00888888, 0x00898989, + 0x008a8a8a, 0x008b8b8b, 0x008c8c8c, 0x008d8d8d, 0x008e8e8e, 0x008f8f8f, + 0x00909090, 0x00919191, 0x00929292, 0x00939393, 0x00949494, 0x00959595, + 0x00969696, 0x00979797, 0x00989898, 0x00999999, 0x009a9a9a, 0x009b9b9b, + 0x009c9c9c, 0x009d9d9d, 0x009e9e9e, 0x009f9f9f, 0x00a0a0a0, 0x00a1a1a1, + 0x00a2a2a2, 0x00a3a3a3, 0x00a4a4a4, 0x00a5a5a5, 0x00a6a6a6, 0x00a7a7a7, + 0x00a8a8a8, 0x00a9a9a9, 0x00aaaaaa, 0x00ababab, 0x00acacac, 0x00adadad, + 0x00aeaeae, 0x00afafaf, 0x00b0b0b0, 0x00b1b1b1, 0x00b2b2b2, 0x00b3b3b3, + 0x00b4b4b4, 0x00b5b5b5, 0x00b6b6b6, 0x00b7b7b7, 0x00b8b8b8, 0x00b9b9b9, + 0x00bababa, 0x00bbbbbb, 0x00bcbcbc, 0x00bdbdbd, 0x00bebebe, 0x00bfbfbf, + 0x00c0c0c0, 0x00c1c1c1, 0x00c2c2c2, 0x00c3c3c3, 0x00c4c4c4, 0x00c5c5c5, + 0x00c6c6c6, 0x00c7c7c7, 0x00c8c8c8, 0x00c9c9c9, 0x00cacaca, 0x00cbcbcb, + 0x00cccccc, 0x00cdcdcd, 0x00cecece, 0x00cfcfcf, 0x00d0d0d0, 0x00d1d1d1, + 0x00d2d2d2, 0x00d3d3d3, 0x00d4d4d4, 0x00d5d5d5, 0x00d6d6d6, 0x00d7d7d7, + 0x00d8d8d8, 0x00d9d9d9, 0x00dadada, 0x00dbdbdb, 0x00dcdcdc, 0x00dddddd, + 0x00dedede, 0x00dfdfdf, 0x00e0e0e0, 0x00e1e1e1, 0x00e2e2e2, 0x00e3e3e3, + 0x00e4e4e4, 0x00e5e5e5, 0x00e6e6e6, 0x00e7e7e7, 0x00e8e8e8, 0x00e9e9e9, + 0x00eaeaea, 0x00ebebeb, 0x00ececec, 0x00ededed, 0x00eeeeee, 0x00efefef, + 0x00f0f0f0, 0x00f1f1f1, 0x00f2f2f2, 0x00f3f3f3, 0x00f4f4f4, 0x00f5f5f5, + 0x00f6f6f6, 0x00f7f7f7, 0x00f8f8f8, 0x00f9f9f9, 0x00fafafa, 0x00fbfbfb, + 0x00fcfcfc, 0x00fdfdfd, 0x00fefefe, 0x00ffffff}}; static WEBP_INLINE uint32_t GetScale(uint32_t a, int inverse) { return kMultTables[!inverse][a]; @@ -145,15 +143,15 @@ void WebPMultARGBRow_C(uint32_t* const ptr, int width, int inverse) { int x; for (x = 0; x < width; ++x) { const uint32_t argb = ptr[x]; - if (argb < 0xff000000u) { // alpha < 255 - if (argb <= 0x00ffffffu) { // alpha == 0 + if (argb < 0xff000000u) { // alpha < 255 + if (argb <= 0x00ffffffu) { // alpha == 0 ptr[x] = 0; } else { const uint32_t alpha = (argb >> 24) & 0xff; const uint32_t scale = GetScale(alpha, inverse); uint32_t out = argb & 0xff000000u; - out |= Mult(argb >> 0, scale) << 0; - out |= Mult(argb >> 8, scale) << 8; + out |= Mult(argb >> 0, scale) << 0; + out |= Mult(argb >> 8, scale) << 8; out |= Mult(argb >> 16, scale) << 16; ptr[x] = out; } @@ -162,8 +160,8 @@ void WebPMultARGBRow_C(uint32_t* const ptr, int width, int inverse) { } void WebPMultRow_C(uint8_t* WEBP_RESTRICT const ptr, - const uint8_t* WEBP_RESTRICT const alpha, - int width, int inverse) { + const uint8_t* WEBP_RESTRICT const alpha, int width, + int inverse) { int x; for (x = 0; x < width; ++x) { const uint32_t a = alpha[x]; @@ -184,8 +182,8 @@ void WebPMultRow_C(uint8_t* WEBP_RESTRICT const ptr, void (*WebPMultARGBRow)(uint32_t* const ptr, int width, int inverse); void (*WebPMultRow)(uint8_t* WEBP_RESTRICT const ptr, - const uint8_t* WEBP_RESTRICT const alpha, - int width, int inverse); + const uint8_t* WEBP_RESTRICT const alpha, int width, + int inverse); //------------------------------------------------------------------------------ // Generic per-plane calls @@ -218,17 +216,17 @@ void WebPMultRows(uint8_t* WEBP_RESTRICT ptr, int stride, // (x * a * 32897) >> 23 is bit-wise equivalent to (int)(x * a / 255.) // for all 8bit x or a. For bit-wise equivalence to (int)(x * a / 255. + .5), // one can use instead: (x * a * 65793 + (1 << 23)) >> 24 -#if 1 // (int)(x * a / 255.) -#define MULTIPLIER(a) ((a) * 32897U) +#if 1 // (int)(x * a / 255.) +#define MULTIPLIER(a) ((a) * 32897U) #define PREMULTIPLY(x, m) (((x) * (m)) >> 23) -#else // (int)(x * a / 255. + .5) +#else // (int)(x * a / 255. + .5) #define MULTIPLIER(a) ((a) * 65793U) #define PREMULTIPLY(x, m) (((x) * (m) + (1U << 23)) >> 24) #endif #if !WEBP_NEON_OMIT_C_CODE -static void ApplyAlphaMultiply_C(uint8_t* rgba, int alpha_first, - int w, int h, int stride) { +static void ApplyAlphaMultiply_C(uint8_t* rgba, int alpha_first, int w, int h, + int stride) { while (h-- > 0) { uint8_t* const rgb = rgba + (alpha_first ? 1 : 0); const uint8_t* const alpha = rgba + (alpha_first ? 0 : 3); @@ -251,7 +249,7 @@ static void ApplyAlphaMultiply_C(uint8_t* rgba, int alpha_first, // rgbA4444 -#define MULTIPLIER(a) ((a) * 0x1111) // 0x1111 ~= (1 << 16) / 15 +#define MULTIPLIER(a) ((a) * 0x1111) // 0x1111 ~= (1 << 16) / 15 static WEBP_INLINE uint8_t dither_hi(uint8_t x) { return (x & 0xf0) | (x >> 4); @@ -265,8 +263,8 @@ static WEBP_INLINE uint8_t multiply(uint8_t x, uint32_t m) { return (x * m) >> 16; } -static WEBP_INLINE void ApplyAlphaMultiply4444_C(uint8_t* rgba4444, - int w, int h, int stride, +static WEBP_INLINE void ApplyAlphaMultiply4444_C(uint8_t* rgba4444, int w, + int h, int stride, int rg_byte_pos /* 0 or 1 */) { while (h-- > 0) { int i; @@ -286,8 +284,8 @@ static WEBP_INLINE void ApplyAlphaMultiply4444_C(uint8_t* rgba4444, } #undef MULTIPLIER -static void ApplyAlphaMultiply_16b_C(uint8_t* rgba4444, - int w, int h, int stride) { +static void ApplyAlphaMultiply_16b_C(uint8_t* rgba4444, int w, int h, + int stride) { #if (WEBP_SWAP_16BIT_CSP == 1) ApplyAlphaMultiply4444_C(rgba4444, w, h, stride, 1); #else @@ -297,8 +295,8 @@ static void ApplyAlphaMultiply_16b_C(uint8_t* rgba4444, #if !WEBP_NEON_OMIT_C_CODE static int DispatchAlpha_C(const uint8_t* WEBP_RESTRICT alpha, int alpha_stride, - int width, int height, - uint8_t* WEBP_RESTRICT dst, int dst_stride) { + int width, int height, uint8_t* WEBP_RESTRICT dst, + int dst_stride) { uint32_t alpha_mask = 0xff; int i, j; @@ -330,8 +328,8 @@ static void DispatchAlphaToGreen_C(const uint8_t* WEBP_RESTRICT alpha, } static int ExtractAlpha_C(const uint8_t* WEBP_RESTRICT argb, int argb_stride, - int width, int height, - uint8_t* WEBP_RESTRICT alpha, int alpha_stride) { + int width, int height, uint8_t* WEBP_RESTRICT alpha, + int alpha_stride) { uint8_t alpha_mask = 0xff; int i, j; @@ -357,19 +355,22 @@ static void ExtractGreen_C(const uint32_t* WEBP_RESTRICT argb, //------------------------------------------------------------------------------ static int HasAlpha8b_C(const uint8_t* src, int length) { - while (length-- > 0) if (*src++ != 0xff) return 1; + while (length-- > 0) + if (*src++ != 0xff) return 1; return 0; } static int HasAlpha32b_C(const uint8_t* src, int length) { int x; - for (x = 0; length-- > 0; x += 4) if (src[x] != 0xff) return 1; + for (x = 0; length-- > 0; x += 4) + if (src[x] != 0xff) return 1; return 0; } static void AlphaReplace_C(uint32_t* src, int length, uint32_t color) { int x; - for (x = 0; x < length; ++x) if ((src[x] >> 24) == 0) src[x] = color; + for (x = 0; x < length; ++x) + if ((src[x] >> 24) == 0) src[x] = color; } //------------------------------------------------------------------------------ @@ -383,8 +384,8 @@ static WEBP_INLINE uint32_t MakeARGB32(int a, int r, int g, int b) { static void PackARGB_C(const uint8_t* WEBP_RESTRICT a, const uint8_t* WEBP_RESTRICT r, const uint8_t* WEBP_RESTRICT g, - const uint8_t* WEBP_RESTRICT b, - int len, uint32_t* WEBP_RESTRICT out) { + const uint8_t* WEBP_RESTRICT b, int len, + uint32_t* WEBP_RESTRICT out) { int i; for (i = 0; i < len; ++i) { out[i] = MakeARGB32(a[4 * i], r[4 * i], g[4 * i], b[4 * i]); @@ -394,8 +395,8 @@ static void PackARGB_C(const uint8_t* WEBP_RESTRICT a, static void PackRGB_C(const uint8_t* WEBP_RESTRICT r, const uint8_t* WEBP_RESTRICT g, - const uint8_t* WEBP_RESTRICT b, - int len, int step, uint32_t* WEBP_RESTRICT out) { + const uint8_t* WEBP_RESTRICT b, int len, int step, + uint32_t* WEBP_RESTRICT out) { int i, offset = 0; for (i = 0; i < len; ++i) { out[i] = MakeARGB32(0xff, r[offset], g[offset], b[offset]); @@ -419,8 +420,8 @@ void (*WebPPackARGB)(const uint8_t* a, const uint8_t* r, const uint8_t* g, #endif void (*WebPPackRGB)(const uint8_t* WEBP_RESTRICT r, const uint8_t* WEBP_RESTRICT g, - const uint8_t* WEBP_RESTRICT b, - int len, int step, uint32_t* WEBP_RESTRICT out); + const uint8_t* WEBP_RESTRICT b, int len, int step, + uint32_t* WEBP_RESTRICT out); int (*WebPHasAlpha8b)(const uint8_t* src, int length); int (*WebPHasAlpha32b)(const uint8_t* src, int length); diff --git a/src/dsp/alpha_processing_mips_dsp_r2.c b/src/dsp/alpha_processing_mips_dsp_r2.c index 0090e87c..b7cf80ef 100644 --- a/src/dsp/alpha_processing_mips_dsp_r2.c +++ b/src/dsp/alpha_processing_mips_dsp_r2.c @@ -17,8 +17,8 @@ #if defined(WEBP_USE_MIPS_DSP_R2) static int DispatchAlpha_MIPSdspR2(const uint8_t* alpha, int alpha_stride, - int width, int height, - uint8_t* dst, int dst_stride) { + int width, int height, uint8_t* dst, + int dst_stride) { uint32_t alpha_mask = 0xffffffff; int i, j, temp0; @@ -28,97 +28,92 @@ static int DispatchAlpha_MIPSdspR2(const uint8_t* alpha, int alpha_stride, for (i = 0; i < (width >> 2); ++i) { int temp1, temp2, temp3; - __asm__ volatile ( - "ulw %[temp0], 0(%[palpha]) \n\t" - "addiu %[palpha], %[palpha], 4 \n\t" - "addiu %[pdst], %[pdst], 16 \n\t" - "srl %[temp1], %[temp0], 8 \n\t" - "srl %[temp2], %[temp0], 16 \n\t" - "srl %[temp3], %[temp0], 24 \n\t" - "and %[alpha_mask], %[alpha_mask], %[temp0] \n\t" - "sb %[temp0], -16(%[pdst]) \n\t" - "sb %[temp1], -12(%[pdst]) \n\t" - "sb %[temp2], -8(%[pdst]) \n\t" - "sb %[temp3], -4(%[pdst]) \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [palpha]"+r"(palpha), [pdst]"+r"(pdst), - [alpha_mask]"+r"(alpha_mask) - : - : "memory" - ); + __asm__ volatile( + "ulw %[temp0], 0(%[palpha]) \n\t" + "addiu %[palpha], %[palpha], 4 \n\t" + "addiu %[pdst], %[pdst], 16 \n\t" + "srl %[temp1], %[temp0], 8 \n\t" + "srl %[temp2], %[temp0], 16 \n\t" + "srl %[temp3], %[temp0], 24 \n\t" + "and %[alpha_mask], %[alpha_mask], %[temp0] \n\t" + "sb %[temp0], -16(%[pdst]) \n\t" + "sb %[temp1], -12(%[pdst]) \n\t" + "sb %[temp2], -8(%[pdst]) \n\t" + "sb %[temp3], -4(%[pdst]) \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [palpha] "+r"(palpha), [pdst] "+r"(pdst), + [alpha_mask] "+r"(alpha_mask) + : + : "memory"); } for (i = 0; i < (width & 3); ++i) { - __asm__ volatile ( - "lbu %[temp0], 0(%[palpha]) \n\t" - "addiu %[palpha], %[palpha], 1 \n\t" - "sb %[temp0], 0(%[pdst]) \n\t" - "and %[alpha_mask], %[alpha_mask], %[temp0] \n\t" - "addiu %[pdst], %[pdst], 4 \n\t" - : [temp0]"=&r"(temp0), [palpha]"+r"(palpha), [pdst]"+r"(pdst), - [alpha_mask]"+r"(alpha_mask) - : - : "memory" - ); + __asm__ volatile( + "lbu %[temp0], 0(%[palpha]) \n\t" + "addiu %[palpha], %[palpha], 1 \n\t" + "sb %[temp0], 0(%[pdst]) \n\t" + "and %[alpha_mask], %[alpha_mask], %[temp0] \n\t" + "addiu %[pdst], %[pdst], 4 \n\t" + : [temp0] "=&r"(temp0), [palpha] "+r"(palpha), [pdst] "+r"(pdst), + [alpha_mask] "+r"(alpha_mask) + : + : "memory"); } alpha += alpha_stride; dst += dst_stride; } - __asm__ volatile ( - "ext %[temp0], %[alpha_mask], 0, 16 \n\t" - "srl %[alpha_mask], %[alpha_mask], 16 \n\t" - "and %[alpha_mask], %[alpha_mask], %[temp0] \n\t" - "ext %[temp0], %[alpha_mask], 0, 8 \n\t" - "srl %[alpha_mask], %[alpha_mask], 8 \n\t" - "and %[alpha_mask], %[alpha_mask], %[temp0] \n\t" - : [temp0]"=&r"(temp0), [alpha_mask]"+r"(alpha_mask) - : - ); + __asm__ volatile( + "ext %[temp0], %[alpha_mask], 0, 16 \n\t" + "srl %[alpha_mask], %[alpha_mask], 16 \n\t" + "and %[alpha_mask], %[alpha_mask], %[temp0] \n\t" + "ext %[temp0], %[alpha_mask], 0, 8 \n\t" + "srl %[alpha_mask], %[alpha_mask], 8 \n\t" + "and %[alpha_mask], %[alpha_mask], %[temp0] \n\t" + : [temp0] "=&r"(temp0), [alpha_mask] "+r"(alpha_mask) + :); return (alpha_mask != 0xff); } -static void MultARGBRow_MIPSdspR2(uint32_t* const ptr, int width, - int inverse) { +static void MultARGBRow_MIPSdspR2(uint32_t* const ptr, int width, int inverse) { int x; const uint32_t c_00ffffff = 0x00ffffffu; const uint32_t c_ff000000 = 0xff000000u; - const uint32_t c_8000000 = 0x00800000u; - const uint32_t c_8000080 = 0x00800080u; + const uint32_t c_8000000 = 0x00800000u; + const uint32_t c_8000080 = 0x00800080u; for (x = 0; x < width; ++x) { const uint32_t argb = ptr[x]; - if (argb < 0xff000000u) { // alpha < 255 - if (argb <= 0x00ffffffu) { // alpha == 0 + if (argb < 0xff000000u) { // alpha < 255 + if (argb <= 0x00ffffffu) { // alpha == 0 ptr[x] = 0; } else { int temp0, temp1, temp2, temp3, alpha; - __asm__ volatile ( - "srl %[alpha], %[argb], 24 \n\t" - "replv.qb %[temp0], %[alpha] \n\t" - "and %[temp0], %[temp0], %[c_00ffffff] \n\t" - "beqz %[inverse], 0f \n\t" - "divu $zero, %[c_ff000000], %[alpha] \n\t" - "mflo %[temp0] \n\t" - "0: \n\t" - "andi %[temp1], %[argb], 0xff \n\t" - "ext %[temp2], %[argb], 8, 8 \n\t" - "ext %[temp3], %[argb], 16, 8 \n\t" - "mul %[temp1], %[temp1], %[temp0] \n\t" - "mul %[temp2], %[temp2], %[temp0] \n\t" - "mul %[temp3], %[temp3], %[temp0] \n\t" - "precrq.ph.w %[temp1], %[temp2], %[temp1] \n\t" - "addu %[temp3], %[temp3], %[c_8000000] \n\t" - "addu %[temp1], %[temp1], %[c_8000080] \n\t" - "precrq.ph.w %[temp3], %[argb], %[temp3] \n\t" - "precrq.qb.ph %[temp1], %[temp3], %[temp1] \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [alpha]"=&r"(alpha) - : [inverse]"r"(inverse), [c_00ffffff]"r"(c_00ffffff), - [c_8000000]"r"(c_8000000), [c_8000080]"r"(c_8000080), - [c_ff000000]"r"(c_ff000000), [argb]"r"(argb) - : "memory", "hi", "lo" - ); + __asm__ volatile( + "srl %[alpha], %[argb], 24 \n\t" + "replv.qb %[temp0], %[alpha] \n\t" + "and %[temp0], %[temp0], %[c_00ffffff] \n\t" + "beqz %[inverse], 0f \n\t" + "divu $zero, %[c_ff000000], %[alpha] \n\t" + "mflo %[temp0] \n\t" + "0: \n\t" + "andi %[temp1], %[argb], 0xff \n\t" + "ext %[temp2], %[argb], 8, 8 \n\t" + "ext %[temp3], %[argb], 16, 8 \n\t" + "mul %[temp1], %[temp1], %[temp0] \n\t" + "mul %[temp2], %[temp2], %[temp0] \n\t" + "mul %[temp3], %[temp3], %[temp0] \n\t" + "precrq.ph.w %[temp1], %[temp2], %[temp1] \n\t" + "addu %[temp3], %[temp3], %[c_8000000] \n\t" + "addu %[temp1], %[temp1], %[c_8000080] \n\t" + "precrq.ph.w %[temp3], %[argb], %[temp3] \n\t" + "precrq.qb.ph %[temp1], %[temp3], %[temp1] \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [alpha] "=&r"(alpha) + : [inverse] "r"(inverse), [c_00ffffff] "r"(c_00ffffff), + [c_8000000] "r"(c_8000000), [c_8000080] "r"(c_8000080), + [c_ff000000] "r"(c_ff000000), [argb] "r"(argb) + : "memory", "hi", "lo"); ptr[x] = temp1; } } @@ -133,38 +128,37 @@ static void PackARGB_MIPSdspR2(const uint8_t* a, const uint8_t* r, const int rest = len & 1; const uint32_t* const loop_end = out + len - rest; const int step = 4; - __asm__ volatile ( - "xor %[offset], %[offset], %[offset] \n\t" - "beq %[loop_end], %[out], 0f \n\t" - "2: \n\t" - "lbux %[temp0], %[offset](%[a]) \n\t" - "lbux %[temp1], %[offset](%[r]) \n\t" - "lbux %[temp2], %[offset](%[g]) \n\t" - "lbux %[temp3], %[offset](%[b]) \n\t" - "ins %[temp1], %[temp0], 16, 16 \n\t" - "ins %[temp3], %[temp2], 16, 16 \n\t" - "addiu %[out], %[out], 4 \n\t" - "precr.qb.ph %[temp0], %[temp1], %[temp3] \n\t" - "sw %[temp0], -4(%[out]) \n\t" - "addu %[offset], %[offset], %[step] \n\t" - "bne %[loop_end], %[out], 2b \n\t" - "0: \n\t" - "beq %[rest], $zero, 1f \n\t" - "lbux %[temp0], %[offset](%[a]) \n\t" - "lbux %[temp1], %[offset](%[r]) \n\t" - "lbux %[temp2], %[offset](%[g]) \n\t" - "lbux %[temp3], %[offset](%[b]) \n\t" - "ins %[temp1], %[temp0], 16, 16 \n\t" - "ins %[temp3], %[temp2], 16, 16 \n\t" - "precr.qb.ph %[temp0], %[temp1], %[temp3] \n\t" - "sw %[temp0], 0(%[out]) \n\t" - "1: \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [offset]"=&r"(offset), [out]"+&r"(out) - : [a]"r"(a), [r]"r"(r), [g]"r"(g), [b]"r"(b), [step]"r"(step), - [loop_end]"r"(loop_end), [rest]"r"(rest) - : "memory" - ); + __asm__ volatile( + "xor %[offset], %[offset], %[offset] \n\t" + "beq %[loop_end], %[out], 0f \n\t" + "2: \n\t" + "lbux %[temp0], %[offset](%[a]) \n\t" + "lbux %[temp1], %[offset](%[r]) \n\t" + "lbux %[temp2], %[offset](%[g]) \n\t" + "lbux %[temp3], %[offset](%[b]) \n\t" + "ins %[temp1], %[temp0], 16, 16 \n\t" + "ins %[temp3], %[temp2], 16, 16 \n\t" + "addiu %[out], %[out], 4 \n\t" + "precr.qb.ph %[temp0], %[temp1], %[temp3] \n\t" + "sw %[temp0], -4(%[out]) \n\t" + "addu %[offset], %[offset], %[step] \n\t" + "bne %[loop_end], %[out], 2b \n\t" + "0: \n\t" + "beq %[rest], $zero, 1f \n\t" + "lbux %[temp0], %[offset](%[a]) \n\t" + "lbux %[temp1], %[offset](%[r]) \n\t" + "lbux %[temp2], %[offset](%[g]) \n\t" + "lbux %[temp3], %[offset](%[b]) \n\t" + "ins %[temp1], %[temp0], 16, 16 \n\t" + "ins %[temp3], %[temp2], 16, 16 \n\t" + "precr.qb.ph %[temp0], %[temp1], %[temp3] \n\t" + "sw %[temp0], 0(%[out]) \n\t" + "1: \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [offset] "=&r"(offset), [out] "+&r"(out) + : [a] "r"(a), [r] "r"(r), [g] "r"(g), [b] "r"(b), [step] "r"(step), + [loop_end] "r"(loop_end), [rest] "r"(rest) + : "memory"); } #endif // WORDS_BIGENDIAN @@ -175,36 +169,35 @@ static void PackRGB_MIPSdspR2(const uint8_t* r, const uint8_t* g, const int rest = len & 1; const int a = 0xff; const uint32_t* const loop_end = out + len - rest; - __asm__ volatile ( - "xor %[offset], %[offset], %[offset] \n\t" - "beq %[loop_end], %[out], 0f \n\t" - "2: \n\t" - "lbux %[temp0], %[offset](%[r]) \n\t" - "lbux %[temp1], %[offset](%[g]) \n\t" - "lbux %[temp2], %[offset](%[b]) \n\t" - "ins %[temp0], %[a], 16, 16 \n\t" - "ins %[temp2], %[temp1], 16, 16 \n\t" - "addiu %[out], %[out], 4 \n\t" - "precr.qb.ph %[temp0], %[temp0], %[temp2] \n\t" - "sw %[temp0], -4(%[out]) \n\t" - "addu %[offset], %[offset], %[step] \n\t" - "bne %[loop_end], %[out], 2b \n\t" - "0: \n\t" - "beq %[rest], $zero, 1f \n\t" - "lbux %[temp0], %[offset](%[r]) \n\t" - "lbux %[temp1], %[offset](%[g]) \n\t" - "lbux %[temp2], %[offset](%[b]) \n\t" - "ins %[temp0], %[a], 16, 16 \n\t" - "ins %[temp2], %[temp1], 16, 16 \n\t" - "precr.qb.ph %[temp0], %[temp0], %[temp2] \n\t" - "sw %[temp0], 0(%[out]) \n\t" - "1: \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [offset]"=&r"(offset), [out]"+&r"(out) - : [a]"r"(a), [r]"r"(r), [g]"r"(g), [b]"r"(b), [step]"r"(step), - [loop_end]"r"(loop_end), [rest]"r"(rest) - : "memory" - ); + __asm__ volatile( + "xor %[offset], %[offset], %[offset] \n\t" + "beq %[loop_end], %[out], 0f \n\t" + "2: \n\t" + "lbux %[temp0], %[offset](%[r]) \n\t" + "lbux %[temp1], %[offset](%[g]) \n\t" + "lbux %[temp2], %[offset](%[b]) \n\t" + "ins %[temp0], %[a], 16, 16 \n\t" + "ins %[temp2], %[temp1], 16, 16 \n\t" + "addiu %[out], %[out], 4 \n\t" + "precr.qb.ph %[temp0], %[temp0], %[temp2] \n\t" + "sw %[temp0], -4(%[out]) \n\t" + "addu %[offset], %[offset], %[step] \n\t" + "bne %[loop_end], %[out], 2b \n\t" + "0: \n\t" + "beq %[rest], $zero, 1f \n\t" + "lbux %[temp0], %[offset](%[r]) \n\t" + "lbux %[temp1], %[offset](%[g]) \n\t" + "lbux %[temp2], %[offset](%[b]) \n\t" + "ins %[temp0], %[a], 16, 16 \n\t" + "ins %[temp2], %[temp1], 16, 16 \n\t" + "precr.qb.ph %[temp0], %[temp0], %[temp2] \n\t" + "sw %[temp0], 0(%[out]) \n\t" + "1: \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [offset] "=&r"(offset), [out] "+&r"(out) + : [a] "r"(a), [r] "r"(r), [g] "r"(g), [b] "r"(b), [step] "r"(step), + [loop_end] "r"(loop_end), [rest] "r"(rest) + : "memory"); } //------------------------------------------------------------------------------ diff --git a/src/dsp/alpha_processing_neon.c b/src/dsp/alpha_processing_neon.c index 6716fb77..806ef92a 100644 --- a/src/dsp/alpha_processing_neon.c +++ b/src/dsp/alpha_processing_neon.c @@ -22,25 +22,26 @@ #define MULTIPLIER(a) ((a) * 0x8081) #define PREMULTIPLY(x, m) (((x) * (m)) >> 23) -#define MULTIPLY_BY_ALPHA(V, ALPHA, OTHER) do { \ - const uint8x8_t alpha = (V).val[(ALPHA)]; \ - const uint16x8_t r1 = vmull_u8((V).val[1], alpha); \ - const uint16x8_t g1 = vmull_u8((V).val[2], alpha); \ - const uint16x8_t b1 = vmull_u8((V).val[(OTHER)], alpha); \ - /* we use: v / 255 = (v + 1 + (v >> 8)) >> 8 */ \ - const uint16x8_t r2 = vsraq_n_u16(r1, r1, 8); \ - const uint16x8_t g2 = vsraq_n_u16(g1, g1, 8); \ - const uint16x8_t b2 = vsraq_n_u16(b1, b1, 8); \ - const uint16x8_t r3 = vaddq_u16(r2, kOne); \ - const uint16x8_t g3 = vaddq_u16(g2, kOne); \ - const uint16x8_t b3 = vaddq_u16(b2, kOne); \ - (V).val[1] = vshrn_n_u16(r3, 8); \ - (V).val[2] = vshrn_n_u16(g3, 8); \ - (V).val[(OTHER)] = vshrn_n_u16(b3, 8); \ -} while (0) +#define MULTIPLY_BY_ALPHA(V, ALPHA, OTHER) \ + do { \ + const uint8x8_t alpha = (V).val[(ALPHA)]; \ + const uint16x8_t r1 = vmull_u8((V).val[1], alpha); \ + const uint16x8_t g1 = vmull_u8((V).val[2], alpha); \ + const uint16x8_t b1 = vmull_u8((V).val[(OTHER)], alpha); \ + /* we use: v / 255 = (v + 1 + (v >> 8)) >> 8 */ \ + const uint16x8_t r2 = vsraq_n_u16(r1, r1, 8); \ + const uint16x8_t g2 = vsraq_n_u16(g1, g1, 8); \ + const uint16x8_t b2 = vsraq_n_u16(b1, b1, 8); \ + const uint16x8_t r3 = vaddq_u16(r2, kOne); \ + const uint16x8_t g3 = vaddq_u16(g2, kOne); \ + const uint16x8_t b3 = vaddq_u16(b2, kOne); \ + (V).val[1] = vshrn_n_u16(r3, 8); \ + (V).val[2] = vshrn_n_u16(g3, 8); \ + (V).val[(OTHER)] = vshrn_n_u16(b3, 8); \ + } while (0) -static void ApplyAlphaMultiply_NEON(uint8_t* rgba, int alpha_first, - int w, int h, int stride) { +static void ApplyAlphaMultiply_NEON(uint8_t* rgba, int alpha_first, int w, + int h, int stride) { const uint16x8_t kOne = vdupq_n_u16(1u); while (h-- > 0) { uint32_t* const rgbx = (uint32_t*)rgba; @@ -118,7 +119,7 @@ static void DispatchAlphaToGreen_NEON(const uint8_t* WEBP_RESTRICT alpha, uint32_t* WEBP_RESTRICT dst, int dst_stride) { int i, j; - uint8x8x4_t greens; // leave A/R/B channels zero'd. + uint8x8x4_t greens; // leave A/R/B channels zero'd. greens.val[0] = vdup_n_u8(0); greens.val[2] = vdup_n_u8(0); greens.val[3] = vdup_n_u8(0); diff --git a/src/dsp/alpha_processing_sse2.c b/src/dsp/alpha_processing_sse2.c index 1a6bfcb9..b4bafc52 100644 --- a/src/dsp/alpha_processing_sse2.c +++ b/src/dsp/alpha_processing_sse2.c @@ -16,8 +16,8 @@ #if defined(WEBP_USE_SSE2) #include -#include "src/webp/types.h" #include "src/dsp/cpu.h" +#include "src/webp/types.h" //------------------------------------------------------------------------------ @@ -90,7 +90,7 @@ static void DispatchAlphaToGreen_SSE2(const uint8_t* WEBP_RESTRICT alpha, const __m128i zero = _mm_setzero_si128(); const int limit = width & ~15; for (j = 0; j < height; ++j) { - for (i = 0; i < limit; i += 16) { // process 16 alpha bytes + for (i = 0; i < limit; i += 16) { // process 16 alpha bytes const __m128i a0 = _mm_loadu_si128((const __m128i*)&alpha[i]); const __m128i a1 = _mm_unpacklo_epi8(zero, a0); // note the 'zero' first! const __m128i b1 = _mm_unpackhi_epi8(zero, a0); @@ -98,9 +98,9 @@ static void DispatchAlphaToGreen_SSE2(const uint8_t* WEBP_RESTRICT alpha, const __m128i b2_lo = _mm_unpacklo_epi16(b1, zero); const __m128i a2_hi = _mm_unpackhi_epi16(a1, zero); const __m128i b2_hi = _mm_unpackhi_epi16(b1, zero); - _mm_storeu_si128((__m128i*)&dst[i + 0], a2_lo); - _mm_storeu_si128((__m128i*)&dst[i + 4], a2_hi); - _mm_storeu_si128((__m128i*)&dst[i + 8], b2_lo); + _mm_storeu_si128((__m128i*)&dst[i + 0], a2_lo); + _mm_storeu_si128((__m128i*)&dst[i + 4], a2_hi); + _mm_storeu_si128((__m128i*)&dst[i + 8], b2_lo); _mm_storeu_si128((__m128i*)&dst[i + 12], b2_hi); } for (; i < width; ++i) dst[i] = alpha[i] << 8; @@ -197,36 +197,37 @@ static void ExtractGreen_SSE2(const uint32_t* WEBP_RESTRICT argb, //------------------------------------------------------------------------------ // Non-dither premultiplied modes -#define MULTIPLIER(a) ((a) * 0x8081) +#define MULTIPLIER(a) ((a) * 0x8081) #define PREMULTIPLY(x, m) (((x) * (m)) >> 23) // We can't use a 'const int' for the SHUFFLE value, because it has to be an // immediate in the _mm_shufflexx_epi16() instruction. We really need a macro. // We use: v / 255 = (v * 0x8081) >> 23, where v = alpha * {r,g,b} is a 16bit // value. -#define APPLY_ALPHA(RGBX, SHUFFLE) do { \ - const __m128i argb0 = _mm_loadu_si128((const __m128i*)&(RGBX)); \ - const __m128i argb1_lo = _mm_unpacklo_epi8(argb0, zero); \ - const __m128i argb1_hi = _mm_unpackhi_epi8(argb0, zero); \ - const __m128i alpha0_lo = _mm_or_si128(argb1_lo, kMask); \ - const __m128i alpha0_hi = _mm_or_si128(argb1_hi, kMask); \ - const __m128i alpha1_lo = _mm_shufflelo_epi16(alpha0_lo, SHUFFLE); \ - const __m128i alpha1_hi = _mm_shufflelo_epi16(alpha0_hi, SHUFFLE); \ - const __m128i alpha2_lo = _mm_shufflehi_epi16(alpha1_lo, SHUFFLE); \ - const __m128i alpha2_hi = _mm_shufflehi_epi16(alpha1_hi, SHUFFLE); \ - /* alpha2 = [ff a0 a0 a0][ff a1 a1 a1] */ \ - const __m128i A0_lo = _mm_mullo_epi16(alpha2_lo, argb1_lo); \ - const __m128i A0_hi = _mm_mullo_epi16(alpha2_hi, argb1_hi); \ - const __m128i A1_lo = _mm_mulhi_epu16(A0_lo, kMult); \ - const __m128i A1_hi = _mm_mulhi_epu16(A0_hi, kMult); \ - const __m128i A2_lo = _mm_srli_epi16(A1_lo, 7); \ - const __m128i A2_hi = _mm_srli_epi16(A1_hi, 7); \ - const __m128i A3 = _mm_packus_epi16(A2_lo, A2_hi); \ - _mm_storeu_si128((__m128i*)&(RGBX), A3); \ -} while (0) +#define APPLY_ALPHA(RGBX, SHUFFLE) \ + do { \ + const __m128i argb0 = _mm_loadu_si128((const __m128i*)&(RGBX)); \ + const __m128i argb1_lo = _mm_unpacklo_epi8(argb0, zero); \ + const __m128i argb1_hi = _mm_unpackhi_epi8(argb0, zero); \ + const __m128i alpha0_lo = _mm_or_si128(argb1_lo, kMask); \ + const __m128i alpha0_hi = _mm_or_si128(argb1_hi, kMask); \ + const __m128i alpha1_lo = _mm_shufflelo_epi16(alpha0_lo, SHUFFLE); \ + const __m128i alpha1_hi = _mm_shufflelo_epi16(alpha0_hi, SHUFFLE); \ + const __m128i alpha2_lo = _mm_shufflehi_epi16(alpha1_lo, SHUFFLE); \ + const __m128i alpha2_hi = _mm_shufflehi_epi16(alpha1_hi, SHUFFLE); \ + /* alpha2 = [ff a0 a0 a0][ff a1 a1 a1] */ \ + const __m128i A0_lo = _mm_mullo_epi16(alpha2_lo, argb1_lo); \ + const __m128i A0_hi = _mm_mullo_epi16(alpha2_hi, argb1_hi); \ + const __m128i A1_lo = _mm_mulhi_epu16(A0_lo, kMult); \ + const __m128i A1_hi = _mm_mulhi_epu16(A0_hi, kMult); \ + const __m128i A2_lo = _mm_srli_epi16(A1_lo, 7); \ + const __m128i A2_hi = _mm_srli_epi16(A1_hi, 7); \ + const __m128i A3 = _mm_packus_epi16(A2_lo, A2_hi); \ + _mm_storeu_si128((__m128i*)&(RGBX), A3); \ + } while (0) -static void ApplyAlphaMultiply_SSE2(uint8_t* rgba, int alpha_first, - int w, int h, int stride) { +static void ApplyAlphaMultiply_SSE2(uint8_t* rgba, int alpha_first, int w, + int h, int stride) { const __m128i zero = _mm_setzero_si128(); const __m128i kMult = _mm_set1_epi16((short)0x8081); const __m128i kMask = _mm_set_epi16(0, 0xff, 0xff, 0, 0, 0xff, 0xff, 0); @@ -273,7 +274,8 @@ static int HasAlpha8b_SSE2(const uint8_t* src, int length) { const int mask = _mm_movemask_epi8(bits); if (mask != 0xffff) return 1; } - for (; i < length; ++i) if (src[i] != 0xff) return 1; + for (; i < length; ++i) + if (src[i] != 0xff) return 1; return 0; } @@ -284,9 +286,9 @@ static int HasAlpha32b_SSE2(const uint8_t* src, int length) { // We don't know if we can access the last 3 bytes after the last alpha // value 'src[4 * length - 4]' (because we don't know if alpha is the first // or the last byte of the quadruplet). Hence the '-3' protection below. - length = length * 4 - 3; // size in bytes + length = length * 4 - 3; // size in bytes for (; i + 64 <= length; i += 64) { - const __m128i a0 = _mm_loadu_si128((const __m128i*)(src + i + 0)); + const __m128i a0 = _mm_loadu_si128((const __m128i*)(src + i + 0)); const __m128i a1 = _mm_loadu_si128((const __m128i*)(src + i + 16)); const __m128i a2 = _mm_loadu_si128((const __m128i*)(src + i + 32)); const __m128i a3 = _mm_loadu_si128((const __m128i*)(src + i + 48)); @@ -296,23 +298,24 @@ static int HasAlpha32b_SSE2(const uint8_t* src, int length) { const __m128i b3 = _mm_and_si128(a3, alpha_mask); const __m128i c0 = _mm_packs_epi32(b0, b1); const __m128i c1 = _mm_packs_epi32(b2, b3); - const __m128i d = _mm_packus_epi16(c0, c1); + const __m128i d = _mm_packus_epi16(c0, c1); const __m128i bits = _mm_cmpeq_epi8(d, all_0xff); const int mask = _mm_movemask_epi8(bits); if (mask != 0xffff) return 1; } for (; i + 32 <= length; i += 32) { - const __m128i a0 = _mm_loadu_si128((const __m128i*)(src + i + 0)); + const __m128i a0 = _mm_loadu_si128((const __m128i*)(src + i + 0)); const __m128i a1 = _mm_loadu_si128((const __m128i*)(src + i + 16)); const __m128i b0 = _mm_and_si128(a0, alpha_mask); const __m128i b1 = _mm_and_si128(a1, alpha_mask); - const __m128i c = _mm_packs_epi32(b0, b1); - const __m128i d = _mm_packus_epi16(c, c); + const __m128i c = _mm_packs_epi32(b0, b1); + const __m128i d = _mm_packus_epi16(c, c); const __m128i bits = _mm_cmpeq_epi8(d, all_0xff); const int mask = _mm_movemask_epi8(bits); if (mask != 0xffff) return 1; } - for (; i <= length; i += 4) if (src[i] != 0xff) return 1; + for (; i <= length; i += 4) + if (src[i] != 0xff) return 1; return 0; } @@ -334,7 +337,8 @@ static void AlphaReplace_SSE2(uint32_t* src, int length, uint32_t color) { _mm_storeu_si128((__m128i*)(src + i + 0), _mm_or_si128(d0, e0)); _mm_storeu_si128((__m128i*)(src + i + 4), _mm_or_si128(d1, e1)); } - for (; i < length; ++i) if ((src[i] >> 24) == 0) src[i] = color; + for (; i < length; ++i) + if ((src[i] >> 24) == 0) src[i] = color; } // ----------------------------------------------------------------------------- @@ -369,8 +373,8 @@ static void MultARGBRow_SSE2(uint32_t* const ptr, int width, int inverse) { } static void MultRow_SSE2(uint8_t* WEBP_RESTRICT const ptr, - const uint8_t* WEBP_RESTRICT const alpha, - int width, int inverse) { + const uint8_t* WEBP_RESTRICT const alpha, int width, + int inverse) { int x = 0; if (!inverse) { const __m128i zero = _mm_setzero_si128(); diff --git a/src/dsp/alpha_processing_sse41.c b/src/dsp/alpha_processing_sse41.c index ed95ea4e..f4183c4d 100644 --- a/src/dsp/alpha_processing_sse41.c +++ b/src/dsp/alpha_processing_sse41.c @@ -12,8 +12,8 @@ // Author: Skal (pascal.massimino@gmail.com) #include "src/dsp/cpu.h" -#include "src/webp/types.h" #include "src/dsp/dsp.h" +#include "src/webp/types.h" #if defined(WEBP_USE_SSE41) #include @@ -35,14 +35,14 @@ static int ExtractAlpha_SSE41(const uint8_t* WEBP_RESTRICT argb, // 'src[4 * width - 4]', because we don't know if alpha is the first or the // last byte of the quadruplet. const int limit = (width - 1) & ~15; - const __m128i kCstAlpha0 = _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 12, 8, 4, 0); - const __m128i kCstAlpha1 = _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, - 12, 8, 4, 0, -1, -1, -1, -1); - const __m128i kCstAlpha2 = _mm_set_epi8(-1, -1, -1, -1, 12, 8, 4, 0, - -1, -1, -1, -1, -1, -1, -1, -1); - const __m128i kCstAlpha3 = _mm_set_epi8(12, 8, 4, 0, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1); + const __m128i kCstAlpha0 = + _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, 8, 4, 0); + const __m128i kCstAlpha1 = + _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, 12, 8, 4, 0, -1, -1, -1, -1); + const __m128i kCstAlpha2 = + _mm_set_epi8(-1, -1, -1, -1, 12, 8, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1); + const __m128i kCstAlpha3 = + _mm_set_epi8(12, 8, 4, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1); for (j = 0; j < height; ++j) { const __m128i* src = (const __m128i*)argb; for (i = 0; i < limit; i += 16) { diff --git a/src/dsp/common_sse41.h b/src/dsp/common_sse41.h index 2f173c02..64e20948 100644 --- a/src/dsp/common_sse41.h +++ b/src/dsp/common_sse41.h @@ -44,12 +44,12 @@ static WEBP_INLINE void VP8PlanarTo24b_SSE41( // Process R. { - const __m128i shuff0 = _mm_set_epi8( - 5, -1, -1, 4, -1, -1, 3, -1, -1, 2, -1, -1, 1, -1, -1, 0); - const __m128i shuff1 = _mm_set_epi8( - -1, 10, -1, -1, 9, -1, -1, 8, -1, -1, 7, -1, -1, 6, -1, -1); - const __m128i shuff2 = _mm_set_epi8( - -1, -1, 15, -1, -1, 14, -1, -1, 13, -1, -1, 12, -1, -1, 11, -1); + const __m128i shuff0 = + _mm_set_epi8(5, -1, -1, 4, -1, -1, 3, -1, -1, 2, -1, -1, 1, -1, -1, 0); + const __m128i shuff1 = _mm_set_epi8(-1, 10, -1, -1, 9, -1, -1, 8, -1, -1, 7, + -1, -1, 6, -1, -1); + const __m128i shuff2 = _mm_set_epi8(-1, -1, 15, -1, -1, 14, -1, -1, 13, -1, + -1, 12, -1, -1, 11, -1); WEBP_SSE41_SHUFF(R, in0, in1) } @@ -57,23 +57,23 @@ static WEBP_INLINE void VP8PlanarTo24b_SSE41( { // Same as before, just shifted to the left by one and including the right // padding. - const __m128i shuff0 = _mm_set_epi8( - -1, -1, 4, -1, -1, 3, -1, -1, 2, -1, -1, 1, -1, -1, 0, -1); - const __m128i shuff1 = _mm_set_epi8( - 10, -1, -1, 9, -1, -1, 8, -1, -1, 7, -1, -1, 6, -1, -1, 5); - const __m128i shuff2 = _mm_set_epi8( - -1, 15, -1, -1, 14, -1, -1, 13, -1, -1, 12, -1, -1, 11, -1, -1); + const __m128i shuff0 = + _mm_set_epi8(-1, -1, 4, -1, -1, 3, -1, -1, 2, -1, -1, 1, -1, -1, 0, -1); + const __m128i shuff1 = + _mm_set_epi8(10, -1, -1, 9, -1, -1, 8, -1, -1, 7, -1, -1, 6, -1, -1, 5); + const __m128i shuff2 = _mm_set_epi8(-1, 15, -1, -1, 14, -1, -1, 13, -1, -1, + 12, -1, -1, 11, -1, -1); WEBP_SSE41_SHUFF(G, in2, in3) } // Process B. { - const __m128i shuff0 = _mm_set_epi8( - -1, 4, -1, -1, 3, -1, -1, 2, -1, -1, 1, -1, -1, 0, -1, -1); - const __m128i shuff1 = _mm_set_epi8( - -1, -1, 9, -1, -1, 8, -1, -1, 7, -1, -1, 6, -1, -1, 5, -1); - const __m128i shuff2 = _mm_set_epi8( - 15, -1, -1, 14, -1, -1, 13, -1, -1, 12, -1, -1, 11, -1, -1, 10); + const __m128i shuff0 = + _mm_set_epi8(-1, 4, -1, -1, 3, -1, -1, 2, -1, -1, 1, -1, -1, 0, -1, -1); + const __m128i shuff1 = + _mm_set_epi8(-1, -1, 9, -1, -1, 8, -1, -1, 7, -1, -1, 6, -1, -1, 5, -1); + const __m128i shuff2 = _mm_set_epi8(15, -1, -1, 14, -1, -1, 13, -1, -1, 12, + -1, -1, 11, -1, -1, 10); WEBP_SSE41_SHUFF(B, in4, in5) } diff --git a/src/dsp/cost.c b/src/dsp/cost.c index acf6c219..2fd45ce3 100644 --- a/src/dsp/cost.c +++ b/src/dsp/cost.c @@ -14,42 +14,37 @@ #include #include "src/dsp/cpu.h" -#include "src/webp/types.h" #include "src/dsp/dsp.h" #include "src/enc/cost_enc.h" #include "src/enc/vp8i_enc.h" +#include "src/webp/types.h" //------------------------------------------------------------------------------ // Boolean-cost cost table const uint16_t VP8EntropyCost[256] = { - 1792, 1792, 1792, 1536, 1536, 1408, 1366, 1280, 1280, 1216, - 1178, 1152, 1110, 1076, 1061, 1024, 1024, 992, 968, 951, - 939, 911, 896, 878, 871, 854, 838, 820, 811, 794, - 786, 768, 768, 752, 740, 732, 720, 709, 704, 690, - 683, 672, 666, 655, 647, 640, 631, 622, 615, 607, - 598, 592, 586, 576, 572, 564, 559, 555, 547, 541, - 534, 528, 522, 512, 512, 504, 500, 494, 488, 483, - 477, 473, 467, 461, 458, 452, 448, 443, 438, 434, - 427, 424, 419, 415, 410, 406, 403, 399, 394, 390, - 384, 384, 377, 374, 370, 366, 362, 359, 355, 351, - 347, 342, 342, 336, 333, 330, 326, 323, 320, 316, - 312, 308, 305, 302, 299, 296, 293, 288, 287, 283, - 280, 277, 274, 272, 268, 266, 262, 256, 256, 256, - 251, 248, 245, 242, 240, 237, 234, 232, 228, 226, - 223, 221, 218, 216, 214, 211, 208, 205, 203, 201, - 198, 196, 192, 191, 188, 187, 183, 181, 179, 176, - 175, 171, 171, 168, 165, 163, 160, 159, 156, 154, - 152, 150, 148, 146, 144, 142, 139, 138, 135, 133, - 131, 128, 128, 125, 123, 121, 119, 117, 115, 113, - 111, 110, 107, 105, 103, 102, 100, 98, 96, 94, - 92, 91, 89, 86, 86, 83, 82, 80, 77, 76, - 74, 73, 71, 69, 67, 66, 64, 63, 61, 59, - 57, 55, 54, 52, 51, 49, 47, 46, 44, 43, - 41, 40, 38, 36, 35, 33, 32, 30, 29, 27, - 25, 24, 22, 21, 19, 18, 16, 15, 13, 12, - 10, 9, 7, 6, 4, 3 -}; + 1792, 1792, 1792, 1536, 1536, 1408, 1366, 1280, 1280, 1216, 1178, 1152, + 1110, 1076, 1061, 1024, 1024, 992, 968, 951, 939, 911, 896, 878, + 871, 854, 838, 820, 811, 794, 786, 768, 768, 752, 740, 732, + 720, 709, 704, 690, 683, 672, 666, 655, 647, 640, 631, 622, + 615, 607, 598, 592, 586, 576, 572, 564, 559, 555, 547, 541, + 534, 528, 522, 512, 512, 504, 500, 494, 488, 483, 477, 473, + 467, 461, 458, 452, 448, 443, 438, 434, 427, 424, 419, 415, + 410, 406, 403, 399, 394, 390, 384, 384, 377, 374, 370, 366, + 362, 359, 355, 351, 347, 342, 342, 336, 333, 330, 326, 323, + 320, 316, 312, 308, 305, 302, 299, 296, 293, 288, 287, 283, + 280, 277, 274, 272, 268, 266, 262, 256, 256, 256, 251, 248, + 245, 242, 240, 237, 234, 232, 228, 226, 223, 221, 218, 216, + 214, 211, 208, 205, 203, 201, 198, 196, 192, 191, 188, 187, + 183, 181, 179, 176, 175, 171, 171, 168, 165, 163, 160, 159, + 156, 154, 152, 150, 148, 146, 144, 142, 139, 138, 135, 133, + 131, 128, 128, 125, 123, 121, 119, 117, 115, 113, 111, 110, + 107, 105, 103, 102, 100, 98, 96, 94, 92, 91, 89, 86, + 86, 83, 82, 80, 77, 76, 74, 73, 71, 69, 67, 66, + 64, 63, 61, 59, 57, 55, 54, 52, 51, 49, 47, 46, + 44, 43, 41, 40, 38, 36, 35, 33, 32, 30, 29, 27, + 25, 24, 22, 21, 19, 18, 16, 15, 13, 12, 10, 9, + 7, 6, 4, 3}; //------------------------------------------------------------------------------ // Level cost tables @@ -57,270 +52,184 @@ const uint16_t VP8EntropyCost[256] = { // fixed costs for coding levels, deduce from the coding tree. // This is only the part that doesn't depend on the probability state. const uint16_t VP8LevelFixedCosts[MAX_LEVEL + 1] = { - 0, 256, 256, 256, 256, 432, 618, 630, - 731, 640, 640, 828, 901, 948, 1021, 1101, - 1174, 1221, 1294, 1042, 1085, 1115, 1158, 1202, - 1245, 1275, 1318, 1337, 1380, 1410, 1453, 1497, - 1540, 1570, 1613, 1280, 1295, 1317, 1332, 1358, - 1373, 1395, 1410, 1454, 1469, 1491, 1506, 1532, - 1547, 1569, 1584, 1601, 1616, 1638, 1653, 1679, - 1694, 1716, 1731, 1775, 1790, 1812, 1827, 1853, - 1868, 1890, 1905, 1727, 1733, 1742, 1748, 1759, - 1765, 1774, 1780, 1800, 1806, 1815, 1821, 1832, - 1838, 1847, 1853, 1878, 1884, 1893, 1899, 1910, - 1916, 1925, 1931, 1951, 1957, 1966, 1972, 1983, - 1989, 1998, 2004, 2027, 2033, 2042, 2048, 2059, - 2065, 2074, 2080, 2100, 2106, 2115, 2121, 2132, - 2138, 2147, 2153, 2178, 2184, 2193, 2199, 2210, - 2216, 2225, 2231, 2251, 2257, 2266, 2272, 2283, - 2289, 2298, 2304, 2168, 2174, 2183, 2189, 2200, - 2206, 2215, 2221, 2241, 2247, 2256, 2262, 2273, - 2279, 2288, 2294, 2319, 2325, 2334, 2340, 2351, - 2357, 2366, 2372, 2392, 2398, 2407, 2413, 2424, - 2430, 2439, 2445, 2468, 2474, 2483, 2489, 2500, - 2506, 2515, 2521, 2541, 2547, 2556, 2562, 2573, - 2579, 2588, 2594, 2619, 2625, 2634, 2640, 2651, - 2657, 2666, 2672, 2692, 2698, 2707, 2713, 2724, - 2730, 2739, 2745, 2540, 2546, 2555, 2561, 2572, - 2578, 2587, 2593, 2613, 2619, 2628, 2634, 2645, - 2651, 2660, 2666, 2691, 2697, 2706, 2712, 2723, - 2729, 2738, 2744, 2764, 2770, 2779, 2785, 2796, - 2802, 2811, 2817, 2840, 2846, 2855, 2861, 2872, - 2878, 2887, 2893, 2913, 2919, 2928, 2934, 2945, - 2951, 2960, 2966, 2991, 2997, 3006, 3012, 3023, - 3029, 3038, 3044, 3064, 3070, 3079, 3085, 3096, - 3102, 3111, 3117, 2981, 2987, 2996, 3002, 3013, - 3019, 3028, 3034, 3054, 3060, 3069, 3075, 3086, - 3092, 3101, 3107, 3132, 3138, 3147, 3153, 3164, - 3170, 3179, 3185, 3205, 3211, 3220, 3226, 3237, - 3243, 3252, 3258, 3281, 3287, 3296, 3302, 3313, - 3319, 3328, 3334, 3354, 3360, 3369, 3375, 3386, - 3392, 3401, 3407, 3432, 3438, 3447, 3453, 3464, - 3470, 3479, 3485, 3505, 3511, 3520, 3526, 3537, - 3543, 3552, 3558, 2816, 2822, 2831, 2837, 2848, - 2854, 2863, 2869, 2889, 2895, 2904, 2910, 2921, - 2927, 2936, 2942, 2967, 2973, 2982, 2988, 2999, - 3005, 3014, 3020, 3040, 3046, 3055, 3061, 3072, - 3078, 3087, 3093, 3116, 3122, 3131, 3137, 3148, - 3154, 3163, 3169, 3189, 3195, 3204, 3210, 3221, - 3227, 3236, 3242, 3267, 3273, 3282, 3288, 3299, - 3305, 3314, 3320, 3340, 3346, 3355, 3361, 3372, - 3378, 3387, 3393, 3257, 3263, 3272, 3278, 3289, - 3295, 3304, 3310, 3330, 3336, 3345, 3351, 3362, - 3368, 3377, 3383, 3408, 3414, 3423, 3429, 3440, - 3446, 3455, 3461, 3481, 3487, 3496, 3502, 3513, - 3519, 3528, 3534, 3557, 3563, 3572, 3578, 3589, - 3595, 3604, 3610, 3630, 3636, 3645, 3651, 3662, - 3668, 3677, 3683, 3708, 3714, 3723, 3729, 3740, - 3746, 3755, 3761, 3781, 3787, 3796, 3802, 3813, - 3819, 3828, 3834, 3629, 3635, 3644, 3650, 3661, - 3667, 3676, 3682, 3702, 3708, 3717, 3723, 3734, - 3740, 3749, 3755, 3780, 3786, 3795, 3801, 3812, - 3818, 3827, 3833, 3853, 3859, 3868, 3874, 3885, - 3891, 3900, 3906, 3929, 3935, 3944, 3950, 3961, - 3967, 3976, 3982, 4002, 4008, 4017, 4023, 4034, - 4040, 4049, 4055, 4080, 4086, 4095, 4101, 4112, - 4118, 4127, 4133, 4153, 4159, 4168, 4174, 4185, - 4191, 4200, 4206, 4070, 4076, 4085, 4091, 4102, - 4108, 4117, 4123, 4143, 4149, 4158, 4164, 4175, - 4181, 4190, 4196, 4221, 4227, 4236, 4242, 4253, - 4259, 4268, 4274, 4294, 4300, 4309, 4315, 4326, - 4332, 4341, 4347, 4370, 4376, 4385, 4391, 4402, - 4408, 4417, 4423, 4443, 4449, 4458, 4464, 4475, - 4481, 4490, 4496, 4521, 4527, 4536, 4542, 4553, - 4559, 4568, 4574, 4594, 4600, 4609, 4615, 4626, - 4632, 4641, 4647, 3515, 3521, 3530, 3536, 3547, - 3553, 3562, 3568, 3588, 3594, 3603, 3609, 3620, - 3626, 3635, 3641, 3666, 3672, 3681, 3687, 3698, - 3704, 3713, 3719, 3739, 3745, 3754, 3760, 3771, - 3777, 3786, 3792, 3815, 3821, 3830, 3836, 3847, - 3853, 3862, 3868, 3888, 3894, 3903, 3909, 3920, - 3926, 3935, 3941, 3966, 3972, 3981, 3987, 3998, - 4004, 4013, 4019, 4039, 4045, 4054, 4060, 4071, - 4077, 4086, 4092, 3956, 3962, 3971, 3977, 3988, - 3994, 4003, 4009, 4029, 4035, 4044, 4050, 4061, - 4067, 4076, 4082, 4107, 4113, 4122, 4128, 4139, - 4145, 4154, 4160, 4180, 4186, 4195, 4201, 4212, - 4218, 4227, 4233, 4256, 4262, 4271, 4277, 4288, - 4294, 4303, 4309, 4329, 4335, 4344, 4350, 4361, - 4367, 4376, 4382, 4407, 4413, 4422, 4428, 4439, - 4445, 4454, 4460, 4480, 4486, 4495, 4501, 4512, - 4518, 4527, 4533, 4328, 4334, 4343, 4349, 4360, - 4366, 4375, 4381, 4401, 4407, 4416, 4422, 4433, - 4439, 4448, 4454, 4479, 4485, 4494, 4500, 4511, - 4517, 4526, 4532, 4552, 4558, 4567, 4573, 4584, - 4590, 4599, 4605, 4628, 4634, 4643, 4649, 4660, - 4666, 4675, 4681, 4701, 4707, 4716, 4722, 4733, - 4739, 4748, 4754, 4779, 4785, 4794, 4800, 4811, - 4817, 4826, 4832, 4852, 4858, 4867, 4873, 4884, - 4890, 4899, 4905, 4769, 4775, 4784, 4790, 4801, - 4807, 4816, 4822, 4842, 4848, 4857, 4863, 4874, - 4880, 4889, 4895, 4920, 4926, 4935, 4941, 4952, - 4958, 4967, 4973, 4993, 4999, 5008, 5014, 5025, - 5031, 5040, 5046, 5069, 5075, 5084, 5090, 5101, - 5107, 5116, 5122, 5142, 5148, 5157, 5163, 5174, - 5180, 5189, 5195, 5220, 5226, 5235, 5241, 5252, - 5258, 5267, 5273, 5293, 5299, 5308, 5314, 5325, - 5331, 5340, 5346, 4604, 4610, 4619, 4625, 4636, - 4642, 4651, 4657, 4677, 4683, 4692, 4698, 4709, - 4715, 4724, 4730, 4755, 4761, 4770, 4776, 4787, - 4793, 4802, 4808, 4828, 4834, 4843, 4849, 4860, - 4866, 4875, 4881, 4904, 4910, 4919, 4925, 4936, - 4942, 4951, 4957, 4977, 4983, 4992, 4998, 5009, - 5015, 5024, 5030, 5055, 5061, 5070, 5076, 5087, - 5093, 5102, 5108, 5128, 5134, 5143, 5149, 5160, - 5166, 5175, 5181, 5045, 5051, 5060, 5066, 5077, - 5083, 5092, 5098, 5118, 5124, 5133, 5139, 5150, - 5156, 5165, 5171, 5196, 5202, 5211, 5217, 5228, - 5234, 5243, 5249, 5269, 5275, 5284, 5290, 5301, - 5307, 5316, 5322, 5345, 5351, 5360, 5366, 5377, - 5383, 5392, 5398, 5418, 5424, 5433, 5439, 5450, - 5456, 5465, 5471, 5496, 5502, 5511, 5517, 5528, - 5534, 5543, 5549, 5569, 5575, 5584, 5590, 5601, - 5607, 5616, 5622, 5417, 5423, 5432, 5438, 5449, - 5455, 5464, 5470, 5490, 5496, 5505, 5511, 5522, - 5528, 5537, 5543, 5568, 5574, 5583, 5589, 5600, - 5606, 5615, 5621, 5641, 5647, 5656, 5662, 5673, - 5679, 5688, 5694, 5717, 5723, 5732, 5738, 5749, - 5755, 5764, 5770, 5790, 5796, 5805, 5811, 5822, - 5828, 5837, 5843, 5868, 5874, 5883, 5889, 5900, - 5906, 5915, 5921, 5941, 5947, 5956, 5962, 5973, - 5979, 5988, 5994, 5858, 5864, 5873, 5879, 5890, - 5896, 5905, 5911, 5931, 5937, 5946, 5952, 5963, - 5969, 5978, 5984, 6009, 6015, 6024, 6030, 6041, - 6047, 6056, 6062, 6082, 6088, 6097, 6103, 6114, - 6120, 6129, 6135, 6158, 6164, 6173, 6179, 6190, - 6196, 6205, 6211, 6231, 6237, 6246, 6252, 6263, - 6269, 6278, 6284, 6309, 6315, 6324, 6330, 6341, - 6347, 6356, 6362, 6382, 6388, 6397, 6403, 6414, - 6420, 6429, 6435, 3515, 3521, 3530, 3536, 3547, - 3553, 3562, 3568, 3588, 3594, 3603, 3609, 3620, - 3626, 3635, 3641, 3666, 3672, 3681, 3687, 3698, - 3704, 3713, 3719, 3739, 3745, 3754, 3760, 3771, - 3777, 3786, 3792, 3815, 3821, 3830, 3836, 3847, - 3853, 3862, 3868, 3888, 3894, 3903, 3909, 3920, - 3926, 3935, 3941, 3966, 3972, 3981, 3987, 3998, - 4004, 4013, 4019, 4039, 4045, 4054, 4060, 4071, - 4077, 4086, 4092, 3956, 3962, 3971, 3977, 3988, - 3994, 4003, 4009, 4029, 4035, 4044, 4050, 4061, - 4067, 4076, 4082, 4107, 4113, 4122, 4128, 4139, - 4145, 4154, 4160, 4180, 4186, 4195, 4201, 4212, - 4218, 4227, 4233, 4256, 4262, 4271, 4277, 4288, - 4294, 4303, 4309, 4329, 4335, 4344, 4350, 4361, - 4367, 4376, 4382, 4407, 4413, 4422, 4428, 4439, - 4445, 4454, 4460, 4480, 4486, 4495, 4501, 4512, - 4518, 4527, 4533, 4328, 4334, 4343, 4349, 4360, - 4366, 4375, 4381, 4401, 4407, 4416, 4422, 4433, - 4439, 4448, 4454, 4479, 4485, 4494, 4500, 4511, - 4517, 4526, 4532, 4552, 4558, 4567, 4573, 4584, - 4590, 4599, 4605, 4628, 4634, 4643, 4649, 4660, - 4666, 4675, 4681, 4701, 4707, 4716, 4722, 4733, - 4739, 4748, 4754, 4779, 4785, 4794, 4800, 4811, - 4817, 4826, 4832, 4852, 4858, 4867, 4873, 4884, - 4890, 4899, 4905, 4769, 4775, 4784, 4790, 4801, - 4807, 4816, 4822, 4842, 4848, 4857, 4863, 4874, - 4880, 4889, 4895, 4920, 4926, 4935, 4941, 4952, - 4958, 4967, 4973, 4993, 4999, 5008, 5014, 5025, - 5031, 5040, 5046, 5069, 5075, 5084, 5090, 5101, - 5107, 5116, 5122, 5142, 5148, 5157, 5163, 5174, - 5180, 5189, 5195, 5220, 5226, 5235, 5241, 5252, - 5258, 5267, 5273, 5293, 5299, 5308, 5314, 5325, - 5331, 5340, 5346, 4604, 4610, 4619, 4625, 4636, - 4642, 4651, 4657, 4677, 4683, 4692, 4698, 4709, - 4715, 4724, 4730, 4755, 4761, 4770, 4776, 4787, - 4793, 4802, 4808, 4828, 4834, 4843, 4849, 4860, - 4866, 4875, 4881, 4904, 4910, 4919, 4925, 4936, - 4942, 4951, 4957, 4977, 4983, 4992, 4998, 5009, - 5015, 5024, 5030, 5055, 5061, 5070, 5076, 5087, - 5093, 5102, 5108, 5128, 5134, 5143, 5149, 5160, - 5166, 5175, 5181, 5045, 5051, 5060, 5066, 5077, - 5083, 5092, 5098, 5118, 5124, 5133, 5139, 5150, - 5156, 5165, 5171, 5196, 5202, 5211, 5217, 5228, - 5234, 5243, 5249, 5269, 5275, 5284, 5290, 5301, - 5307, 5316, 5322, 5345, 5351, 5360, 5366, 5377, - 5383, 5392, 5398, 5418, 5424, 5433, 5439, 5450, - 5456, 5465, 5471, 5496, 5502, 5511, 5517, 5528, - 5534, 5543, 5549, 5569, 5575, 5584, 5590, 5601, - 5607, 5616, 5622, 5417, 5423, 5432, 5438, 5449, - 5455, 5464, 5470, 5490, 5496, 5505, 5511, 5522, - 5528, 5537, 5543, 5568, 5574, 5583, 5589, 5600, - 5606, 5615, 5621, 5641, 5647, 5656, 5662, 5673, - 5679, 5688, 5694, 5717, 5723, 5732, 5738, 5749, - 5755, 5764, 5770, 5790, 5796, 5805, 5811, 5822, - 5828, 5837, 5843, 5868, 5874, 5883, 5889, 5900, - 5906, 5915, 5921, 5941, 5947, 5956, 5962, 5973, - 5979, 5988, 5994, 5858, 5864, 5873, 5879, 5890, - 5896, 5905, 5911, 5931, 5937, 5946, 5952, 5963, - 5969, 5978, 5984, 6009, 6015, 6024, 6030, 6041, - 6047, 6056, 6062, 6082, 6088, 6097, 6103, 6114, - 6120, 6129, 6135, 6158, 6164, 6173, 6179, 6190, - 6196, 6205, 6211, 6231, 6237, 6246, 6252, 6263, - 6269, 6278, 6284, 6309, 6315, 6324, 6330, 6341, - 6347, 6356, 6362, 6382, 6388, 6397, 6403, 6414, - 6420, 6429, 6435, 5303, 5309, 5318, 5324, 5335, - 5341, 5350, 5356, 5376, 5382, 5391, 5397, 5408, - 5414, 5423, 5429, 5454, 5460, 5469, 5475, 5486, - 5492, 5501, 5507, 5527, 5533, 5542, 5548, 5559, - 5565, 5574, 5580, 5603, 5609, 5618, 5624, 5635, - 5641, 5650, 5656, 5676, 5682, 5691, 5697, 5708, - 5714, 5723, 5729, 5754, 5760, 5769, 5775, 5786, - 5792, 5801, 5807, 5827, 5833, 5842, 5848, 5859, - 5865, 5874, 5880, 5744, 5750, 5759, 5765, 5776, - 5782, 5791, 5797, 5817, 5823, 5832, 5838, 5849, - 5855, 5864, 5870, 5895, 5901, 5910, 5916, 5927, - 5933, 5942, 5948, 5968, 5974, 5983, 5989, 6000, - 6006, 6015, 6021, 6044, 6050, 6059, 6065, 6076, - 6082, 6091, 6097, 6117, 6123, 6132, 6138, 6149, - 6155, 6164, 6170, 6195, 6201, 6210, 6216, 6227, - 6233, 6242, 6248, 6268, 6274, 6283, 6289, 6300, - 6306, 6315, 6321, 6116, 6122, 6131, 6137, 6148, - 6154, 6163, 6169, 6189, 6195, 6204, 6210, 6221, - 6227, 6236, 6242, 6267, 6273, 6282, 6288, 6299, - 6305, 6314, 6320, 6340, 6346, 6355, 6361, 6372, - 6378, 6387, 6393, 6416, 6422, 6431, 6437, 6448, - 6454, 6463, 6469, 6489, 6495, 6504, 6510, 6521, - 6527, 6536, 6542, 6567, 6573, 6582, 6588, 6599, - 6605, 6614, 6620, 6640, 6646, 6655, 6661, 6672, - 6678, 6687, 6693, 6557, 6563, 6572, 6578, 6589, - 6595, 6604, 6610, 6630, 6636, 6645, 6651, 6662, - 6668, 6677, 6683, 6708, 6714, 6723, 6729, 6740, - 6746, 6755, 6761, 6781, 6787, 6796, 6802, 6813, - 6819, 6828, 6834, 6857, 6863, 6872, 6878, 6889, - 6895, 6904, 6910, 6930, 6936, 6945, 6951, 6962, - 6968, 6977, 6983, 7008, 7014, 7023, 7029, 7040, - 7046, 7055, 7061, 7081, 7087, 7096, 7102, 7113, - 7119, 7128, 7134, 6392, 6398, 6407, 6413, 6424, - 6430, 6439, 6445, 6465, 6471, 6480, 6486, 6497, - 6503, 6512, 6518, 6543, 6549, 6558, 6564, 6575, - 6581, 6590, 6596, 6616, 6622, 6631, 6637, 6648, - 6654, 6663, 6669, 6692, 6698, 6707, 6713, 6724, - 6730, 6739, 6745, 6765, 6771, 6780, 6786, 6797, - 6803, 6812, 6818, 6843, 6849, 6858, 6864, 6875, - 6881, 6890, 6896, 6916, 6922, 6931, 6937, 6948, - 6954, 6963, 6969, 6833, 6839, 6848, 6854, 6865, - 6871, 6880, 6886, 6906, 6912, 6921, 6927, 6938, - 6944, 6953, 6959, 6984, 6990, 6999, 7005, 7016, - 7022, 7031, 7037, 7057, 7063, 7072, 7078, 7089, - 7095, 7104, 7110, 7133, 7139, 7148, 7154, 7165, - 7171, 7180, 7186, 7206, 7212, 7221, 7227, 7238, - 7244, 7253, 7259, 7284, 7290, 7299, 7305, 7316, - 7322, 7331, 7337, 7357, 7363, 7372, 7378, 7389, - 7395, 7404, 7410, 7205, 7211, 7220, 7226, 7237, - 7243, 7252, 7258, 7278, 7284, 7293, 7299, 7310, - 7316, 7325, 7331, 7356, 7362, 7371, 7377, 7388, - 7394, 7403, 7409, 7429, 7435, 7444, 7450, 7461, - 7467, 7476, 7482, 7505, 7511, 7520, 7526, 7537, - 7543, 7552, 7558, 7578, 7584, 7593, 7599, 7610, - 7616, 7625, 7631, 7656, 7662, 7671, 7677, 7688, - 7694, 7703, 7709, 7729, 7735, 7744, 7750, 7761 -}; + 0, 256, 256, 256, 256, 432, 618, 630, 731, 640, 640, 828, + 901, 948, 1021, 1101, 1174, 1221, 1294, 1042, 1085, 1115, 1158, 1202, + 1245, 1275, 1318, 1337, 1380, 1410, 1453, 1497, 1540, 1570, 1613, 1280, + 1295, 1317, 1332, 1358, 1373, 1395, 1410, 1454, 1469, 1491, 1506, 1532, + 1547, 1569, 1584, 1601, 1616, 1638, 1653, 1679, 1694, 1716, 1731, 1775, + 1790, 1812, 1827, 1853, 1868, 1890, 1905, 1727, 1733, 1742, 1748, 1759, + 1765, 1774, 1780, 1800, 1806, 1815, 1821, 1832, 1838, 1847, 1853, 1878, + 1884, 1893, 1899, 1910, 1916, 1925, 1931, 1951, 1957, 1966, 1972, 1983, + 1989, 1998, 2004, 2027, 2033, 2042, 2048, 2059, 2065, 2074, 2080, 2100, + 2106, 2115, 2121, 2132, 2138, 2147, 2153, 2178, 2184, 2193, 2199, 2210, + 2216, 2225, 2231, 2251, 2257, 2266, 2272, 2283, 2289, 2298, 2304, 2168, + 2174, 2183, 2189, 2200, 2206, 2215, 2221, 2241, 2247, 2256, 2262, 2273, + 2279, 2288, 2294, 2319, 2325, 2334, 2340, 2351, 2357, 2366, 2372, 2392, + 2398, 2407, 2413, 2424, 2430, 2439, 2445, 2468, 2474, 2483, 2489, 2500, + 2506, 2515, 2521, 2541, 2547, 2556, 2562, 2573, 2579, 2588, 2594, 2619, + 2625, 2634, 2640, 2651, 2657, 2666, 2672, 2692, 2698, 2707, 2713, 2724, + 2730, 2739, 2745, 2540, 2546, 2555, 2561, 2572, 2578, 2587, 2593, 2613, + 2619, 2628, 2634, 2645, 2651, 2660, 2666, 2691, 2697, 2706, 2712, 2723, + 2729, 2738, 2744, 2764, 2770, 2779, 2785, 2796, 2802, 2811, 2817, 2840, + 2846, 2855, 2861, 2872, 2878, 2887, 2893, 2913, 2919, 2928, 2934, 2945, + 2951, 2960, 2966, 2991, 2997, 3006, 3012, 3023, 3029, 3038, 3044, 3064, + 3070, 3079, 3085, 3096, 3102, 3111, 3117, 2981, 2987, 2996, 3002, 3013, + 3019, 3028, 3034, 3054, 3060, 3069, 3075, 3086, 3092, 3101, 3107, 3132, + 3138, 3147, 3153, 3164, 3170, 3179, 3185, 3205, 3211, 3220, 3226, 3237, + 3243, 3252, 3258, 3281, 3287, 3296, 3302, 3313, 3319, 3328, 3334, 3354, + 3360, 3369, 3375, 3386, 3392, 3401, 3407, 3432, 3438, 3447, 3453, 3464, + 3470, 3479, 3485, 3505, 3511, 3520, 3526, 3537, 3543, 3552, 3558, 2816, + 2822, 2831, 2837, 2848, 2854, 2863, 2869, 2889, 2895, 2904, 2910, 2921, + 2927, 2936, 2942, 2967, 2973, 2982, 2988, 2999, 3005, 3014, 3020, 3040, + 3046, 3055, 3061, 3072, 3078, 3087, 3093, 3116, 3122, 3131, 3137, 3148, + 3154, 3163, 3169, 3189, 3195, 3204, 3210, 3221, 3227, 3236, 3242, 3267, + 3273, 3282, 3288, 3299, 3305, 3314, 3320, 3340, 3346, 3355, 3361, 3372, + 3378, 3387, 3393, 3257, 3263, 3272, 3278, 3289, 3295, 3304, 3310, 3330, + 3336, 3345, 3351, 3362, 3368, 3377, 3383, 3408, 3414, 3423, 3429, 3440, + 3446, 3455, 3461, 3481, 3487, 3496, 3502, 3513, 3519, 3528, 3534, 3557, + 3563, 3572, 3578, 3589, 3595, 3604, 3610, 3630, 3636, 3645, 3651, 3662, + 3668, 3677, 3683, 3708, 3714, 3723, 3729, 3740, 3746, 3755, 3761, 3781, + 3787, 3796, 3802, 3813, 3819, 3828, 3834, 3629, 3635, 3644, 3650, 3661, + 3667, 3676, 3682, 3702, 3708, 3717, 3723, 3734, 3740, 3749, 3755, 3780, + 3786, 3795, 3801, 3812, 3818, 3827, 3833, 3853, 3859, 3868, 3874, 3885, + 3891, 3900, 3906, 3929, 3935, 3944, 3950, 3961, 3967, 3976, 3982, 4002, + 4008, 4017, 4023, 4034, 4040, 4049, 4055, 4080, 4086, 4095, 4101, 4112, + 4118, 4127, 4133, 4153, 4159, 4168, 4174, 4185, 4191, 4200, 4206, 4070, + 4076, 4085, 4091, 4102, 4108, 4117, 4123, 4143, 4149, 4158, 4164, 4175, + 4181, 4190, 4196, 4221, 4227, 4236, 4242, 4253, 4259, 4268, 4274, 4294, + 4300, 4309, 4315, 4326, 4332, 4341, 4347, 4370, 4376, 4385, 4391, 4402, + 4408, 4417, 4423, 4443, 4449, 4458, 4464, 4475, 4481, 4490, 4496, 4521, + 4527, 4536, 4542, 4553, 4559, 4568, 4574, 4594, 4600, 4609, 4615, 4626, + 4632, 4641, 4647, 3515, 3521, 3530, 3536, 3547, 3553, 3562, 3568, 3588, + 3594, 3603, 3609, 3620, 3626, 3635, 3641, 3666, 3672, 3681, 3687, 3698, + 3704, 3713, 3719, 3739, 3745, 3754, 3760, 3771, 3777, 3786, 3792, 3815, + 3821, 3830, 3836, 3847, 3853, 3862, 3868, 3888, 3894, 3903, 3909, 3920, + 3926, 3935, 3941, 3966, 3972, 3981, 3987, 3998, 4004, 4013, 4019, 4039, + 4045, 4054, 4060, 4071, 4077, 4086, 4092, 3956, 3962, 3971, 3977, 3988, + 3994, 4003, 4009, 4029, 4035, 4044, 4050, 4061, 4067, 4076, 4082, 4107, + 4113, 4122, 4128, 4139, 4145, 4154, 4160, 4180, 4186, 4195, 4201, 4212, + 4218, 4227, 4233, 4256, 4262, 4271, 4277, 4288, 4294, 4303, 4309, 4329, + 4335, 4344, 4350, 4361, 4367, 4376, 4382, 4407, 4413, 4422, 4428, 4439, + 4445, 4454, 4460, 4480, 4486, 4495, 4501, 4512, 4518, 4527, 4533, 4328, + 4334, 4343, 4349, 4360, 4366, 4375, 4381, 4401, 4407, 4416, 4422, 4433, + 4439, 4448, 4454, 4479, 4485, 4494, 4500, 4511, 4517, 4526, 4532, 4552, + 4558, 4567, 4573, 4584, 4590, 4599, 4605, 4628, 4634, 4643, 4649, 4660, + 4666, 4675, 4681, 4701, 4707, 4716, 4722, 4733, 4739, 4748, 4754, 4779, + 4785, 4794, 4800, 4811, 4817, 4826, 4832, 4852, 4858, 4867, 4873, 4884, + 4890, 4899, 4905, 4769, 4775, 4784, 4790, 4801, 4807, 4816, 4822, 4842, + 4848, 4857, 4863, 4874, 4880, 4889, 4895, 4920, 4926, 4935, 4941, 4952, + 4958, 4967, 4973, 4993, 4999, 5008, 5014, 5025, 5031, 5040, 5046, 5069, + 5075, 5084, 5090, 5101, 5107, 5116, 5122, 5142, 5148, 5157, 5163, 5174, + 5180, 5189, 5195, 5220, 5226, 5235, 5241, 5252, 5258, 5267, 5273, 5293, + 5299, 5308, 5314, 5325, 5331, 5340, 5346, 4604, 4610, 4619, 4625, 4636, + 4642, 4651, 4657, 4677, 4683, 4692, 4698, 4709, 4715, 4724, 4730, 4755, + 4761, 4770, 4776, 4787, 4793, 4802, 4808, 4828, 4834, 4843, 4849, 4860, + 4866, 4875, 4881, 4904, 4910, 4919, 4925, 4936, 4942, 4951, 4957, 4977, + 4983, 4992, 4998, 5009, 5015, 5024, 5030, 5055, 5061, 5070, 5076, 5087, + 5093, 5102, 5108, 5128, 5134, 5143, 5149, 5160, 5166, 5175, 5181, 5045, + 5051, 5060, 5066, 5077, 5083, 5092, 5098, 5118, 5124, 5133, 5139, 5150, + 5156, 5165, 5171, 5196, 5202, 5211, 5217, 5228, 5234, 5243, 5249, 5269, + 5275, 5284, 5290, 5301, 5307, 5316, 5322, 5345, 5351, 5360, 5366, 5377, + 5383, 5392, 5398, 5418, 5424, 5433, 5439, 5450, 5456, 5465, 5471, 5496, + 5502, 5511, 5517, 5528, 5534, 5543, 5549, 5569, 5575, 5584, 5590, 5601, + 5607, 5616, 5622, 5417, 5423, 5432, 5438, 5449, 5455, 5464, 5470, 5490, + 5496, 5505, 5511, 5522, 5528, 5537, 5543, 5568, 5574, 5583, 5589, 5600, + 5606, 5615, 5621, 5641, 5647, 5656, 5662, 5673, 5679, 5688, 5694, 5717, + 5723, 5732, 5738, 5749, 5755, 5764, 5770, 5790, 5796, 5805, 5811, 5822, + 5828, 5837, 5843, 5868, 5874, 5883, 5889, 5900, 5906, 5915, 5921, 5941, + 5947, 5956, 5962, 5973, 5979, 5988, 5994, 5858, 5864, 5873, 5879, 5890, + 5896, 5905, 5911, 5931, 5937, 5946, 5952, 5963, 5969, 5978, 5984, 6009, + 6015, 6024, 6030, 6041, 6047, 6056, 6062, 6082, 6088, 6097, 6103, 6114, + 6120, 6129, 6135, 6158, 6164, 6173, 6179, 6190, 6196, 6205, 6211, 6231, + 6237, 6246, 6252, 6263, 6269, 6278, 6284, 6309, 6315, 6324, 6330, 6341, + 6347, 6356, 6362, 6382, 6388, 6397, 6403, 6414, 6420, 6429, 6435, 3515, + 3521, 3530, 3536, 3547, 3553, 3562, 3568, 3588, 3594, 3603, 3609, 3620, + 3626, 3635, 3641, 3666, 3672, 3681, 3687, 3698, 3704, 3713, 3719, 3739, + 3745, 3754, 3760, 3771, 3777, 3786, 3792, 3815, 3821, 3830, 3836, 3847, + 3853, 3862, 3868, 3888, 3894, 3903, 3909, 3920, 3926, 3935, 3941, 3966, + 3972, 3981, 3987, 3998, 4004, 4013, 4019, 4039, 4045, 4054, 4060, 4071, + 4077, 4086, 4092, 3956, 3962, 3971, 3977, 3988, 3994, 4003, 4009, 4029, + 4035, 4044, 4050, 4061, 4067, 4076, 4082, 4107, 4113, 4122, 4128, 4139, + 4145, 4154, 4160, 4180, 4186, 4195, 4201, 4212, 4218, 4227, 4233, 4256, + 4262, 4271, 4277, 4288, 4294, 4303, 4309, 4329, 4335, 4344, 4350, 4361, + 4367, 4376, 4382, 4407, 4413, 4422, 4428, 4439, 4445, 4454, 4460, 4480, + 4486, 4495, 4501, 4512, 4518, 4527, 4533, 4328, 4334, 4343, 4349, 4360, + 4366, 4375, 4381, 4401, 4407, 4416, 4422, 4433, 4439, 4448, 4454, 4479, + 4485, 4494, 4500, 4511, 4517, 4526, 4532, 4552, 4558, 4567, 4573, 4584, + 4590, 4599, 4605, 4628, 4634, 4643, 4649, 4660, 4666, 4675, 4681, 4701, + 4707, 4716, 4722, 4733, 4739, 4748, 4754, 4779, 4785, 4794, 4800, 4811, + 4817, 4826, 4832, 4852, 4858, 4867, 4873, 4884, 4890, 4899, 4905, 4769, + 4775, 4784, 4790, 4801, 4807, 4816, 4822, 4842, 4848, 4857, 4863, 4874, + 4880, 4889, 4895, 4920, 4926, 4935, 4941, 4952, 4958, 4967, 4973, 4993, + 4999, 5008, 5014, 5025, 5031, 5040, 5046, 5069, 5075, 5084, 5090, 5101, + 5107, 5116, 5122, 5142, 5148, 5157, 5163, 5174, 5180, 5189, 5195, 5220, + 5226, 5235, 5241, 5252, 5258, 5267, 5273, 5293, 5299, 5308, 5314, 5325, + 5331, 5340, 5346, 4604, 4610, 4619, 4625, 4636, 4642, 4651, 4657, 4677, + 4683, 4692, 4698, 4709, 4715, 4724, 4730, 4755, 4761, 4770, 4776, 4787, + 4793, 4802, 4808, 4828, 4834, 4843, 4849, 4860, 4866, 4875, 4881, 4904, + 4910, 4919, 4925, 4936, 4942, 4951, 4957, 4977, 4983, 4992, 4998, 5009, + 5015, 5024, 5030, 5055, 5061, 5070, 5076, 5087, 5093, 5102, 5108, 5128, + 5134, 5143, 5149, 5160, 5166, 5175, 5181, 5045, 5051, 5060, 5066, 5077, + 5083, 5092, 5098, 5118, 5124, 5133, 5139, 5150, 5156, 5165, 5171, 5196, + 5202, 5211, 5217, 5228, 5234, 5243, 5249, 5269, 5275, 5284, 5290, 5301, + 5307, 5316, 5322, 5345, 5351, 5360, 5366, 5377, 5383, 5392, 5398, 5418, + 5424, 5433, 5439, 5450, 5456, 5465, 5471, 5496, 5502, 5511, 5517, 5528, + 5534, 5543, 5549, 5569, 5575, 5584, 5590, 5601, 5607, 5616, 5622, 5417, + 5423, 5432, 5438, 5449, 5455, 5464, 5470, 5490, 5496, 5505, 5511, 5522, + 5528, 5537, 5543, 5568, 5574, 5583, 5589, 5600, 5606, 5615, 5621, 5641, + 5647, 5656, 5662, 5673, 5679, 5688, 5694, 5717, 5723, 5732, 5738, 5749, + 5755, 5764, 5770, 5790, 5796, 5805, 5811, 5822, 5828, 5837, 5843, 5868, + 5874, 5883, 5889, 5900, 5906, 5915, 5921, 5941, 5947, 5956, 5962, 5973, + 5979, 5988, 5994, 5858, 5864, 5873, 5879, 5890, 5896, 5905, 5911, 5931, + 5937, 5946, 5952, 5963, 5969, 5978, 5984, 6009, 6015, 6024, 6030, 6041, + 6047, 6056, 6062, 6082, 6088, 6097, 6103, 6114, 6120, 6129, 6135, 6158, + 6164, 6173, 6179, 6190, 6196, 6205, 6211, 6231, 6237, 6246, 6252, 6263, + 6269, 6278, 6284, 6309, 6315, 6324, 6330, 6341, 6347, 6356, 6362, 6382, + 6388, 6397, 6403, 6414, 6420, 6429, 6435, 5303, 5309, 5318, 5324, 5335, + 5341, 5350, 5356, 5376, 5382, 5391, 5397, 5408, 5414, 5423, 5429, 5454, + 5460, 5469, 5475, 5486, 5492, 5501, 5507, 5527, 5533, 5542, 5548, 5559, + 5565, 5574, 5580, 5603, 5609, 5618, 5624, 5635, 5641, 5650, 5656, 5676, + 5682, 5691, 5697, 5708, 5714, 5723, 5729, 5754, 5760, 5769, 5775, 5786, + 5792, 5801, 5807, 5827, 5833, 5842, 5848, 5859, 5865, 5874, 5880, 5744, + 5750, 5759, 5765, 5776, 5782, 5791, 5797, 5817, 5823, 5832, 5838, 5849, + 5855, 5864, 5870, 5895, 5901, 5910, 5916, 5927, 5933, 5942, 5948, 5968, + 5974, 5983, 5989, 6000, 6006, 6015, 6021, 6044, 6050, 6059, 6065, 6076, + 6082, 6091, 6097, 6117, 6123, 6132, 6138, 6149, 6155, 6164, 6170, 6195, + 6201, 6210, 6216, 6227, 6233, 6242, 6248, 6268, 6274, 6283, 6289, 6300, + 6306, 6315, 6321, 6116, 6122, 6131, 6137, 6148, 6154, 6163, 6169, 6189, + 6195, 6204, 6210, 6221, 6227, 6236, 6242, 6267, 6273, 6282, 6288, 6299, + 6305, 6314, 6320, 6340, 6346, 6355, 6361, 6372, 6378, 6387, 6393, 6416, + 6422, 6431, 6437, 6448, 6454, 6463, 6469, 6489, 6495, 6504, 6510, 6521, + 6527, 6536, 6542, 6567, 6573, 6582, 6588, 6599, 6605, 6614, 6620, 6640, + 6646, 6655, 6661, 6672, 6678, 6687, 6693, 6557, 6563, 6572, 6578, 6589, + 6595, 6604, 6610, 6630, 6636, 6645, 6651, 6662, 6668, 6677, 6683, 6708, + 6714, 6723, 6729, 6740, 6746, 6755, 6761, 6781, 6787, 6796, 6802, 6813, + 6819, 6828, 6834, 6857, 6863, 6872, 6878, 6889, 6895, 6904, 6910, 6930, + 6936, 6945, 6951, 6962, 6968, 6977, 6983, 7008, 7014, 7023, 7029, 7040, + 7046, 7055, 7061, 7081, 7087, 7096, 7102, 7113, 7119, 7128, 7134, 6392, + 6398, 6407, 6413, 6424, 6430, 6439, 6445, 6465, 6471, 6480, 6486, 6497, + 6503, 6512, 6518, 6543, 6549, 6558, 6564, 6575, 6581, 6590, 6596, 6616, + 6622, 6631, 6637, 6648, 6654, 6663, 6669, 6692, 6698, 6707, 6713, 6724, + 6730, 6739, 6745, 6765, 6771, 6780, 6786, 6797, 6803, 6812, 6818, 6843, + 6849, 6858, 6864, 6875, 6881, 6890, 6896, 6916, 6922, 6931, 6937, 6948, + 6954, 6963, 6969, 6833, 6839, 6848, 6854, 6865, 6871, 6880, 6886, 6906, + 6912, 6921, 6927, 6938, 6944, 6953, 6959, 6984, 6990, 6999, 7005, 7016, + 7022, 7031, 7037, 7057, 7063, 7072, 7078, 7089, 7095, 7104, 7110, 7133, + 7139, 7148, 7154, 7165, 7171, 7180, 7186, 7206, 7212, 7221, 7227, 7238, + 7244, 7253, 7259, 7284, 7290, 7299, 7305, 7316, 7322, 7331, 7337, 7357, + 7363, 7372, 7378, 7389, 7395, 7404, 7410, 7205, 7211, 7220, 7226, 7237, + 7243, 7252, 7258, 7278, 7284, 7293, 7299, 7310, 7316, 7325, 7331, 7356, + 7362, 7371, 7377, 7388, 7394, 7403, 7409, 7429, 7435, 7444, 7450, 7461, + 7467, 7476, 7482, 7505, 7511, 7520, 7526, 7537, 7543, 7552, 7558, 7578, + 7584, 7593, 7599, 7610, 7616, 7625, 7631, 7656, 7662, 7671, 7677, 7688, + 7694, 7703, 7709, 7729, 7735, 7744, 7750, 7761}; //------------------------------------------------------------------------------ // Tables for level coding const uint8_t VP8EncBands[16 + 1] = { - 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, - 0 // sentinel + 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 0 // sentinel }; //------------------------------------------------------------------------------ diff --git a/src/dsp/cost_mips32.c b/src/dsp/cost_mips32.c index 54586576..d7a06008 100644 --- a/src/dsp/cost_mips32.c +++ b/src/dsp/cost_mips32.c @@ -38,48 +38,48 @@ static int GetResidualCost_MIPS32(int ctx0, const VP8Residual* const res) { return VP8BitCost(0, p0); } - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "subu %[temp1], %[res_last], %[n] \n\t" - "sll %[temp0], %[n], 1 \n\t" - "blez %[temp1], 2f \n\t" - " addu %[res_coeffs], %[res_coeffs], %[temp0] \n\t" - "1: \n\t" - "lh %[v_reg], 0(%[res_coeffs]) \n\t" - "addiu %[n], %[n], 1 \n\t" - "negu %[temp0], %[v_reg] \n\t" - "slti %[temp1], %[v_reg], 0 \n\t" - "movn %[v_reg], %[temp0], %[temp1] \n\t" - "sltiu %[temp0], %[v_reg], 2 \n\t" - "move %[ctx_reg], %[v_reg] \n\t" - "movz %[ctx_reg], %[const_2], %[temp0] \n\t" - "sll %[temp1], %[v_reg], 1 \n\t" - "addu %[temp1], %[temp1], %[VP8LevelFixedCosts] \n\t" - "lhu %[temp1], 0(%[temp1]) \n\t" - "slt %[temp0], %[v_reg], %[const_max_level] \n\t" - "movz %[v_reg], %[const_max_level], %[temp0] \n\t" - "addu %[cost], %[cost], %[temp1] \n\t" - "sll %[v_reg], %[v_reg], 1 \n\t" - "sll %[ctx_reg], %[ctx_reg], 2 \n\t" - "addu %[v_reg], %[v_reg], %[t] \n\t" - "lhu %[temp0], 0(%[v_reg]) \n\t" - "addu %[p_costs], %[p_costs], %[inc_p_costs] \n\t" - "addu %[t], %[p_costs], %[ctx_reg] \n\t" - "addu %[cost], %[cost], %[temp0] \n\t" - "addiu %[res_coeffs], %[res_coeffs], 2 \n\t" - "bne %[n], %[res_last], 1b \n\t" - " lw %[t], 0(%[t]) \n\t" - "2: \n\t" - ".set pop \n\t" - : [cost]"+&r"(cost), [t]"+&r"(t), [n]"+&r"(n), [v_reg]"=&r"(v_reg), - [ctx_reg]"=&r"(ctx_reg), [p_costs]"+&r"(p_costs), [temp0]"=&r"(temp0), - [temp1]"=&r"(temp1), [res_coeffs]"+&r"(res_coeffs) - : [const_2]"r"(const_2), [const_max_level]"r"(const_max_level), - [VP8LevelFixedCosts]"r"(VP8LevelFixedCosts), [res_last]"r"(res_last), - [inc_p_costs]"r"(inc_p_costs) - : "memory" - ); + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "subu %[temp1], %[res_last], %[n] \n\t" + "sll %[temp0], %[n], 1 \n\t" + "blez %[temp1], 2f \n\t" + " addu %[res_coeffs], %[res_coeffs], %[temp0] \n\t" + "1: \n\t" + "lh %[v_reg], 0(%[res_coeffs]) \n\t" + "addiu %[n], %[n], 1 \n\t" + "negu %[temp0], %[v_reg] \n\t" + "slti %[temp1], %[v_reg], 0 \n\t" + "movn %[v_reg], %[temp0], %[temp1] \n\t" + "sltiu %[temp0], %[v_reg], 2 \n\t" + "move %[ctx_reg], %[v_reg] \n\t" + "movz %[ctx_reg], %[const_2], %[temp0] \n\t" + "sll %[temp1], %[v_reg], 1 \n\t" + "addu %[temp1], %[temp1], %[VP8LevelFixedCosts] \n\t" + "lhu %[temp1], 0(%[temp1]) \n\t" + "slt %[temp0], %[v_reg], %[const_max_level] \n\t" + "movz %[v_reg], %[const_max_level], %[temp0] \n\t" + "addu %[cost], %[cost], %[temp1] \n\t" + "sll %[v_reg], %[v_reg], 1 \n\t" + "sll %[ctx_reg], %[ctx_reg], 2 \n\t" + "addu %[v_reg], %[v_reg], %[t] \n\t" + "lhu %[temp0], 0(%[v_reg]) \n\t" + "addu %[p_costs], %[p_costs], %[inc_p_costs] \n\t" + "addu %[t], %[p_costs], %[ctx_reg] \n\t" + "addu %[cost], %[cost], %[temp0] \n\t" + "addiu %[res_coeffs], %[res_coeffs], 2 \n\t" + "bne %[n], %[res_last], 1b \n\t" + " lw %[t], 0(%[t]) \n\t" + "2: \n\t" + ".set pop \n\t" + : [cost] "+&r"(cost), [t] "+&r"(t), [n] "+&r"(n), [v_reg] "=&r"(v_reg), + [ctx_reg] "=&r"(ctx_reg), [p_costs] "+&r"(p_costs), + [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), + [res_coeffs] "+&r"(res_coeffs) + : [const_2] "r"(const_2), [const_max_level] "r"(const_max_level), + [VP8LevelFixedCosts] "r"(VP8LevelFixedCosts), [res_last] "r"(res_last), + [inc_p_costs] "r"(inc_p_costs) + : "memory"); // Last coefficient is always non-zero { @@ -102,37 +102,35 @@ static void SetResidualCoeffs_MIPS32(const int16_t* WEBP_RESTRICT const coeffs, int temp0, temp1, temp2, n, n1; assert(res->first == 0 || coeffs[0] == 0); - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "addiu %[p_coeffs], %[p_coeffs], 28 \n\t" - "li %[n], 15 \n\t" - "li %[temp2], -1 \n\t" - "0: \n\t" - "ulw %[temp0], 0(%[p_coeffs]) \n\t" - "beqz %[temp0], 1f \n\t" + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "addiu %[p_coeffs], %[p_coeffs], 28 \n\t" + "li %[n], 15 \n\t" + "li %[temp2], -1 \n\t" + "0: \n\t" + "ulw %[temp0], 0(%[p_coeffs]) \n\t" + "beqz %[temp0], 1f \n\t" #if defined(WORDS_BIGENDIAN) - " sll %[temp1], %[temp0], 16 \n\t" + " sll %[temp1], %[temp0], 16 \n\t" #else - " srl %[temp1], %[temp0], 16 \n\t" + " srl %[temp1], %[temp0], 16 \n\t" #endif - "addiu %[n1], %[n], -1 \n\t" - "movz %[temp0], %[n1], %[temp1] \n\t" - "movn %[temp0], %[n], %[temp1] \n\t" - "j 2f \n\t" - " addiu %[temp2], %[temp0], 0 \n\t" - "1: \n\t" - "addiu %[n], %[n], -2 \n\t" - "bgtz %[n], 0b \n\t" - " addiu %[p_coeffs], %[p_coeffs], -4 \n\t" - "2: \n\t" - ".set pop \n\t" - : [p_coeffs]"+&r"(p_coeffs), [temp0]"=&r"(temp0), - [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [n]"=&r"(n), [n1]"=&r"(n1) - : - : "memory" - ); + "addiu %[n1], %[n], -1 \n\t" + "movz %[temp0], %[n1], %[temp1] \n\t" + "movn %[temp0], %[n], %[temp1] \n\t" + "j 2f \n\t" + " addiu %[temp2], %[temp0], 0 \n\t" + "1: \n\t" + "addiu %[n], %[n], -2 \n\t" + "bgtz %[n], 0b \n\t" + " addiu %[p_coeffs], %[p_coeffs], -4 \n\t" + "2: \n\t" + ".set pop \n\t" + : [p_coeffs] "+&r"(p_coeffs), [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), + [temp2] "=&r"(temp2), [n] "=&r"(n), [n1] "=&r"(n1) + : + : "memory"); res->last = temp2; res->coeffs = coeffs; } diff --git a/src/dsp/cost_mips_dsp_r2.c b/src/dsp/cost_mips_dsp_r2.c index 51248de7..70d5a394 100644 --- a/src/dsp/cost_mips_dsp_r2.c +++ b/src/dsp/cost_mips_dsp_r2.c @@ -38,43 +38,44 @@ static int GetResidualCost_MIPSdspR2(int ctx0, const VP8Residual* const res) { return VP8BitCost(0, p0); } - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "subu %[temp1], %[res_last], %[n] \n\t" - "blez %[temp1], 2f \n\t" - " nop \n\t" - "1: \n\t" - "sll %[temp0], %[n], 1 \n\t" - "lhx %[v_reg], %[temp0](%[res_coeffs]) \n\t" - "addiu %[n], %[n], 1 \n\t" - "absq_s.w %[v_reg], %[v_reg] \n\t" - "sltiu %[temp0], %[v_reg], 2 \n\t" - "move %[ctx_reg], %[v_reg] \n\t" - "movz %[ctx_reg], %[const_2], %[temp0] \n\t" - "sll %[temp1], %[v_reg], 1 \n\t" - "lhx %[temp1], %[temp1](%[VP8LevelFixedCosts]) \n\t" - "slt %[temp0], %[v_reg], %[const_max_level] \n\t" - "movz %[v_reg], %[const_max_level], %[temp0] \n\t" - "addu %[cost], %[cost], %[temp1] \n\t" - "sll %[v_reg], %[v_reg], 1 \n\t" - "sll %[ctx_reg], %[ctx_reg], 2 \n\t" - "lhx %[temp0], %[v_reg](%[t]) \n\t" - "addu %[p_costs], %[p_costs], %[inc_p_costs] \n\t" - "addu %[t], %[p_costs], %[ctx_reg] \n\t" - "addu %[cost], %[cost], %[temp0] \n\t" - "bne %[n], %[res_last], 1b \n\t" - " lw %[t], 0(%[t]) \n\t" - "2: \n\t" - ".set pop \n\t" - : [cost]"+&r"(cost), [t]"+&r"(t), [n]"+&r"(n), [v_reg]"=&r"(v_reg), - [ctx_reg]"=&r"(ctx_reg), [p_costs]"+&r"(p_costs), [temp0]"=&r"(temp0), - [temp1]"=&r"(temp1) - : [const_2]"r"(const_2), [const_max_level]"r"(const_max_level), - [VP8LevelFixedCosts]"r"(VP8LevelFixedCosts), [res_last]"r"(res_last), - [res_coeffs]"r"(res_coeffs), [inc_p_costs]"r"(inc_p_costs) - : "memory" - ); + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "subu %[temp1], %[res_last], %[n] \n\t" + "blez %[temp1], 2f \n\t" + " nop \n\t" + "1: " + "\n\t" + "sll %[temp0], %[n], 1 \n\t" + "lhx %[v_reg], %[temp0](%[res_coeffs]) \n\t" + "addiu %[n], %[n], 1 \n\t" + "absq_s.w %[v_reg], %[v_reg] \n\t" + "sltiu %[temp0], %[v_reg], 2 \n\t" + "move %[ctx_reg], %[v_reg] \n\t" + "movz %[ctx_reg], %[const_2], %[temp0] \n\t" + "sll %[temp1], %[v_reg], 1 \n\t" + "lhx %[temp1], %[temp1](%[VP8LevelFixedCosts]) \n\t" + "slt %[temp0], %[v_reg], %[const_max_level] \n\t" + "movz %[v_reg], %[const_max_level], %[temp0] \n\t" + "addu %[cost], %[cost], %[temp1] \n\t" + "sll %[v_reg], %[v_reg], 1 \n\t" + "sll %[ctx_reg], %[ctx_reg], 2 \n\t" + "lhx %[temp0], %[v_reg](%[t]) \n\t" + "addu %[p_costs], %[p_costs], %[inc_p_costs] \n\t" + "addu %[t], %[p_costs], %[ctx_reg] \n\t" + "addu %[cost], %[cost], %[temp0] \n\t" + "bne %[n], %[res_last], 1b \n\t" + " lw %[t], 0(%[t]) \n\t" + "2: " + "\n\t" + ".set pop \n\t" + : [cost] "+&r"(cost), [t] "+&r"(t), [n] "+&r"(n), [v_reg] "=&r"(v_reg), + [ctx_reg] "=&r"(ctx_reg), [p_costs] "+&r"(p_costs), + [temp0] "=&r"(temp0), [temp1] "=&r"(temp1) + : [const_2] "r"(const_2), [const_max_level] "r"(const_max_level), + [VP8LevelFixedCosts] "r"(VP8LevelFixedCosts), [res_last] "r"(res_last), + [res_coeffs] "r"(res_coeffs), [inc_p_costs] "r"(inc_p_costs) + : "memory"); // Last coefficient is always non-zero { diff --git a/src/dsp/cost_neon.c b/src/dsp/cost_neon.c index e1bf3657..1effbf05 100644 --- a/src/dsp/cost_neon.c +++ b/src/dsp/cost_neon.c @@ -16,8 +16,8 @@ #include "src/dsp/neon.h" #include "src/enc/cost_enc.h" -static const uint8_t position[16] = { 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16 }; +static const uint8_t position[16] = {1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16}; static void SetResidualCoeffs_NEON(const int16_t* WEBP_RESTRICT const coeffs, VP8Residual* WEBP_RESTRICT const res) { @@ -65,7 +65,7 @@ static int GetResidualCost_NEON(int ctx0, const VP8Residual* const res) { return VP8BitCost(0, p0); } - { // precompute clamped levels and contexts, packed to 8b. + { // precompute clamped levels and contexts, packed to 8b. const uint8x16_t kCst2 = vdupq_n_u8(2); const uint8x16_t kCst67 = vdupq_n_u8(MAX_VARIABLE_LEVEL); const int16x8_t c0 = vld1q_s16(res->coeffs); @@ -85,7 +85,7 @@ static int GetResidualCost_NEON(int ctx0, const VP8Residual* const res) { for (; n < res->last; ++n) { const int ctx = ctxs[n]; const int level = levels[n]; - const int flevel = abs_levels[n]; // full level + const int flevel = abs_levels[n]; // full level cost += VP8LevelFixedCosts[flevel] + t[level]; // simplified VP8LevelCost() t = costs[n + 1][ctx]; } diff --git a/src/dsp/cost_sse2.c b/src/dsp/cost_sse2.c index 2fc3c1c0..68dfbeb3 100644 --- a/src/dsp/cost_sse2.c +++ b/src/dsp/cost_sse2.c @@ -14,15 +14,14 @@ #include "src/dsp/dsp.h" #if defined(WEBP_USE_SSE2) +#include #include -#include - -#include "src/webp/types.h" #include "src/dsp/cpu.h" #include "src/enc/cost_enc.h" #include "src/enc/vp8i_enc.h" #include "src/utils/utils.h" +#include "src/webp/types.h" //------------------------------------------------------------------------------ @@ -63,7 +62,7 @@ static int GetResidualCost_SSE2(int ctx0, const VP8Residual* const res) { return VP8BitCost(0, p0); } - { // precompute clamped levels and contexts, packed to 8b. + { // precompute clamped levels and contexts, packed to 8b. const __m128i zero = _mm_setzero_si128(); const __m128i kCst2 = _mm_set1_epi8(2); const __m128i kCst67 = _mm_set1_epi8(MAX_VARIABLE_LEVEL); @@ -71,11 +70,11 @@ static int GetResidualCost_SSE2(int ctx0, const VP8Residual* const res) { const __m128i c1 = _mm_loadu_si128((const __m128i*)&res->coeffs[8]); const __m128i D0 = _mm_sub_epi16(zero, c0); const __m128i D1 = _mm_sub_epi16(zero, c1); - const __m128i E0 = _mm_max_epi16(c0, D0); // abs(v), 16b + const __m128i E0 = _mm_max_epi16(c0, D0); // abs(v), 16b const __m128i E1 = _mm_max_epi16(c1, D1); const __m128i F = _mm_packs_epi16(E0, E1); - const __m128i G = _mm_min_epu8(F, kCst2); // context = 0,1,2 - const __m128i H = _mm_min_epu8(F, kCst67); // clamp_level in [0..67] + const __m128i G = _mm_min_epu8(F, kCst2); // context = 0,1,2 + const __m128i H = _mm_min_epu8(F, kCst67); // clamp_level in [0..67] _mm_storeu_si128((__m128i*)&ctxs[0], G); _mm_storeu_si128((__m128i*)&levels[0], H); @@ -86,7 +85,7 @@ static int GetResidualCost_SSE2(int ctx0, const VP8Residual* const res) { for (; n < res->last; ++n) { const int ctx = ctxs[n]; const int level = levels[n]; - const int flevel = abs_levels[n]; // full level + const int flevel = abs_levels[n]; // full level cost += VP8LevelFixedCosts[flevel] + t[level]; // simplified VP8LevelCost() t = costs[n + 1][ctx]; } diff --git a/src/dsp/cpu.c b/src/dsp/cpu.c index 816892fb..ad50cc2c 100644 --- a/src/dsp/cpu.c +++ b/src/dsp/cpu.c @@ -33,19 +33,20 @@ // apple/darwin gcc-4.0.1 defines __PIC__, but not __pic__ with -fPIC. #if (defined(__pic__) || defined(__PIC__)) && defined(__i386__) static WEBP_INLINE void GetCPUInfo(int cpu_info[4], int info_type) { - __asm__ volatile ( - "mov %%ebx, %%edi\n" - "cpuid\n" - "xchg %%edi, %%ebx\n" - : "=a"(cpu_info[0]), "=D"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3]) - : "a"(info_type), "c"(0)); + __asm__ volatile( + "mov %%ebx, %%edi\n" + "cpuid\n" + "xchg %%edi, %%ebx\n" + : "=a"(cpu_info[0]), "=D"(cpu_info[1]), "=c"(cpu_info[2]), + "=d"(cpu_info[3]) + : "a"(info_type), "c"(0)); } #elif defined(__i386__) || defined(__x86_64__) static WEBP_INLINE void GetCPUInfo(int cpu_info[4], int info_type) { - __asm__ volatile ( - "cpuid\n" - : "=a"(cpu_info[0]), "=b"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3]) - : "a"(info_type), "c"(0)); + __asm__ volatile("cpuid\n" + : "=a"(cpu_info[0]), "=b"(cpu_info[1]), "=c"(cpu_info[2]), + "=d"(cpu_info[3]) + : "a"(info_type), "c"(0)); } #elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) @@ -67,13 +68,13 @@ static WEBP_INLINE uint64_t xgetbv(void) { const uint32_t ecx = 0; uint32_t eax, edx; // Use the raw opcode for xgetbv for compatibility with older toolchains. - __asm__ volatile ( - ".byte 0x0f, 0x01, 0xd0\n" - : "=a"(eax), "=d"(edx) : "c" (ecx)); + __asm__ volatile(".byte 0x0f, 0x01, 0xd0\n" + : "=a"(eax), "=d"(edx) + : "c"(ecx)); return ((uint64_t)edx << 32) | eax; } -#elif (defined(_M_X64) || defined(_M_IX86)) && \ - defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 160040219 // >= VS2010 SP1 +#elif (defined(_M_X64) || defined(_M_IX86)) && defined(_MSC_FULL_VER) && \ + _MSC_FULL_VER >= 160040219 // >= VS2010 SP1 #include #define xgetbv() _xgetbv(0) #elif defined(_MSC_VER) && defined(_M_IX86) @@ -100,8 +101,8 @@ static int CheckSlowModel(int info) { // (ie 2 cycles vs 10/16 cycles) and some SSSE3 instructions like pshufb. // Refer to Intel 64 and IA-32 Architectures Optimization Reference Manual. static const uint8_t kSlowModels[] = { - 0x37, 0x4a, 0x4d, // Silvermont Microarchitecture - 0x1c, 0x26, 0x27 // Atom Microarchitecture + 0x37, 0x4a, 0x4d, // Silvermont Microarchitecture + 0x1c, 0x26, 0x27 // Atom Microarchitecture }; const uint32_t model = ((info & 0xf0000) >> 12) | ((info >> 4) & 0xf); const uint32_t family = (info >> 8) & 0xf; @@ -130,7 +131,7 @@ static int x86CPUInfo(CPUFeature feature) { const int VENDOR_ID_INTEL_ECX = 0x6c65746e; // letn is_intel = (cpu_info[1] == VENDOR_ID_INTEL_EBX && cpu_info[2] == VENDOR_ID_INTEL_ECX && - cpu_info[3] == VENDOR_ID_INTEL_EDX); // genuine Intel? + cpu_info[3] == VENDOR_ID_INTEL_EDX); // genuine Intel? } GetCPUInfo(cpu_info, 1); @@ -141,7 +142,7 @@ static int x86CPUInfo(CPUFeature feature) { return !!(cpu_info[2] & (1 << 0)); } if (feature == kSlowSSSE3) { - if (is_intel && (cpu_info[2] & (1 << 9))) { // SSSE3? + if (is_intel && (cpu_info[2] & (1 << 9))) { // SSSE3? return CheckSlowModel(cpu_info[0]); } return 0; @@ -179,7 +180,7 @@ static int AndroidCPUInfo(CPUFeature feature) { } WEBP_EXTERN VP8CPUInfo VP8GetCPUInfo; VP8CPUInfo VP8GetCPUInfo = AndroidCPUInfo; -#elif defined(EMSCRIPTEN) // also needs to be before generic NEON test +#elif defined(EMSCRIPTEN) // also needs to be before generic NEON test // Use compile flags as an indicator of SIMD support instead of a runtime check. static int wasmCPUInfo(CPUFeature feature) { switch (feature) { @@ -234,14 +235,13 @@ static int armCPUInfo(CPUFeature feature) { WEBP_EXTERN VP8CPUInfo VP8GetCPUInfo; VP8CPUInfo VP8GetCPUInfo = armCPUInfo; #elif defined(WEBP_USE_MIPS32) || defined(WEBP_USE_MIPS_DSP_R2) || \ - defined(WEBP_USE_MSA) + defined(WEBP_USE_MSA) static int mipsCPUInfo(CPUFeature feature) { if ((feature == kMIPS32) || (feature == kMIPSdspR2) || (feature == kMSA)) { return 1; } else { return 0; } - } WEBP_EXTERN VP8CPUInfo VP8GetCPUInfo; VP8CPUInfo VP8GetCPUInfo = mipsCPUInfo; diff --git a/src/dsp/cpu.h b/src/dsp/cpu.h index 7f87d7da..8dc0c0cb 100644 --- a/src/dsp/cpu.h +++ b/src/dsp/cpu.h @@ -119,7 +119,7 @@ // inclusion of arm64_neon.h; Visual Studio 2019 includes this file in // arm_neon.h. Compile errors were seen with Visual Studio 2019 16.4 with // vtbl4_u8(); a fix was made in 16.6. -#if defined(_MSC_VER) && \ +#if defined(_MSC_VER) && \ ((_MSC_VER >= 1700 && defined(_M_ARM)) || \ (_MSC_VER >= 1926 && (defined(_M_ARM64) || defined(_M_ARM64EC)))) #define WEBP_USE_NEON @@ -192,6 +192,7 @@ #if defined(WEBP_USE_THREAD) && !defined(_WIN32) #include // NOLINT +// clang-format off #define WEBP_DSP_INIT(func) \ do { \ static volatile VP8CPUInfo func##_last_cpuinfo_used = \ @@ -202,7 +203,9 @@ func##_last_cpuinfo_used = VP8GetCPUInfo; \ (void)pthread_mutex_unlock(&func##_lock); \ } while (0) -#else // !(defined(WEBP_USE_THREAD) && !defined(_WIN32)) +// clang-format on +#else // !(defined(WEBP_USE_THREAD) && !defined(_WIN32)) +// clang-format off #define WEBP_DSP_INIT(func) \ do { \ static volatile VP8CPUInfo func##_last_cpuinfo_used = \ @@ -211,6 +214,7 @@ func(); \ func##_last_cpuinfo_used = VP8GetCPUInfo; \ } while (0) +// clang-format on #endif // defined(WEBP_USE_THREAD) && !defined(_WIN32) // Defines an Init + helper function that control multiple initialization of diff --git a/src/dsp/dec.c b/src/dsp/dec.c index 4f383099..7a29fd2a 100644 --- a/src/dsp/dec.c +++ b/src/dsp/dec.c @@ -34,13 +34,14 @@ static WEBP_INLINE uint8_t clip_8b(int v) { #define STORE(x, y, v) \ dst[(x) + (y) * BPS] = clip_8b(dst[(x) + (y) * BPS] + ((v) >> 3)) -#define STORE2(y, dc, d, c) do { \ - const int DC = (dc); \ - STORE(0, y, DC + (d)); \ - STORE(1, y, DC + (c)); \ - STORE(2, y, DC - (c)); \ - STORE(3, y, DC - (d)); \ -} while (0) +#define STORE2(y, dc, d, c) \ + do { \ + const int DC = (dc); \ + STORE(0, y, DC + (d)); \ + STORE(1, y, DC + (c)); \ + STORE(2, y, DC - (c)); \ + STORE(3, y, DC - (d)); \ + } while (0) #if !WEBP_NEON_OMIT_C_CODE static void TransformOne_C(const int16_t* WEBP_RESTRICT in, @@ -48,17 +49,17 @@ static void TransformOne_C(const int16_t* WEBP_RESTRICT in, int C[4 * 4], *tmp; int i; tmp = C; - for (i = 0; i < 4; ++i) { // vertical pass - const int a = in[0] + in[8]; // [-4096, 4094] - const int b = in[0] - in[8]; // [-4095, 4095] + for (i = 0; i < 4; ++i) { // vertical pass + const int a = in[0] + in[8]; // [-4096, 4094] + const int b = in[0] - in[8]; // [-4095, 4095] const int c = WEBP_TRANSFORM_AC3_MUL2(in[4]) - WEBP_TRANSFORM_AC3_MUL1(in[12]); // [-3783, 3783] const int d = WEBP_TRANSFORM_AC3_MUL1(in[4]) + WEBP_TRANSFORM_AC3_MUL2(in[12]); // [-3785, 3781] - tmp[0] = a + d; // [-7881, 7875] - tmp[1] = b + c; // [-7878, 7878] - tmp[2] = b - c; // [-7878, 7878] - tmp[3] = a - d; // [-7877, 7879] + tmp[0] = a + d; // [-7881, 7875] + tmp[1] = b + c; // [-7878, 7878] + tmp[2] = b - c; // [-7878, 7878] + tmp[3] = a - d; // [-7877, 7879] tmp += 4; in++; } @@ -70,10 +71,10 @@ static void TransformOne_C(const int16_t* WEBP_RESTRICT in, // In the worst case scenario, the input to clip_8b() can be as large as // [-60713, 60968]. tmp = C; - for (i = 0; i < 4; ++i) { // horizontal pass + for (i = 0; i < 4; ++i) { // horizontal pass const int dc = tmp[0] + 4; - const int a = dc + tmp[8]; - const int b = dc - tmp[8]; + const int a = dc + tmp[8]; + const int b = dc - tmp[8]; const int c = WEBP_TRANSFORM_AC3_MUL2(tmp[4]) - WEBP_TRANSFORM_AC3_MUL1(tmp[12]); const int d = @@ -150,21 +151,21 @@ static void TransformWHT_C(const int16_t* WEBP_RESTRICT in, int i; for (i = 0; i < 4; ++i) { const int a0 = in[0 + i] + in[12 + i]; - const int a1 = in[4 + i] + in[ 8 + i]; - const int a2 = in[4 + i] - in[ 8 + i]; + const int a1 = in[4 + i] + in[8 + i]; + const int a2 = in[4 + i] - in[8 + i]; const int a3 = in[0 + i] - in[12 + i]; - tmp[0 + i] = a0 + a1; - tmp[8 + i] = a0 - a1; - tmp[4 + i] = a3 + a2; + tmp[0 + i] = a0 + a1; + tmp[8 + i] = a0 - a1; + tmp[4 + i] = a3 + a2; tmp[12 + i] = a3 - a2; } for (i = 0; i < 4; ++i) { - const int dc = tmp[0 + i * 4] + 3; // w/ rounder - const int a0 = dc + tmp[3 + i * 4]; + const int dc = tmp[0 + i * 4] + 3; // w/ rounder + const int a0 = dc + tmp[3 + i * 4]; const int a1 = tmp[1 + i * 4] + tmp[2 + i * 4]; const int a2 = tmp[1 + i * 4] - tmp[2 + i * 4]; - const int a3 = dc - tmp[3 + i * 4]; - out[ 0] = (a0 + a1) >> 3; + const int a3 = dc - tmp[3 + i * 4]; + out[0] = (a0 + a1) >> 3; out[16] = (a3 + a2) >> 3; out[32] = (a0 - a1) >> 3; out[48] = (a3 - a2) >> 3; @@ -194,21 +195,21 @@ static WEBP_INLINE void TrueMotion(uint8_t* dst, int size) { dst += BPS; } } -static void TM4_C(uint8_t* dst) { TrueMotion(dst, 4); } +static void TM4_C(uint8_t* dst) { TrueMotion(dst, 4); } static void TM8uv_C(uint8_t* dst) { TrueMotion(dst, 8); } -static void TM16_C(uint8_t* dst) { TrueMotion(dst, 16); } +static void TM16_C(uint8_t* dst) { TrueMotion(dst, 16); } //------------------------------------------------------------------------------ // 16x16 -static void VE16_C(uint8_t* dst) { // vertical +static void VE16_C(uint8_t* dst) { // vertical int j; for (j = 0; j < 16; ++j) { memcpy(dst + j * BPS, dst - BPS, 16); } } -static void HE16_C(uint8_t* dst) { // horizontal +static void HE16_C(uint8_t* dst) { // horizontal int j; for (j = 16; j > 0; --j) { memset(dst, dst[-1], 16); @@ -223,7 +224,7 @@ static WEBP_INLINE void Put16(int v, uint8_t* dst) { } } -static void DC16_C(uint8_t* dst) { // DC +static void DC16_C(uint8_t* dst) { // DC int DC = 16; int j; for (j = 0; j < 16; ++j) { @@ -232,7 +233,7 @@ static void DC16_C(uint8_t* dst) { // DC Put16(DC >> 5, dst); } -static void DC16NoTop_C(uint8_t* dst) { // DC with top samples not available +static void DC16NoTop_C(uint8_t* dst) { // DC with top samples not available int DC = 8; int j; for (j = 0; j < 16; ++j) { @@ -264,13 +265,13 @@ VP8PredFunc VP8PredLuma16[NUM_B_DC_MODES]; #define AVG2(a, b) (((a) + (b) + 1) >> 1) #if !WEBP_NEON_OMIT_C_CODE -static void VE4_C(uint8_t* dst) { // vertical +static void VE4_C(uint8_t* dst) { // vertical const uint8_t* top = dst - BPS; const uint8_t vals[4] = { - AVG3(top[-1], top[0], top[1]), - AVG3(top[ 0], top[1], top[2]), - AVG3(top[ 1], top[2], top[3]), - AVG3(top[ 2], top[3], top[4]) + AVG3(top[-1], top[0], top[1]), + AVG3(top[0], top[1], top[2]), + AVG3(top[1], top[2], top[3]), + AVG3(top[2], top[3], top[4]), }; int i; for (i = 0; i < 4; ++i) { @@ -279,7 +280,7 @@ static void VE4_C(uint8_t* dst) { // vertical } #endif // !WEBP_NEON_OMIT_C_CODE -static void HE4_C(uint8_t* dst) { // horizontal +static void HE4_C(uint8_t* dst) { // horizontal const int A = dst[-1 - BPS]; const int B = dst[-1]; const int C = dst[-1 + BPS]; @@ -292,7 +293,7 @@ static void HE4_C(uint8_t* dst) { // horizontal } #if !WEBP_NEON_OMIT_C_CODE -static void DC4_C(uint8_t* dst) { // DC +static void DC4_C(uint8_t* dst) { // DC uint32_t dc = 4; int i; for (i = 0; i < 4; ++i) dc += dst[i - BPS] + dst[-1 + i * BPS]; @@ -300,7 +301,7 @@ static void DC4_C(uint8_t* dst) { // DC for (i = 0; i < 4; ++i) memset(dst + i * BPS, dc, 4); } -static void RD4_C(uint8_t* dst) { // Down-right +static void RD4_C(uint8_t* dst) { // Down-right const int I = dst[-1 + 0 * BPS]; const int J = dst[-1 + 1 * BPS]; const int K = dst[-1 + 2 * BPS]; @@ -310,16 +311,16 @@ static void RD4_C(uint8_t* dst) { // Down-right const int B = dst[1 - BPS]; const int C = dst[2 - BPS]; const int D = dst[3 - BPS]; - DST(0, 3) = AVG3(J, K, L); - DST(1, 3) = DST(0, 2) = AVG3(I, J, K); - DST(2, 3) = DST(1, 2) = DST(0, 1) = AVG3(X, I, J); + DST(0, 3) = AVG3(J, K, L); + DST(1, 3) = DST(0, 2) = AVG3(I, J, K); + DST(2, 3) = DST(1, 2) = DST(0, 1) = AVG3(X, I, J); DST(3, 3) = DST(2, 2) = DST(1, 1) = DST(0, 0) = AVG3(A, X, I); - DST(3, 2) = DST(2, 1) = DST(1, 0) = AVG3(B, A, X); - DST(3, 1) = DST(2, 0) = AVG3(C, B, A); - DST(3, 0) = AVG3(D, C, B); + DST(3, 2) = DST(2, 1) = DST(1, 0) = AVG3(B, A, X); + DST(3, 1) = DST(2, 0) = AVG3(C, B, A); + DST(3, 0) = AVG3(D, C, B); } -static void LD4_C(uint8_t* dst) { // Down-Left +static void LD4_C(uint8_t* dst) { // Down-Left const int A = dst[0 - BPS]; const int B = dst[1 - BPS]; const int C = dst[2 - BPS]; @@ -328,17 +329,17 @@ static void LD4_C(uint8_t* dst) { // Down-Left const int F = dst[5 - BPS]; const int G = dst[6 - BPS]; const int H = dst[7 - BPS]; - DST(0, 0) = AVG3(A, B, C); - DST(1, 0) = DST(0, 1) = AVG3(B, C, D); - DST(2, 0) = DST(1, 1) = DST(0, 2) = AVG3(C, D, E); + DST(0, 0) = AVG3(A, B, C); + DST(1, 0) = DST(0, 1) = AVG3(B, C, D); + DST(2, 0) = DST(1, 1) = DST(0, 2) = AVG3(C, D, E); DST(3, 0) = DST(2, 1) = DST(1, 2) = DST(0, 3) = AVG3(D, E, F); - DST(3, 1) = DST(2, 2) = DST(1, 3) = AVG3(E, F, G); - DST(3, 2) = DST(2, 3) = AVG3(F, G, H); - DST(3, 3) = AVG3(G, H, H); + DST(3, 1) = DST(2, 2) = DST(1, 3) = AVG3(E, F, G); + DST(3, 2) = DST(2, 3) = AVG3(F, G, H); + DST(3, 3) = AVG3(G, H, H); } #endif // !WEBP_NEON_OMIT_C_CODE -static void VR4_C(uint8_t* dst) { // Vertical-Right +static void VR4_C(uint8_t* dst) { // Vertical-Right const int I = dst[-1 + 0 * BPS]; const int J = dst[-1 + 1 * BPS]; const int K = dst[-1 + 2 * BPS]; @@ -350,17 +351,17 @@ static void VR4_C(uint8_t* dst) { // Vertical-Right DST(0, 0) = DST(1, 2) = AVG2(X, A); DST(1, 0) = DST(2, 2) = AVG2(A, B); DST(2, 0) = DST(3, 2) = AVG2(B, C); - DST(3, 0) = AVG2(C, D); + DST(3, 0) = AVG2(C, D); - DST(0, 3) = AVG3(K, J, I); - DST(0, 2) = AVG3(J, I, X); + DST(0, 3) = AVG3(K, J, I); + DST(0, 2) = AVG3(J, I, X); DST(0, 1) = DST(1, 3) = AVG3(I, X, A); DST(1, 1) = DST(2, 3) = AVG3(X, A, B); DST(2, 1) = DST(3, 3) = AVG3(A, B, C); - DST(3, 1) = AVG3(B, C, D); + DST(3, 1) = AVG3(B, C, D); } -static void VL4_C(uint8_t* dst) { // Vertical-Left +static void VL4_C(uint8_t* dst) { // Vertical-Left const int A = dst[0 - BPS]; const int B = dst[1 - BPS]; const int C = dst[2 - BPS]; @@ -369,32 +370,31 @@ static void VL4_C(uint8_t* dst) { // Vertical-Left const int F = dst[5 - BPS]; const int G = dst[6 - BPS]; const int H = dst[7 - BPS]; - DST(0, 0) = AVG2(A, B); + DST(0, 0) = AVG2(A, B); DST(1, 0) = DST(0, 2) = AVG2(B, C); DST(2, 0) = DST(1, 2) = AVG2(C, D); DST(3, 0) = DST(2, 2) = AVG2(D, E); - DST(0, 1) = AVG3(A, B, C); + DST(0, 1) = AVG3(A, B, C); DST(1, 1) = DST(0, 3) = AVG3(B, C, D); DST(2, 1) = DST(1, 3) = AVG3(C, D, E); DST(3, 1) = DST(2, 3) = AVG3(D, E, F); - DST(3, 2) = AVG3(E, F, G); - DST(3, 3) = AVG3(F, G, H); + DST(3, 2) = AVG3(E, F, G); + DST(3, 3) = AVG3(F, G, H); } -static void HU4_C(uint8_t* dst) { // Horizontal-Up +static void HU4_C(uint8_t* dst) { // Horizontal-Up const int I = dst[-1 + 0 * BPS]; const int J = dst[-1 + 1 * BPS]; const int K = dst[-1 + 2 * BPS]; const int L = dst[-1 + 3 * BPS]; - DST(0, 0) = AVG2(I, J); + DST(0, 0) = AVG2(I, J); DST(2, 0) = DST(0, 1) = AVG2(J, K); DST(2, 1) = DST(0, 2) = AVG2(K, L); - DST(1, 0) = AVG3(I, J, K); + DST(1, 0) = AVG3(I, J, K); DST(3, 0) = DST(1, 1) = AVG3(J, K, L); DST(3, 1) = DST(1, 2) = AVG3(K, L, L); - DST(3, 2) = DST(2, 2) = - DST(0, 3) = DST(1, 3) = DST(2, 3) = DST(3, 3) = L; + DST(3, 2) = DST(2, 2) = DST(0, 3) = DST(1, 3) = DST(2, 3) = DST(3, 3) = L; } static void HD4_C(uint8_t* dst) { // Horizontal-Down @@ -410,14 +410,14 @@ static void HD4_C(uint8_t* dst) { // Horizontal-Down DST(0, 0) = DST(2, 1) = AVG2(I, X); DST(0, 1) = DST(2, 2) = AVG2(J, I); DST(0, 2) = DST(2, 3) = AVG2(K, J); - DST(0, 3) = AVG2(L, K); + DST(0, 3) = AVG2(L, K); - DST(3, 0) = AVG3(A, B, C); - DST(2, 0) = AVG3(X, A, B); + DST(3, 0) = AVG3(A, B, C); + DST(2, 0) = AVG3(X, A, B); DST(1, 0) = DST(3, 1) = AVG3(I, X, A); DST(1, 1) = DST(3, 2) = AVG3(J, I, X); DST(1, 2) = DST(3, 3) = AVG3(K, J, I); - DST(1, 3) = AVG3(L, K, J); + DST(1, 3) = AVG3(L, K, J); } #undef DST @@ -430,14 +430,14 @@ VP8PredFunc VP8PredLuma4[NUM_BMODES]; // Chroma #if !WEBP_NEON_OMIT_C_CODE -static void VE8uv_C(uint8_t* dst) { // vertical +static void VE8uv_C(uint8_t* dst) { // vertical int j; for (j = 0; j < 8; ++j) { memcpy(dst + j * BPS, dst - BPS, 8); } } -static void HE8uv_C(uint8_t* dst) { // horizontal +static void HE8uv_C(uint8_t* dst) { // horizontal int j; for (j = 0; j < 8; ++j) { memset(dst, dst[-1], 8); @@ -453,7 +453,7 @@ static WEBP_INLINE void Put8x8uv(uint8_t value, uint8_t* dst) { } } -static void DC8uv_C(uint8_t* dst) { // DC +static void DC8uv_C(uint8_t* dst) { // DC int dc0 = 8; int i; for (i = 0; i < 8; ++i) { @@ -462,7 +462,7 @@ static void DC8uv_C(uint8_t* dst) { // DC Put8x8uv(dc0 >> 4, dst); } -static void DC8uvNoLeft_C(uint8_t* dst) { // DC with no left samples +static void DC8uvNoLeft_C(uint8_t* dst) { // DC with no left samples int dc0 = 4; int i; for (i = 0; i < 8; ++i) { @@ -480,7 +480,7 @@ static void DC8uvNoTop_C(uint8_t* dst) { // DC with no top samples Put8x8uv(dc0 >> 3, dst); } -static void DC8uvNoTopLeft_C(uint8_t* dst) { // DC with nothing +static void DC8uvNoTopLeft_C(uint8_t* dst) { // DC with nothing Put8x8uv(0x80, dst); } #endif // !WEBP_NEON_OMIT_C_CODE @@ -493,46 +493,46 @@ VP8PredFunc VP8PredChroma8[NUM_B_DC_MODES]; #if !WEBP_NEON_OMIT_C_CODE || WEBP_NEON_WORK_AROUND_GCC // 4 pixels in, 2 pixels out static WEBP_INLINE void DoFilter2_C(uint8_t* p, int step) { - const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step]; + const int p1 = p[-2 * step], p0 = p[-step], q0 = p[0], q1 = p[step]; const int a = 3 * (q0 - p0) + VP8ksclip1[p1 - q1]; // in [-893,892] const int a1 = VP8ksclip2[(a + 4) >> 3]; // in [-16,15] const int a2 = VP8ksclip2[(a + 3) >> 3]; p[-step] = VP8kclip1[p0 + a2]; - p[ 0] = VP8kclip1[q0 - a1]; + p[0] = VP8kclip1[q0 - a1]; } // 4 pixels in, 4 pixels out static WEBP_INLINE void DoFilter4_C(uint8_t* p, int step) { - const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step]; + const int p1 = p[-2 * step], p0 = p[-step], q0 = p[0], q1 = p[step]; const int a = 3 * (q0 - p0); const int a1 = VP8ksclip2[(a + 4) >> 3]; const int a2 = VP8ksclip2[(a + 3) >> 3]; const int a3 = (a1 + 1) >> 1; - p[-2*step] = VP8kclip1[p1 + a3]; - p[- step] = VP8kclip1[p0 + a2]; - p[ 0] = VP8kclip1[q0 - a1]; - p[ step] = VP8kclip1[q1 - a3]; + p[-2 * step] = VP8kclip1[p1 + a3]; + p[-step] = VP8kclip1[p0 + a2]; + p[0] = VP8kclip1[q0 - a1]; + p[step] = VP8kclip1[q1 - a3]; } // 6 pixels in, 6 pixels out static WEBP_INLINE void DoFilter6_C(uint8_t* p, int step) { - const int p2 = p[-3*step], p1 = p[-2*step], p0 = p[-step]; - const int q0 = p[0], q1 = p[step], q2 = p[2*step]; + const int p2 = p[-3 * step], p1 = p[-2 * step], p0 = p[-step]; + const int q0 = p[0], q1 = p[step], q2 = p[2 * step]; const int a = VP8ksclip1[3 * (q0 - p0) + VP8ksclip1[p1 - q1]]; // a is in [-128,127], a1 in [-27,27], a2 in [-18,18] and a3 in [-9,9] const int a1 = (27 * a + 63) >> 7; // eq. to ((3 * a + 7) * 9) >> 7 const int a2 = (18 * a + 63) >> 7; // eq. to ((2 * a + 7) * 9) >> 7 - const int a3 = (9 * a + 63) >> 7; // eq. to ((1 * a + 7) * 9) >> 7 - p[-3*step] = VP8kclip1[p2 + a3]; - p[-2*step] = VP8kclip1[p1 + a2]; - p[- step] = VP8kclip1[p0 + a1]; - p[ 0] = VP8kclip1[q0 - a1]; - p[ step] = VP8kclip1[q1 - a2]; - p[ 2*step] = VP8kclip1[q2 - a3]; + const int a3 = (9 * a + 63) >> 7; // eq. to ((1 * a + 7) * 9) >> 7 + p[-3 * step] = VP8kclip1[p2 + a3]; + p[-2 * step] = VP8kclip1[p1 + a2]; + p[-step] = VP8kclip1[p0 + a1]; + p[0] = VP8kclip1[q0 - a1]; + p[step] = VP8kclip1[q1 - a2]; + p[2 * step] = VP8kclip1[q2 - a3]; } static WEBP_INLINE int Hev(const uint8_t* p, int step, int thresh) { - const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step]; + const int p1 = p[-2 * step], p0 = p[-step], q0 = p[0], q1 = p[step]; return (VP8kabs0[p1 - p0] > thresh) || (VP8kabs0[q1 - q0] > thresh); } #endif // !WEBP_NEON_OMIT_C_CODE || WEBP_NEON_WORK_AROUND_GCC @@ -545,8 +545,8 @@ static WEBP_INLINE int NeedsFilter_C(const uint8_t* p, int step, int t) { #endif // !WEBP_NEON_OMIT_C_CODE #if !WEBP_NEON_OMIT_C_CODE || WEBP_NEON_WORK_AROUND_GCC -static WEBP_INLINE int NeedsFilter2_C(const uint8_t* p, - int step, int t, int it) { +static WEBP_INLINE int NeedsFilter2_C(const uint8_t* p, int step, int t, + int it) { const int p3 = p[-4 * step], p2 = p[-3 * step], p1 = p[-2 * step]; const int p0 = p[-step], q0 = p[0]; const int q1 = p[step], q2 = p[2 * step], q3 = p[3 * step]; @@ -602,9 +602,8 @@ static void SimpleHFilter16i_C(uint8_t* p, int stride, int thresh) { // Complex In-loop filtering (Paragraph 15.3) #if !WEBP_NEON_OMIT_C_CODE || WEBP_NEON_WORK_AROUND_GCC -static WEBP_INLINE void FilterLoop26_C(uint8_t* p, - int hstride, int vstride, int size, - int thresh, int ithresh, +static WEBP_INLINE void FilterLoop26_C(uint8_t* p, int hstride, int vstride, + int size, int thresh, int ithresh, int hev_thresh) { const int thresh2 = 2 * thresh + 1; while (size-- > 0) { @@ -619,9 +618,8 @@ static WEBP_INLINE void FilterLoop26_C(uint8_t* p, } } -static WEBP_INLINE void FilterLoop24_C(uint8_t* p, - int hstride, int vstride, int size, - int thresh, int ithresh, +static WEBP_INLINE void FilterLoop24_C(uint8_t* p, int hstride, int vstride, + int size, int thresh, int ithresh, int hev_thresh) { const int thresh2 = 2 * thresh + 1; while (size-- > 0) { @@ -639,19 +637,19 @@ static WEBP_INLINE void FilterLoop24_C(uint8_t* p, #if !WEBP_NEON_OMIT_C_CODE // on macroblock edges -static void VFilter16_C(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void VFilter16_C(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { FilterLoop26_C(p, stride, 1, 16, thresh, ithresh, hev_thresh); } -static void HFilter16_C(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void HFilter16_C(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { FilterLoop26_C(p, 1, stride, 16, thresh, ithresh, hev_thresh); } // on three inner edges -static void VFilter16i_C(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void VFilter16i_C(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { int k; for (k = 3; k > 0; --k) { p += 4 * stride; @@ -661,8 +659,8 @@ static void VFilter16i_C(uint8_t* p, int stride, #endif // !WEBP_NEON_OMIT_C_CODE #if !WEBP_NEON_OMIT_C_CODE || WEBP_NEON_WORK_AROUND_GCC -static void HFilter16i_C(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void HFilter16i_C(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { int k; for (k = 3; k > 0; --k) { p += 4; diff --git a/src/dsp/dec_clip_tables.c b/src/dsp/dec_clip_tables.c index 4c816ddb..d547e2bb 100644 --- a/src/dsp/dec_clip_tables.c +++ b/src/dsp/dec_clip_tables.c @@ -12,323 +12,319 @@ // Author: Skal (pascal.massimino@gmail.com) #include "src/dsp/cpu.h" -#include "src/webp/types.h" #include "src/dsp/dsp.h" +#include "src/webp/types.h" // define to 0 to have run-time table initialization #if !defined(USE_STATIC_TABLES) -#define USE_STATIC_TABLES 1 // ALTERNATE_CODE +#define USE_STATIC_TABLES 1 // ALTERNATE_CODE #endif #if (USE_STATIC_TABLES == 1) static const uint8_t abs0[255 + 255 + 1] = { - 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, 0xf5, 0xf4, - 0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, 0xeb, 0xea, 0xe9, 0xe8, - 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, 0xe1, 0xe0, 0xdf, 0xde, 0xdd, 0xdc, - 0xdb, 0xda, 0xd9, 0xd8, 0xd7, 0xd6, 0xd5, 0xd4, 0xd3, 0xd2, 0xd1, 0xd0, - 0xcf, 0xce, 0xcd, 0xcc, 0xcb, 0xca, 0xc9, 0xc8, 0xc7, 0xc6, 0xc5, 0xc4, - 0xc3, 0xc2, 0xc1, 0xc0, 0xbf, 0xbe, 0xbd, 0xbc, 0xbb, 0xba, 0xb9, 0xb8, - 0xb7, 0xb6, 0xb5, 0xb4, 0xb3, 0xb2, 0xb1, 0xb0, 0xaf, 0xae, 0xad, 0xac, - 0xab, 0xaa, 0xa9, 0xa8, 0xa7, 0xa6, 0xa5, 0xa4, 0xa3, 0xa2, 0xa1, 0xa0, - 0x9f, 0x9e, 0x9d, 0x9c, 0x9b, 0x9a, 0x99, 0x98, 0x97, 0x96, 0x95, 0x94, - 0x93, 0x92, 0x91, 0x90, 0x8f, 0x8e, 0x8d, 0x8c, 0x8b, 0x8a, 0x89, 0x88, - 0x87, 0x86, 0x85, 0x84, 0x83, 0x82, 0x81, 0x80, 0x7f, 0x7e, 0x7d, 0x7c, - 0x7b, 0x7a, 0x79, 0x78, 0x77, 0x76, 0x75, 0x74, 0x73, 0x72, 0x71, 0x70, - 0x6f, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x69, 0x68, 0x67, 0x66, 0x65, 0x64, - 0x63, 0x62, 0x61, 0x60, 0x5f, 0x5e, 0x5d, 0x5c, 0x5b, 0x5a, 0x59, 0x58, - 0x57, 0x56, 0x55, 0x54, 0x53, 0x52, 0x51, 0x50, 0x4f, 0x4e, 0x4d, 0x4c, - 0x4b, 0x4a, 0x49, 0x48, 0x47, 0x46, 0x45, 0x44, 0x43, 0x42, 0x41, 0x40, - 0x3f, 0x3e, 0x3d, 0x3c, 0x3b, 0x3a, 0x39, 0x38, 0x37, 0x36, 0x35, 0x34, - 0x33, 0x32, 0x31, 0x30, 0x2f, 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x29, 0x28, - 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0x20, 0x1f, 0x1e, 0x1d, 0x1c, - 0x1b, 0x1a, 0x19, 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, - 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, - 0x03, 0x02, 0x01, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, - 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, - 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, - 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32,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67, 0x66, 0x65, 0x64, + 0x63, 0x62, 0x61, 0x60, 0x5f, 0x5e, 0x5d, 0x5c, 0x5b, 0x5a, 0x59, 0x58, + 0x57, 0x56, 0x55, 0x54, 0x53, 0x52, 0x51, 0x50, 0x4f, 0x4e, 0x4d, 0x4c, + 0x4b, 0x4a, 0x49, 0x48, 0x47, 0x46, 0x45, 0x44, 0x43, 0x42, 0x41, 0x40, + 0x3f, 0x3e, 0x3d, 0x3c, 0x3b, 0x3a, 0x39, 0x38, 0x37, 0x36, 0x35, 0x34, + 0x33, 0x32, 0x31, 0x30, 0x2f, 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x29, 0x28, + 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0x20, 0x1f, 0x1e, 0x1d, 0x1c, + 0x1b, 0x1a, 0x19, 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, + 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, + 0x03, 0x02, 0x01, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, + 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, + 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, + 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, + 0x51, 0x52, 0x53, 0x54, 0x55,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0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, - 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, - 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, - 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, - 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0x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f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, - 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f -}; + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, + 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, + 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, + 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, + 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, + 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, + 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, + 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, + 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, + 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, + 0x7f, 0x7f, 0x7f, 0x7f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00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, - 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, - 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, - 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, - 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, - 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, - 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, - 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, - 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, - 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, - 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, - 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, - 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, - 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, - 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, - 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, - 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, - 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, - 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, - 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, - 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -}; + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, + 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, + 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, + 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, + 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, + 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, + 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, + 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, + 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, + 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, + 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, + 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, + 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, + 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, + 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, + 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, + 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, + 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; #else @@ -342,7 +338,7 @@ static uint8_t clip1[255 + 511 + 1]; // and make sure it's set to true _last_ (so as to be thread-safe) static volatile int tables_ok = 0; -#endif // USE_STATIC_TABLES +#endif // USE_STATIC_TABLES const int8_t* const VP8ksclip1 = (const int8_t*)&sclip1[1020]; const int8_t* const VP8ksclip2 = (const int8_t*)&sclip2[112]; @@ -367,5 +363,5 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8InitClipTables(void) { } tables_ok = 1; } -#endif // USE_STATIC_TABLES +#endif // USE_STATIC_TABLES } diff --git a/src/dsp/dec_mips32.c b/src/dsp/dec_mips32.c index 89fe9009..722c2abc 100644 --- a/src/dsp/dec_mips32.c +++ b/src/dsp/dec_mips32.c @@ -33,7 +33,7 @@ static WEBP_INLINE void do_filter2(uint8_t* p, int step) { const int a1 = VP8ksclip2[(a + 4) >> 3]; const int a2 = VP8ksclip2[(a + 3) >> 3]; p[-step] = VP8kclip1[p0 + a2]; - p[ 0] = VP8kclip1[q0 - a1]; + p[0] = VP8kclip1[q0 - a1]; } // 4 pixels in, 4 pixels out @@ -44,9 +44,9 @@ static WEBP_INLINE void do_filter4(uint8_t* p, int step) { const int a2 = VP8ksclip2[(a + 3) >> 3]; const int a3 = (a1 + 1) >> 1; p[-2 * step] = VP8kclip1[p1 + a3]; - p[- step] = VP8kclip1[p0 + a2]; - p[ 0] = VP8kclip1[q0 - a1]; - p[ step] = VP8kclip1[q1 - a3]; + p[-step] = VP8kclip1[p0 + a2]; + p[0] = VP8kclip1[q0 - a1]; + p[step] = VP8kclip1[q1 - a3]; } // 6 pixels in, 6 pixels out @@ -57,13 +57,13 @@ static WEBP_INLINE void do_filter6(uint8_t* p, int step) { // a is in [-128,127], a1 in [-27,27], a2 in [-18,18] and a3 in [-9,9] const int a1 = (27 * a + 63) >> 7; // eq. to ((3 * a + 7) * 9) >> 7 const int a2 = (18 * a + 63) >> 7; // eq. to ((2 * a + 7) * 9) >> 7 - const int a3 = (9 * a + 63) >> 7; // eq. to ((1 * a + 7) * 9) >> 7 + const int a3 = (9 * a + 63) >> 7; // eq. to ((1 * a + 7) * 9) >> 7 p[-3 * step] = VP8kclip1[p2 + a3]; p[-2 * step] = VP8kclip1[p1 + a2]; - p[- step] = VP8kclip1[p0 + a1]; - p[ 0] = VP8kclip1[q0 - a1]; - p[ step] = VP8kclip1[q1 - a2]; - p[ 2 * step] = VP8kclip1[q2 - a3]; + p[-step] = VP8kclip1[p0 + a1]; + p[0] = VP8kclip1[q0 - a1]; + p[step] = VP8kclip1[q1 - a2]; + p[2 * step] = VP8kclip1[q2 - a3]; } static WEBP_INLINE int hev(const uint8_t* p, int step, int thresh) { @@ -76,8 +76,8 @@ static WEBP_INLINE int needs_filter(const uint8_t* p, int step, int t) { return ((4 * abs_mips32(p0 - q0) + abs_mips32(p1 - q1)) <= t); } -static WEBP_INLINE int needs_filter2(const uint8_t* p, - int step, int t, int it) { +static WEBP_INLINE int needs_filter2(const uint8_t* p, int step, int t, + int it) { const int p3 = p[-4 * step], p2 = p[-3 * step]; const int p1 = p[-2 * step], p0 = p[-step]; const int q0 = p[0], q1 = p[step], q2 = p[2 * step], q3 = p[3 * step]; @@ -89,9 +89,9 @@ static WEBP_INLINE int needs_filter2(const uint8_t* p, abs_mips32(q2 - q1) <= it && abs_mips32(q1 - q0) <= it; } -static WEBP_INLINE void FilterLoop26(uint8_t* p, - int hstride, int vstride, int size, - int thresh, int ithresh, int hev_thresh) { +static WEBP_INLINE void FilterLoop26(uint8_t* p, int hstride, int vstride, + int size, int thresh, int ithresh, + int hev_thresh) { const int thresh2 = 2 * thresh + 1; while (size-- > 0) { if (needs_filter2(p, hstride, thresh2, ithresh)) { @@ -105,9 +105,9 @@ static WEBP_INLINE void FilterLoop26(uint8_t* p, } } -static WEBP_INLINE void FilterLoop24(uint8_t* p, - int hstride, int vstride, int size, - int thresh, int ithresh, int hev_thresh) { +static WEBP_INLINE void FilterLoop24(uint8_t* p, int hstride, int vstride, + int size, int thresh, int ithresh, + int hev_thresh) { const int thresh2 = 2 * thresh + 1; while (size-- > 0) { if (needs_filter2(p, hstride, thresh2, ithresh)) { @@ -122,13 +122,13 @@ static WEBP_INLINE void FilterLoop24(uint8_t* p, } // on macroblock edges -static void VFilter16(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void VFilter16(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { FilterLoop26(p, stride, 1, 16, thresh, ithresh, hev_thresh); } -static void HFilter16(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void HFilter16(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { FilterLoop26(p, 1, stride, 16, thresh, ithresh, hev_thresh); } @@ -158,8 +158,8 @@ static void HFilter8i(uint8_t* WEBP_RESTRICT u, uint8_t* WEBP_RESTRICT v, } // on three inner edges -static void VFilter16i(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void VFilter16i(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { int k; for (k = 3; k > 0; --k) { p += 4 * stride; @@ -167,8 +167,8 @@ static void VFilter16i(uint8_t* p, int stride, } } -static void HFilter16i(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void HFilter16i(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { int k; for (k = 3; k > 0; --k) { p += 4; diff --git a/src/dsp/dec_mips_dsp_r2.c b/src/dsp/dec_mips_dsp_r2.c index 03b5f122..8966a6d1 100644 --- a/src/dsp/dec_mips_dsp_r2.c +++ b/src/dsp/dec_mips_dsp_r2.c @@ -25,7 +25,7 @@ static void TransformDC(const int16_t* WEBP_RESTRICT in, uint8_t* WEBP_RESTRICT dst) { int temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9, temp10; - __asm__ volatile ( + __asm__ volatile( LOAD_WITH_OFFSET_X4(temp1, temp2, temp3, temp4, dst, 0, 0, 0, 0, 0, 1, 2, 3, @@ -56,7 +56,7 @@ static void TransformAC3(const int16_t* WEBP_RESTRICT in, int temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9; int temp10, temp11, temp12, temp13, temp14, temp15, temp16, temp17, temp18; - __asm__ volatile ( + __asm__ volatile( "ins %[c4], %[d4], 16, 16 \n\t" "replv.ph %[temp1], %[a] \n\t" "replv.ph %[temp4], %[d1] \n\t" @@ -88,7 +88,7 @@ static void TransformOne(const int16_t* WEBP_RESTRICT in, int temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9; int temp10, temp11, temp12, temp13, temp14, temp15, temp16, temp17, temp18; - __asm__ volatile ( + __asm__ volatile( "ulw %[temp1], 0(%[in]) \n\t" "ulw %[temp2], 16(%[in]) \n\t" LOAD_IN_X2(temp5, temp6, 24, 26) @@ -159,281 +159,279 @@ static void TransformTwo(const int16_t* WEBP_RESTRICT in, } } -static WEBP_INLINE void FilterLoop26(uint8_t* p, - int hstride, int vstride, int size, - int thresh, int ithresh, int hev_thresh) { +static WEBP_INLINE void FilterLoop26(uint8_t* p, int hstride, int vstride, + int size, int thresh, int ithresh, + int hev_thresh) { const int thresh2 = 2 * thresh + 1; int temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9; int temp10, temp11, temp12, temp13, temp14, temp15; - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "1: \n\t" - "negu %[temp1], %[hstride] \n\t" - "addiu %[size], %[size], -1 \n\t" - "sll %[temp2], %[hstride], 1 \n\t" - "sll %[temp3], %[temp1], 1 \n\t" - "addu %[temp4], %[temp2], %[hstride] \n\t" - "addu %[temp5], %[temp3], %[temp1] \n\t" - "lbu %[temp7], 0(%[p]) \n\t" - "sll %[temp6], %[temp3], 1 \n\t" - "lbux %[temp8], %[temp5](%[p]) \n\t" - "lbux %[temp9], %[temp3](%[p]) \n\t" - "lbux %[temp10], %[temp1](%[p]) \n\t" - "lbux %[temp11], %[temp6](%[p]) \n\t" - "lbux %[temp12], %[hstride](%[p]) \n\t" - "lbux %[temp13], %[temp2](%[p]) \n\t" - "lbux %[temp14], %[temp4](%[p]) \n\t" - "subu %[temp1], %[temp10], %[temp7] \n\t" - "subu %[temp2], %[temp9], %[temp12] \n\t" - "absq_s.w %[temp3], %[temp1] \n\t" - "absq_s.w %[temp4], %[temp2] \n\t" - "negu %[temp1], %[temp1] \n\t" - "sll %[temp3], %[temp3], 2 \n\t" - "addu %[temp15], %[temp3], %[temp4] \n\t" - "subu %[temp3], %[temp15], %[thresh2] \n\t" - "sll %[temp6], %[temp1], 1 \n\t" - "bgtz %[temp3], 3f \n\t" - " subu %[temp4], %[temp11], %[temp8] \n\t" - "absq_s.w %[temp4], %[temp4] \n\t" - "shll_s.w %[temp2], %[temp2], 24 \n\t" - "subu %[temp4], %[temp4], %[ithresh] \n\t" - "bgtz %[temp4], 3f \n\t" - " subu %[temp3], %[temp8], %[temp9] \n\t" - "absq_s.w %[temp3], %[temp3] \n\t" - "subu %[temp3], %[temp3], %[ithresh] \n\t" - "bgtz %[temp3], 3f \n\t" - " subu %[temp5], %[temp9], %[temp10] \n\t" - "absq_s.w %[temp3], %[temp5] \n\t" - "absq_s.w %[temp5], %[temp5] \n\t" - "subu %[temp3], %[temp3], %[ithresh] \n\t" - "bgtz %[temp3], 3f \n\t" - " subu %[temp3], %[temp14], %[temp13] \n\t" - "absq_s.w %[temp3], %[temp3] \n\t" - "slt %[temp5], %[hev_thresh], %[temp5] \n\t" - "subu %[temp3], %[temp3], %[ithresh] \n\t" - "bgtz %[temp3], 3f \n\t" - " subu %[temp3], %[temp13], %[temp12] \n\t" - "absq_s.w %[temp3], %[temp3] \n\t" - "sra %[temp4], %[temp2], 24 \n\t" - "subu %[temp3], %[temp3], %[ithresh] \n\t" - "bgtz %[temp3], 3f \n\t" - " subu %[temp15], %[temp12], %[temp7] \n\t" - "absq_s.w %[temp3], %[temp15] \n\t" - "absq_s.w %[temp15], %[temp15] \n\t" - "subu %[temp3], %[temp3], %[ithresh] \n\t" - "bgtz %[temp3], 3f \n\t" - " slt %[temp15], %[hev_thresh], %[temp15] \n\t" - "addu %[temp3], %[temp6], %[temp1] \n\t" - "or %[temp2], %[temp5], %[temp15] \n\t" - "addu %[temp5], %[temp4], %[temp3] \n\t" - "beqz %[temp2], 4f \n\t" - " shra_r.w %[temp1], %[temp5], 3 \n\t" - "addiu %[temp2], %[temp5], 3 \n\t" - "sra %[temp2], %[temp2], 3 \n\t" - "shll_s.w %[temp1], %[temp1], 27 \n\t" - "shll_s.w %[temp2], %[temp2], 27 \n\t" - "subu %[temp3], %[p], %[hstride] \n\t" - "sra %[temp1], %[temp1], 27 \n\t" - "sra %[temp2], %[temp2], 27 \n\t" - "subu %[temp1], %[temp7], %[temp1] \n\t" - "addu %[temp2], %[temp10], %[temp2] \n\t" - "lbux %[temp2], %[temp2](%[VP8kclip1]) \n\t" - "lbux %[temp1], %[temp1](%[VP8kclip1]) \n\t" - "sb %[temp2], 0(%[temp3]) \n\t" - "j 3f \n\t" - " sb %[temp1], 0(%[p]) \n\t" - "4: \n\t" - "shll_s.w %[temp5], %[temp5], 24 \n\t" - "subu %[temp14], %[p], %[hstride] \n\t" - "subu %[temp11], %[temp14], %[hstride] \n\t" - "sra %[temp6], %[temp5], 24 \n\t" - "sll %[temp1], %[temp6], 3 \n\t" - "subu %[temp15], %[temp11], %[hstride] \n\t" - "addu %[temp2], %[temp6], %[temp1] \n\t" - "sll %[temp3], %[temp2], 1 \n\t" - "addu %[temp4], %[temp3], %[temp2] \n\t" - "addiu %[temp2], %[temp2], 63 \n\t" - "addiu %[temp3], %[temp3], 63 \n\t" - "addiu %[temp4], %[temp4], 63 \n\t" - "sra %[temp2], %[temp2], 7 \n\t" - "sra %[temp3], %[temp3], 7 \n\t" - "sra %[temp4], %[temp4], 7 \n\t" - "addu %[temp1], %[temp8], %[temp2] \n\t" - "addu %[temp5], %[temp9], %[temp3] \n\t" - "addu %[temp6], %[temp10], %[temp4] \n\t" - "subu %[temp8], %[temp7], %[temp4] \n\t" - "subu %[temp7], %[temp12], %[temp3] \n\t" - "addu %[temp10], %[p], %[hstride] \n\t" - "subu %[temp9], %[temp13], %[temp2] \n\t" - "addu %[temp12], %[temp10], %[hstride] \n\t" - "lbux %[temp2], %[temp1](%[VP8kclip1]) \n\t" - "lbux %[temp3], %[temp5](%[VP8kclip1]) \n\t" - "lbux %[temp4], %[temp6](%[VP8kclip1]) \n\t" - "lbux %[temp5], %[temp8](%[VP8kclip1]) \n\t" - "lbux %[temp6], %[temp7](%[VP8kclip1]) \n\t" - "lbux %[temp8], %[temp9](%[VP8kclip1]) \n\t" - "sb %[temp2], 0(%[temp15]) \n\t" - "sb %[temp3], 0(%[temp11]) \n\t" - "sb %[temp4], 0(%[temp14]) \n\t" - "sb %[temp5], 0(%[p]) \n\t" - "sb %[temp6], 0(%[temp10]) \n\t" - "sb %[temp8], 0(%[temp12]) \n\t" - "3: \n\t" - "bgtz %[size], 1b \n\t" - " addu %[p], %[p], %[vstride] \n\t" - ".set pop \n\t" - : [temp1]"=&r"(temp1), [temp2]"=&r"(temp2),[temp3]"=&r"(temp3), - [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), [temp6]"=&r"(temp6), - [temp7]"=&r"(temp7),[temp8]"=&r"(temp8),[temp9]"=&r"(temp9), - [temp10]"=&r"(temp10),[temp11]"=&r"(temp11),[temp12]"=&r"(temp12), - [temp13]"=&r"(temp13),[temp14]"=&r"(temp14),[temp15]"=&r"(temp15), - [size]"+&r"(size), [p]"+&r"(p) - : [hstride]"r"(hstride), [thresh2]"r"(thresh2), - [ithresh]"r"(ithresh),[vstride]"r"(vstride), [hev_thresh]"r"(hev_thresh), - [VP8kclip1]"r"(VP8kclip1) - : "memory" - ); + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "1: \n\t" + "negu %[temp1], %[hstride] \n\t" + "addiu %[size], %[size], -1 \n\t" + "sll %[temp2], %[hstride], 1 \n\t" + "sll %[temp3], %[temp1], 1 \n\t" + "addu %[temp4], %[temp2], %[hstride] \n\t" + "addu %[temp5], %[temp3], %[temp1] \n\t" + "lbu %[temp7], 0(%[p]) \n\t" + "sll %[temp6], %[temp3], 1 \n\t" + "lbux %[temp8], %[temp5](%[p]) \n\t" + "lbux %[temp9], %[temp3](%[p]) \n\t" + "lbux %[temp10], %[temp1](%[p]) \n\t" + "lbux %[temp11], %[temp6](%[p]) \n\t" + "lbux %[temp12], %[hstride](%[p]) \n\t" + "lbux %[temp13], %[temp2](%[p]) \n\t" + "lbux %[temp14], %[temp4](%[p]) \n\t" + "subu %[temp1], %[temp10], %[temp7] \n\t" + "subu %[temp2], %[temp9], %[temp12] \n\t" + "absq_s.w %[temp3], %[temp1] \n\t" + "absq_s.w %[temp4], %[temp2] \n\t" + "negu %[temp1], %[temp1] \n\t" + "sll %[temp3], %[temp3], 2 \n\t" + "addu %[temp15], %[temp3], %[temp4] \n\t" + "subu %[temp3], %[temp15], %[thresh2] \n\t" + "sll %[temp6], %[temp1], 1 \n\t" + "bgtz %[temp3], 3f \n\t" + " subu %[temp4], %[temp11], %[temp8] \n\t" + "absq_s.w %[temp4], %[temp4] \n\t" + "shll_s.w %[temp2], %[temp2], 24 \n\t" + "subu %[temp4], %[temp4], %[ithresh] \n\t" + "bgtz %[temp4], 3f \n\t" + " subu %[temp3], %[temp8], %[temp9] \n\t" + "absq_s.w %[temp3], %[temp3] \n\t" + "subu %[temp3], %[temp3], %[ithresh] \n\t" + "bgtz %[temp3], 3f \n\t" + " subu %[temp5], %[temp9], %[temp10] \n\t" + "absq_s.w %[temp3], %[temp5] \n\t" + "absq_s.w %[temp5], %[temp5] \n\t" + "subu %[temp3], %[temp3], %[ithresh] \n\t" + "bgtz %[temp3], 3f \n\t" + " subu %[temp3], %[temp14], %[temp13] \n\t" + "absq_s.w %[temp3], %[temp3] \n\t" + "slt %[temp5], %[hev_thresh], %[temp5] \n\t" + "subu %[temp3], %[temp3], %[ithresh] \n\t" + "bgtz %[temp3], 3f \n\t" + " subu %[temp3], %[temp13], %[temp12] \n\t" + "absq_s.w %[temp3], %[temp3] \n\t" + "sra %[temp4], %[temp2], 24 \n\t" + "subu %[temp3], %[temp3], %[ithresh] \n\t" + "bgtz %[temp3], 3f \n\t" + " subu %[temp15], %[temp12], %[temp7] \n\t" + "absq_s.w %[temp3], %[temp15] \n\t" + "absq_s.w %[temp15], %[temp15] \n\t" + "subu %[temp3], %[temp3], %[ithresh] \n\t" + "bgtz %[temp3], 3f \n\t" + " slt %[temp15], %[hev_thresh], %[temp15] \n\t" + "addu %[temp3], %[temp6], %[temp1] \n\t" + "or %[temp2], %[temp5], %[temp15] \n\t" + "addu %[temp5], %[temp4], %[temp3] \n\t" + "beqz %[temp2], 4f \n\t" + " shra_r.w %[temp1], %[temp5], 3 \n\t" + "addiu %[temp2], %[temp5], 3 \n\t" + "sra %[temp2], %[temp2], 3 \n\t" + "shll_s.w %[temp1], %[temp1], 27 \n\t" + "shll_s.w %[temp2], %[temp2], 27 \n\t" + "subu %[temp3], %[p], %[hstride] \n\t" + "sra %[temp1], %[temp1], 27 \n\t" + "sra %[temp2], %[temp2], 27 \n\t" + "subu %[temp1], %[temp7], %[temp1] \n\t" + "addu %[temp2], %[temp10], %[temp2] \n\t" + "lbux %[temp2], %[temp2](%[VP8kclip1]) \n\t" + "lbux %[temp1], %[temp1](%[VP8kclip1]) \n\t" + "sb %[temp2], 0(%[temp3]) \n\t" + "j 3f \n\t" + " sb %[temp1], 0(%[p]) \n\t" + "4: \n\t" + "shll_s.w %[temp5], %[temp5], 24 \n\t" + "subu %[temp14], %[p], %[hstride] \n\t" + "subu %[temp11], %[temp14], %[hstride] \n\t" + "sra %[temp6], %[temp5], 24 \n\t" + "sll %[temp1], %[temp6], 3 \n\t" + "subu %[temp15], %[temp11], %[hstride] \n\t" + "addu %[temp2], %[temp6], %[temp1] \n\t" + "sll %[temp3], %[temp2], 1 \n\t" + "addu %[temp4], %[temp3], %[temp2] \n\t" + "addiu %[temp2], %[temp2], 63 \n\t" + "addiu %[temp3], %[temp3], 63 \n\t" + "addiu %[temp4], %[temp4], 63 \n\t" + "sra %[temp2], %[temp2], 7 \n\t" + "sra %[temp3], %[temp3], 7 \n\t" + "sra %[temp4], %[temp4], 7 \n\t" + "addu %[temp1], %[temp8], %[temp2] \n\t" + "addu %[temp5], %[temp9], %[temp3] \n\t" + "addu %[temp6], %[temp10], %[temp4] \n\t" + "subu %[temp8], %[temp7], %[temp4] \n\t" + "subu %[temp7], %[temp12], %[temp3] \n\t" + "addu %[temp10], %[p], %[hstride] \n\t" + "subu %[temp9], %[temp13], %[temp2] \n\t" + "addu %[temp12], %[temp10], %[hstride] \n\t" + "lbux %[temp2], %[temp1](%[VP8kclip1]) \n\t" + "lbux %[temp3], %[temp5](%[VP8kclip1]) \n\t" + "lbux %[temp4], %[temp6](%[VP8kclip1]) \n\t" + "lbux %[temp5], %[temp8](%[VP8kclip1]) \n\t" + "lbux %[temp6], %[temp7](%[VP8kclip1]) \n\t" + "lbux %[temp8], %[temp9](%[VP8kclip1]) \n\t" + "sb %[temp2], 0(%[temp15]) \n\t" + "sb %[temp3], 0(%[temp11]) \n\t" + "sb %[temp4], 0(%[temp14]) \n\t" + "sb %[temp5], 0(%[p]) \n\t" + "sb %[temp6], 0(%[temp10]) \n\t" + "sb %[temp8], 0(%[temp12]) \n\t" + "3: \n\t" + "bgtz %[size], 1b \n\t" + " addu %[p], %[p], %[vstride] \n\t" + ".set pop \n\t" + : [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), [temp3] "=&r"(temp3), + [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), [temp6] "=&r"(temp6), + [temp7] "=&r"(temp7), [temp8] "=&r"(temp8), [temp9] "=&r"(temp9), + [temp10] "=&r"(temp10), [temp11] "=&r"(temp11), [temp12] "=&r"(temp12), + [temp13] "=&r"(temp13), [temp14] "=&r"(temp14), [temp15] "=&r"(temp15), + [size] "+&r"(size), [p] "+&r"(p) + : [hstride] "r"(hstride), [thresh2] "r"(thresh2), [ithresh] "r"(ithresh), + [vstride] "r"(vstride), [hev_thresh] "r"(hev_thresh), + [VP8kclip1] "r"(VP8kclip1) + : "memory"); } -static WEBP_INLINE void FilterLoop24(uint8_t* p, - int hstride, int vstride, int size, - int thresh, int ithresh, int hev_thresh) { +static WEBP_INLINE void FilterLoop24(uint8_t* p, int hstride, int vstride, + int size, int thresh, int ithresh, + int hev_thresh) { int p0, q0, p1, q1, p2, q2, p3, q3; int step1, step2, temp1, temp2, temp3, temp4; uint8_t* pTemp0; uint8_t* pTemp1; const int thresh2 = 2 * thresh + 1; - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "bltz %[size], 3f \n\t" - " nop \n\t" - "2: \n\t" - "negu %[step1], %[hstride] \n\t" - "lbu %[q0], 0(%[p]) \n\t" - "lbux %[p0], %[step1](%[p]) \n\t" - "subu %[step1], %[step1], %[hstride] \n\t" - "lbux %[q1], %[hstride](%[p]) \n\t" - "subu %[temp1], %[p0], %[q0] \n\t" - "lbux %[p1], %[step1](%[p]) \n\t" - "addu %[step2], %[hstride], %[hstride] \n\t" - "absq_s.w %[temp2], %[temp1] \n\t" - "subu %[temp3], %[p1], %[q1] \n\t" - "absq_s.w %[temp4], %[temp3] \n\t" - "sll %[temp2], %[temp2], 2 \n\t" - "addu %[temp2], %[temp2], %[temp4] \n\t" - "subu %[temp4], %[temp2], %[thresh2] \n\t" - "subu %[step1], %[step1], %[hstride] \n\t" - "bgtz %[temp4], 0f \n\t" - " lbux %[p2], %[step1](%[p]) \n\t" - "subu %[step1], %[step1], %[hstride] \n\t" - "lbux %[q2], %[step2](%[p]) \n\t" - "lbux %[p3], %[step1](%[p]) \n\t" - "subu %[temp4], %[p2], %[p1] \n\t" - "addu %[step2], %[step2], %[hstride] \n\t" - "subu %[temp2], %[p3], %[p2] \n\t" - "absq_s.w %[temp4], %[temp4] \n\t" - "absq_s.w %[temp2], %[temp2] \n\t" - "lbux %[q3], %[step2](%[p]) \n\t" - "subu %[temp4], %[temp4], %[ithresh] \n\t" - "negu %[temp1], %[temp1] \n\t" - "bgtz %[temp4], 0f \n\t" - " subu %[temp2], %[temp2], %[ithresh] \n\t" - "subu %[p3], %[p1], %[p0] \n\t" - "bgtz %[temp2], 0f \n\t" - " absq_s.w %[p3], %[p3] \n\t" - "subu %[temp4], %[q3], %[q2] \n\t" - "subu %[pTemp0], %[p], %[hstride] \n\t" - "absq_s.w %[temp4], %[temp4] \n\t" - "subu %[temp2], %[p3], %[ithresh] \n\t" - "sll %[step1], %[temp1], 1 \n\t" - "bgtz %[temp2], 0f \n\t" - " subu %[temp4], %[temp4], %[ithresh] \n\t" - "subu %[temp2], %[q2], %[q1] \n\t" - "bgtz %[temp4], 0f \n\t" - " absq_s.w %[temp2], %[temp2] \n\t" - "subu %[q3], %[q1], %[q0] \n\t" - "absq_s.w %[q3], %[q3] \n\t" - "subu %[temp2], %[temp2], %[ithresh] \n\t" - "addu %[temp1], %[temp1], %[step1] \n\t" - "bgtz %[temp2], 0f \n\t" - " subu %[temp4], %[q3], %[ithresh] \n\t" - "slt %[p3], %[hev_thresh], %[p3] \n\t" - "bgtz %[temp4], 0f \n\t" - " slt %[q3], %[hev_thresh], %[q3] \n\t" - "or %[q3], %[q3], %[p3] \n\t" - "bgtz %[q3], 1f \n\t" - " shra_r.w %[temp2], %[temp1], 3 \n\t" - "addiu %[temp1], %[temp1], 3 \n\t" - "sra %[temp1], %[temp1], 3 \n\t" - "shll_s.w %[temp2], %[temp2], 27 \n\t" - "shll_s.w %[temp1], %[temp1], 27 \n\t" - "addu %[pTemp1], %[p], %[hstride] \n\t" - "sra %[temp2], %[temp2], 27 \n\t" - "sra %[temp1], %[temp1], 27 \n\t" - "addiu %[step1], %[temp2], 1 \n\t" - "sra %[step1], %[step1], 1 \n\t" - "addu %[p0], %[p0], %[temp1] \n\t" - "addu %[p1], %[p1], %[step1] \n\t" - "subu %[q0], %[q0], %[temp2] \n\t" - "subu %[q1], %[q1], %[step1] \n\t" - "lbux %[temp2], %[p0](%[VP8kclip1]) \n\t" - "lbux %[temp3], %[q0](%[VP8kclip1]) \n\t" - "lbux %[temp4], %[q1](%[VP8kclip1]) \n\t" - "sb %[temp2], 0(%[pTemp0]) \n\t" - "lbux %[temp1], %[p1](%[VP8kclip1]) \n\t" - "subu %[pTemp0], %[pTemp0], %[hstride] \n\t" - "sb %[temp3], 0(%[p]) \n\t" - "sb %[temp4], 0(%[pTemp1]) \n\t" - "j 0f \n\t" - " sb %[temp1], 0(%[pTemp0]) \n\t" - "1: \n\t" - "shll_s.w %[temp3], %[temp3], 24 \n\t" - "sra %[temp3], %[temp3], 24 \n\t" - "addu %[temp1], %[temp1], %[temp3] \n\t" - "shra_r.w %[temp2], %[temp1], 3 \n\t" - "addiu %[temp1], %[temp1], 3 \n\t" - "shll_s.w %[temp2], %[temp2], 27 \n\t" - "sra %[temp1], %[temp1], 3 \n\t" - "shll_s.w %[temp1], %[temp1], 27 \n\t" - "sra %[temp2], %[temp2], 27 \n\t" - "sra %[temp1], %[temp1], 27 \n\t" - "addu %[p0], %[p0], %[temp1] \n\t" - "subu %[q0], %[q0], %[temp2] \n\t" - "lbux %[temp1], %[p0](%[VP8kclip1]) \n\t" - "lbux %[temp2], %[q0](%[VP8kclip1]) \n\t" - "sb %[temp2], 0(%[p]) \n\t" - "sb %[temp1], 0(%[pTemp0]) \n\t" - "0: \n\t" - "subu %[size], %[size], 1 \n\t" - "bgtz %[size], 2b \n\t" - " addu %[p], %[p], %[vstride] \n\t" - "3: \n\t" - ".set pop \n\t" - : [p0]"=&r"(p0), [q0]"=&r"(q0), [p1]"=&r"(p1), [q1]"=&r"(q1), - [p2]"=&r"(p2), [q2]"=&r"(q2), [p3]"=&r"(p3), [q3]"=&r"(q3), - [step2]"=&r"(step2), [step1]"=&r"(step1), [temp1]"=&r"(temp1), - [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), - [pTemp0]"=&r"(pTemp0), [pTemp1]"=&r"(pTemp1), [p]"+&r"(p), - [size]"+&r"(size) - : [vstride]"r"(vstride), [ithresh]"r"(ithresh), - [hev_thresh]"r"(hev_thresh), [hstride]"r"(hstride), - [VP8kclip1]"r"(VP8kclip1), [thresh2]"r"(thresh2) - : "memory" - ); + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "bltz %[size], 3f \n\t" + " nop \n\t" + "2: \n\t" + "negu %[step1], %[hstride] \n\t" + "lbu %[q0], 0(%[p]) \n\t" + "lbux %[p0], %[step1](%[p]) \n\t" + "subu %[step1], %[step1], %[hstride] \n\t" + "lbux %[q1], %[hstride](%[p]) \n\t" + "subu %[temp1], %[p0], %[q0] \n\t" + "lbux %[p1], %[step1](%[p]) \n\t" + "addu %[step2], %[hstride], %[hstride] \n\t" + "absq_s.w %[temp2], %[temp1] \n\t" + "subu %[temp3], %[p1], %[q1] \n\t" + "absq_s.w %[temp4], %[temp3] \n\t" + "sll %[temp2], %[temp2], 2 \n\t" + "addu %[temp2], %[temp2], %[temp4] \n\t" + "subu %[temp4], %[temp2], %[thresh2] \n\t" + "subu %[step1], %[step1], %[hstride] \n\t" + "bgtz %[temp4], 0f \n\t" + " lbux %[p2], %[step1](%[p]) \n\t" + "subu %[step1], %[step1], %[hstride] \n\t" + "lbux %[q2], %[step2](%[p]) \n\t" + "lbux %[p3], %[step1](%[p]) \n\t" + "subu %[temp4], %[p2], %[p1] \n\t" + "addu %[step2], %[step2], %[hstride] \n\t" + "subu %[temp2], %[p3], %[p2] \n\t" + "absq_s.w %[temp4], %[temp4] \n\t" + "absq_s.w %[temp2], %[temp2] \n\t" + "lbux %[q3], %[step2](%[p]) \n\t" + "subu %[temp4], %[temp4], %[ithresh] \n\t" + "negu %[temp1], %[temp1] \n\t" + "bgtz %[temp4], 0f \n\t" + " subu %[temp2], %[temp2], %[ithresh] \n\t" + "subu %[p3], %[p1], %[p0] \n\t" + "bgtz %[temp2], 0f \n\t" + " absq_s.w %[p3], %[p3] \n\t" + "subu %[temp4], %[q3], %[q2] \n\t" + "subu %[pTemp0], %[p], %[hstride] \n\t" + "absq_s.w %[temp4], %[temp4] \n\t" + "subu %[temp2], %[p3], %[ithresh] \n\t" + "sll %[step1], %[temp1], 1 \n\t" + "bgtz %[temp2], 0f \n\t" + " subu %[temp4], %[temp4], %[ithresh] \n\t" + "subu %[temp2], %[q2], %[q1] \n\t" + "bgtz %[temp4], 0f \n\t" + " absq_s.w %[temp2], %[temp2] \n\t" + "subu %[q3], %[q1], %[q0] \n\t" + "absq_s.w %[q3], %[q3] \n\t" + "subu %[temp2], %[temp2], %[ithresh] \n\t" + "addu %[temp1], %[temp1], %[step1] \n\t" + "bgtz %[temp2], 0f \n\t" + " subu %[temp4], %[q3], %[ithresh] \n\t" + "slt %[p3], %[hev_thresh], %[p3] \n\t" + "bgtz %[temp4], 0f \n\t" + " slt %[q3], %[hev_thresh], %[q3] \n\t" + "or %[q3], %[q3], %[p3] \n\t" + "bgtz %[q3], 1f \n\t" + " shra_r.w %[temp2], %[temp1], 3 \n\t" + "addiu %[temp1], %[temp1], 3 \n\t" + "sra %[temp1], %[temp1], 3 \n\t" + "shll_s.w %[temp2], %[temp2], 27 \n\t" + "shll_s.w %[temp1], %[temp1], 27 \n\t" + "addu %[pTemp1], %[p], %[hstride] \n\t" + "sra %[temp2], %[temp2], 27 \n\t" + "sra %[temp1], %[temp1], 27 \n\t" + "addiu %[step1], %[temp2], 1 \n\t" + "sra %[step1], %[step1], 1 \n\t" + "addu %[p0], %[p0], %[temp1] \n\t" + "addu %[p1], %[p1], %[step1] \n\t" + "subu %[q0], %[q0], %[temp2] \n\t" + "subu %[q1], %[q1], %[step1] \n\t" + "lbux %[temp2], %[p0](%[VP8kclip1]) \n\t" + "lbux %[temp3], %[q0](%[VP8kclip1]) \n\t" + "lbux %[temp4], %[q1](%[VP8kclip1]) \n\t" + "sb %[temp2], 0(%[pTemp0]) \n\t" + "lbux %[temp1], %[p1](%[VP8kclip1]) \n\t" + "subu %[pTemp0], %[pTemp0], %[hstride] \n\t" + "sb %[temp3], 0(%[p]) \n\t" + "sb %[temp4], 0(%[pTemp1]) \n\t" + "j 0f \n\t" + " sb %[temp1], 0(%[pTemp0]) \n\t" + "1: \n\t" + "shll_s.w %[temp3], %[temp3], 24 \n\t" + "sra %[temp3], %[temp3], 24 \n\t" + "addu %[temp1], %[temp1], %[temp3] \n\t" + "shra_r.w %[temp2], %[temp1], 3 \n\t" + "addiu %[temp1], %[temp1], 3 \n\t" + "shll_s.w %[temp2], %[temp2], 27 \n\t" + "sra %[temp1], %[temp1], 3 \n\t" + "shll_s.w %[temp1], %[temp1], 27 \n\t" + "sra %[temp2], %[temp2], 27 \n\t" + "sra %[temp1], %[temp1], 27 \n\t" + "addu %[p0], %[p0], %[temp1] \n\t" + "subu %[q0], %[q0], %[temp2] \n\t" + "lbux %[temp1], %[p0](%[VP8kclip1]) \n\t" + "lbux %[temp2], %[q0](%[VP8kclip1]) \n\t" + "sb %[temp2], 0(%[p]) \n\t" + "sb %[temp1], 0(%[pTemp0]) \n\t" + "0: \n\t" + "subu %[size], %[size], 1 \n\t" + "bgtz %[size], 2b \n\t" + " addu %[p], %[p], %[vstride] \n\t" + "3: \n\t" + ".set pop \n\t" + : [p0] "=&r"(p0), [q0] "=&r"(q0), [p1] "=&r"(p1), [q1] "=&r"(q1), + [p2] "=&r"(p2), [q2] "=&r"(q2), [p3] "=&r"(p3), [q3] "=&r"(q3), + [step2] "=&r"(step2), [step1] "=&r"(step1), [temp1] "=&r"(temp1), + [temp2] "=&r"(temp2), [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), + [pTemp0] "=&r"(pTemp0), [pTemp1] "=&r"(pTemp1), [p] "+&r"(p), + [size] "+&r"(size) + : [vstride] "r"(vstride), [ithresh] "r"(ithresh), + [hev_thresh] "r"(hev_thresh), [hstride] "r"(hstride), + [VP8kclip1] "r"(VP8kclip1), [thresh2] "r"(thresh2) + : "memory"); } // on macroblock edges -static void VFilter16(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void VFilter16(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { FilterLoop26(p, stride, 1, 16, thresh, ithresh, hev_thresh); } -static void HFilter16(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void HFilter16(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { FilterLoop26(p, 1, stride, 16, thresh, ithresh, hev_thresh); } @@ -451,8 +449,8 @@ static void HFilter8(uint8_t* WEBP_RESTRICT u, uint8_t* WEBP_RESTRICT v, } // on three inner edges -static void VFilter16i(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void VFilter16i(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { int k; for (k = 3; k > 0; --k) { p += 4 * stride; @@ -460,8 +458,8 @@ static void VFilter16i(uint8_t* p, int stride, } } -static void HFilter16i(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void HFilter16i(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { int k; for (k = 3; k > 0; --k) { p += 4; @@ -489,75 +487,76 @@ static void SimpleVFilter16(uint8_t* p, int stride, int thresh) { const int thresh2 = 2 * thresh + 1; int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8; uint8_t* p1 = p - stride; - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "li %[i], 16 \n\t" - "0: \n\t" - "negu %[temp4], %[stride] \n\t" - "sll %[temp5], %[temp4], 1 \n\t" - "lbu %[temp2], 0(%[p]) \n\t" - "lbux %[temp3], %[stride](%[p]) \n\t" - "lbux %[temp1], %[temp4](%[p]) \n\t" - "lbux %[temp0], %[temp5](%[p]) \n\t" - "subu %[temp7], %[temp1], %[temp2] \n\t" - "subu %[temp6], %[temp0], %[temp3] \n\t" - "absq_s.w %[temp4], %[temp7] \n\t" - "absq_s.w %[temp5], %[temp6] \n\t" - "sll %[temp4], %[temp4], 2 \n\t" - "subu %[temp5], %[temp5], %[thresh2] \n\t" - "addu %[temp5], %[temp4], %[temp5] \n\t" - "negu %[temp8], %[temp7] \n\t" - "bgtz %[temp5], 1f \n\t" - " addiu %[i], %[i], -1 \n\t" - "sll %[temp4], %[temp8], 1 \n\t" - "shll_s.w %[temp5], %[temp6], 24 \n\t" - "addu %[temp3], %[temp4], %[temp8] \n\t" - "sra %[temp5], %[temp5], 24 \n\t" - "addu %[temp3], %[temp3], %[temp5] \n\t" - "addiu %[temp7], %[temp3], 3 \n\t" - "sra %[temp7], %[temp7], 3 \n\t" - "shra_r.w %[temp8], %[temp3], 3 \n\t" - "shll_s.w %[temp0], %[temp7], 27 \n\t" - "shll_s.w %[temp4], %[temp8], 27 \n\t" - "sra %[temp0], %[temp0], 27 \n\t" - "sra %[temp4], %[temp4], 27 \n\t" - "addu %[temp7], %[temp1], %[temp0] \n\t" - "subu %[temp2], %[temp2], %[temp4] \n\t" - "lbux %[temp3], %[temp7](%[VP8kclip1]) \n\t" - "lbux %[temp4], %[temp2](%[VP8kclip1]) \n\t" - "sb %[temp3], 0(%[p1]) \n\t" - "sb %[temp4], 0(%[p]) \n\t" - "1: \n\t" - "addiu %[p1], %[p1], 1 \n\t" - "bgtz %[i], 0b \n\t" - " addiu %[p], %[p], 1 \n\t" - " .set pop \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [temp6]"=&r"(temp6), [temp7]"=&r"(temp7), [temp8]"=&r"(temp8), - [p]"+&r"(p), [i]"=&r"(i), [p1]"+&r"(p1) - : [stride]"r"(stride), [VP8kclip1]"r"(VP8kclip1), [thresh2]"r"(thresh2) - : "memory" - ); + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "li %[i], 16 \n\t" + "0: \n\t" + "negu %[temp4], %[stride] \n\t" + "sll %[temp5], %[temp4], 1 \n\t" + "lbu %[temp2], 0(%[p]) \n\t" + "lbux %[temp3], %[stride](%[p]) \n\t" + "lbux %[temp1], %[temp4](%[p]) \n\t" + "lbux %[temp0], %[temp5](%[p]) \n\t" + "subu %[temp7], %[temp1], %[temp2] \n\t" + "subu %[temp6], %[temp0], %[temp3] \n\t" + "absq_s.w %[temp4], %[temp7] \n\t" + "absq_s.w %[temp5], %[temp6] \n\t" + "sll %[temp4], %[temp4], 2 \n\t" + "subu %[temp5], %[temp5], %[thresh2] \n\t" + "addu %[temp5], %[temp4], %[temp5] \n\t" + "negu %[temp8], %[temp7] \n\t" + "bgtz %[temp5], 1f \n\t" + " addiu %[i], %[i], -1 \n\t" + "sll %[temp4], %[temp8], 1 \n\t" + "shll_s.w %[temp5], %[temp6], 24 \n\t" + "addu %[temp3], %[temp4], %[temp8] \n\t" + "sra %[temp5], %[temp5], 24 \n\t" + "addu %[temp3], %[temp3], %[temp5] \n\t" + "addiu %[temp7], %[temp3], 3 \n\t" + "sra %[temp7], %[temp7], 3 \n\t" + "shra_r.w %[temp8], %[temp3], 3 \n\t" + "shll_s.w %[temp0], %[temp7], 27 \n\t" + "shll_s.w %[temp4], %[temp8], 27 \n\t" + "sra %[temp0], %[temp0], 27 \n\t" + "sra %[temp4], %[temp4], 27 \n\t" + "addu %[temp7], %[temp1], %[temp0] \n\t" + "subu %[temp2], %[temp2], %[temp4] \n\t" + "lbux %[temp3], %[temp7](%[VP8kclip1]) \n\t" + "lbux %[temp4], %[temp2](%[VP8kclip1]) \n\t" + "sb %[temp3], 0(%[p1]) \n\t" + "sb %[temp4], 0(%[p]) \n\t" + "1: \n\t" + "addiu %[p1], %[p1], 1 \n\t" + "bgtz %[i], 0b \n\t" + " addiu %[p], %[p], 1 \n\t" + " .set pop \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [temp6] "=&r"(temp6), [temp7] "=&r"(temp7), [temp8] "=&r"(temp8), + [p] "+&r"(p), [i] "=&r"(i), [p1] "+&r"(p1) + : [stride] "r"(stride), [VP8kclip1] "r"(VP8kclip1), [thresh2] "r"(thresh2) + : "memory"); } // TEMP0 = SRC[A + A1 * BPS] // TEMP1 = SRC[B + B1 * BPS] // TEMP2 = SRC[C + C1 * BPS] // TEMP3 = SRC[D + D1 * BPS] +// clang-format off #define LOAD_4_BYTES(TEMP0, TEMP1, TEMP2, TEMP3, \ A, A1, B, B1, C, C1, D, D1, SRC) \ "lbu %[" #TEMP0 "], " #A "+" #A1 "*" XSTR(BPS) "(%[" #SRC "]) \n\t" \ "lbu %[" #TEMP1 "], " #B "+" #B1 "*" XSTR(BPS) "(%[" #SRC "]) \n\t" \ "lbu %[" #TEMP2 "], " #C "+" #C1 "*" XSTR(BPS) "(%[" #SRC "]) \n\t" \ - "lbu %[" #TEMP3 "], " #D "+" #D1 "*" XSTR(BPS) "(%[" #SRC "]) \n\t" \ + "lbu %[" #TEMP3 "], " #D "+" #D1 "*" XSTR(BPS) "(%[" #SRC "]) \n\t" +// clang-format on static void SimpleHFilter16(uint8_t* p, int stride, int thresh) { int i; const int thresh2 = 2 * thresh + 1; int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8; - __asm__ volatile ( + __asm__ volatile( ".set push \n\t" ".set noreorder \n\t" "li %[i], 16 \n\t" @@ -622,43 +621,44 @@ static void SimpleHFilter16i(uint8_t* p, int stride, int thresh) { // DST[A * BPS] = TEMP0 // DST[B + C * BPS] = TEMP1 +// clang-format off #define STORE_8_BYTES(TEMP0, TEMP1, A, B, C, DST) \ "usw %[" #TEMP0 "], " #A "*" XSTR(BPS) "(%[" #DST "]) \n\t" \ "usw %[" #TEMP1 "], " #B "+" #C "*" XSTR(BPS) "(%[" #DST "]) \n\t" +// clang-format on -static void VE4(uint8_t* dst) { // vertical +static void VE4(uint8_t* dst) { // vertical const uint8_t* top = dst - BPS; int temp0, temp1, temp2, temp3, temp4, temp5, temp6; - __asm__ volatile ( - "ulw %[temp0], -1(%[top]) \n\t" - "ulh %[temp1], 3(%[top]) \n\t" - "preceu.ph.qbr %[temp2], %[temp0] \n\t" - "preceu.ph.qbl %[temp3], %[temp0] \n\t" - "preceu.ph.qbr %[temp4], %[temp1] \n\t" - "packrl.ph %[temp5], %[temp3], %[temp2] \n\t" - "packrl.ph %[temp6], %[temp4], %[temp3] \n\t" - "shll.ph %[temp5], %[temp5], 1 \n\t" - "shll.ph %[temp6], %[temp6], 1 \n\t" - "addq.ph %[temp2], %[temp5], %[temp2] \n\t" - "addq.ph %[temp6], %[temp6], %[temp4] \n\t" - "addq.ph %[temp2], %[temp2], %[temp3] \n\t" - "addq.ph %[temp6], %[temp6], %[temp3] \n\t" - "shra_r.ph %[temp2], %[temp2], 2 \n\t" - "shra_r.ph %[temp6], %[temp6], 2 \n\t" - "precr.qb.ph %[temp4], %[temp6], %[temp2] \n\t" - STORE_8_BYTES(temp4, temp4, 0, 0, 1, dst) - STORE_8_BYTES(temp4, temp4, 2, 0, 3, dst) - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [temp6]"=&r"(temp6) - : [top]"r"(top), [dst]"r"(dst) - : "memory" - ); + __asm__ volatile( + "ulw %[temp0], -1(%[top]) \n\t" + "ulh %[temp1], 3(%[top]) \n\t" + "preceu.ph.qbr %[temp2], %[temp0] \n\t" + "preceu.ph.qbl %[temp3], %[temp0] \n\t" + "preceu.ph.qbr %[temp4], %[temp1] \n\t" + "packrl.ph %[temp5], %[temp3], %[temp2] \n\t" + "packrl.ph %[temp6], %[temp4], %[temp3] \n\t" + "shll.ph %[temp5], %[temp5], 1 \n\t" + "shll.ph %[temp6], %[temp6], 1 \n\t" + "addq.ph %[temp2], %[temp5], %[temp2] \n\t" + "addq.ph %[temp6], %[temp6], %[temp4] \n\t" + "addq.ph %[temp2], %[temp2], %[temp3] \n\t" + "addq.ph %[temp6], %[temp6], %[temp3] \n\t" + "shra_r.ph %[temp2], %[temp2], 2 \n\t" + "shra_r.ph %[temp6], %[temp6], 2 \n\t" + "precr.qb.ph %[temp4], %[temp6], %[temp2] \n\t" // + STORE_8_BYTES(temp4, temp4, 0, 0, 1, dst) // + STORE_8_BYTES(temp4, temp4, 2, 0, 3, dst) + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [temp6] "=&r"(temp6) + : [top] "r"(top), [dst] "r"(dst) + : "memory"); } -static void DC4(uint8_t* dst) { // DC +static void DC4(uint8_t* dst) { // DC int temp0, temp1, temp2, temp3, temp4; - __asm__ volatile ( + __asm__ volatile( "ulw %[temp0], -1*" XSTR(BPS) "(%[dst]) \n\t" LOAD_4_BYTES(temp1, temp2, temp3, temp4, -1, 0, -1, 1, -1, 2, -1, 3, dst) "ins %[temp1], %[temp2], 8, 8 \n\t" @@ -668,8 +668,8 @@ static void DC4(uint8_t* dst) { // DC "raddu.w.qb %[temp1], %[temp1] \n\t" "addu %[temp0], %[temp0], %[temp1] \n\t" "shra_r.w %[temp0], %[temp0], 3 \n\t" - "replv.qb %[temp0], %[temp0] \n\t" - STORE_8_BYTES(temp0, temp0, 0, 0, 1, dst) + "replv.qb %[temp0], %[temp0] \n\t" // + STORE_8_BYTES(temp0, temp0, 0, 0, 1, dst) // STORE_8_BYTES(temp0, temp0, 2, 0, 3, dst) : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), [temp4]"=&r"(temp4) @@ -678,12 +678,12 @@ static void DC4(uint8_t* dst) { // DC ); } -static void RD4(uint8_t* dst) { // Down-right +static void RD4(uint8_t* dst) { // Down-right int temp0, temp1, temp2, temp3, temp4; int temp5, temp6, temp7, temp8; - __asm__ volatile ( + __asm__ volatile( LOAD_4_BYTES(temp0, temp1, temp2, temp3, -1, 0, -1, 1, -1, 2, -1, 3, dst) - "ulw %[temp7], -1-" XSTR(BPS) "(%[dst]) \n\t" + "ulw %[temp7], -1-" XSTR(BPS) "(%[dst]) \n\t" // "ins %[temp1], %[temp0], 16, 16 \n\t" "preceu.ph.qbr %[temp5], %[temp7] \n\t" "ins %[temp2], %[temp1], 16, 16 \n\t" @@ -702,17 +702,17 @@ static void RD4(uint8_t* dst) { // Down-right "shll.ph %[temp0], %[temp0], 1 \n\t" "shra_r.ph %[temp1], %[temp1], 2 \n\t" "addq.ph %[temp8], %[temp0], %[temp8] \n\t" - "lbu %[temp5], 3-" XSTR(BPS) "(%[dst]) \n\t" + "lbu %[temp5], 3-" XSTR(BPS) "(%[dst]) \n\t" // "precrq.ph.w %[temp7], %[temp7], %[temp7] \n\t" "shra_r.ph %[temp8], %[temp8], 2 \n\t" "ins %[temp7], %[temp5], 0, 8 \n\t" "precr.qb.ph %[temp2], %[temp1], %[temp3] \n\t" "raddu.w.qb %[temp4], %[temp7] \n\t" "precr.qb.ph %[temp6], %[temp8], %[temp1] \n\t" - "shra_r.w %[temp4], %[temp4], 2 \n\t" + "shra_r.w %[temp4], %[temp4], 2 \n\t" // STORE_8_BYTES(temp2, temp6, 3, 0, 1, dst) "prepend %[temp2], %[temp8], 8 \n\t" - "prepend %[temp6], %[temp4], 8 \n\t" + "prepend %[temp6], %[temp4], 8 \n\t" // STORE_8_BYTES(temp2, temp6, 2, 0, 0, dst) : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), @@ -724,14 +724,16 @@ static void RD4(uint8_t* dst) { // Down-right // TEMP0 = SRC[A * BPS] // TEMP1 = SRC[B + C * BPS] +// clang-format off #define LOAD_8_BYTES(TEMP0, TEMP1, A, B, C, SRC) \ "ulw %[" #TEMP0 "], " #A "*" XSTR(BPS) "(%[" #SRC "]) \n\t" \ "ulw %[" #TEMP1 "], " #B "+" #C "*" XSTR(BPS) "(%[" #SRC "]) \n\t" +// clang-format on -static void LD4(uint8_t* dst) { // Down-Left +static void LD4(uint8_t* dst) { // Down-Left int temp0, temp1, temp2, temp3, temp4; int temp5, temp6, temp7, temp8, temp9; - __asm__ volatile ( + __asm__ volatile( LOAD_8_BYTES(temp0, temp1, -1, 4, -1, dst) "preceu.ph.qbl %[temp2], %[temp0] \n\t" "preceu.ph.qbr %[temp3], %[temp0] \n\t" @@ -775,10 +777,10 @@ static void LD4(uint8_t* dst) { // Down-Left //------------------------------------------------------------------------------ // Chroma -static void DC8uv(uint8_t* dst) { // DC +static void DC8uv(uint8_t* dst) { // DC int temp0, temp1, temp2, temp3, temp4; int temp5, temp6, temp7, temp8, temp9; - __asm__ volatile ( + __asm__ volatile( LOAD_8_BYTES(temp0, temp1, -1, 4, -1, dst) LOAD_4_BYTES(temp2, temp3, temp4, temp5, -1, 0, -1, 1, -1, 2, -1, 3, dst) LOAD_4_BYTES(temp6, temp7, temp8, temp9, -1, 4, -1, 5, -1, 6, -1, 7, dst) @@ -812,9 +814,9 @@ static void DC8uv(uint8_t* dst) { // DC ); } -static void DC8uvNoLeft(uint8_t* dst) { // DC with no left samples +static void DC8uvNoLeft(uint8_t* dst) { // DC with no left samples int temp0, temp1; - __asm__ volatile ( + __asm__ volatile( LOAD_8_BYTES(temp0, temp1, -1, 4, -1, dst) "raddu.w.qb %[temp0], %[temp0] \n\t" "raddu.w.qb %[temp1], %[temp1] \n\t" @@ -838,7 +840,7 @@ static void DC8uvNoLeft(uint8_t* dst) { // DC with no left samples static void DC8uvNoTop(uint8_t* dst) { // DC with no top samples int temp0, temp1, temp2, temp3, temp4; int temp5, temp6, temp7, temp8; - __asm__ volatile ( + __asm__ volatile( LOAD_4_BYTES(temp2, temp3, temp4, temp5, -1, 0, -1, 1, -1, 2, -1, 3, dst) LOAD_4_BYTES(temp6, temp7, temp8, temp1, -1, 4, -1, 5, -1, 6, -1, 7, dst) "addu %[temp2], %[temp2], %[temp3] \n\t" @@ -870,76 +872,77 @@ static void DC8uvNoTop(uint8_t* dst) { // DC with no top samples #undef STORE_8_BYTES #undef LOAD_4_BYTES -#define CLIPPING(SIZE) \ - "preceu.ph.qbl %[temp2], %[temp0] \n\t" \ - "preceu.ph.qbr %[temp0], %[temp0] \n\t" \ -".if " #SIZE " == 8 \n\t" \ - "preceu.ph.qbl %[temp3], %[temp1] \n\t" \ - "preceu.ph.qbr %[temp1], %[temp1] \n\t" \ -".endif \n\t" \ - "addu.ph %[temp2], %[temp2], %[dst_1] \n\t" \ - "addu.ph %[temp0], %[temp0], %[dst_1] \n\t" \ -".if " #SIZE " == 8 \n\t" \ - "addu.ph %[temp3], %[temp3], %[dst_1] \n\t" \ - "addu.ph %[temp1], %[temp1], %[dst_1] \n\t" \ -".endif \n\t" \ - "shll_s.ph %[temp2], %[temp2], 7 \n\t" \ - "shll_s.ph %[temp0], %[temp0], 7 \n\t" \ -".if " #SIZE " == 8 \n\t" \ - "shll_s.ph %[temp3], %[temp3], 7 \n\t" \ - "shll_s.ph %[temp1], %[temp1], 7 \n\t" \ -".endif \n\t" \ - "precrqu_s.qb.ph %[temp0], %[temp2], %[temp0] \n\t" \ -".if " #SIZE " == 8 \n\t" \ - "precrqu_s.qb.ph %[temp1], %[temp3], %[temp1] \n\t" \ +// clang-format off +#define CLIPPING(SIZE) \ + "preceu.ph.qbl %[temp2], %[temp0] \n\t" \ + "preceu.ph.qbr %[temp0], %[temp0] \n\t" \ +".if " #SIZE " == 8 \n\t" \ + "preceu.ph.qbl %[temp3], %[temp1] \n\t" \ + "preceu.ph.qbr %[temp1], %[temp1] \n\t" \ +".endif \n\t" \ + "addu.ph %[temp2], %[temp2], %[dst_1] \n\t" \ + "addu.ph %[temp0], %[temp0], %[dst_1] \n\t" \ +".if " #SIZE " == 8 \n\t" \ + "addu.ph %[temp3], %[temp3], %[dst_1] \n\t" \ + "addu.ph %[temp1], %[temp1], %[dst_1] \n\t" \ +".endif \n\t" \ + "shll_s.ph %[temp2], %[temp2], 7 \n\t" \ + "shll_s.ph %[temp0], %[temp0], 7 \n\t" \ +".if " #SIZE " == 8 \n\t" \ + "shll_s.ph %[temp3], %[temp3], 7 \n\t" \ + "shll_s.ph %[temp1], %[temp1], 7 \n\t" \ +".endif \n\t" \ + "precrqu_s.qb.ph %[temp0], %[temp2], %[temp0] \n\t" \ +".if " #SIZE " == 8 \n\t" \ + "precrqu_s.qb.ph %[temp1], %[temp3], %[temp1] \n\t" \ ".endif \n\t" +#define CLIP_8B_TO_DST(DST, TOP, SIZE) \ + do { \ + int dst_1 = ((int)(DST)[-1] << 16) + (DST)[-1]; \ + int temp0, temp1, temp2, temp3; \ + __asm__ volatile( \ + ".if " #SIZE " < 8 \n\t" \ + "ulw %[temp0], 0(%[top]) \n\t" \ + "subu.ph %[dst_1], %[dst_1], %[top_1] \n\t" \ + CLIPPING(4) \ + "usw %[temp0], 0(%[dst]) \n\t" \ + ".else \n\t" \ + "ulw %[temp0], 0(%[top]) \n\t" \ + "ulw %[temp1], 4(%[top]) \n\t" \ + "subu.ph %[dst_1], %[dst_1], %[top_1] \n\t" \ + CLIPPING(8) \ + "usw %[temp0], 0(%[dst]) \n\t" \ + "usw %[temp1], 4(%[dst]) \n\t" \ + ".if " #SIZE " == 16 \n\t" \ + "ulw %[temp0], 8(%[top]) \n\t" \ + "ulw %[temp1], 12(%[top]) \n\t" \ + CLIPPING(8) \ + "usw %[temp0], 8(%[dst]) \n\t" \ + "usw %[temp1], 12(%[dst]) \n\t" \ + ".endif \n\t" \ + ".endif \n\t" \ + : [dst_1]"+&r"(dst_1), [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), \ + [temp2]"=&r"(temp2), [temp3]"=&r"(temp3) \ + : [top_1]"r"(top_1), [top]"r"((TOP)), [dst]"r"((DST)) \ + : "memory" \ + ); \ + } while (0) +// clang-format on -#define CLIP_8B_TO_DST(DST, TOP, SIZE) do { \ - int dst_1 = ((int)(DST)[-1] << 16) + (DST)[-1]; \ - int temp0, temp1, temp2, temp3; \ - __asm__ volatile ( \ - ".if " #SIZE " < 8 \n\t" \ - "ulw %[temp0], 0(%[top]) \n\t" \ - "subu.ph %[dst_1], %[dst_1], %[top_1] \n\t" \ - CLIPPING(4) \ - "usw %[temp0], 0(%[dst]) \n\t" \ - ".else \n\t" \ - "ulw %[temp0], 0(%[top]) \n\t" \ - "ulw %[temp1], 4(%[top]) \n\t" \ - "subu.ph %[dst_1], %[dst_1], %[top_1] \n\t" \ - CLIPPING(8) \ - "usw %[temp0], 0(%[dst]) \n\t" \ - "usw %[temp1], 4(%[dst]) \n\t" \ - ".if " #SIZE " == 16 \n\t" \ - "ulw %[temp0], 8(%[top]) \n\t" \ - "ulw %[temp1], 12(%[top]) \n\t" \ - CLIPPING(8) \ - "usw %[temp0], 8(%[dst]) \n\t" \ - "usw %[temp1], 12(%[dst]) \n\t" \ - ".endif \n\t" \ - ".endif \n\t" \ - : [dst_1]"+&r"(dst_1), [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), \ - [temp2]"=&r"(temp2), [temp3]"=&r"(temp3) \ - : [top_1]"r"(top_1), [top]"r"((TOP)), [dst]"r"((DST)) \ - : "memory" \ - ); \ -} while (0) +#define CLIP_TO_DST(DST, SIZE) \ + do { \ + int y; \ + const uint8_t* top = (DST) - BPS; \ + const int top_1 = ((int)top[-1] << 16) + top[-1]; \ + for (y = 0; y < (SIZE); ++y) { \ + CLIP_8B_TO_DST((DST), top, (SIZE)); \ + (DST) += BPS; \ + } \ + } while (0) -#define CLIP_TO_DST(DST, SIZE) do { \ - int y; \ - const uint8_t* top = (DST) - BPS; \ - const int top_1 = ((int)top[-1] << 16) + top[-1]; \ - for (y = 0; y < (SIZE); ++y) { \ - CLIP_8B_TO_DST((DST), top, (SIZE)); \ - (DST) += BPS; \ - } \ -} while (0) - -#define TRUE_MOTION(DST, SIZE) \ -static void TrueMotion##SIZE(uint8_t* (DST)) { \ - CLIP_TO_DST((DST), (SIZE)); \ -} +#define TRUE_MOTION(DST, SIZE) \ + static void TrueMotion##SIZE(uint8_t*(DST)) { CLIP_TO_DST((DST), (SIZE)); } TRUE_MOTION(dst, 4) TRUE_MOTION(dst, 8) diff --git a/src/dsp/dec_msa.c b/src/dsp/dec_msa.c index 422b3632..f8d7c5c2 100644 --- a/src/dsp/dec_msa.c +++ b/src/dsp/dec_msa.c @@ -11,7 +11,6 @@ // // Author(s): Prashant Patil (prashant.patil@imgtec.com) - #include "src/dsp/dsp.h" #if defined(WEBP_USE_MSA) @@ -21,29 +20,30 @@ //------------------------------------------------------------------------------ // Transforms -#define IDCT_1D_W(in0, in1, in2, in3, out0, out1, out2, out3) { \ - v4i32 a1_m, b1_m, c1_m, d1_m; \ - v4i32 c_tmp1_m, c_tmp2_m, d_tmp1_m, d_tmp2_m; \ - const v4i32 cospi8sqrt2minus1 = __msa_fill_w(20091); \ - const v4i32 sinpi8sqrt2 = __msa_fill_w(35468); \ +#define IDCT_1D_W(in0, in1, in2, in3, out0, out1, out2, out3) \ + { \ + v4i32 a1_m, b1_m, c1_m, d1_m; \ + v4i32 c_tmp1_m, c_tmp2_m, d_tmp1_m, d_tmp2_m; \ + const v4i32 cospi8sqrt2minus1 = __msa_fill_w(20091); \ + const v4i32 sinpi8sqrt2 = __msa_fill_w(35468); \ \ - a1_m = in0 + in2; \ - b1_m = in0 - in2; \ - c_tmp1_m = (in1 * sinpi8sqrt2) >> 16; \ - c_tmp2_m = in3 + ((in3 * cospi8sqrt2minus1) >> 16); \ - c1_m = c_tmp1_m - c_tmp2_m; \ - d_tmp1_m = in1 + ((in1 * cospi8sqrt2minus1) >> 16); \ - d_tmp2_m = (in3 * sinpi8sqrt2) >> 16; \ - d1_m = d_tmp1_m + d_tmp2_m; \ - BUTTERFLY_4(a1_m, b1_m, c1_m, d1_m, out0, out1, out2, out3); \ -} + a1_m = in0 + in2; \ + b1_m = in0 - in2; \ + c_tmp1_m = (in1 * sinpi8sqrt2) >> 16; \ + c_tmp2_m = in3 + ((in3 * cospi8sqrt2minus1) >> 16); \ + c1_m = c_tmp1_m - c_tmp2_m; \ + d_tmp1_m = in1 + ((in1 * cospi8sqrt2minus1) >> 16); \ + d_tmp2_m = (in3 * sinpi8sqrt2) >> 16; \ + d1_m = d_tmp1_m + d_tmp2_m; \ + BUTTERFLY_4(a1_m, b1_m, c1_m, d1_m, out0, out1, out2, out3); \ + } static void TransformOne(const int16_t* WEBP_RESTRICT in, uint8_t* WEBP_RESTRICT dst) { v8i16 input0, input1; v4i32 in0, in1, in2, in3, hz0, hz1, hz2, hz3, vt0, vt1, vt2, vt3; v4i32 res0, res1, res2, res3; - const v16i8 zero = { 0 }; + const v16i8 zero = {0}; v16i8 dest0, dest1, dest2, dest3; LD_SH2(in, 8, input0, input1); @@ -55,10 +55,10 @@ static void TransformOne(const int16_t* WEBP_RESTRICT in, SRARI_W4_SW(vt0, vt1, vt2, vt3, 3); TRANSPOSE4x4_SW_SW(vt0, vt1, vt2, vt3, vt0, vt1, vt2, vt3); LD_SB4(dst, BPS, dest0, dest1, dest2, dest3); - ILVR_B4_SW(zero, dest0, zero, dest1, zero, dest2, zero, dest3, - res0, res1, res2, res3); - ILVR_H4_SW(zero, res0, zero, res1, zero, res2, zero, res3, - res0, res1, res2, res3); + ILVR_B4_SW(zero, dest0, zero, dest1, zero, dest2, zero, dest3, res0, res1, + res2, res3); + ILVR_H4_SW(zero, res0, zero, res1, zero, res2, zero, res3, res0, res1, res2, + res3); ADD4(res0, vt0, res1, vt1, res2, vt2, res3, vt3, res0, res1, res2, res3); CLIP_SW4_0_255(res0, res1, res2, res3); PCKEV_B2_SW(res0, res1, res2, res3, vt0, vt1); @@ -77,10 +77,10 @@ static void TransformTwo(const int16_t* WEBP_RESTRICT in, static void TransformWHT(const int16_t* WEBP_RESTRICT in, int16_t* WEBP_RESTRICT out) { v8i16 input0, input1; - const v8i16 mask0 = { 0, 1, 2, 3, 8, 9, 10, 11 }; - const v8i16 mask1 = { 4, 5, 6, 7, 12, 13, 14, 15 }; - const v8i16 mask2 = { 0, 4, 8, 12, 1, 5, 9, 13 }; - const v8i16 mask3 = { 3, 7, 11, 15, 2, 6, 10, 14 }; + const v8i16 mask0 = {0, 1, 2, 3, 8, 9, 10, 11}; + const v8i16 mask1 = {4, 5, 6, 7, 12, 13, 14, 15}; + const v8i16 mask2 = {0, 4, 8, 12, 1, 5, 9, 13}; + const v8i16 mask3 = {3, 7, 11, 15, 2, 6, 10, 14}; v8i16 tmp0, tmp1, tmp2, tmp3; v8i16 out0, out1; @@ -131,24 +131,23 @@ static void TransformAC3(const int16_t* WEBP_RESTRICT in, const int d4 = WEBP_TRANSFORM_AC3_MUL1(in[4]); const int in2 = WEBP_TRANSFORM_AC3_MUL2(in[1]); const int in3 = WEBP_TRANSFORM_AC3_MUL1(in[1]); - v4i32 tmp0 = { 0 }; + v4i32 tmp0 = {0}; v4i32 out0 = __msa_fill_w(a + d4); v4i32 out1 = __msa_fill_w(a + c4); v4i32 out2 = __msa_fill_w(a - c4); v4i32 out3 = __msa_fill_w(a - d4); v4i32 res0, res1, res2, res3; - const v4i32 zero = { 0 }; + const v4i32 zero = {0}; v16u8 dest0, dest1, dest2, dest3; INSERT_W4_SW(in3, in2, -in2, -in3, tmp0); - ADD4(out0, tmp0, out1, tmp0, out2, tmp0, out3, tmp0, - out0, out1, out2, out3); + ADD4(out0, tmp0, out1, tmp0, out2, tmp0, out3, tmp0, out0, out1, out2, out3); SRAI_W4_SW(out0, out1, out2, out3, 3); LD_UB4(dst, BPS, dest0, dest1, dest2, dest3); - ILVR_B4_SW(zero, dest0, zero, dest1, zero, dest2, zero, dest3, - res0, res1, res2, res3); - ILVR_H4_SW(zero, res0, zero, res1, zero, res2, zero, res3, - res0, res1, res2, res3); + ILVR_B4_SW(zero, dest0, zero, dest1, zero, dest2, zero, dest3, res0, res1, + res2, res3); + ILVR_H4_SW(zero, res0, zero, res1, zero, res2, zero, res3, res0, res1, res2, + res3); ADD4(res0, out0, res1, out1, res2, out2, res3, out3, res0, res1, res2, res3); CLIP_SW4_0_255(res0, res1, res2, res3); PCKEV_B2_SW(res0, res1, res2, res3, out0, out1); @@ -159,189 +158,198 @@ static void TransformAC3(const int16_t* WEBP_RESTRICT in, //------------------------------------------------------------------------------ // Edge filtering functions -#define FLIP_SIGN2(in0, in1, out0, out1) { \ - out0 = (v16i8)__msa_xori_b(in0, 0x80); \ - out1 = (v16i8)__msa_xori_b(in1, 0x80); \ -} +#define FLIP_SIGN2(in0, in1, out0, out1) \ + { \ + out0 = (v16i8)__msa_xori_b(in0, 0x80); \ + out1 = (v16i8)__msa_xori_b(in1, 0x80); \ + } -#define FLIP_SIGN4(in0, in1, in2, in3, out0, out1, out2, out3) { \ - FLIP_SIGN2(in0, in1, out0, out1); \ - FLIP_SIGN2(in2, in3, out2, out3); \ -} +#define FLIP_SIGN4(in0, in1, in2, in3, out0, out1, out2, out3) \ + { \ + FLIP_SIGN2(in0, in1, out0, out1); \ + FLIP_SIGN2(in2, in3, out2, out3); \ + } -#define FILT_VAL(q0_m, p0_m, mask, filt) do { \ - v16i8 q0_sub_p0; \ - q0_sub_p0 = __msa_subs_s_b(q0_m, p0_m); \ - filt = __msa_adds_s_b(filt, q0_sub_p0); \ - filt = __msa_adds_s_b(filt, q0_sub_p0); \ - filt = __msa_adds_s_b(filt, q0_sub_p0); \ - filt = filt & mask; \ -} while (0) +#define FILT_VAL(q0_m, p0_m, mask, filt) \ + do { \ + v16i8 q0_sub_p0; \ + q0_sub_p0 = __msa_subs_s_b(q0_m, p0_m); \ + filt = __msa_adds_s_b(filt, q0_sub_p0); \ + filt = __msa_adds_s_b(filt, q0_sub_p0); \ + filt = __msa_adds_s_b(filt, q0_sub_p0); \ + filt = filt & mask; \ + } while (0) -#define FILT2(q_m, p_m, q, p) do { \ - u_r = SRAI_H(temp1, 7); \ - u_r = __msa_sat_s_h(u_r, 7); \ - u_l = SRAI_H(temp3, 7); \ - u_l = __msa_sat_s_h(u_l, 7); \ - u = __msa_pckev_b((v16i8)u_l, (v16i8)u_r); \ - q_m = __msa_subs_s_b(q_m, u); \ - p_m = __msa_adds_s_b(p_m, u); \ - q = __msa_xori_b((v16u8)q_m, 0x80); \ - p = __msa_xori_b((v16u8)p_m, 0x80); \ -} while (0) +#define FILT2(q_m, p_m, q, p) \ + do { \ + u_r = SRAI_H(temp1, 7); \ + u_r = __msa_sat_s_h(u_r, 7); \ + u_l = SRAI_H(temp3, 7); \ + u_l = __msa_sat_s_h(u_l, 7); \ + u = __msa_pckev_b((v16i8)u_l, (v16i8)u_r); \ + q_m = __msa_subs_s_b(q_m, u); \ + p_m = __msa_adds_s_b(p_m, u); \ + q = __msa_xori_b((v16u8)q_m, 0x80); \ + p = __msa_xori_b((v16u8)p_m, 0x80); \ + } while (0) -#define LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev) do { \ - v16i8 p1_m, p0_m, q0_m, q1_m; \ - v16i8 filt, t1, t2; \ - const v16i8 cnst4b = __msa_ldi_b(4); \ - const v16i8 cnst3b = __msa_ldi_b(3); \ +#define LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev) \ + do { \ + v16i8 p1_m, p0_m, q0_m, q1_m; \ + v16i8 filt, t1, t2; \ + const v16i8 cnst4b = __msa_ldi_b(4); \ + const v16i8 cnst3b = __msa_ldi_b(3); \ \ - FLIP_SIGN4(p1, p0, q0, q1, p1_m, p0_m, q0_m, q1_m); \ - filt = __msa_subs_s_b(p1_m, q1_m); \ - filt = filt & hev; \ - FILT_VAL(q0_m, p0_m, mask, filt); \ - t1 = __msa_adds_s_b(filt, cnst4b); \ - t1 = SRAI_B(t1, 3); \ - t2 = __msa_adds_s_b(filt, cnst3b); \ - t2 = SRAI_B(t2, 3); \ - q0_m = __msa_subs_s_b(q0_m, t1); \ - q0 = __msa_xori_b((v16u8)q0_m, 0x80); \ - p0_m = __msa_adds_s_b(p0_m, t2); \ - p0 = __msa_xori_b((v16u8)p0_m, 0x80); \ - filt = __msa_srari_b(t1, 1); \ - hev = __msa_xori_b(hev, 0xff); \ - filt = filt & hev; \ - q1_m = __msa_subs_s_b(q1_m, filt); \ - q1 = __msa_xori_b((v16u8)q1_m, 0x80); \ - p1_m = __msa_adds_s_b(p1_m, filt); \ - p1 = __msa_xori_b((v16u8)p1_m, 0x80); \ -} while (0) + FLIP_SIGN4(p1, p0, q0, q1, p1_m, p0_m, q0_m, q1_m); \ + filt = __msa_subs_s_b(p1_m, q1_m); \ + filt = filt & hev; \ + FILT_VAL(q0_m, p0_m, mask, filt); \ + t1 = __msa_adds_s_b(filt, cnst4b); \ + t1 = SRAI_B(t1, 3); \ + t2 = __msa_adds_s_b(filt, cnst3b); \ + t2 = SRAI_B(t2, 3); \ + q0_m = __msa_subs_s_b(q0_m, t1); \ + q0 = __msa_xori_b((v16u8)q0_m, 0x80); \ + p0_m = __msa_adds_s_b(p0_m, t2); \ + p0 = __msa_xori_b((v16u8)p0_m, 0x80); \ + filt = __msa_srari_b(t1, 1); \ + hev = __msa_xori_b(hev, 0xff); \ + filt = filt & hev; \ + q1_m = __msa_subs_s_b(q1_m, filt); \ + q1 = __msa_xori_b((v16u8)q1_m, 0x80); \ + p1_m = __msa_adds_s_b(p1_m, filt); \ + p1 = __msa_xori_b((v16u8)p1_m, 0x80); \ + } while (0) -#define LPF_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev) do { \ - v16i8 p2_m, p1_m, p0_m, q2_m, q1_m, q0_m; \ - v16i8 u, filt, t1, t2, filt_sign; \ - v8i16 filt_r, filt_l, u_r, u_l; \ - v8i16 temp0, temp1, temp2, temp3; \ - const v16i8 cnst4b = __msa_ldi_b(4); \ - const v16i8 cnst3b = __msa_ldi_b(3); \ - const v8i16 cnst9h = __msa_ldi_h(9); \ - const v8i16 cnst63h = __msa_ldi_h(63); \ +#define LPF_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev) \ + do { \ + v16i8 p2_m, p1_m, p0_m, q2_m, q1_m, q0_m; \ + v16i8 u, filt, t1, t2, filt_sign; \ + v8i16 filt_r, filt_l, u_r, u_l; \ + v8i16 temp0, temp1, temp2, temp3; \ + const v16i8 cnst4b = __msa_ldi_b(4); \ + const v16i8 cnst3b = __msa_ldi_b(3); \ + const v8i16 cnst9h = __msa_ldi_h(9); \ + const v8i16 cnst63h = __msa_ldi_h(63); \ + \ + FLIP_SIGN4(p1, p0, q0, q1, p1_m, p0_m, q0_m, q1_m); \ + filt = __msa_subs_s_b(p1_m, q1_m); \ + FILT_VAL(q0_m, p0_m, mask, filt); \ + FLIP_SIGN2(p2, q2, p2_m, q2_m); \ + t2 = filt & hev; \ + /* filt_val &= ~hev */ \ + hev = __msa_xori_b(hev, 0xff); \ + filt = filt & hev; \ + t1 = __msa_adds_s_b(t2, cnst4b); \ + t1 = SRAI_B(t1, 3); \ + t2 = __msa_adds_s_b(t2, cnst3b); \ + t2 = SRAI_B(t2, 3); \ + q0_m = __msa_subs_s_b(q0_m, t1); \ + p0_m = __msa_adds_s_b(p0_m, t2); \ + filt_sign = __msa_clti_s_b(filt, 0); \ + ILVRL_B2_SH(filt_sign, filt, filt_r, filt_l); \ + /* update q2/p2 */ \ + temp0 = filt_r * cnst9h; \ + temp1 = temp0 + cnst63h; \ + temp2 = filt_l * cnst9h; \ + temp3 = temp2 + cnst63h; \ + FILT2(q2_m, p2_m, q2, p2); \ + /* update q1/p1 */ \ + temp1 = temp1 + temp0; \ + temp3 = temp3 + temp2; \ + FILT2(q1_m, p1_m, q1, p1); \ + /* update q0/p0 */ \ + temp1 = temp1 + temp0; \ + temp3 = temp3 + temp2; \ + FILT2(q0_m, p0_m, q0, p0); \ + } while (0) + +#define LPF_MASK_HEV(p3_in, p2_in, p1_in, p0_in, q0_in, q1_in, q2_in, q3_in, \ + limit_in, b_limit_in, thresh_in, hev_out, mask_out) \ + do { \ + v16u8 p3_asub_p2_m, p2_asub_p1_m, p1_asub_p0_m, q1_asub_q0_m; \ + v16u8 p1_asub_q1_m, p0_asub_q0_m, q3_asub_q2_m, q2_asub_q1_m; \ + v16u8 flat_out; \ + \ + /* absolute subtraction of pixel values */ \ + p3_asub_p2_m = __msa_asub_u_b(p3_in, p2_in); \ + p2_asub_p1_m = __msa_asub_u_b(p2_in, p1_in); \ + p1_asub_p0_m = __msa_asub_u_b(p1_in, p0_in); \ + q1_asub_q0_m = __msa_asub_u_b(q1_in, q0_in); \ + q2_asub_q1_m = __msa_asub_u_b(q2_in, q1_in); \ + q3_asub_q2_m = __msa_asub_u_b(q3_in, q2_in); \ + p0_asub_q0_m = __msa_asub_u_b(p0_in, q0_in); \ + p1_asub_q1_m = __msa_asub_u_b(p1_in, q1_in); \ + /* calculation of hev */ \ + flat_out = __msa_max_u_b(p1_asub_p0_m, q1_asub_q0_m); \ + hev_out = (thresh_in < flat_out); \ + /* calculation of mask */ \ + p0_asub_q0_m = __msa_adds_u_b(p0_asub_q0_m, p0_asub_q0_m); \ + p1_asub_q1_m = SRAI_B(p1_asub_q1_m, 1); \ + p0_asub_q0_m = __msa_adds_u_b(p0_asub_q0_m, p1_asub_q1_m); \ + mask_out = (b_limit_in < p0_asub_q0_m); \ + mask_out = __msa_max_u_b(flat_out, mask_out); \ + p3_asub_p2_m = __msa_max_u_b(p3_asub_p2_m, p2_asub_p1_m); \ + mask_out = __msa_max_u_b(p3_asub_p2_m, mask_out); \ + q2_asub_q1_m = __msa_max_u_b(q2_asub_q1_m, q3_asub_q2_m); \ + mask_out = __msa_max_u_b(q2_asub_q1_m, mask_out); \ + mask_out = (limit_in < mask_out); \ + mask_out = __msa_xori_b(mask_out, 0xff); \ + } while (0) + +#define ST6x1_UB(in0, in0_idx, in1, in1_idx, pdst, stride) \ + do { \ + const uint16_t tmp0_h = __msa_copy_s_h((v8i16)in1, in1_idx); \ + const uint32_t tmp0_w = __msa_copy_s_w((v4i32)in0, in0_idx); \ + SW(tmp0_w, pdst); \ + SH(tmp0_h, pdst + stride); \ + } while (0) + +#define ST6x4_UB(in0, start_in0_idx, in1, start_in1_idx, pdst, stride) \ + do { \ + uint8_t* ptmp1 = (uint8_t*)pdst; \ + ST6x1_UB(in0, start_in0_idx, in1, start_in1_idx, ptmp1, 4); \ + ptmp1 += stride; \ + ST6x1_UB(in0, start_in0_idx + 1, in1, start_in1_idx + 1, ptmp1, 4); \ + ptmp1 += stride; \ + ST6x1_UB(in0, start_in0_idx + 2, in1, start_in1_idx + 2, ptmp1, 4); \ + ptmp1 += stride; \ + ST6x1_UB(in0, start_in0_idx + 3, in1, start_in1_idx + 3, ptmp1, 4); \ + } while (0) + +#define LPF_SIMPLE_FILT(p1_in, p0_in, q0_in, q1_in, mask) \ + do { \ + v16i8 p1_m, p0_m, q0_m, q1_m, filt, filt1, filt2; \ + const v16i8 cnst4b = __msa_ldi_b(4); \ + const v16i8 cnst3b = __msa_ldi_b(3); \ + \ + FLIP_SIGN4(p1_in, p0_in, q0_in, q1_in, p1_m, p0_m, q0_m, q1_m); \ + filt = __msa_subs_s_b(p1_m, q1_m); \ + FILT_VAL(q0_m, p0_m, mask, filt); \ + filt1 = __msa_adds_s_b(filt, cnst4b); \ + filt1 = SRAI_B(filt1, 3); \ + filt2 = __msa_adds_s_b(filt, cnst3b); \ + filt2 = SRAI_B(filt2, 3); \ + q0_m = __msa_subs_s_b(q0_m, filt1); \ + p0_m = __msa_adds_s_b(p0_m, filt2); \ + q0_in = __msa_xori_b((v16u8)q0_m, 0x80); \ + p0_in = __msa_xori_b((v16u8)p0_m, 0x80); \ + } while (0) + +#define LPF_SIMPLE_MASK(p1, p0, q0, q1, b_limit, mask) \ + do { \ + v16u8 p1_a_sub_q1, p0_a_sub_q0; \ \ - FLIP_SIGN4(p1, p0, q0, q1, p1_m, p0_m, q0_m, q1_m); \ - filt = __msa_subs_s_b(p1_m, q1_m); \ - FILT_VAL(q0_m, p0_m, mask, filt); \ - FLIP_SIGN2(p2, q2, p2_m, q2_m); \ - t2 = filt & hev; \ - /* filt_val &= ~hev */ \ - hev = __msa_xori_b(hev, 0xff); \ - filt = filt & hev; \ - t1 = __msa_adds_s_b(t2, cnst4b); \ - t1 = SRAI_B(t1, 3); \ - t2 = __msa_adds_s_b(t2, cnst3b); \ - t2 = SRAI_B(t2, 3); \ - q0_m = __msa_subs_s_b(q0_m, t1); \ - p0_m = __msa_adds_s_b(p0_m, t2); \ - filt_sign = __msa_clti_s_b(filt, 0); \ - ILVRL_B2_SH(filt_sign, filt, filt_r, filt_l); \ - /* update q2/p2 */ \ - temp0 = filt_r * cnst9h; \ - temp1 = temp0 + cnst63h; \ - temp2 = filt_l * cnst9h; \ - temp3 = temp2 + cnst63h; \ - FILT2(q2_m, p2_m, q2, p2); \ - /* update q1/p1 */ \ - temp1 = temp1 + temp0; \ - temp3 = temp3 + temp2; \ - FILT2(q1_m, p1_m, q1, p1); \ - /* update q0/p0 */ \ - temp1 = temp1 + temp0; \ - temp3 = temp3 + temp2; \ - FILT2(q0_m, p0_m, q0, p0); \ -} while (0) + p0_a_sub_q0 = __msa_asub_u_b(p0, q0); \ + p1_a_sub_q1 = __msa_asub_u_b(p1, q1); \ + p1_a_sub_q1 = (v16u8)__msa_srli_b((v16i8)p1_a_sub_q1, 1); \ + p0_a_sub_q0 = __msa_adds_u_b(p0_a_sub_q0, p0_a_sub_q0); \ + mask = __msa_adds_u_b(p0_a_sub_q0, p1_a_sub_q1); \ + mask = (mask <= b_limit); \ + } while (0) -#define LPF_MASK_HEV(p3_in, p2_in, p1_in, p0_in, \ - q0_in, q1_in, q2_in, q3_in, \ - limit_in, b_limit_in, thresh_in, \ - hev_out, mask_out) do { \ - v16u8 p3_asub_p2_m, p2_asub_p1_m, p1_asub_p0_m, q1_asub_q0_m; \ - v16u8 p1_asub_q1_m, p0_asub_q0_m, q3_asub_q2_m, q2_asub_q1_m; \ - v16u8 flat_out; \ - \ - /* absolute subtraction of pixel values */ \ - p3_asub_p2_m = __msa_asub_u_b(p3_in, p2_in); \ - p2_asub_p1_m = __msa_asub_u_b(p2_in, p1_in); \ - p1_asub_p0_m = __msa_asub_u_b(p1_in, p0_in); \ - q1_asub_q0_m = __msa_asub_u_b(q1_in, q0_in); \ - q2_asub_q1_m = __msa_asub_u_b(q2_in, q1_in); \ - q3_asub_q2_m = __msa_asub_u_b(q3_in, q2_in); \ - p0_asub_q0_m = __msa_asub_u_b(p0_in, q0_in); \ - p1_asub_q1_m = __msa_asub_u_b(p1_in, q1_in); \ - /* calculation of hev */ \ - flat_out = __msa_max_u_b(p1_asub_p0_m, q1_asub_q0_m); \ - hev_out = (thresh_in < flat_out); \ - /* calculation of mask */ \ - p0_asub_q0_m = __msa_adds_u_b(p0_asub_q0_m, p0_asub_q0_m); \ - p1_asub_q1_m = SRAI_B(p1_asub_q1_m, 1); \ - p0_asub_q0_m = __msa_adds_u_b(p0_asub_q0_m, p1_asub_q1_m); \ - mask_out = (b_limit_in < p0_asub_q0_m); \ - mask_out = __msa_max_u_b(flat_out, mask_out); \ - p3_asub_p2_m = __msa_max_u_b(p3_asub_p2_m, p2_asub_p1_m); \ - mask_out = __msa_max_u_b(p3_asub_p2_m, mask_out); \ - q2_asub_q1_m = __msa_max_u_b(q2_asub_q1_m, q3_asub_q2_m); \ - mask_out = __msa_max_u_b(q2_asub_q1_m, mask_out); \ - mask_out = (limit_in < mask_out); \ - mask_out = __msa_xori_b(mask_out, 0xff); \ -} while (0) - -#define ST6x1_UB(in0, in0_idx, in1, in1_idx, pdst, stride) do { \ - const uint16_t tmp0_h = __msa_copy_s_h((v8i16)in1, in1_idx); \ - const uint32_t tmp0_w = __msa_copy_s_w((v4i32)in0, in0_idx); \ - SW(tmp0_w, pdst); \ - SH(tmp0_h, pdst + stride); \ -} while (0) - -#define ST6x4_UB(in0, start_in0_idx, in1, start_in1_idx, pdst, stride) do { \ - uint8_t* ptmp1 = (uint8_t*)pdst; \ - ST6x1_UB(in0, start_in0_idx, in1, start_in1_idx, ptmp1, 4); \ - ptmp1 += stride; \ - ST6x1_UB(in0, start_in0_idx + 1, in1, start_in1_idx + 1, ptmp1, 4); \ - ptmp1 += stride; \ - ST6x1_UB(in0, start_in0_idx + 2, in1, start_in1_idx + 2, ptmp1, 4); \ - ptmp1 += stride; \ - ST6x1_UB(in0, start_in0_idx + 3, in1, start_in1_idx + 3, ptmp1, 4); \ -} while (0) - -#define LPF_SIMPLE_FILT(p1_in, p0_in, q0_in, q1_in, mask) do { \ - v16i8 p1_m, p0_m, q0_m, q1_m, filt, filt1, filt2; \ - const v16i8 cnst4b = __msa_ldi_b(4); \ - const v16i8 cnst3b = __msa_ldi_b(3); \ - \ - FLIP_SIGN4(p1_in, p0_in, q0_in, q1_in, p1_m, p0_m, q0_m, q1_m); \ - filt = __msa_subs_s_b(p1_m, q1_m); \ - FILT_VAL(q0_m, p0_m, mask, filt); \ - filt1 = __msa_adds_s_b(filt, cnst4b); \ - filt1 = SRAI_B(filt1, 3); \ - filt2 = __msa_adds_s_b(filt, cnst3b); \ - filt2 = SRAI_B(filt2, 3); \ - q0_m = __msa_subs_s_b(q0_m, filt1); \ - p0_m = __msa_adds_s_b(p0_m, filt2); \ - q0_in = __msa_xori_b((v16u8)q0_m, 0x80); \ - p0_in = __msa_xori_b((v16u8)p0_m, 0x80); \ -} while (0) - -#define LPF_SIMPLE_MASK(p1, p0, q0, q1, b_limit, mask) do { \ - v16u8 p1_a_sub_q1, p0_a_sub_q0; \ - \ - p0_a_sub_q0 = __msa_asub_u_b(p0, q0); \ - p1_a_sub_q1 = __msa_asub_u_b(p1, q1); \ - p1_a_sub_q1 = (v16u8)__msa_srli_b((v16i8)p1_a_sub_q1, 1); \ - p0_a_sub_q0 = __msa_adds_u_b(p0_a_sub_q0, p0_a_sub_q0); \ - mask = __msa_adds_u_b(p0_a_sub_q0, p1_a_sub_q1); \ - mask = (mask <= b_limit); \ -} while (0) - -static void VFilter16(uint8_t* src, int stride, - int b_limit_in, int limit_in, int thresh_in) { +static void VFilter16(uint8_t* src, int stride, int b_limit_in, int limit_in, + int thresh_in) { uint8_t* ptemp = src - 4 * stride; v16u8 p3, p2, p1, p0, q3, q2, q1, q0; v16u8 mask, hev; @@ -350,8 +358,8 @@ static void VFilter16(uint8_t* src, int stride, const v16u8 b_limit = (v16u8)__msa_fill_b(b_limit_in); LD_UB8(ptemp, stride, p3, p2, p1, p0, q0, q1, q2, q3); - LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, - hev, mask); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, hev, + mask); LPF_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev); ptemp = src - 3 * stride; ST_UB4(p2, p1, p0, q0, ptemp, stride); @@ -359,9 +367,9 @@ static void VFilter16(uint8_t* src, int stride, ST_UB2(q1, q2, ptemp, stride); } -static void HFilter16(uint8_t* src, int stride, - int b_limit_in, int limit_in, int thresh_in) { - uint8_t* ptmp = src - 4; +static void HFilter16(uint8_t* src, int stride, int b_limit_in, int limit_in, + int thresh_in) { + uint8_t* ptmp = src - 4; v16u8 p3, p2, p1, p0, q3, q2, q1, q0; v16u8 mask, hev; v16u8 row0, row1, row2, row3, row4, row5, row6, row7, row8; @@ -374,11 +382,11 @@ static void HFilter16(uint8_t* src, int stride, LD_UB8(ptmp, stride, row0, row1, row2, row3, row4, row5, row6, row7); ptmp += (8 * stride); LD_UB8(ptmp, stride, row8, row9, row10, row11, row12, row13, row14, row15); - TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, - row8, row9, row10, row11, row12, row13, row14, row15, - p3, p2, p1, p0, q0, q1, q2, q3); - LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, - hev, mask); + TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, row8, + row9, row10, row11, row12, row13, row14, row15, p3, p2, + p1, p0, q0, q1, q2, q3); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, hev, + mask); LPF_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev); ILVR_B2_SH(p1, p2, q0, p0, tmp0, tmp1); ILVRL_H2_SH(tmp1, tmp0, tmp3, tmp4); @@ -420,8 +428,8 @@ static void HFilter16(uint8_t* src, int stride, } // on three inner edges -static void VFilterHorEdge16i(uint8_t* src, int stride, - int b_limit, int limit, int thresh) { +static void VFilterHorEdge16i(uint8_t* src, int stride, int b_limit, int limit, + int thresh) { v16u8 mask, hev; v16u8 p3, p2, p1, p0, q3, q2, q1, q0; const v16u8 thresh0 = (v16u8)__msa_fill_b(thresh); @@ -429,21 +437,21 @@ static void VFilterHorEdge16i(uint8_t* src, int stride, const v16u8 limit0 = (v16u8)__msa_fill_b(limit); LD_UB8((src - 4 * stride), stride, p3, p2, p1, p0, q0, q1, q2, q3); - LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit0, b_limit0, thresh0, - hev, mask); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit0, b_limit0, thresh0, hev, + mask); LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev); ST_UB4(p1, p0, q0, q1, (src - 2 * stride), stride); } -static void VFilter16i(uint8_t* src_y, int stride, - int b_limit, int limit, int thresh) { - VFilterHorEdge16i(src_y + 4 * stride, stride, b_limit, limit, thresh); - VFilterHorEdge16i(src_y + 8 * stride, stride, b_limit, limit, thresh); +static void VFilter16i(uint8_t* src_y, int stride, int b_limit, int limit, + int thresh) { + VFilterHorEdge16i(src_y + 4 * stride, stride, b_limit, limit, thresh); + VFilterHorEdge16i(src_y + 8 * stride, stride, b_limit, limit, thresh); VFilterHorEdge16i(src_y + 12 * stride, stride, b_limit, limit, thresh); } -static void HFilterVertEdge16i(uint8_t* src, int stride, - int b_limit, int limit, int thresh) { +static void HFilterVertEdge16i(uint8_t* src, int stride, int b_limit, int limit, + int thresh) { v16u8 mask, hev; v16u8 p3, p2, p1, p0, q3, q2, q1, q0; v16u8 row0, row1, row2, row3, row4, row5, row6, row7; @@ -454,13 +462,13 @@ static void HFilterVertEdge16i(uint8_t* src, int stride, const v16u8 limit0 = (v16u8)__msa_fill_b(limit); LD_UB8(src - 4, stride, row0, row1, row2, row3, row4, row5, row6, row7); - LD_UB8(src - 4 + (8 * stride), stride, - row8, row9, row10, row11, row12, row13, row14, row15); - TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, - row8, row9, row10, row11, row12, row13, row14, row15, - p3, p2, p1, p0, q0, q1, q2, q3); - LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit0, b_limit0, thresh0, - hev, mask); + LD_UB8(src - 4 + (8 * stride), stride, row8, row9, row10, row11, row12, row13, + row14, row15); + TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, row8, + row9, row10, row11, row12, row13, row14, row15, p3, p2, + p1, p0, q0, q1, q2, q3); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit0, b_limit0, thresh0, hev, + mask); LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev); ILVR_B2_SH(p0, p1, q1, q0, tmp0, tmp1); ILVRL_H2_SH(tmp1, tmp0, tmp2, tmp3); @@ -472,10 +480,10 @@ static void HFilterVertEdge16i(uint8_t* src, int stride, ST4x8_UB(tmp4, tmp5, src, stride); } -static void HFilter16i(uint8_t* src_y, int stride, - int b_limit, int limit, int thresh) { - HFilterVertEdge16i(src_y + 4, stride, b_limit, limit, thresh); - HFilterVertEdge16i(src_y + 8, stride, b_limit, limit, thresh); +static void HFilter16i(uint8_t* src_y, int stride, int b_limit, int limit, + int thresh) { + HFilterVertEdge16i(src_y + 4, stride, b_limit, limit, thresh); + HFilterVertEdge16i(src_y + 8, stride, b_limit, limit, thresh); HFilterVertEdge16i(src_y + 12, stride, b_limit, limit, thresh); } @@ -496,8 +504,8 @@ static void VFilter8(uint8_t* WEBP_RESTRICT src_u, uint8_t* WEBP_RESTRICT src_v, LD_UB8(ptmp_src_v, stride, p3_v, p2_v, p1_v, p0_v, q0_v, q1_v, q2_v, q3_v); ILVR_D4_UB(p3_v, p3_u, p2_v, p2_u, p1_v, p1_u, p0_v, p0_u, p3, p2, p1, p0); ILVR_D4_UB(q0_v, q0_u, q1_v, q1_u, q2_v, q2_u, q3_v, q3_u, q0, q1, q2, q3); - LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, - hev, mask); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, hev, + mask); LPF_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev); p2_d = __msa_copy_s_d((v2i64)p2, 0); p1_d = __msa_copy_s_d((v2i64)p1, 0); @@ -538,13 +546,13 @@ static void HFilter8(uint8_t* WEBP_RESTRICT src_u, uint8_t* WEBP_RESTRICT src_v, const v16u8 thresh = (v16u8)__msa_fill_b(thresh_in); LD_UB8(ptmp_src_u, stride, row0, row1, row2, row3, row4, row5, row6, row7); - LD_UB8(ptmp_src_v, stride, - row8, row9, row10, row11, row12, row13, row14, row15); - TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, - row8, row9, row10, row11, row12, row13, row14, row15, - p3, p2, p1, p0, q0, q1, q2, q3); - LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, - hev, mask); + LD_UB8(ptmp_src_v, stride, row8, row9, row10, row11, row12, row13, row14, + row15); + TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, row8, + row9, row10, row11, row12, row13, row14, row15, p3, p2, + p1, p0, q0, q1, q2, q3); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, hev, + mask); LPF_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev); ILVR_B2_SH(p1, p2, q0, p0, tmp0, tmp1); ILVRL_H2_SH(tmp1, tmp0, tmp3, tmp4); @@ -562,8 +570,8 @@ static void HFilter8(uint8_t* WEBP_RESTRICT src_u, uint8_t* WEBP_RESTRICT src_v, } static void VFilter8i(uint8_t* WEBP_RESTRICT src_u, - uint8_t* WEBP_RESTRICT src_v, int stride, - int b_limit_in, int limit_in, int thresh_in) { + uint8_t* WEBP_RESTRICT src_v, int stride, int b_limit_in, + int limit_in, int thresh_in) { uint64_t p1_d, p0_d, q0_d, q1_d; v16u8 p3, p2, p1, p0, q3, q2, q1, q0, mask, hev; v16u8 p3_u, p2_u, p1_u, p0_u, q3_u, q2_u, q1_u, q0_u; @@ -578,8 +586,8 @@ static void VFilter8i(uint8_t* WEBP_RESTRICT src_u, src_v += (5 * stride); ILVR_D4_UB(p3_v, p3_u, p2_v, p2_u, p1_v, p1_u, p0_v, p0_u, p3, p2, p1, p0); ILVR_D4_UB(q0_v, q0_u, q1_v, q1_u, q2_v, q2_u, q3_v, q3_u, q0, q1, q2, q3); - LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, - hev, mask); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, hev, + mask); LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev); p1_d = __msa_copy_s_d((v2i64)p1, 0); p0_d = __msa_copy_s_d((v2i64)p0, 0); @@ -594,8 +602,8 @@ static void VFilter8i(uint8_t* WEBP_RESTRICT src_u, } static void HFilter8i(uint8_t* WEBP_RESTRICT src_u, - uint8_t* WEBP_RESTRICT src_v, int stride, - int b_limit_in, int limit_in, int thresh_in) { + uint8_t* WEBP_RESTRICT src_v, int stride, int b_limit_in, + int limit_in, int thresh_in) { v16u8 p3, p2, p1, p0, q3, q2, q1, q0, mask, hev; v16u8 row0, row1, row2, row3, row4, row5, row6, row7, row8; v16u8 row9, row10, row11, row12, row13, row14, row15; @@ -605,13 +613,12 @@ static void HFilter8i(uint8_t* WEBP_RESTRICT src_u, const v16u8 b_limit = (v16u8)__msa_fill_b(b_limit_in); LD_UB8(src_u, stride, row0, row1, row2, row3, row4, row5, row6, row7); - LD_UB8(src_v, stride, - row8, row9, row10, row11, row12, row13, row14, row15); - TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, - row8, row9, row10, row11, row12, row13, row14, row15, - p3, p2, p1, p0, q0, q1, q2, q3); - LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, - hev, mask); + LD_UB8(src_v, stride, row8, row9, row10, row11, row12, row13, row14, row15); + TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, row8, + row9, row10, row11, row12, row13, row14, row15, p3, p2, + p1, p0, q0, q1, q2, q3); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, hev, + mask); LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev); ILVR_B2_SW(p0, p1, q1, q0, tmp0, tmp1); ILVRL_H2_SW(tmp1, tmp0, tmp2, tmp3); @@ -645,11 +652,11 @@ static void SimpleHFilter16(uint8_t* src, int stride, int b_limit_in) { uint8_t* ptemp_src = src - 2; LD_UB8(ptemp_src, stride, row0, row1, row2, row3, row4, row5, row6, row7); - LD_UB8(ptemp_src + 8 * stride, stride, - row8, row9, row10, row11, row12, row13, row14, row15); - TRANSPOSE16x4_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, - row8, row9, row10, row11, row12, row13, row14, row15, - p1, p0, q0, q1); + LD_UB8(ptemp_src + 8 * stride, stride, row8, row9, row10, row11, row12, row13, + row14, row15); + TRANSPOSE16x4_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, row8, + row9, row10, row11, row12, row13, row14, row15, p1, p0, + q0, q1); LPF_SIMPLE_MASK(p1, p0, q0, q1, b_limit, mask); LPF_SIMPLE_FILT(p1, p0, q0, q1, mask); ILVRL_B2_SH(q0, p0, tmp1, tmp0); @@ -665,14 +672,14 @@ static void SimpleHFilter16(uint8_t* src, int stride, int b_limit_in) { } static void SimpleVFilter16i(uint8_t* src_y, int stride, int b_limit_in) { - SimpleVFilter16(src_y + 4 * stride, stride, b_limit_in); - SimpleVFilter16(src_y + 8 * stride, stride, b_limit_in); + SimpleVFilter16(src_y + 4 * stride, stride, b_limit_in); + SimpleVFilter16(src_y + 8 * stride, stride, b_limit_in); SimpleVFilter16(src_y + 12 * stride, stride, b_limit_in); } static void SimpleHFilter16i(uint8_t* src_y, int stride, int b_limit_in) { - SimpleHFilter16(src_y + 4, stride, b_limit_in); - SimpleHFilter16(src_y + 8, stride, b_limit_in); + SimpleHFilter16(src_y + 4, stride, b_limit_in); + SimpleHFilter16(src_y + 8, stride, b_limit_in); SimpleHFilter16(src_y + 12, stride, b_limit_in); } @@ -682,7 +689,7 @@ static void SimpleHFilter16i(uint8_t* src_y, int stride, int b_limit_in) { // 4x4 -static void DC4(uint8_t* dst) { // DC +static void DC4(uint8_t* dst) { // DC uint32_t dc = 4; int i; for (i = 0; i < 4; ++i) dc += dst[i - BPS] + dst[-1 + i * BPS]; @@ -694,7 +701,7 @@ static void DC4(uint8_t* dst) { // DC static void TM4(uint8_t* dst) { const uint8_t* const ptemp = dst - BPS - 1; v8i16 T, d, r0, r1, r2, r3; - const v16i8 zero = { 0 }; + const v16i8 zero = {0}; const v8i16 TL = (v8i16)__msa_fill_h(ptemp[0 * BPS]); const v8i16 L0 = (v8i16)__msa_fill_h(ptemp[1 * BPS]); const v8i16 L1 = (v8i16)__msa_fill_h(ptemp[2 * BPS]); @@ -702,19 +709,19 @@ static void TM4(uint8_t* dst) { const v8i16 L3 = (v8i16)__msa_fill_h(ptemp[4 * BPS]); const v16u8 T1 = LD_UB(ptemp + 1); - T = (v8i16)__msa_ilvr_b(zero, (v16i8)T1); + T = (v8i16)__msa_ilvr_b(zero, (v16i8)T1); d = T - TL; ADD4(d, L0, d, L1, d, L2, d, L3, r0, r1, r2, r3); CLIP_SH4_0_255(r0, r1, r2, r3); PCKEV_ST4x4_UB(r0, r1, r2, r3, dst, BPS); } -static void VE4(uint8_t* dst) { // vertical +static void VE4(uint8_t* dst) { // vertical const uint8_t* const ptop = dst - BPS - 1; const uint32_t val0 = LW(ptop + 0); const uint32_t val1 = LW(ptop + 4); uint32_t out; - v16u8 A = { 0 }, B, C, AC, B2, R; + v16u8 A = {0}, B, C, AC, B2, R; INSERT_W2_UB(val0, val1, A); B = SLDI_UB(A, A, 1); @@ -726,12 +733,12 @@ static void VE4(uint8_t* dst) { // vertical SW4(out, out, out, out, dst, BPS); } -static void RD4(uint8_t* dst) { // Down-right +static void RD4(uint8_t* dst) { // Down-right const uint8_t* const ptop = dst - 1 - BPS; uint32_t val0 = LW(ptop + 0); uint32_t val1 = LW(ptop + 4); uint32_t val2, val3; - v16u8 A, B, C, AC, B2, R, A1 = { 0 }; + v16u8 A, B, C, AC, B2, R, A1 = {0}; INSERT_W2_UB(val0, val1, A1); A = SLDI_UB(A1, A1, 12); @@ -754,12 +761,12 @@ static void RD4(uint8_t* dst) { // Down-right SW4(val0, val1, val2, val3, dst, BPS); } -static void LD4(uint8_t* dst) { // Down-Left +static void LD4(uint8_t* dst) { // Down-Left const uint8_t* const ptop = dst - BPS; uint32_t val0 = LW(ptop + 0); uint32_t val1 = LW(ptop + 4); uint32_t val2, val3; - v16u8 A = { 0 }, B, C, AC, B2, R; + v16u8 A = {0}, B, C, AC, B2, R; INSERT_W2_UB(val0, val1, A); B = SLDI_UB(A, A, 1); @@ -780,7 +787,7 @@ static void LD4(uint8_t* dst) { // Down-Left // 16x16 -static void DC16(uint8_t* dst) { // DC +static void DC16(uint8_t* dst) { // DC uint32_t dc = 16; int i; const v16u8 rtop = LD_UB(dst - BPS); @@ -799,7 +806,7 @@ static void DC16(uint8_t* dst) { // DC static void TM16(uint8_t* dst) { int j; v8i16 d1, d2; - const v16i8 zero = { 0 }; + const v16i8 zero = {0}; const v8i16 TL = (v8i16)__msa_fill_h(dst[-1 - BPS]); const v16i8 T = LD_SB(dst - BPS); @@ -822,13 +829,13 @@ static void TM16(uint8_t* dst) { } } -static void VE16(uint8_t* dst) { // vertical +static void VE16(uint8_t* dst) { // vertical const v16u8 rtop = LD_UB(dst - BPS); ST_UB8(rtop, rtop, rtop, rtop, rtop, rtop, rtop, rtop, dst, BPS); ST_UB8(rtop, rtop, rtop, rtop, rtop, rtop, rtop, rtop, dst + 8 * BPS, BPS); } -static void HE16(uint8_t* dst) { // horizontal +static void HE16(uint8_t* dst) { // horizontal int j; for (j = 16; j > 0; j -= 4) { const v16u8 L0 = (v16u8)__msa_fill_b(dst[-1 + 0 * BPS]); @@ -840,7 +847,7 @@ static void HE16(uint8_t* dst) { // horizontal } } -static void DC16NoTop(uint8_t* dst) { // DC with top samples not available +static void DC16NoTop(uint8_t* dst) { // DC with top samples not available int j; uint32_t dc = 8; v16u8 out; @@ -853,7 +860,7 @@ static void DC16NoTop(uint8_t* dst) { // DC with top samples not available ST_UB8(out, out, out, out, out, out, out, out, dst + 8 * BPS, BPS); } -static void DC16NoLeft(uint8_t* dst) { // DC with left samples not available +static void DC16NoLeft(uint8_t* dst) { // DC with left samples not available uint32_t dc = 8; const v16u8 rtop = LD_UB(dst - BPS); const v8u16 dctop = __msa_hadd_u_h(rtop, rtop); @@ -865,7 +872,7 @@ static void DC16NoLeft(uint8_t* dst) { // DC with left samples not available ST_UB8(out, out, out, out, out, out, out, out, dst + 8 * BPS, BPS); } -static void DC16NoTopLeft(uint8_t* dst) { // DC with nothing +static void DC16NoTopLeft(uint8_t* dst) { // DC with nothing const v16u8 out = (v16u8)__msa_fill_b(0x80); ST_UB8(out, out, out, out, out, out, out, out, dst, BPS); ST_UB8(out, out, out, out, out, out, out, out, dst + 8 * BPS, BPS); @@ -873,12 +880,13 @@ static void DC16NoTopLeft(uint8_t* dst) { // DC with nothing // Chroma -#define STORE8x8(out, dst) do { \ - SD4(out, out, out, out, dst + 0 * BPS, BPS); \ - SD4(out, out, out, out, dst + 4 * BPS, BPS); \ -} while (0) +#define STORE8x8(out, dst) \ + do { \ + SD4(out, out, out, out, dst + 0 * BPS, BPS); \ + SD4(out, out, out, out, dst + 4 * BPS, BPS); \ + } while (0) -static void DC8uv(uint8_t* dst) { // DC +static void DC8uv(uint8_t* dst) { // DC uint32_t dc = 8; int i; uint64_t out; @@ -900,8 +908,8 @@ static void DC8uv(uint8_t* dst) { // DC static void TM8uv(uint8_t* dst) { int j; const v16i8 T1 = LD_SB(dst - BPS); - const v16i8 zero = { 0 }; - const v8i16 T = (v8i16)__msa_ilvr_b(zero, T1); + const v16i8 zero = {0}; + const v8i16 T = (v8i16)__msa_ilvr_b(zero, T1); const v8i16 TL = (v8i16)__msa_fill_h(dst[-1 - BPS]); const v8i16 d = T - TL; @@ -920,13 +928,13 @@ static void TM8uv(uint8_t* dst) { } } -static void VE8uv(uint8_t* dst) { // vertical +static void VE8uv(uint8_t* dst) { // vertical const v16u8 rtop = LD_UB(dst - BPS); const uint64_t out = __msa_copy_s_d((v2i64)rtop, 0); STORE8x8(out, dst); } -static void HE8uv(uint8_t* dst) { // horizontal +static void HE8uv(uint8_t* dst) { // horizontal int j; for (j = 0; j < 8; j += 4) { const v16u8 L0 = (v16u8)__msa_fill_b(dst[-1 + 0 * BPS]); @@ -942,7 +950,7 @@ static void HE8uv(uint8_t* dst) { // horizontal } } -static void DC8uvNoLeft(uint8_t* dst) { // DC with no left samples +static void DC8uvNoLeft(uint8_t* dst) { // DC with no left samples const uint32_t dc = 4; const v16u8 rtop = LD_UB(dst - BPS); const v8u16 temp0 = __msa_hadd_u_h(rtop, rtop); @@ -954,7 +962,7 @@ static void DC8uvNoLeft(uint8_t* dst) { // DC with no left samples STORE8x8(out, dst); } -static void DC8uvNoTop(uint8_t* dst) { // DC with no top samples +static void DC8uvNoTop(uint8_t* dst) { // DC with no top samples uint32_t dc = 4; int i; uint64_t out; @@ -968,7 +976,7 @@ static void DC8uvNoTop(uint8_t* dst) { // DC with no top samples STORE8x8(out, dst); } -static void DC8uvNoTopLeft(uint8_t* dst) { // DC with nothing +static void DC8uvNoTopLeft(uint8_t* dst) { // DC with nothing const uint64_t out = 0x8080808080808080ULL; STORE8x8(out, dst); } @@ -984,16 +992,16 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitMSA(void) { VP8TransformDC = TransformDC; VP8TransformAC3 = TransformAC3; - VP8VFilter16 = VFilter16; - VP8HFilter16 = HFilter16; + VP8VFilter16 = VFilter16; + VP8HFilter16 = HFilter16; VP8VFilter16i = VFilter16i; VP8HFilter16i = HFilter16i; - VP8VFilter8 = VFilter8; - VP8HFilter8 = HFilter8; + VP8VFilter8 = VFilter8; + VP8HFilter8 = HFilter8; VP8VFilter8i = VFilter8i; VP8HFilter8i = HFilter8i; - VP8SimpleVFilter16 = SimpleVFilter16; - VP8SimpleHFilter16 = SimpleHFilter16; + VP8SimpleVFilter16 = SimpleVFilter16; + VP8SimpleHFilter16 = SimpleHFilter16; VP8SimpleVFilter16i = SimpleVFilter16i; VP8SimpleHFilter16i = SimpleHFilter16i; diff --git a/src/dsp/dec_neon.c b/src/dsp/dec_neon.c index f150692a..de601d90 100644 --- a/src/dsp/dec_neon.c +++ b/src/dsp/dec_neon.c @@ -16,8 +16,8 @@ #if defined(WEBP_USE_NEON) -#include "src/dsp/neon.h" #include "src/dec/vp8i_dec.h" +#include "src/dsp/neon.h" //------------------------------------------------------------------------------ // NxM Loading functions @@ -60,10 +60,11 @@ static WEBP_INLINE void Load4x16_NEON(const uint8_t* const src, int stride, #else // WORK_AROUND_GCC -#define LOADQ_LANE_32b(VALUE, LANE) do { \ - (VALUE) = vld1q_lane_u32((const uint32_t*)src, (VALUE), (LANE)); \ - src += stride; \ -} while (0) +#define LOADQ_LANE_32b(VALUE, LANE) \ + do { \ + (VALUE) = vld1q_lane_u32((const uint32_t*)src, (VALUE), (LANE)); \ + src += stride; \ + } while (0) static WEBP_INLINE void Load4x16_NEON(const uint8_t* src, int stride, uint8x16_t* const p1, @@ -111,10 +112,10 @@ static WEBP_INLINE void Load4x16_NEON(const uint8_t* src, int stride, #endif // !WORK_AROUND_GCC static WEBP_INLINE void Load8x16_NEON( - const uint8_t* const src, int stride, - uint8x16_t* const p3, uint8x16_t* const p2, uint8x16_t* const p1, - uint8x16_t* const p0, uint8x16_t* const q0, uint8x16_t* const q1, - uint8x16_t* const q2, uint8x16_t* const q3) { + const uint8_t* const src, int stride, uint8x16_t* const p3, + uint8x16_t* const p2, uint8x16_t* const p1, uint8x16_t* const p0, + uint8x16_t* const q0, uint8x16_t* const q1, uint8x16_t* const q2, + uint8x16_t* const q3) { Load4x16_NEON(src - 2, stride, p3, p2, p1, p0); Load4x16_NEON(src + 2, stride, q0, q1, q2, q3); } @@ -131,12 +132,12 @@ static WEBP_INLINE void Load16x4_NEON(const uint8_t* const src, int stride, } static WEBP_INLINE void Load16x8_NEON( - const uint8_t* const src, int stride, - uint8x16_t* const p3, uint8x16_t* const p2, uint8x16_t* const p1, - uint8x16_t* const p0, uint8x16_t* const q0, uint8x16_t* const q1, - uint8x16_t* const q2, uint8x16_t* const q3) { - Load16x4_NEON(src - 2 * stride, stride, p3, p2, p1, p0); - Load16x4_NEON(src + 2 * stride, stride, q0, q1, q2, q3); + const uint8_t* const src, int stride, uint8x16_t* const p3, + uint8x16_t* const p2, uint8x16_t* const p1, uint8x16_t* const p0, + uint8x16_t* const q0, uint8x16_t* const q1, uint8x16_t* const q2, + uint8x16_t* const q3) { + Load16x4_NEON(src - 2 * stride, stride, p3, p2, p1, p0); + Load16x4_NEON(src + 2 * stride, stride, q0, q1, q2, q3); } static WEBP_INLINE void Load8x8x2_NEON( @@ -220,8 +221,8 @@ static WEBP_INLINE void Load8x8x2T_NEON( #endif // !WORK_AROUND_GCC -static WEBP_INLINE void Store2x8_NEON(const uint8x8x2_t v, - uint8_t* const dst, int stride) { +static WEBP_INLINE void Store2x8_NEON(const uint8x8x2_t v, uint8_t* const dst, + int stride) { vst2_lane_u8(dst + 0 * stride, v, 0); vst2_lane_u8(dst + 1 * stride, v, 1); vst2_lane_u8(dst + 2 * stride, v, 2); @@ -244,8 +245,8 @@ static WEBP_INLINE void Store2x16_NEON(const uint8x16_t p0, const uint8x16_t q0, } #if !defined(WORK_AROUND_GCC) -static WEBP_INLINE void Store4x8_NEON(const uint8x8x4_t v, - uint8_t* const dst, int stride) { +static WEBP_INLINE void Store4x8_NEON(const uint8x8x4_t v, uint8_t* const dst, + int stride) { vst4_lane_u8(dst + 0 * stride, v, 0); vst4_lane_u8(dst + 1 * stride, v, 1); vst4_lane_u8(dst + 2 * stride, v, 2); @@ -260,12 +261,10 @@ static WEBP_INLINE void Store4x16_NEON(const uint8x16_t p1, const uint8x16_t p0, const uint8x16_t q0, const uint8x16_t q1, uint8_t* const dst, int stride) { uint8x8x4_t lo, hi; - INIT_VECTOR4(lo, - vget_low_u8(p1), vget_low_u8(p0), - vget_low_u8(q0), vget_low_u8(q1)); - INIT_VECTOR4(hi, - vget_high_u8(p1), vget_high_u8(p0), - vget_high_u8(q0), vget_high_u8(q1)); + INIT_VECTOR4(lo, vget_low_u8(p1), vget_low_u8(p0), vget_low_u8(q0), + vget_low_u8(q1)); + INIT_VECTOR4(hi, vget_high_u8(p1), vget_high_u8(p0), vget_high_u8(q0), + vget_high_u8(q1)); Store4x8_NEON(lo, dst - 2 + 0 * stride, stride); Store4x8_NEON(hi, dst - 2 + 8 * stride, stride); } @@ -285,22 +284,20 @@ static WEBP_INLINE void Store16x4_NEON(const uint8x16_t p1, const uint8x16_t p0, } static WEBP_INLINE void Store8x2x2_NEON(const uint8x16_t p0, - const uint8x16_t q0, - uint8_t* const u, uint8_t* const v, - int stride) { + const uint8x16_t q0, uint8_t* const u, + uint8_t* const v, int stride) { // p0 and q0 contain the u+v samples packed in low/high halves. vst1_u8(u - stride, vget_low_u8(p0)); - vst1_u8(u, vget_low_u8(q0)); + vst1_u8(u, vget_low_u8(q0)); vst1_u8(v - stride, vget_high_u8(p0)); - vst1_u8(v, vget_high_u8(q0)); + vst1_u8(v, vget_high_u8(q0)); } static WEBP_INLINE void Store8x4x2_NEON(const uint8x16_t p1, const uint8x16_t p0, const uint8x16_t q0, - const uint8x16_t q1, - uint8_t* const u, uint8_t* const v, - int stride) { + const uint8x16_t q1, uint8_t* const u, + uint8_t* const v, int stride) { // The p1...q1 registers contain the u+v samples packed in low/high halves. Store8x2x2_NEON(p1, p0, u - stride, v - stride, stride); Store8x2x2_NEON(q0, q1, u + stride, v + stride, stride); @@ -308,16 +305,17 @@ static WEBP_INLINE void Store8x4x2_NEON(const uint8x16_t p1, #if !defined(WORK_AROUND_GCC) -#define STORE6_LANE(DST, VAL0, VAL1, LANE) do { \ - vst3_lane_u8((DST) - 3, (VAL0), (LANE)); \ - vst3_lane_u8((DST) + 0, (VAL1), (LANE)); \ - (DST) += stride; \ -} while (0) +#define STORE6_LANE(DST, VAL0, VAL1, LANE) \ + do { \ + vst3_lane_u8((DST) - 3, (VAL0), (LANE)); \ + vst3_lane_u8((DST) + 0, (VAL1), (LANE)); \ + (DST) += stride; \ + } while (0) static WEBP_INLINE void Store6x8x2_NEON( const uint8x16_t p2, const uint8x16_t p1, const uint8x16_t p0, - const uint8x16_t q0, const uint8x16_t q1, const uint8x16_t q2, - uint8_t* u, uint8_t* v, int stride) { + const uint8x16_t q0, const uint8x16_t q1, const uint8x16_t q2, uint8_t* u, + uint8_t* v, int stride) { uint8x8x3_t u0, u1, v0, v1; INIT_VECTOR3(u0, vget_low_u8(p2), vget_low_u8(p1), vget_low_u8(p0)); INIT_VECTOR3(u1, vget_low_u8(q0), vget_low_u8(q1), vget_low_u8(q2)); @@ -345,16 +343,13 @@ static WEBP_INLINE void Store6x8x2_NEON( static WEBP_INLINE void Store4x8x2_NEON(const uint8x16_t p1, const uint8x16_t p0, const uint8x16_t q0, - const uint8x16_t q1, - uint8_t* const u, uint8_t* const v, - int stride) { + const uint8x16_t q1, uint8_t* const u, + uint8_t* const v, int stride) { uint8x8x4_t u0, v0; - INIT_VECTOR4(u0, - vget_low_u8(p1), vget_low_u8(p0), - vget_low_u8(q0), vget_low_u8(q1)); - INIT_VECTOR4(v0, - vget_high_u8(p1), vget_high_u8(p0), - vget_high_u8(q0), vget_high_u8(q1)); + INIT_VECTOR4(u0, vget_low_u8(p1), vget_low_u8(p0), vget_low_u8(q0), + vget_low_u8(q1)); + INIT_VECTOR4(v0, vget_high_u8(p1), vget_high_u8(p0), vget_high_u8(q0), + vget_high_u8(q1)); vst4_lane_u8(u - 2 + 0 * stride, u0, 0); vst4_lane_u8(u - 2 + 1 * stride, u0, 1); vst4_lane_u8(u - 2 + 2 * stride, u0, 2); @@ -397,8 +392,7 @@ static WEBP_INLINE void SaturateAndStore4x4_NEON(uint8_t* const dst, } static WEBP_INLINE void Add4x4_NEON(const int16x8_t row01, - const int16x8_t row23, - uint8_t* const dst) { + const int16x8_t row23, uint8_t* const dst) { uint32x2_t dst01 = vdup_n_u32(0); uint32x2_t dst23 = vdup_n_u32(0); @@ -449,26 +443,25 @@ static uint8x16_t FlipSignBack_NEON(const int8x16_t v) { static int8x16_t GetBaseDelta_NEON(const int8x16_t p1, const int8x16_t p0, const int8x16_t q0, const int8x16_t q1) { - const int8x16_t q0_p0 = vqsubq_s8(q0, p0); // (q0-p0) - const int8x16_t p1_q1 = vqsubq_s8(p1, q1); // (p1-q1) - const int8x16_t s1 = vqaddq_s8(p1_q1, q0_p0); // (p1-q1) + 1 * (q0 - p0) - const int8x16_t s2 = vqaddq_s8(q0_p0, s1); // (p1-q1) + 2 * (q0 - p0) - const int8x16_t s3 = vqaddq_s8(q0_p0, s2); // (p1-q1) + 3 * (q0 - p0) + const int8x16_t q0_p0 = vqsubq_s8(q0, p0); // (q0-p0) + const int8x16_t p1_q1 = vqsubq_s8(p1, q1); // (p1-q1) + const int8x16_t s1 = vqaddq_s8(p1_q1, q0_p0); // (p1-q1) + 1 * (q0 - p0) + const int8x16_t s2 = vqaddq_s8(q0_p0, s1); // (p1-q1) + 2 * (q0 - p0) + const int8x16_t s3 = vqaddq_s8(q0_p0, s2); // (p1-q1) + 3 * (q0 - p0) return s3; } static int8x16_t GetBaseDelta0_NEON(const int8x16_t p0, const int8x16_t q0) { - const int8x16_t q0_p0 = vqsubq_s8(q0, p0); // (q0-p0) - const int8x16_t s1 = vqaddq_s8(q0_p0, q0_p0); // 2 * (q0 - p0) - const int8x16_t s2 = vqaddq_s8(q0_p0, s1); // 3 * (q0 - p0) + const int8x16_t q0_p0 = vqsubq_s8(q0, p0); // (q0-p0) + const int8x16_t s1 = vqaddq_s8(q0_p0, q0_p0); // 2 * (q0 - p0) + const int8x16_t s2 = vqaddq_s8(q0_p0, s1); // 3 * (q0 - p0) return s2; } //------------------------------------------------------------------------------ static void ApplyFilter2NoFlip_NEON(const int8x16_t p0s, const int8x16_t q0s, - const int8x16_t delta, - int8x16_t* const op0, + const int8x16_t delta, int8x16_t* const op0, int8x16_t* const oq0) { const int8x16_t kCst3 = vdupq_n_s8(0x03); const int8x16_t kCst4 = vdupq_n_s8(0x04); @@ -483,8 +476,8 @@ static void ApplyFilter2NoFlip_NEON(const int8x16_t p0s, const int8x16_t q0s, #if defined(WEBP_USE_INTRINSICS) static void ApplyFilter2_NEON(const int8x16_t p0s, const int8x16_t q0s, - const int8x16_t delta, - uint8x16_t* const op0, uint8x16_t* const oq0) { + const int8x16_t delta, uint8x16_t* const op0, + uint8x16_t* const oq0) { const int8x16_t kCst3 = vdupq_n_s8(0x03); const int8x16_t kCst4 = vdupq_n_s8(0x04); const int8x16_t delta_p3 = vqaddq_s8(delta, kCst3); @@ -499,8 +492,8 @@ static void ApplyFilter2_NEON(const int8x16_t p0s, const int8x16_t q0s, static void DoFilter2_NEON(const uint8x16_t p1, const uint8x16_t p0, const uint8x16_t q0, const uint8x16_t q1, - const uint8x16_t mask, - uint8x16_t* const op0, uint8x16_t* const oq0) { + const uint8x16_t mask, uint8x16_t* const op0, + uint8x16_t* const oq0) { const int8x16_t p1s = FlipSign_NEON(p1); const int8x16_t p0s = FlipSign_NEON(p0); const int8x16_t q0s = FlipSign_NEON(q0); @@ -533,6 +526,7 @@ static void SimpleHFilter16_NEON(uint8_t* p, int stride, int thresh) { #else // Load/Store vertical edge +// clang-format off #define LOAD8x4(c1, c2, c3, c4, b1, b2, stride) \ "vld4.8 {" #c1 "[0]," #c2 "[0]," #c3 "[0]," #c4 "[0]}," #b1 "," #stride "\n" \ "vld4.8 {" #c1 "[1]," #c2 "[1]," #c3 "[1]," #c4 "[1]}," #b2 "," #stride "\n" \ @@ -600,30 +594,30 @@ static void SimpleHFilter16_NEON(uint8_t* p, int stride, int thresh) { "vand q9, q9, q11 \n" /* apply filter mask */ \ DO_SIMPLE_FILTER(p0, q0, q9) /* apply filter */ \ FLIP_SIGN_BIT2(p0, q0, q10) +// clang-format on static void SimpleVFilter16_NEON(uint8_t* p, int stride, int thresh) { - __asm__ volatile ( - "sub %[p], %[p], %[stride], lsl #1 \n" // p -= 2 * stride + __asm__ volatile( + "sub %[p], %[p], %[stride], lsl #1 \n" // p -= 2 * stride - "vld1.u8 {q1}, [%[p]], %[stride] \n" // p1 - "vld1.u8 {q2}, [%[p]], %[stride] \n" // p0 - "vld1.u8 {q3}, [%[p]], %[stride] \n" // q0 - "vld1.u8 {q12}, [%[p]] \n" // q1 + "vld1.u8 {q1}, [%[p]], %[stride] \n" // p1 + "vld1.u8 {q2}, [%[p]], %[stride] \n" // p0 + "vld1.u8 {q3}, [%[p]], %[stride] \n" // q0 + "vld1.u8 {q12}, [%[p]] \n" // q1 - DO_FILTER2(q1, q2, q3, q12, %[thresh]) + DO_FILTER2(q1, q2, q3, q12, % [thresh]) // - "sub %[p], %[p], %[stride], lsl #1 \n" // p -= 2 * stride + "sub %[p], %[p], %[stride], lsl #1 \n" // p -= 2 * stride - "vst1.u8 {q2}, [%[p]], %[stride] \n" // store op0 - "vst1.u8 {q3}, [%[p]] \n" // store oq0 - : [p] "+r"(p) - : [stride] "r"(stride), [thresh] "r"(thresh) - : "memory", QRegs - ); + "vst1.u8 {q2}, [%[p]], %[stride] \n" // store op0 + "vst1.u8 {q3}, [%[p]] \n" // store oq0 + : [p] "+r"(p) + : [stride] "r"(stride), [thresh] "r"(thresh) + : "memory", QRegs); } static void SimpleHFilter16_NEON(uint8_t* p, int stride, int thresh) { - __asm__ volatile ( + __asm__ volatile( "sub r4, %[p], #2 \n" // base1 = p - 2 "lsl r6, %[stride], #1 \n" // r6 = 2 * stride "add r5, r4, %[stride] \n" // base2 = base1 + stride @@ -651,7 +645,7 @@ static void SimpleHFilter16_NEON(uint8_t* p, int stride, int thresh) { #undef LOAD8x4 #undef STORE8x2 -#endif // WEBP_USE_INTRINSICS +#endif // WEBP_USE_INTRINSICS static void SimpleVFilter16i_NEON(uint8_t* p, int stride, int thresh) { uint32_t k; @@ -708,31 +702,29 @@ static uint8x16_t NeedsFilter2_NEON(const uint8x16_t p3, const uint8x16_t p2, // 4-points filter -static void ApplyFilter4_NEON( - const int8x16_t p1, const int8x16_t p0, - const int8x16_t q0, const int8x16_t q1, - const int8x16_t delta0, - uint8x16_t* const op1, uint8x16_t* const op0, - uint8x16_t* const oq0, uint8x16_t* const oq1) { +static void ApplyFilter4_NEON(const int8x16_t p1, const int8x16_t p0, + const int8x16_t q0, const int8x16_t q1, + const int8x16_t delta0, uint8x16_t* const op1, + uint8x16_t* const op0, uint8x16_t* const oq0, + uint8x16_t* const oq1) { const int8x16_t kCst3 = vdupq_n_s8(0x03); const int8x16_t kCst4 = vdupq_n_s8(0x04); const int8x16_t delta1 = vqaddq_s8(delta0, kCst4); const int8x16_t delta2 = vqaddq_s8(delta0, kCst3); const int8x16_t a1 = vshrq_n_s8(delta1, 3); const int8x16_t a2 = vshrq_n_s8(delta2, 3); - const int8x16_t a3 = vrshrq_n_s8(a1, 1); // a3 = (a1 + 1) >> 1 + const int8x16_t a3 = vrshrq_n_s8(a1, 1); // a3 = (a1 + 1) >> 1 *op0 = FlipSignBack_NEON(vqaddq_s8(p0, a2)); // clip(p0 + a2) *oq0 = FlipSignBack_NEON(vqsubq_s8(q0, a1)); // clip(q0 - a1) *op1 = FlipSignBack_NEON(vqaddq_s8(p1, a3)); // clip(p1 + a3) *oq1 = FlipSignBack_NEON(vqsubq_s8(q1, a3)); // clip(q1 - a3) } -static void DoFilter4_NEON( - const uint8x16_t p1, const uint8x16_t p0, - const uint8x16_t q0, const uint8x16_t q1, - const uint8x16_t mask, const uint8x16_t hev_mask, - uint8x16_t* const op1, uint8x16_t* const op0, - uint8x16_t* const oq0, uint8x16_t* const oq1) { +static void DoFilter4_NEON(const uint8x16_t p1, const uint8x16_t p0, + const uint8x16_t q0, const uint8x16_t q1, + const uint8x16_t mask, const uint8x16_t hev_mask, + uint8x16_t* const op1, uint8x16_t* const op0, + uint8x16_t* const oq0, uint8x16_t* const oq1) { // This is a fused version of DoFilter2() calling ApplyFilter2 directly const int8x16_t p1s = FlipSign_NEON(p1); int8x16_t p0s = FlipSign_NEON(p0); @@ -761,12 +753,13 @@ static void DoFilter4_NEON( // 6-points filter -static void ApplyFilter6_NEON( - const int8x16_t p2, const int8x16_t p1, const int8x16_t p0, - const int8x16_t q0, const int8x16_t q1, const int8x16_t q2, - const int8x16_t delta, - uint8x16_t* const op2, uint8x16_t* const op1, uint8x16_t* const op0, - uint8x16_t* const oq0, uint8x16_t* const oq1, uint8x16_t* const oq2) { +static void ApplyFilter6_NEON(const int8x16_t p2, const int8x16_t p1, + const int8x16_t p0, const int8x16_t q0, + const int8x16_t q1, const int8x16_t q2, + const int8x16_t delta, uint8x16_t* const op2, + uint8x16_t* const op1, uint8x16_t* const op0, + uint8x16_t* const oq0, uint8x16_t* const oq1, + uint8x16_t* const oq2) { // We have to compute: X = (9*a+63) >> 7, Y = (18*a+63)>>7, Z = (27*a+63) >> 7 // Turns out, there's a common sub-expression S=9 * a - 1 that can be used // with the special vqrshrn_n_s16 rounding-shift-and-narrow instruction: @@ -778,13 +771,13 @@ static void ApplyFilter6_NEON( const int8x8_t kCst18 = vdup_n_s8(18); const int16x8_t S_lo = vmlal_s8(kCstm1, kCst9, delta_lo); // S = 9 * a - 1 const int16x8_t S_hi = vmlal_s8(kCstm1, kCst9, delta_hi); - const int16x8_t Z_lo = vmlal_s8(S_lo, kCst18, delta_lo); // S + 18 * a + const int16x8_t Z_lo = vmlal_s8(S_lo, kCst18, delta_lo); // S + 18 * a const int16x8_t Z_hi = vmlal_s8(S_hi, kCst18, delta_hi); - const int8x8_t a3_lo = vqrshrn_n_s16(S_lo, 7); // (9 * a + 63) >> 7 + const int8x8_t a3_lo = vqrshrn_n_s16(S_lo, 7); // (9 * a + 63) >> 7 const int8x8_t a3_hi = vqrshrn_n_s16(S_hi, 7); - const int8x8_t a2_lo = vqrshrn_n_s16(S_lo, 6); // (9 * a + 31) >> 6 + const int8x8_t a2_lo = vqrshrn_n_s16(S_lo, 6); // (9 * a + 31) >> 6 const int8x8_t a2_hi = vqrshrn_n_s16(S_hi, 6); - const int8x8_t a1_lo = vqrshrn_n_s16(Z_lo, 7); // (27 * a + 63) >> 7 + const int8x8_t a1_lo = vqrshrn_n_s16(Z_lo, 7); // (27 * a + 63) >> 7 const int8x8_t a1_hi = vqrshrn_n_s16(Z_hi, 7); const int8x16_t a1 = vcombine_s8(a1_lo, a1_hi); const int8x16_t a2 = vcombine_s8(a2_lo, a2_hi); @@ -798,12 +791,13 @@ static void ApplyFilter6_NEON( *op2 = FlipSignBack_NEON(vqaddq_s8(p2, a3)); // clip(p2 + a3) } -static void DoFilter6_NEON( - const uint8x16_t p2, const uint8x16_t p1, const uint8x16_t p0, - const uint8x16_t q0, const uint8x16_t q1, const uint8x16_t q2, - const uint8x16_t mask, const uint8x16_t hev_mask, - uint8x16_t* const op2, uint8x16_t* const op1, uint8x16_t* const op0, - uint8x16_t* const oq0, uint8x16_t* const oq1, uint8x16_t* const oq2) { +static void DoFilter6_NEON(const uint8x16_t p2, const uint8x16_t p1, + const uint8x16_t p0, const uint8x16_t q0, + const uint8x16_t q1, const uint8x16_t q2, + const uint8x16_t mask, const uint8x16_t hev_mask, + uint8x16_t* const op2, uint8x16_t* const op1, + uint8x16_t* const op0, uint8x16_t* const oq0, + uint8x16_t* const oq1, uint8x16_t* const oq2) { // This is a fused version of DoFilter2() calling ApplyFilter2 directly const int8x16_t p2s = FlipSign_NEON(p2); const int8x16_t p1s = FlipSign_NEON(p1); @@ -827,41 +821,41 @@ static void DoFilter6_NEON( const uint8x16_t complex_lf_mask = veorq_u8(simple_lf_mask, mask); const int8x16_t complex_lf_delta = vandq_s8(delta0, vreinterpretq_s8_u8(complex_lf_mask)); - ApplyFilter6_NEON(p2s, p1s, p0s, q0s, q1s, q2s, complex_lf_delta, - op2, op1, op0, oq0, oq1, oq2); + ApplyFilter6_NEON(p2s, p1s, p0s, q0s, q1s, q2s, complex_lf_delta, op2, op1, + op0, oq0, oq1, oq2); } } // on macroblock edges -static void VFilter16_NEON(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void VFilter16_NEON(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { uint8x16_t p3, p2, p1, p0, q0, q1, q2, q3; Load16x8_NEON(p, stride, &p3, &p2, &p1, &p0, &q0, &q1, &q2, &q3); { - const uint8x16_t mask = NeedsFilter2_NEON(p3, p2, p1, p0, q0, q1, q2, q3, - ithresh, thresh); + const uint8x16_t mask = + NeedsFilter2_NEON(p3, p2, p1, p0, q0, q1, q2, q3, ithresh, thresh); const uint8x16_t hev_mask = NeedsHev_NEON(p1, p0, q0, q1, hev_thresh); uint8x16_t op2, op1, op0, oq0, oq1, oq2; - DoFilter6_NEON(p2, p1, p0, q0, q1, q2, mask, hev_mask, - &op2, &op1, &op0, &oq0, &oq1, &oq2); + DoFilter6_NEON(p2, p1, p0, q0, q1, q2, mask, hev_mask, &op2, &op1, &op0, + &oq0, &oq1, &oq2); Store16x2_NEON(op2, op1, p - 2 * stride, stride); Store16x2_NEON(op0, oq0, p + 0 * stride, stride); Store16x2_NEON(oq1, oq2, p + 2 * stride, stride); } } -static void HFilter16_NEON(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void HFilter16_NEON(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { uint8x16_t p3, p2, p1, p0, q0, q1, q2, q3; Load8x16_NEON(p, stride, &p3, &p2, &p1, &p0, &q0, &q1, &q2, &q3); { - const uint8x16_t mask = NeedsFilter2_NEON(p3, p2, p1, p0, q0, q1, q2, q3, - ithresh, thresh); + const uint8x16_t mask = + NeedsFilter2_NEON(p3, p2, p1, p0, q0, q1, q2, q3, ithresh, thresh); const uint8x16_t hev_mask = NeedsHev_NEON(p1, p0, q0, q1, hev_thresh); uint8x16_t op2, op1, op0, oq0, oq1, oq2; - DoFilter6_NEON(p2, p1, p0, q0, q1, q2, mask, hev_mask, - &op2, &op1, &op0, &oq0, &oq1, &oq2); + DoFilter6_NEON(p2, p1, p0, q0, q1, q2, mask, hev_mask, &op2, &op1, &op0, + &oq0, &oq1, &oq2); Store2x16_NEON(op2, op1, p - 2, stride); Store2x16_NEON(op0, oq0, p + 0, stride); Store2x16_NEON(oq1, oq2, p + 2, stride); @@ -869,15 +863,15 @@ static void HFilter16_NEON(uint8_t* p, int stride, } // on three inner edges -static void VFilter16i_NEON(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void VFilter16i_NEON(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { uint32_t k; uint8x16_t p3, p2, p1, p0; - Load16x4_NEON(p + 2 * stride, stride, &p3, &p2, &p1, &p0); + Load16x4_NEON(p + 2 * stride, stride, &p3, &p2, &p1, &p0); for (k = 3; k != 0; --k) { uint8x16_t q0, q1, q2, q3; p += 4 * stride; - Load16x4_NEON(p + 2 * stride, stride, &q0, &q1, &q2, &q3); + Load16x4_NEON(p + 2 * stride, stride, &q0, &q1, &q2, &q3); { const uint8x16_t mask = NeedsFilter2_NEON(p3, p2, p1, p0, q0, q1, q2, q3, ithresh, thresh); @@ -893,8 +887,8 @@ static void VFilter16i_NEON(uint8_t* p, int stride, } #if !defined(WORK_AROUND_GCC) -static void HFilter16i_NEON(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void HFilter16i_NEON(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { uint32_t k; uint8x16_t p3, p2, p1, p0; Load4x16_NEON(p + 2, stride, &p3, &p2, &p1, &p0); @@ -921,27 +915,27 @@ static void VFilter8_NEON(uint8_t* WEBP_RESTRICT u, uint8_t* WEBP_RESTRICT v, uint8x16_t p3, p2, p1, p0, q0, q1, q2, q3; Load8x8x2_NEON(u, v, stride, &p3, &p2, &p1, &p0, &q0, &q1, &q2, &q3); { - const uint8x16_t mask = NeedsFilter2_NEON(p3, p2, p1, p0, q0, q1, q2, q3, - ithresh, thresh); + const uint8x16_t mask = + NeedsFilter2_NEON(p3, p2, p1, p0, q0, q1, q2, q3, ithresh, thresh); const uint8x16_t hev_mask = NeedsHev_NEON(p1, p0, q0, q1, hev_thresh); uint8x16_t op2, op1, op0, oq0, oq1, oq2; - DoFilter6_NEON(p2, p1, p0, q0, q1, q2, mask, hev_mask, - &op2, &op1, &op0, &oq0, &oq1, &oq2); + DoFilter6_NEON(p2, p1, p0, q0, q1, q2, mask, hev_mask, &op2, &op1, &op0, + &oq0, &oq1, &oq2); Store8x2x2_NEON(op2, op1, u - 2 * stride, v - 2 * stride, stride); Store8x2x2_NEON(op0, oq0, u + 0 * stride, v + 0 * stride, stride); Store8x2x2_NEON(oq1, oq2, u + 2 * stride, v + 2 * stride, stride); } } static void VFilter8i_NEON(uint8_t* WEBP_RESTRICT u, uint8_t* WEBP_RESTRICT v, - int stride, - int thresh, int ithresh, int hev_thresh) { + int stride, int thresh, int ithresh, + int hev_thresh) { uint8x16_t p3, p2, p1, p0, q0, q1, q2, q3; u += 4 * stride; v += 4 * stride; Load8x8x2_NEON(u, v, stride, &p3, &p2, &p1, &p0, &q0, &q1, &q2, &q3); { - const uint8x16_t mask = NeedsFilter2_NEON(p3, p2, p1, p0, q0, q1, q2, q3, - ithresh, thresh); + const uint8x16_t mask = + NeedsFilter2_NEON(p3, p2, p1, p0, q0, q1, q2, q3, ithresh, thresh); const uint8x16_t hev_mask = NeedsHev_NEON(p1, p0, q0, q1, hev_thresh); uint8x16_t op1, op0, oq0, oq1; DoFilter4_NEON(p1, p0, q0, q1, mask, hev_mask, &op1, &op0, &oq0, &oq1); @@ -955,26 +949,26 @@ static void HFilter8_NEON(uint8_t* WEBP_RESTRICT u, uint8_t* WEBP_RESTRICT v, uint8x16_t p3, p2, p1, p0, q0, q1, q2, q3; Load8x8x2T_NEON(u, v, stride, &p3, &p2, &p1, &p0, &q0, &q1, &q2, &q3); { - const uint8x16_t mask = NeedsFilter2_NEON(p3, p2, p1, p0, q0, q1, q2, q3, - ithresh, thresh); + const uint8x16_t mask = + NeedsFilter2_NEON(p3, p2, p1, p0, q0, q1, q2, q3, ithresh, thresh); const uint8x16_t hev_mask = NeedsHev_NEON(p1, p0, q0, q1, hev_thresh); uint8x16_t op2, op1, op0, oq0, oq1, oq2; - DoFilter6_NEON(p2, p1, p0, q0, q1, q2, mask, hev_mask, - &op2, &op1, &op0, &oq0, &oq1, &oq2); + DoFilter6_NEON(p2, p1, p0, q0, q1, q2, mask, hev_mask, &op2, &op1, &op0, + &oq0, &oq1, &oq2); Store6x8x2_NEON(op2, op1, op0, oq0, oq1, oq2, u, v, stride); } } static void HFilter8i_NEON(uint8_t* WEBP_RESTRICT u, uint8_t* WEBP_RESTRICT v, - int stride, - int thresh, int ithresh, int hev_thresh) { + int stride, int thresh, int ithresh, + int hev_thresh) { uint8x16_t p3, p2, p1, p0, q0, q1, q2, q3; u += 4; v += 4; Load8x8x2T_NEON(u, v, stride, &p3, &p2, &p1, &p0, &q0, &q1, &q2, &q3); { - const uint8x16_t mask = NeedsFilter2_NEON(p3, p2, p1, p0, q0, q1, q2, q3, - ithresh, thresh); + const uint8x16_t mask = + NeedsFilter2_NEON(p3, p2, p1, p0, q0, q1, q2, q3, ithresh, thresh); const uint8x16_t hev_mask = NeedsHev_NEON(p1, p0, q0, q1, hev_thresh); uint8x16_t op1, op0, oq0, oq1; DoFilter4_NEON(p1, p0, q0, q1, mask, hev_mask, &op1, &op0, &oq0, &oq1); @@ -1012,8 +1006,8 @@ static WEBP_INLINE void Transpose8x2_NEON(const int16x8_t in0, int16x8x2_t* const out) { // a0 a1 a2 a3 | b0 b1 b2 b3 => a0 b0 c0 d0 | a1 b1 c1 d1 // c0 c1 c2 c3 | d0 d1 d2 d3 a2 b2 c2 d2 | a3 b3 c3 d3 - const int16x8x2_t tmp0 = vzipq_s16(in0, in1); // a0 c0 a1 c1 a2 c2 ... - // b0 d0 b1 d1 b2 d2 ... + const int16x8x2_t tmp0 = vzipq_s16(in0, in1); // a0 c0 a1 c1 a2 c2 ... + // b0 d0 b1 d1 b2 d2 ... *out = vzipq_s16(tmp0.val[0], tmp0.val[1]); } @@ -1028,17 +1022,17 @@ static WEBP_INLINE void TransformPass_NEON(int16x8x2_t* const rows) { const int16x8_t C0 = vsraq_n_s16(B1, vqdmulhq_n_s16(B1, kC1), 1); const int16x8_t C1 = vqdmulhq_n_s16(B1, kC2); const int16x4_t a = vqadd_s16(vget_low_s16(rows->val[0]), - vget_low_s16(rows->val[1])); // in0 + in8 + vget_low_s16(rows->val[1])); // in0 + in8 const int16x4_t b = vqsub_s16(vget_low_s16(rows->val[0]), - vget_low_s16(rows->val[1])); // in0 - in8 + vget_low_s16(rows->val[1])); // in0 - in8 // c = kC2 * in4 - kC1 * in12 // d = kC1 * in4 + kC2 * in12 const int16x4_t c = vqsub_s16(vget_low_s16(C1), vget_high_s16(C0)); const int16x4_t d = vqadd_s16(vget_low_s16(C0), vget_high_s16(C1)); - const int16x8_t D0 = vcombine_s16(a, b); // D0 = a | b - const int16x8_t D1 = vcombine_s16(d, c); // D1 = d | c - const int16x8_t E0 = vqaddq_s16(D0, D1); // a+d | b+c - const int16x8_t E_tmp = vqsubq_s16(D0, D1); // a-d | b-c + const int16x8_t D0 = vcombine_s16(a, b); // D0 = a | b + const int16x8_t D1 = vcombine_s16(d, c); // D1 = d | c + const int16x8_t E0 = vqaddq_s16(D0, D1); // a+d | b+c + const int16x8_t E_tmp = vqsubq_s16(D0, D1); // a-d | b-c const int16x8_t E1 = vcombine_s16(vget_high_s16(E_tmp), vget_low_s16(E_tmp)); Transpose8x2_NEON(E0, E1, rows); } @@ -1058,135 +1052,135 @@ static void TransformOne_NEON(const int16_t* WEBP_RESTRICT in, uint8_t* WEBP_RESTRICT dst) { const int kBPS = BPS; // kC1, kC2. Padded because vld1.16 loads 8 bytes - const int16_t constants[4] = { kC1, kC2, 0, 0 }; + const int16_t constants[4] = {kC1, kC2, 0, 0}; /* Adapted from libvpx: vp8/common/arm/neon/shortidct4x4llm_neon.asm */ - __asm__ volatile ( - "vld1.16 {q1, q2}, [%[in]] \n" - "vld1.16 {d0}, [%[constants]] \n" + __asm__ volatile( + "vld1.16 {q1, q2}, [%[in]] \n" + "vld1.16 {d0}, [%[constants]] \n" - /* d2: in[0] - * d3: in[8] - * d4: in[4] - * d5: in[12] - */ - "vswp d3, d4 \n" + /* d2: in[0] + * d3: in[8] + * d4: in[4] + * d5: in[12] + */ + "vswp d3, d4 \n" - /* q8 = {in[4], in[12]} * kC1 * 2 >> 16 - * q9 = {in[4], in[12]} * kC2 >> 16 - */ - "vqdmulh.s16 q8, q2, d0[0] \n" - "vqdmulh.s16 q9, q2, d0[1] \n" + /* q8 = {in[4], in[12]} * kC1 * 2 >> 16 + * q9 = {in[4], in[12]} * kC2 >> 16 + */ + "vqdmulh.s16 q8, q2, d0[0] \n" + "vqdmulh.s16 q9, q2, d0[1] \n" - /* d22 = a = in[0] + in[8] - * d23 = b = in[0] - in[8] - */ - "vqadd.s16 d22, d2, d3 \n" - "vqsub.s16 d23, d2, d3 \n" + /* d22 = a = in[0] + in[8] + * d23 = b = in[0] - in[8] + */ + "vqadd.s16 d22, d2, d3 \n" + "vqsub.s16 d23, d2, d3 \n" - /* The multiplication should be x * kC1 >> 16 - * However, with vqdmulh we get x * kC1 * 2 >> 16 - * (multiply, double, return high half) - * We avoided this in kC2 by pre-shifting the constant. - * q8 = in[4]/[12] * kC1 >> 16 - */ - "vshr.s16 q8, q8, #1 \n" + /* The multiplication should be x * kC1 >> 16 + * However, with vqdmulh we get x * kC1 * 2 >> 16 + * (multiply, double, return high half) + * We avoided this in kC2 by pre-shifting the constant. + * q8 = in[4]/[12] * kC1 >> 16 + */ + "vshr.s16 q8, q8, #1 \n" - /* Add {in[4], in[12]} back after the multiplication. This is handled by - * adding 1 << 16 to kC1 in the libwebp C code. - */ - "vqadd.s16 q8, q2, q8 \n" + /* Add {in[4], in[12]} back after the multiplication. This is handled by + * adding 1 << 16 to kC1 in the libwebp C code. + */ + "vqadd.s16 q8, q2, q8 \n" - /* d20 = c = in[4]*kC2 - in[12]*kC1 - * d21 = d = in[4]*kC1 + in[12]*kC2 - */ - "vqsub.s16 d20, d18, d17 \n" - "vqadd.s16 d21, d19, d16 \n" + /* d20 = c = in[4]*kC2 - in[12]*kC1 + * d21 = d = in[4]*kC1 + in[12]*kC2 + */ + "vqsub.s16 d20, d18, d17 \n" + "vqadd.s16 d21, d19, d16 \n" - /* d2 = tmp[0] = a + d - * d3 = tmp[1] = b + c - * d4 = tmp[2] = b - c - * d5 = tmp[3] = a - d - */ - "vqadd.s16 d2, d22, d21 \n" - "vqadd.s16 d3, d23, d20 \n" - "vqsub.s16 d4, d23, d20 \n" - "vqsub.s16 d5, d22, d21 \n" + /* d2 = tmp[0] = a + d + * d3 = tmp[1] = b + c + * d4 = tmp[2] = b - c + * d5 = tmp[3] = a - d + */ + "vqadd.s16 d2, d22, d21 \n" + "vqadd.s16 d3, d23, d20 \n" + "vqsub.s16 d4, d23, d20 \n" + "vqsub.s16 d5, d22, d21 \n" - "vzip.16 q1, q2 \n" - "vzip.16 q1, q2 \n" + "vzip.16 q1, q2 \n" + "vzip.16 q1, q2 \n" - "vswp d3, d4 \n" + "vswp d3, d4 \n" - /* q8 = {tmp[4], tmp[12]} * kC1 * 2 >> 16 - * q9 = {tmp[4], tmp[12]} * kC2 >> 16 - */ - "vqdmulh.s16 q8, q2, d0[0] \n" - "vqdmulh.s16 q9, q2, d0[1] \n" + /* q8 = {tmp[4], tmp[12]} * kC1 * 2 >> 16 + * q9 = {tmp[4], tmp[12]} * kC2 >> 16 + */ + "vqdmulh.s16 q8, q2, d0[0] \n" + "vqdmulh.s16 q9, q2, d0[1] \n" - /* d22 = a = tmp[0] + tmp[8] - * d23 = b = tmp[0] - tmp[8] - */ - "vqadd.s16 d22, d2, d3 \n" - "vqsub.s16 d23, d2, d3 \n" + /* d22 = a = tmp[0] + tmp[8] + * d23 = b = tmp[0] - tmp[8] + */ + "vqadd.s16 d22, d2, d3 \n" + "vqsub.s16 d23, d2, d3 \n" - /* See long winded explanations prior */ - "vshr.s16 q8, q8, #1 \n" - "vqadd.s16 q8, q2, q8 \n" + /* See long winded explanations prior */ + "vshr.s16 q8, q8, #1 \n" + "vqadd.s16 q8, q2, q8 \n" - /* d20 = c = in[4]*kC2 - in[12]*kC1 - * d21 = d = in[4]*kC1 + in[12]*kC2 - */ - "vqsub.s16 d20, d18, d17 \n" - "vqadd.s16 d21, d19, d16 \n" + /* d20 = c = in[4]*kC2 - in[12]*kC1 + * d21 = d = in[4]*kC1 + in[12]*kC2 + */ + "vqsub.s16 d20, d18, d17 \n" + "vqadd.s16 d21, d19, d16 \n" - /* d2 = tmp[0] = a + d - * d3 = tmp[1] = b + c - * d4 = tmp[2] = b - c - * d5 = tmp[3] = a - d - */ - "vqadd.s16 d2, d22, d21 \n" - "vqadd.s16 d3, d23, d20 \n" - "vqsub.s16 d4, d23, d20 \n" - "vqsub.s16 d5, d22, d21 \n" + /* d2 = tmp[0] = a + d + * d3 = tmp[1] = b + c + * d4 = tmp[2] = b - c + * d5 = tmp[3] = a - d + */ + "vqadd.s16 d2, d22, d21 \n" + "vqadd.s16 d3, d23, d20 \n" + "vqsub.s16 d4, d23, d20 \n" + "vqsub.s16 d5, d22, d21 \n" - "vld1.32 d6[0], [%[dst]], %[kBPS] \n" - "vld1.32 d6[1], [%[dst]], %[kBPS] \n" - "vld1.32 d7[0], [%[dst]], %[kBPS] \n" - "vld1.32 d7[1], [%[dst]], %[kBPS] \n" + "vld1.32 d6[0], [%[dst]], %[kBPS] \n" + "vld1.32 d6[1], [%[dst]], %[kBPS] \n" + "vld1.32 d7[0], [%[dst]], %[kBPS] \n" + "vld1.32 d7[1], [%[dst]], %[kBPS] \n" - "sub %[dst], %[dst], %[kBPS], lsl #2 \n" + "sub %[dst], %[dst], %[kBPS], lsl #2 \n" - /* (val) + 4 >> 3 */ - "vrshr.s16 d2, d2, #3 \n" - "vrshr.s16 d3, d3, #3 \n" - "vrshr.s16 d4, d4, #3 \n" - "vrshr.s16 d5, d5, #3 \n" + /* (val) + 4 >> 3 */ + "vrshr.s16 d2, d2, #3 \n" + "vrshr.s16 d3, d3, #3 \n" + "vrshr.s16 d4, d4, #3 \n" + "vrshr.s16 d5, d5, #3 \n" - "vzip.16 q1, q2 \n" - "vzip.16 q1, q2 \n" + "vzip.16 q1, q2 \n" + "vzip.16 q1, q2 \n" - /* Must accumulate before saturating */ - "vmovl.u8 q8, d6 \n" - "vmovl.u8 q9, d7 \n" + /* Must accumulate before saturating */ + "vmovl.u8 q8, d6 \n" + "vmovl.u8 q9, d7 \n" - "vqadd.s16 q1, q1, q8 \n" - "vqadd.s16 q2, q2, q9 \n" + "vqadd.s16 q1, q1, q8 \n" + "vqadd.s16 q2, q2, q9 \n" - "vqmovun.s16 d0, q1 \n" - "vqmovun.s16 d1, q2 \n" + "vqmovun.s16 d0, q1 \n" + "vqmovun.s16 d1, q2 \n" - "vst1.32 d0[0], [%[dst]], %[kBPS] \n" - "vst1.32 d0[1], [%[dst]], %[kBPS] \n" - "vst1.32 d1[0], [%[dst]], %[kBPS] \n" - "vst1.32 d1[1], [%[dst]] \n" + "vst1.32 d0[0], [%[dst]], %[kBPS] \n" + "vst1.32 d0[1], [%[dst]], %[kBPS] \n" + "vst1.32 d1[0], [%[dst]], %[kBPS] \n" + "vst1.32 d1[1], [%[dst]] \n" - : [in] "+r"(in), [dst] "+r"(dst) /* modified registers */ - : [kBPS] "r"(kBPS), [constants] "r"(constants) /* constants */ - : "memory", "q0", "q1", "q2", "q8", "q9", "q10", "q11" /* clobbered */ + : [in] "+r"(in), [dst] "+r"(dst) /* modified registers */ + : [kBPS] "r"(kBPS), [constants] "r"(constants) /* constants */ + : "memory", "q0", "q1", "q2", "q8", "q9", "q10", "q11" /* clobbered */ ); } -#endif // WEBP_USE_INTRINSICS +#endif // WEBP_USE_INTRINSICS static void TransformTwo_NEON(const int16_t* WEBP_RESTRICT in, uint8_t* WEBP_RESTRICT dst, int do_two) { @@ -1204,12 +1198,17 @@ static void TransformDC_NEON(const int16_t* WEBP_RESTRICT in, //------------------------------------------------------------------------------ -#define STORE_WHT(dst, col, rows) do { \ - *dst = vgetq_lane_s32(rows.val[0], col); (dst) += 16; \ - *dst = vgetq_lane_s32(rows.val[1], col); (dst) += 16; \ - *dst = vgetq_lane_s32(rows.val[2], col); (dst) += 16; \ - *dst = vgetq_lane_s32(rows.val[3], col); (dst) += 16; \ -} while (0) +#define STORE_WHT(dst, col, rows) \ + do { \ + *dst = vgetq_lane_s32(rows.val[0], col); \ + (dst) += 16; \ + *dst = vgetq_lane_s32(rows.val[1], col); \ + (dst) += 16; \ + *dst = vgetq_lane_s32(rows.val[2], col); \ + (dst) += 16; \ + *dst = vgetq_lane_s32(rows.val[3], col); \ + (dst) += 16; \ + } while (0) static void TransformWHT_NEON(const int16_t* WEBP_RESTRICT in, int16_t* WEBP_RESTRICT out) { @@ -1270,10 +1269,9 @@ static void TransformAC3_NEON(const int16_t* WEBP_RESTRICT in, const int16x4_t d4 = vdup_n_s16(WEBP_TRANSFORM_AC3_MUL1(in[4])); const int c1 = WEBP_TRANSFORM_AC3_MUL2(in[1]); const int d1 = WEBP_TRANSFORM_AC3_MUL1(in[1]); - const uint64_t cd = (uint64_t)( d1 & 0xffff) << 0 | - (uint64_t)( c1 & 0xffff) << 16 | - (uint64_t)(-c1 & 0xffff) << 32 | - (uint64_t)(-d1 & 0xffff) << 48; + const uint64_t cd = + (uint64_t)(d1 & 0xffff) << 0 | (uint64_t)(c1 & 0xffff) << 16 | + (uint64_t)(-c1 & 0xffff) << 32 | (uint64_t)(-d1 & 0xffff) << 48; const int16x4_t CD = vcreate_s16(cd); const int16x4_t B = vqadd_s16(A, CD); const int16x8_t m0_m1 = vcombine_s16(vqadd_s16(B, d4), vqadd_s16(B, c4)); @@ -1284,9 +1282,9 @@ static void TransformAC3_NEON(const int16_t* WEBP_RESTRICT in, //------------------------------------------------------------------------------ // 4x4 -static void DC4_NEON(uint8_t* dst) { // DC +static void DC4_NEON(uint8_t* dst) { // DC const uint8x8_t A = vld1_u8(dst - BPS); // top row - const uint16x4_t p0 = vpaddl_u8(A); // cascading summation of the top + const uint16x4_t p0 = vpaddl_u8(A); // cascading summation of the top const uint16x4_t p1 = vpadd_u16(p0, p0); const uint8x8_t L0 = vld1_u8(dst + 0 * BPS - 1); const uint8x8_t L1 = vld1_u8(dst + 1 * BPS - 1); @@ -1307,8 +1305,8 @@ static void DC4_NEON(uint8_t* dst) { // DC // TrueMotion (4x4 + 8x8) static WEBP_INLINE void TrueMotion_NEON(uint8_t* dst, int size) { const uint8x8_t TL = vld1_dup_u8(dst - BPS - 1); // top-left pixel 'A[-1]' - const uint8x8_t T = vld1_u8(dst - BPS); // top row 'A[0..3]' - const uint16x8_t d = vsubl_u8(T, TL); // A[c] - A[-1] + const uint8x8_t T = vld1_u8(dst - BPS); // top row 'A[0..3]' + const uint16x8_t d = vsubl_u8(T, TL); // A[c] - A[-1] int y; for (y = 0; y < size; y += 4) { // left edge @@ -1343,7 +1341,7 @@ static WEBP_INLINE void TrueMotion_NEON(uint8_t* dst, int size) { static void TM4_NEON(uint8_t* dst) { TrueMotion_NEON(dst, 4); } -static void VE4_NEON(uint8_t* dst) { // vertical +static void VE4_NEON(uint8_t* dst) { // vertical // NB: avoid vld1_u64 here as an alignment hint may be added -> SIGBUS. const uint64x1_t A0 = vreinterpret_u64_u8(vld1_u8(dst - BPS - 1)); // top row const uint64x1_t A1 = vshr_n_u64(A0, 8); @@ -1359,7 +1357,7 @@ static void VE4_NEON(uint8_t* dst) { // vertical } } -static void RD4_NEON(uint8_t* dst) { // Down-right +static void RD4_NEON(uint8_t* dst) { // Down-right const uint8x8_t XABCD_u8 = vld1_u8(dst - BPS - 1); const uint64x1_t XABCD = vreinterpret_u64_u8(XABCD_u8); const uint64x1_t ____XABC = vshl_n_u64(XABCD, 32); @@ -1388,7 +1386,7 @@ static void RD4_NEON(uint8_t* dst) { // Down-right vst1_lane_u32((uint32_t*)(dst + 3 * BPS), r3, 0); } -static void LD4_NEON(uint8_t* dst) { // Down-left +static void LD4_NEON(uint8_t* dst) { // Down-left // Note using the same shift trick as VE4() is slower here. const uint8x8_t ABCDEFGH = vld1_u8(dst - BPS + 0); const uint8x8_t BCDEFGH0 = vld1_u8(dst - BPS + 1); @@ -1410,7 +1408,7 @@ static void LD4_NEON(uint8_t* dst) { // Down-left //------------------------------------------------------------------------------ // Chroma -static void VE8uv_NEON(uint8_t* dst) { // vertical +static void VE8uv_NEON(uint8_t* dst) { // vertical const uint8x8_t top = vld1_u8(dst - BPS); int j; for (j = 0; j < 8; ++j) { @@ -1418,7 +1416,7 @@ static void VE8uv_NEON(uint8_t* dst) { // vertical } } -static void HE8uv_NEON(uint8_t* dst) { // horizontal +static void HE8uv_NEON(uint8_t* dst) { // horizontal int j; for (j = 0; j < 8; ++j) { const uint8x8_t left = vld1_dup_u8(dst - 1); @@ -1493,7 +1491,7 @@ static void TM8uv_NEON(uint8_t* dst) { TrueMotion_NEON(dst, 8); } //------------------------------------------------------------------------------ // 16x16 -static void VE16_NEON(uint8_t* dst) { // vertical +static void VE16_NEON(uint8_t* dst) { // vertical const uint8x16_t top = vld1q_u8(dst - BPS); int j; for (j = 0; j < 16; ++j) { @@ -1501,7 +1499,7 @@ static void VE16_NEON(uint8_t* dst) { // vertical } } -static void HE16_NEON(uint8_t* dst) { // horizontal +static void HE16_NEON(uint8_t* dst) { // horizontal int j; for (j = 0; j < 16; ++j) { const uint8x16_t left = vld1q_dup_u8(dst - 1); @@ -1579,7 +1577,7 @@ static void DC16NoTopLeft_NEON(uint8_t* dst) { DC16_NEON(dst, 0, 0); } static void TM16_NEON(uint8_t* dst) { const uint8x8_t TL = vld1_dup_u8(dst - BPS - 1); // top-left pixel 'A[-1]' - const uint8x16_t T = vld1q_u8(dst - BPS); // top row 'A[0..15]' + const uint8x16_t T = vld1q_u8(dst - BPS); // top row 'A[0..15]' // A[c] - A[-1] const uint16x8_t d_lo = vsubl_u8(vget_low_u8(T), TL); const uint16x8_t d_hi = vsubl_u8(vget_high_u8(T), TL); diff --git a/src/dsp/dec_sse2.c b/src/dsp/dec_sse2.c index d5f273e3..600b3738 100644 --- a/src/dsp/dec_sse2.c +++ b/src/dsp/dec_sse2.c @@ -19,7 +19,7 @@ // The 3-coeff sparse transform in SSE2 is not really faster than the plain-C // one it seems => disable it by default. Uncomment the following to enable: #if !defined(USE_TRANSFORM_AC3) -#define USE_TRANSFORM_AC3 0 // ALTERNATE_CODE +#define USE_TRANSFORM_AC3 0 // ALTERNATE_CODE #endif #include @@ -119,8 +119,8 @@ static void Transform_SSE2(const int16_t* WEBP_RESTRICT in, // multiplications. const __m128i four = _mm_set1_epi16(4); const __m128i dc = _mm_add_epi16(T0, four); - const __m128i a = _mm_add_epi16(dc, T2); - const __m128i b = _mm_sub_epi16(dc, T2); + const __m128i a = _mm_add_epi16(dc, T2); + const __m128i b = _mm_sub_epi16(dc, T2); // c = MUL(T1, K2) - MUL(T3, K1) = MUL(T1, k2) - MUL(T3, k1) + T1 - T3 const __m128i c1 = _mm_mulhi_epi16(T1, k2); const __m128i c2 = _mm_mulhi_epi16(T3, k1); @@ -242,15 +242,14 @@ static void TransformAC3_SSE2(const int16_t* WEBP_RESTRICT in, WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(dst3)); } -#endif // USE_TRANSFORM_AC3 +#endif // USE_TRANSFORM_AC3 //------------------------------------------------------------------------------ // Loop Filter (Paragraph 15) // Compute abs(p - q) = subs(p - q) OR subs(q - p) -#define MM_ABS(p, q) _mm_or_si128( \ - _mm_subs_epu8((q), (p)), \ - _mm_subs_epu8((p), (q))) +#define MM_ABS(p, q) \ + _mm_or_si128(_mm_subs_epu8((q), (p)), _mm_subs_epu8((p), (q))) // Shift each byte of "x" by 3 bits while preserving by the sign bit. static WEBP_INLINE void SignedShift8b_SSE2(__m128i* const x) { @@ -262,22 +261,24 @@ static WEBP_INLINE void SignedShift8b_SSE2(__m128i* const x) { *x = _mm_packs_epi16(lo_1, hi_1); } -#define FLIP_SIGN_BIT2(a, b) do { \ - (a) = _mm_xor_si128(a, sign_bit); \ - (b) = _mm_xor_si128(b, sign_bit); \ -} while (0) +#define FLIP_SIGN_BIT2(a, b) \ + do { \ + (a) = _mm_xor_si128(a, sign_bit); \ + (b) = _mm_xor_si128(b, sign_bit); \ + } while (0) -#define FLIP_SIGN_BIT4(a, b, c, d) do { \ - FLIP_SIGN_BIT2(a, b); \ - FLIP_SIGN_BIT2(c, d); \ -} while (0) +#define FLIP_SIGN_BIT4(a, b, c, d) \ + do { \ + FLIP_SIGN_BIT2(a, b); \ + FLIP_SIGN_BIT2(c, d); \ + } while (0) // input/output is uint8_t static WEBP_INLINE void GetNotHEV_SSE2(const __m128i* const p1, const __m128i* const p0, const __m128i* const q0, - const __m128i* const q1, - int hev_thresh, __m128i* const not_hev) { + const __m128i* const q1, int hev_thresh, + __m128i* const not_hev) { const __m128i zero = _mm_setzero_si128(); const __m128i t_1 = MM_ABS(*p1, *p0); const __m128i t_2 = MM_ABS(*q1, *q0); @@ -313,10 +314,10 @@ static WEBP_INLINE void DoSimpleFilter_SSE2(__m128i* const p0, __m128i v3 = _mm_adds_epi8(*fl, k3); __m128i v4 = _mm_adds_epi8(*fl, k4); - SignedShift8b_SSE2(&v4); // v4 >> 3 - SignedShift8b_SSE2(&v3); // v3 >> 3 - *q0 = _mm_subs_epi8(*q0, v4); // q0 -= v4 - *p0 = _mm_adds_epi8(*p0, v3); // p0 += v3 + SignedShift8b_SSE2(&v4); // v4 >> 3 + SignedShift8b_SSE2(&v3); // v3 >> 3 + *q0 = _mm_subs_epi8(*q0, v4); // q0 -= v4 + *p0 = _mm_adds_epi8(*p0, v3); // p0 += v3 } // Updates values of 2 pixels at MB edge during complex filtering. @@ -339,17 +340,17 @@ static WEBP_INLINE void Update2Pixels_SSE2(__m128i* const pi, __m128i* const qi, static WEBP_INLINE void NeedsFilter_SSE2(const __m128i* const p1, const __m128i* const p0, const __m128i* const q0, - const __m128i* const q1, - int thresh, __m128i* const mask) { + const __m128i* const q1, int thresh, + __m128i* const mask) { const __m128i m_thresh = _mm_set1_epi8((char)thresh); - const __m128i t1 = MM_ABS(*p1, *q1); // abs(p1 - q1) + const __m128i t1 = MM_ABS(*p1, *q1); // abs(p1 - q1) const __m128i kFE = _mm_set1_epi8((char)0xFE); const __m128i t2 = _mm_and_si128(t1, kFE); // set lsb of each byte to zero const __m128i t3 = _mm_srli_epi16(t2, 1); // abs(p1 - q1) / 2 - const __m128i t4 = MM_ABS(*p0, *q0); // abs(p0 - q0) - const __m128i t5 = _mm_adds_epu8(t4, t4); // abs(p0 - q0) * 2 - const __m128i t6 = _mm_adds_epu8(t5, t3); // abs(p0-q0)*2 + abs(p1-q1)/2 + const __m128i t4 = MM_ABS(*p0, *q0); // abs(p0 - q0) + const __m128i t5 = _mm_adds_epu8(t4, t4); // abs(p0 - q0) * 2 + const __m128i t6 = _mm_adds_epu8(t5, t3); // abs(p0-q0)*2 + abs(p1-q1)/2 const __m128i t7 = _mm_subs_epu8(t6, m_thresh); // mask <= m_thresh *mask = _mm_cmpeq_epi8(t7, _mm_setzero_si128()); @@ -372,7 +373,7 @@ static WEBP_INLINE void DoFilter2_SSE2(__m128i* const p1, __m128i* const p0, FLIP_SIGN_BIT2(*p0, *q0); GetBaseDelta_SSE2(&p1s, p0, q0, &q1s, &a); - a = _mm_and_si128(a, mask); // mask filter values we don't care about + a = _mm_and_si128(a, mask); // mask filter values we don't care about DoSimpleFilter_SSE2(p0, q0, &a); FLIP_SIGN_BIT2(*p0, *q0); } @@ -404,12 +405,12 @@ static WEBP_INLINE void DoFilter4_SSE2(__m128i* const p1, __m128i* const p0, t1 = _mm_adds_epi8(t1, t2); // hev(p1 - q1) + 3 * (q0 - p0) t1 = _mm_and_si128(t1, *mask); // mask filter values we don't care about - t2 = _mm_adds_epi8(t1, k3); // 3 * (q0 - p0) + hev(p1 - q1) + 3 - t3 = _mm_adds_epi8(t1, k4); // 3 * (q0 - p0) + hev(p1 - q1) + 4 - SignedShift8b_SSE2(&t2); // (3 * (q0 - p0) + hev(p1 - q1) + 3) >> 3 - SignedShift8b_SSE2(&t3); // (3 * (q0 - p0) + hev(p1 - q1) + 4) >> 3 - *p0 = _mm_adds_epi8(*p0, t2); // p0 += t2 - *q0 = _mm_subs_epi8(*q0, t3); // q0 -= t3 + t2 = _mm_adds_epi8(t1, k3); // 3 * (q0 - p0) + hev(p1 - q1) + 3 + t3 = _mm_adds_epi8(t1, k4); // 3 * (q0 - p0) + hev(p1 - q1) + 4 + SignedShift8b_SSE2(&t2); // (3 * (q0 - p0) + hev(p1 - q1) + 3) >> 3 + SignedShift8b_SSE2(&t3); // (3 * (q0 - p0) + hev(p1 - q1) + 4) >> 3 + *p0 = _mm_adds_epi8(*p0, t2); // p0 += t2 + *q0 = _mm_subs_epi8(*q0, t3); // q0 -= t3 FLIP_SIGN_BIT2(*p0, *q0); // this is equivalent to signed (a + 1) >> 1 calculation @@ -417,9 +418,9 @@ static WEBP_INLINE void DoFilter4_SSE2(__m128i* const p1, __m128i* const p0, t3 = _mm_avg_epu8(t2, zero); t3 = _mm_sub_epi8(t3, k64); - t3 = _mm_and_si128(not_hev, t3); // if !hev - *q1 = _mm_subs_epi8(*q1, t3); // q1 -= t3 - *p1 = _mm_adds_epi8(*p1, t3); // p1 += t3 + t3 = _mm_and_si128(not_hev, t3); // if !hev + *q1 = _mm_subs_epi8(*q1, t3); // q1 -= t3 + *p1 = _mm_adds_epi8(*p1, t3); // p1 += t3 FLIP_SIGN_BIT2(*p1, *q1); } @@ -440,13 +441,13 @@ static WEBP_INLINE void DoFilter6_SSE2(__m128i* const p2, __m128i* const p1, FLIP_SIGN_BIT2(*p2, *q2); GetBaseDelta_SSE2(p1, p0, q0, q1, &a); - { // do simple filter on pixels with hev + { // do simple filter on pixels with hev const __m128i m = _mm_andnot_si128(not_hev, *mask); const __m128i f = _mm_and_si128(a, m); DoSimpleFilter_SSE2(p0, q0, &f); } - { // do strong filter on pixels with not hev + { // do strong filter on pixels with not hev const __m128i k9 = _mm_set1_epi16(0x0900); const __m128i k63 = _mm_set1_epi16(63); @@ -456,11 +457,11 @@ static WEBP_INLINE void DoFilter6_SSE2(__m128i* const p2, __m128i* const p1, const __m128i f_lo = _mm_unpacklo_epi8(zero, f); const __m128i f_hi = _mm_unpackhi_epi8(zero, f); - const __m128i f9_lo = _mm_mulhi_epi16(f_lo, k9); // Filter (lo) * 9 - const __m128i f9_hi = _mm_mulhi_epi16(f_hi, k9); // Filter (hi) * 9 + const __m128i f9_lo = _mm_mulhi_epi16(f_lo, k9); // Filter (lo) * 9 + const __m128i f9_hi = _mm_mulhi_epi16(f_hi, k9); // Filter (hi) * 9 - const __m128i a2_lo = _mm_add_epi16(f9_lo, k63); // Filter * 9 + 63 - const __m128i a2_hi = _mm_add_epi16(f9_hi, k63); // Filter * 9 + 63 + const __m128i a2_lo = _mm_add_epi16(f9_lo, k63); // Filter * 9 + 63 + const __m128i a2_hi = _mm_add_epi16(f9_hi, k63); // Filter * 9 + 63 const __m128i a1_lo = _mm_add_epi16(a2_lo, f9_lo); // Filter * 18 + 63 const __m128i a1_hi = _mm_add_epi16(a2_hi, f9_hi); // Filter * 18 + 63 @@ -503,8 +504,7 @@ static WEBP_INLINE void Load8x4_SSE2(const uint8_t* const b, int stride, } static WEBP_INLINE void Load16x4_SSE2(const uint8_t* const r0, - const uint8_t* const r8, - int stride, + const uint8_t* const r8, int stride, __m128i* const p1, __m128i* const p0, __m128i* const q0, __m128i* const q1) { // Assume the pixels around the edge (|) are numbered as follows @@ -539,8 +539,8 @@ static WEBP_INLINE void Load16x4_SSE2(const uint8_t* const r0, } } -static WEBP_INLINE void Store4x4_SSE2(__m128i* const x, - uint8_t* dst, int stride) { +static WEBP_INLINE void Store4x4_SSE2(__m128i* const x, uint8_t* dst, + int stride) { int i; for (i = 0; i < 4; ++i, dst += stride) { WebPInt32ToMem(dst, _mm_cvtsi128_si32(*x)); @@ -552,9 +552,8 @@ static WEBP_INLINE void Store4x4_SSE2(__m128i* const x, static WEBP_INLINE void Store16x4_SSE2(const __m128i* const p1, const __m128i* const p0, const __m128i* const q0, - const __m128i* const q1, - uint8_t* r0, uint8_t* r8, - int stride) { + const __m128i* const q1, uint8_t* r0, + uint8_t* r8, int stride) { __m128i t1, p1_s, p0_s, q0_s, q1_s; // p0 = 71 70 61 60 51 50 41 40 31 30 21 20 11 10 01 00 @@ -636,50 +635,55 @@ static void SimpleHFilter16i_SSE2(uint8_t* p, int stride, int thresh) { //------------------------------------------------------------------------------ // Complex In-loop filtering (Paragraph 15.3) -#define MAX_DIFF1(p3, p2, p1, p0, m) do { \ - (m) = MM_ABS(p1, p0); \ - (m) = _mm_max_epu8(m, MM_ABS(p3, p2)); \ - (m) = _mm_max_epu8(m, MM_ABS(p2, p1)); \ -} while (0) +#define MAX_DIFF1(p3, p2, p1, p0, m) \ + do { \ + (m) = MM_ABS(p1, p0); \ + (m) = _mm_max_epu8(m, MM_ABS(p3, p2)); \ + (m) = _mm_max_epu8(m, MM_ABS(p2, p1)); \ + } while (0) -#define MAX_DIFF2(p3, p2, p1, p0, m) do { \ - (m) = _mm_max_epu8(m, MM_ABS(p1, p0)); \ - (m) = _mm_max_epu8(m, MM_ABS(p3, p2)); \ - (m) = _mm_max_epu8(m, MM_ABS(p2, p1)); \ -} while (0) +#define MAX_DIFF2(p3, p2, p1, p0, m) \ + do { \ + (m) = _mm_max_epu8(m, MM_ABS(p1, p0)); \ + (m) = _mm_max_epu8(m, MM_ABS(p3, p2)); \ + (m) = _mm_max_epu8(m, MM_ABS(p2, p1)); \ + } while (0) -#define LOAD_H_EDGES4(p, stride, e1, e2, e3, e4) do { \ - (e1) = _mm_loadu_si128((__m128i*)&(p)[0 * (stride)]); \ - (e2) = _mm_loadu_si128((__m128i*)&(p)[1 * (stride)]); \ - (e3) = _mm_loadu_si128((__m128i*)&(p)[2 * (stride)]); \ - (e4) = _mm_loadu_si128((__m128i*)&(p)[3 * (stride)]); \ -} while (0) +#define LOAD_H_EDGES4(p, stride, e1, e2, e3, e4) \ + do { \ + (e1) = _mm_loadu_si128((__m128i*)&(p)[0 * (stride)]); \ + (e2) = _mm_loadu_si128((__m128i*)&(p)[1 * (stride)]); \ + (e3) = _mm_loadu_si128((__m128i*)&(p)[2 * (stride)]); \ + (e4) = _mm_loadu_si128((__m128i*)&(p)[3 * (stride)]); \ + } while (0) -#define LOADUV_H_EDGE(p, u, v, stride) do { \ - const __m128i U = _mm_loadl_epi64((__m128i*)&(u)[(stride)]); \ - const __m128i V = _mm_loadl_epi64((__m128i*)&(v)[(stride)]); \ - (p) = _mm_unpacklo_epi64(U, V); \ -} while (0) +#define LOADUV_H_EDGE(p, u, v, stride) \ + do { \ + const __m128i U = _mm_loadl_epi64((__m128i*)&(u)[(stride)]); \ + const __m128i V = _mm_loadl_epi64((__m128i*)&(v)[(stride)]); \ + (p) = _mm_unpacklo_epi64(U, V); \ + } while (0) -#define LOADUV_H_EDGES4(u, v, stride, e1, e2, e3, e4) do { \ - LOADUV_H_EDGE(e1, u, v, 0 * (stride)); \ - LOADUV_H_EDGE(e2, u, v, 1 * (stride)); \ - LOADUV_H_EDGE(e3, u, v, 2 * (stride)); \ - LOADUV_H_EDGE(e4, u, v, 3 * (stride)); \ -} while (0) +#define LOADUV_H_EDGES4(u, v, stride, e1, e2, e3, e4) \ + do { \ + LOADUV_H_EDGE(e1, u, v, 0 * (stride)); \ + LOADUV_H_EDGE(e2, u, v, 1 * (stride)); \ + LOADUV_H_EDGE(e3, u, v, 2 * (stride)); \ + LOADUV_H_EDGE(e4, u, v, 3 * (stride)); \ + } while (0) -#define STOREUV(p, u, v, stride) do { \ - _mm_storel_epi64((__m128i*)&(u)[(stride)], p); \ - (p) = _mm_srli_si128(p, 8); \ - _mm_storel_epi64((__m128i*)&(v)[(stride)], p); \ -} while (0) +#define STOREUV(p, u, v, stride) \ + do { \ + _mm_storel_epi64((__m128i*)&(u)[(stride)], p); \ + (p) = _mm_srli_si128(p, 8); \ + _mm_storel_epi64((__m128i*)&(v)[(stride)], p); \ + } while (0) static WEBP_INLINE void ComplexMask_SSE2(const __m128i* const p1, const __m128i* const p0, const __m128i* const q0, - const __m128i* const q1, - int thresh, int ithresh, - __m128i* const mask) { + const __m128i* const q1, int thresh, + int ithresh, __m128i* const mask) { const __m128i it = _mm_set1_epi8(ithresh); const __m128i diff = _mm_subs_epu8(*mask, it); const __m128i thresh_mask = _mm_cmpeq_epi8(diff, _mm_setzero_si128()); @@ -689,8 +693,8 @@ static WEBP_INLINE void ComplexMask_SSE2(const __m128i* const p1, } // on macroblock edges -static void VFilter16_SSE2(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void VFilter16_SSE2(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { __m128i t1; __m128i mask; __m128i p2, p1, p0, q0, q1, q2; @@ -715,8 +719,8 @@ static void VFilter16_SSE2(uint8_t* p, int stride, _mm_storeu_si128((__m128i*)&p[+2 * stride], q2); } -static void HFilter16_SSE2(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void HFilter16_SSE2(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { __m128i mask; __m128i p3, p2, p1, p0, q0, q1, q2, q3; @@ -735,19 +739,19 @@ static void HFilter16_SSE2(uint8_t* p, int stride, } // on three inner edges -static void VFilter16i_SSE2(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void VFilter16i_SSE2(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { int k; - __m128i p3, p2, p1, p0; // loop invariants + __m128i p3, p2, p1, p0; // loop invariants LOAD_H_EDGES4(p, stride, p3, p2, p1, p0); // prologue for (k = 3; k > 0; --k) { __m128i mask, tmp1, tmp2; - uint8_t* const b = p + 2 * stride; // beginning of p1 + uint8_t* const b = p + 2 * stride; // beginning of p1 p += 4 * stride; - MAX_DIFF1(p3, p2, p1, p0, mask); // compute partial mask + MAX_DIFF1(p3, p2, p1, p0, mask); // compute partial mask LOAD_H_EDGES4(p, stride, p3, p2, tmp1, tmp2); MAX_DIFF2(p3, p2, tmp1, tmp2, mask); @@ -768,20 +772,20 @@ static void VFilter16i_SSE2(uint8_t* p, int stride, } } -static void HFilter16i_SSE2(uint8_t* p, int stride, - int thresh, int ithresh, int hev_thresh) { +static void HFilter16i_SSE2(uint8_t* p, int stride, int thresh, int ithresh, + int hev_thresh) { int k; - __m128i p3, p2, p1, p0; // loop invariants + __m128i p3, p2, p1, p0; // loop invariants Load16x4_SSE2(p, p + 8 * stride, stride, &p3, &p2, &p1, &p0); // prologue for (k = 3; k > 0; --k) { __m128i mask, tmp1, tmp2; - uint8_t* const b = p + 2; // beginning of p1 + uint8_t* const b = p + 2; // beginning of p1 p += 4; // beginning of q0 (and next span) - MAX_DIFF1(p3, p2, p1, p0, mask); // compute partial mask + MAX_DIFF1(p3, p2, p1, p0, mask); // compute partial mask Load16x4_SSE2(p, p + 8 * stride, stride, &p3, &p2, &tmp1, &tmp2); MAX_DIFF2(p3, p2, tmp1, tmp2, mask); @@ -843,8 +847,8 @@ static void HFilter8_SSE2(uint8_t* WEBP_RESTRICT u, uint8_t* WEBP_RESTRICT v, } static void VFilter8i_SSE2(uint8_t* WEBP_RESTRICT u, uint8_t* WEBP_RESTRICT v, - int stride, - int thresh, int ithresh, int hev_thresh) { + int stride, int thresh, int ithresh, + int hev_thresh) { __m128i mask; __m128i t1, t2, p1, p0, q0, q1; @@ -870,11 +874,11 @@ static void VFilter8i_SSE2(uint8_t* WEBP_RESTRICT u, uint8_t* WEBP_RESTRICT v, } static void HFilter8i_SSE2(uint8_t* WEBP_RESTRICT u, uint8_t* WEBP_RESTRICT v, - int stride, - int thresh, int ithresh, int hev_thresh) { + int stride, int thresh, int ithresh, + int hev_thresh) { __m128i mask; __m128i t1, t2, p1, p0, q0, q1; - Load16x4_SSE2(u, v, stride, &t2, &t1, &p1, &p0); // p3, p2, p1, p0 + Load16x4_SSE2(u, v, stride, &t2, &t1, &p1, &p0); // p3, p2, p1, p0 MAX_DIFF1(t2, t1, p1, p0, mask); u += 4; // beginning of q0 @@ -904,7 +908,7 @@ static void HFilter8i_SSE2(uint8_t* WEBP_RESTRICT u, uint8_t* WEBP_RESTRICT v, // where: AC = (a + b + 1) >> 1, BC = (b + c + 1) >> 1 // and ab = a ^ b, bc = b ^ c, lsb = (AC^BC)&1 -static void VE4_SSE2(uint8_t* dst) { // vertical +static void VE4_SSE2(uint8_t* dst) { // vertical const __m128i one = _mm_set1_epi8(1); const __m128i ABCDEFGH = _mm_loadl_epi64((__m128i*)(dst - BPS - 1)); const __m128i BCDEFGH0 = _mm_srli_si128(ABCDEFGH, 1); @@ -920,7 +924,7 @@ static void VE4_SSE2(uint8_t* dst) { // vertical } } -static void LD4_SSE2(uint8_t* dst) { // Down-Left +static void LD4_SSE2(uint8_t* dst) { // Down-Left const __m128i one = _mm_set1_epi8(1); const __m128i ABCDEFGH = _mm_loadl_epi64((__m128i*)(dst - BPS)); const __m128i BCDEFGH0 = _mm_srli_si128(ABCDEFGH, 1); @@ -930,13 +934,13 @@ static void LD4_SSE2(uint8_t* dst) { // Down-Left const __m128i lsb = _mm_and_si128(_mm_xor_si128(ABCDEFGH, CDEFGHH0), one); const __m128i avg2 = _mm_subs_epu8(avg1, lsb); const __m128i abcdefg = _mm_avg_epu8(avg2, BCDEFGH0); - WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcdefg )); + WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(abcdefg)); WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1))); WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2))); WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3))); } -static void VR4_SSE2(uint8_t* dst) { // Vertical-Right +static void VR4_SSE2(uint8_t* dst) { // Vertical-Right const __m128i one = _mm_set1_epi8(1); const int I = dst[-1 + 0 * BPS]; const int J = dst[-1 + 1 * BPS]; @@ -951,8 +955,8 @@ static void VR4_SSE2(uint8_t* dst) { // Vertical-Right const __m128i lsb = _mm_and_si128(_mm_xor_si128(IXABCD, ABCD0), one); const __m128i avg2 = _mm_subs_epu8(avg1, lsb); const __m128i efgh = _mm_avg_epu8(avg2, XABCD); - WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcd )); - WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( efgh )); + WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(abcd)); + WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(efgh)); WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(abcd, 1))); WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(efgh, 1))); @@ -961,7 +965,7 @@ static void VR4_SSE2(uint8_t* dst) { // Vertical-Right DST(0, 3) = AVG3(K, J, I); } -static void VL4_SSE2(uint8_t* dst) { // Vertical-Left +static void VL4_SSE2(uint8_t* dst) { // Vertical-Left const __m128i one = _mm_set1_epi8(1); const __m128i ABCDEFGH = _mm_loadl_epi64((__m128i*)(dst - BPS)); const __m128i BCDEFGH_ = _mm_srli_si128(ABCDEFGH, 1); @@ -977,8 +981,8 @@ static void VL4_SSE2(uint8_t* dst) { // Vertical-Left const __m128i avg4 = _mm_subs_epu8(avg3, lsb2); const uint32_t extra_out = (uint32_t)_mm_cvtsi128_si32(_mm_srli_si128(avg4, 4)); - WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( avg1 )); - WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( avg4 )); + WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(avg1)); + WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(avg4)); WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg1, 1))); WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg4, 1))); @@ -987,7 +991,7 @@ static void VL4_SSE2(uint8_t* dst) { // Vertical-Left DST(3, 3) = (extra_out >> 8) & 0xff; } -static void RD4_SSE2(uint8_t* dst) { // Down-right +static void RD4_SSE2(uint8_t* dst) { // Down-right const __m128i one = _mm_set1_epi8(1); const __m128i XABCD = _mm_loadl_epi64((__m128i*)(dst - BPS - 1)); const __m128i ____XABCD = _mm_slli_si128(XABCD, 4); @@ -1004,7 +1008,7 @@ static void RD4_SSE2(uint8_t* dst) { // Down-right const __m128i lsb = _mm_and_si128(_mm_xor_si128(JIXABCD__, LKJIXABCD), one); const __m128i avg2 = _mm_subs_epu8(avg1, lsb); const __m128i abcdefg = _mm_avg_epu8(avg2, KJIXABCD_); - WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32( abcdefg )); + WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(abcdefg)); WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1))); WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2))); WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3))); @@ -1053,9 +1057,9 @@ static WEBP_INLINE void TrueMotion_SSE2(uint8_t* dst, int size) { } } -static void TM4_SSE2(uint8_t* dst) { TrueMotion_SSE2(dst, 4); } +static void TM4_SSE2(uint8_t* dst) { TrueMotion_SSE2(dst, 4); } static void TM8uv_SSE2(uint8_t* dst) { TrueMotion_SSE2(dst, 8); } -static void TM16_SSE2(uint8_t* dst) { TrueMotion_SSE2(dst, 16); } +static void TM16_SSE2(uint8_t* dst) { TrueMotion_SSE2(dst, 16); } static void VE16_SSE2(uint8_t* dst) { const __m128i top = _mm_loadu_si128((const __m128i*)(dst - BPS)); @@ -1065,7 +1069,7 @@ static void VE16_SSE2(uint8_t* dst) { } } -static void HE16_SSE2(uint8_t* dst) { // horizontal +static void HE16_SSE2(uint8_t* dst) { // horizontal int j; for (j = 16; j > 0; --j) { const __m128i values = _mm_set1_epi8((char)dst[-1]); @@ -1125,7 +1129,7 @@ static void DC16NoTopLeft_SSE2(uint8_t* dst) { // DC with no top & left samples //------------------------------------------------------------------------------ // Chroma -static void VE8uv_SSE2(uint8_t* dst) { // vertical +static void VE8uv_SSE2(uint8_t* dst) { // vertical int j; const __m128i top = _mm_loadl_epi64((const __m128i*)(dst - BPS)); for (j = 0; j < 8; ++j) { @@ -1142,7 +1146,7 @@ static WEBP_INLINE void Put8x8uv_SSE2(uint8_t v, uint8_t* dst) { } } -static void DC8uv_SSE2(uint8_t* dst) { // DC +static void DC8uv_SSE2(uint8_t* dst) { // DC const __m128i zero = _mm_setzero_si128(); const __m128i top = _mm_loadl_epi64((const __m128i*)(dst - BPS)); const __m128i sum = _mm_sad_epu8(top, zero); @@ -1157,7 +1161,7 @@ static void DC8uv_SSE2(uint8_t* dst) { // DC } } -static void DC8uvNoLeft_SSE2(uint8_t* dst) { // DC with no left samples +static void DC8uvNoLeft_SSE2(uint8_t* dst) { // DC with no left samples const __m128i zero = _mm_setzero_si128(); const __m128i top = _mm_loadl_epi64((const __m128i*)(dst - BPS)); const __m128i sum = _mm_sad_epu8(top, zero); @@ -1174,7 +1178,7 @@ static void DC8uvNoTop_SSE2(uint8_t* dst) { // DC with no top samples Put8x8uv_SSE2(dc0 >> 3, dst); } -static void DC8uvNoTopLeft_SSE2(uint8_t* dst) { // DC with nothing +static void DC8uvNoTopLeft_SSE2(uint8_t* dst) { // DC with nothing Put8x8uv_SSE2(0x80, dst); } diff --git a/src/dsp/dec_sse41.c b/src/dsp/dec_sse41.c index 4f514b9b..46d17f60 100644 --- a/src/dsp/dec_sse41.c +++ b/src/dsp/dec_sse41.c @@ -17,12 +17,12 @@ #include #include -#include "src/webp/types.h" #include "src/dec/vp8i_dec.h" #include "src/dsp/cpu.h" #include "src/utils/utils.h" +#include "src/webp/types.h" -static void HE16_SSE41(uint8_t* dst) { // horizontal +static void HE16_SSE41(uint8_t* dst) { // horizontal int j; const __m128i kShuffle3 = _mm_set1_epi8(3); for (j = 16; j > 0; --j) { diff --git a/src/dsp/dsp.h b/src/dsp/dsp.h index 9acfd444..57006e22 100644 --- a/src/dsp/dsp.h +++ b/src/dsp/dsp.h @@ -25,7 +25,7 @@ extern "C" { #endif -#define BPS 32 // this is the common stride for enc/dec +#define BPS 32 // this is the common stride for enc/dec //------------------------------------------------------------------------------ // WEBP_RESTRICT @@ -44,14 +44,13 @@ extern "C" { #define WEBP_RESTRICT #endif - //------------------------------------------------------------------------------ // Init stub generator // Defines an init function stub to ensure each module exposes a symbol, // avoiding a compiler warning. #define WEBP_DSP_INIT_STUB(func) \ - extern void func(void); \ + extern void func(void); \ void func(void) {} //------------------------------------------------------------------------------ @@ -70,7 +69,7 @@ typedef void (*VP8WHT)(const int16_t* WEBP_RESTRICT in, int16_t* WEBP_RESTRICT out); extern VP8Idct VP8ITransform; extern VP8Fdct VP8FTransform; -extern VP8Fdct VP8FTransform2; // performs two transforms at a time +extern VP8Fdct VP8FTransform2; // performs two transforms at a time extern VP8WHT VP8FTransformWHT; // Predictions // *dst is the destination block. *top and *left can be NULL. @@ -95,8 +94,7 @@ extern VP8WMetric VP8TDisto4x4, VP8TDisto16x16; // Compute the average (DC) of four 4x4 blocks. // Each sub-4x4 block #i sum is stored in dc[i]. -typedef void (*VP8MeanMetric)(const uint8_t* WEBP_RESTRICT ref, - uint32_t dc[4]); +typedef void (*VP8MeanMetric)(const uint8_t* WEBP_RESTRICT ref, uint32_t dc[4]); extern VP8MeanMetric VP8Mean16x4; typedef void (*VP8BlockCopy)(const uint8_t* WEBP_RESTRICT src, @@ -104,7 +102,7 @@ typedef void (*VP8BlockCopy)(const uint8_t* WEBP_RESTRICT src, extern VP8BlockCopy VP8Copy4x4; extern VP8BlockCopy VP8Copy16x8; // Quantization -struct VP8Matrix; // forward declaration +struct VP8Matrix; // forward declaration typedef int (*VP8QuantizeBlock)( int16_t in[16], int16_t out[16], const struct VP8Matrix* WEBP_RESTRICT const mtx); @@ -125,15 +123,15 @@ extern VP8QuantizeBlockWHT VP8EncQuantizeBlockWHT; extern const int VP8DspScan[16 + 4 + 4]; // Collect histogram for susceptibility calculation. -#define MAX_COEFF_THRESH 31 // size of histogram used by CollectHistogram. +#define MAX_COEFF_THRESH 31 // size of histogram used by CollectHistogram. typedef struct { // We only need to store max_value and last_non_zero, not the distribution. int max_value; int last_non_zero; } VP8Histogram; typedef void (*VP8CHisto)(const uint8_t* WEBP_RESTRICT ref, - const uint8_t* WEBP_RESTRICT pred, - int start_block, int end_block, + const uint8_t* WEBP_RESTRICT pred, int start_block, + int end_block, VP8Histogram* WEBP_RESTRICT const histo); extern VP8CHisto VP8CollectHistogram; // General-purpose util function to help VP8CollectHistogram(). @@ -146,7 +144,7 @@ void VP8EncDspInit(void); //------------------------------------------------------------------------------ // cost functions (encoding) -extern const uint16_t VP8EntropyCost[256]; // 8bit fixed-point log(p) +extern const uint16_t VP8EntropyCost[256]; // 8bit fixed-point log(p) // approximate cost per level: extern const uint16_t VP8LevelFixedCosts[2047 /*MAX_LEVEL*/ + 1]; extern const uint8_t VP8EncBands[16 + 1]; @@ -180,7 +178,7 @@ typedef struct { double VP8SSIMFromStats(const VP8DistoStats* const stats); double VP8SSIMFromStatsClipped(const VP8DistoStats* const stats); -#define VP8_SSIM_KERNEL 3 // total size of the kernel: 2 * VP8_SSIM_KERNEL + 1 +#define VP8_SSIM_KERNEL 3 // total size of the kernel: 2 * VP8_SSIM_KERNEL + 1 typedef double (*VP8SSIMGetClippedFunc)(const uint8_t* src1, int stride1, const uint8_t* src2, int stride2, int xo, int yo, // center position @@ -192,8 +190,8 @@ typedef double (*VP8SSIMGetClippedFunc)(const uint8_t* src1, int stride1, typedef double (*VP8SSIMGetFunc)(const uint8_t* src1, int stride1, const uint8_t* src2, int stride2); -extern VP8SSIMGetFunc VP8SSIMGet; // unclipped / unchecked -extern VP8SSIMGetClippedFunc VP8SSIMGetClipped; // with clipping +extern VP8SSIMGetFunc VP8SSIMGet; // unclipped / unchecked +extern VP8SSIMGetClippedFunc VP8SSIMGetClipped; // with clipping #endif #if !defined(WEBP_DISABLE_STATS) @@ -248,8 +246,8 @@ extern VP8SimpleFilterFunc VP8SimpleVFilter16i; // filter 3 inner edges extern VP8SimpleFilterFunc VP8SimpleHFilter16i; // regular filter (on both macroblock edges and inner edges) -typedef void (*VP8LumaFilterFunc)(uint8_t* luma, int stride, - int thresh, int ithresh, int hev_t); +typedef void (*VP8LumaFilterFunc)(uint8_t* luma, int stride, int thresh, + int ithresh, int hev_t); typedef void (*VP8ChromaFilterFunc)(uint8_t* WEBP_RESTRICT u, uint8_t* WEBP_RESTRICT v, int stride, int thresh, int ithresh, int hev_t); @@ -260,7 +258,7 @@ extern VP8ChromaFilterFunc VP8VFilter8; extern VP8ChromaFilterFunc VP8HFilter8; // on inner edge -extern VP8LumaFilterFunc VP8VFilter16i; // filtering 3 inner edges altogether +extern VP8LumaFilterFunc VP8VFilter16i; // filtering 3 inner edges altogether extern VP8LumaFilterFunc VP8HFilter16i; extern VP8ChromaFilterFunc VP8VFilter8i; // filtering u and v altogether extern VP8ChromaFilterFunc VP8HFilter8i; @@ -280,7 +278,7 @@ void VP8DspInit(void); //------------------------------------------------------------------------------ // WebP I/O -#define FANCY_UPSAMPLING // undefined to remove fancy upsampling support +#define FANCY_UPSAMPLING // undefined to remove fancy upsampling support // Convert a pair of y/u/v lines together to the output rgb/a colorspace. // bottom_y can be NULL if only one line of output is needed (at top/bottom). @@ -295,7 +293,7 @@ typedef void (*WebPUpsampleLinePairFunc)( // Fancy upsampling functions to convert YUV to RGB(A) modes extern WebPUpsampleLinePairFunc WebPUpsamplers[/* MODE_LAST */]; -#endif // FANCY_UPSAMPLING +#endif // FANCY_UPSAMPLING // Per-row point-sampling methods. typedef void (*WebPSamplerRowFunc)(const uint8_t* WEBP_RESTRICT y, @@ -344,8 +342,8 @@ extern void (*WebPConvertARGBToY)(const uint32_t* WEBP_RESTRICT argb, // the U/V one. extern void (*WebPConvertARGBToUV)(const uint32_t* WEBP_RESTRICT argb, uint8_t* WEBP_RESTRICT u, - uint8_t* WEBP_RESTRICT v, - int src_width, int do_store); + uint8_t* WEBP_RESTRICT v, int src_width, + int do_store); // Convert a row of accumulated (four-values) of rgba32 toward U/V extern void (*WebPConvertRGBA32ToUV)(const uint16_t* WEBP_RESTRICT rgb, @@ -361,8 +359,8 @@ extern void (*WebPConvertBGRToY)(const uint8_t* WEBP_RESTRICT bgr, // used for plain-C fallback. extern void WebPConvertARGBToUV_C(const uint32_t* WEBP_RESTRICT argb, uint8_t* WEBP_RESTRICT u, - uint8_t* WEBP_RESTRICT v, - int src_width, int do_store); + uint8_t* WEBP_RESTRICT v, int src_width, + int do_store); extern void WebPConvertRGBA32ToUV_C(const uint16_t* WEBP_RESTRICT rgb, uint8_t* WEBP_RESTRICT u, uint8_t* WEBP_RESTRICT v, int width); @@ -403,9 +401,8 @@ extern void WebPRescalerExportRowExpand_C(struct WebPRescaler* const wrk); extern void WebPRescalerExportRowShrink_C(struct WebPRescaler* const wrk); // Main entry calls: -extern void WebPRescalerImportRow( - struct WebPRescaler* WEBP_RESTRICT const wrk, - const uint8_t* WEBP_RESTRICT src); +extern void WebPRescalerImportRow(struct WebPRescaler* WEBP_RESTRICT const wrk, + const uint8_t* WEBP_RESTRICT src); // Export one row (starting at x_out position) from rescaler. extern void WebPRescalerExportRow(struct WebPRescaler* const wrk); @@ -417,12 +414,12 @@ void WebPRescalerDspInit(void); // Apply alpha pre-multiply on an rgba, bgra or argb plane of size w * h. // alpha_first should be 0 for argb, 1 for rgba or bgra (where alpha is last). -extern void (*WebPApplyAlphaMultiply)( - uint8_t* rgba, int alpha_first, int w, int h, int stride); +extern void (*WebPApplyAlphaMultiply)(uint8_t* rgba, int alpha_first, int w, + int h, int stride); // Same, buf specifically for RGBA4444 format -extern void (*WebPApplyAlphaMultiply4444)( - uint8_t* rgba4444, int w, int h, int stride); +extern void (*WebPApplyAlphaMultiply4444)(uint8_t* rgba4444, int w, int h, + int stride); // Dispatch the values from alpha[] plane to the ARGB destination 'dst'. // Returns true if alpha[] plane has non-trivial values different from 0xff. @@ -442,8 +439,7 @@ extern void (*WebPDispatchAlphaToGreen)(const uint8_t* WEBP_RESTRICT alpha, // Returns true if there's only trivial 0xff alpha values. extern int (*WebPExtractAlpha)(const uint8_t* WEBP_RESTRICT argb, int argb_stride, int width, int height, - uint8_t* WEBP_RESTRICT alpha, - int alpha_stride); + uint8_t* WEBP_RESTRICT alpha, int alpha_stride); // Extract the green values from 32b values in argb[] and pack them into alpha[] // (this is the opposite of WebPDispatchAlphaToGreen). @@ -462,8 +458,8 @@ void WebPMultARGBRows(uint8_t* ptr, int stride, int width, int num_rows, // Same for a row of single values, with side alpha values. extern void (*WebPMultRow)(uint8_t* WEBP_RESTRICT const ptr, - const uint8_t* WEBP_RESTRICT const alpha, - int width, int inverse); + const uint8_t* WEBP_RESTRICT const alpha, int width, + int inverse); // Same a WebPMultRow(), but for several 'num_rows' rows. void WebPMultRows(uint8_t* WEBP_RESTRICT ptr, int stride, @@ -472,8 +468,8 @@ void WebPMultRows(uint8_t* WEBP_RESTRICT ptr, int stride, // Plain-C versions, used as fallback by some implementations. void WebPMultRow_C(uint8_t* WEBP_RESTRICT const ptr, - const uint8_t* WEBP_RESTRICT const alpha, - int width, int inverse); + const uint8_t* WEBP_RESTRICT const alpha, int width, + int inverse); void WebPMultARGBRow_C(uint32_t* const ptr, int width, int inverse); #ifdef WORDS_BIGENDIAN @@ -481,15 +477,15 @@ void WebPMultARGBRow_C(uint32_t* const ptr, int width, int inverse); extern void (*WebPPackARGB)(const uint8_t* WEBP_RESTRICT a, const uint8_t* WEBP_RESTRICT r, const uint8_t* WEBP_RESTRICT g, - const uint8_t* WEBP_RESTRICT b, - int len, uint32_t* WEBP_RESTRICT out); + const uint8_t* WEBP_RESTRICT b, int len, + uint32_t* WEBP_RESTRICT out); #endif // RGB packing function. 'step' can be 3 or 4. r/g/b input is rgb or bgr order. extern void (*WebPPackRGB)(const uint8_t* WEBP_RESTRICT r, const uint8_t* WEBP_RESTRICT g, - const uint8_t* WEBP_RESTRICT b, - int len, int step, uint32_t* WEBP_RESTRICT out); + const uint8_t* WEBP_RESTRICT b, int len, int step, + uint32_t* WEBP_RESTRICT out); // This function returns true if src[i] contains a value different from 0xff. extern int (*WebPHasAlpha8b)(const uint8_t* src, int length); @@ -504,18 +500,18 @@ void WebPInitAlphaProcessing(void); //------------------------------------------------------------------------------ // Filter functions -typedef enum { // Filter types. +typedef enum { // Filter types. WEBP_FILTER_NONE = 0, WEBP_FILTER_HORIZONTAL, WEBP_FILTER_VERTICAL, WEBP_FILTER_GRADIENT, WEBP_FILTER_LAST = WEBP_FILTER_GRADIENT + 1, // end marker - WEBP_FILTER_BEST, // meta-types + WEBP_FILTER_BEST, // meta-types WEBP_FILTER_FAST } WEBP_FILTER_TYPE; -typedef void (*WebPFilterFunc)(const uint8_t* WEBP_RESTRICT in, - int width, int height, int stride, +typedef void (*WebPFilterFunc)(const uint8_t* WEBP_RESTRICT in, int width, + int height, int stride, uint8_t* WEBP_RESTRICT out); // In-place un-filtering. // Warning! 'prev_line' pointer can be equal to 'cur_line' or 'preds'. @@ -538,7 +534,7 @@ extern WebPUnfilterFunc WebPUnfilters[WEBP_FILTER_LAST]; void VP8FiltersInit(void); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_DSP_DSP_H_ diff --git a/src/dsp/enc.c b/src/dsp/enc.c index f1ebb745..d772d111 100644 --- a/src/dsp/enc.c +++ b/src/dsp/enc.c @@ -26,9 +26,7 @@ static WEBP_INLINE uint8_t clip_8b(int v) { } #if !WEBP_NEON_OMIT_C_CODE -static WEBP_INLINE int clip_max(int v, int max) { - return (v > max) ? max : v; -} +static WEBP_INLINE int clip_max(int v, int max) { return (v > max) ? max : v; } #endif // !WEBP_NEON_OMIT_C_CODE //------------------------------------------------------------------------------ @@ -36,14 +34,14 @@ static WEBP_INLINE int clip_max(int v, int max) { // the higher, the "easier" the macroblock is to compress. const int VP8DspScan[16 + 4 + 4] = { - // Luma - 0 + 0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS, - 0 + 4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS, - 0 + 8 * BPS, 4 + 8 * BPS, 8 + 8 * BPS, 12 + 8 * BPS, - 0 + 12 * BPS, 4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS, + // Luma + 0 + 0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS, + 0 + 4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS, + 0 + 8 * BPS, 4 + 8 * BPS, 8 + 8 * BPS, 12 + 8 * BPS, + 0 + 12 * BPS, 4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS, - 0 + 0 * BPS, 4 + 0 * BPS, 0 + 4 * BPS, 4 + 4 * BPS, // U - 8 + 0 * BPS, 12 + 0 * BPS, 8 + 4 * BPS, 12 + 4 * BPS // V + 0 + 0 * BPS, 4 + 0 * BPS, 0 + 4 * BPS, 4 + 4 * BPS, // U + 8 + 0 * BPS, 12 + 0 * BPS, 8 + 4 * BPS, 12 + 4 * BPS // V }; // general-purpose util function @@ -68,7 +66,7 @@ static void CollectHistogram_C(const uint8_t* WEBP_RESTRICT ref, int start_block, int end_block, VP8Histogram* WEBP_RESTRICT const histo) { int j; - int distribution[MAX_COEFF_THRESH + 1] = { 0 }; + int distribution[MAX_COEFF_THRESH + 1] = {0}; for (j = start_block; j < end_block; ++j) { int k; int16_t out[16]; @@ -89,7 +87,7 @@ static void CollectHistogram_C(const uint8_t* WEBP_RESTRICT ref, //------------------------------------------------------------------------------ // run-time tables (~4k) -static uint8_t clip1[255 + 510 + 1]; // clips [-255,510] to [0,255] +static uint8_t clip1[255 + 510 + 1]; // clips [-255,510] to [0,255] // We declare this variable 'volatile' to prevent instruction reordering // and make sure it's set to true _last_ (so as to be thread-safe) @@ -105,7 +103,6 @@ static WEBP_TSAN_IGNORE_FUNCTION void InitTables(void) { } } - //------------------------------------------------------------------------------ // Transforms (Paragraph 14.4) @@ -120,7 +117,7 @@ static WEBP_INLINE void ITransformOne(const uint8_t* WEBP_RESTRICT ref, int C[4 * 4], *tmp; int i; tmp = C; - for (i = 0; i < 4; ++i) { // vertical pass + for (i = 0; i < 4; ++i) { // vertical pass const int a = in[0] + in[8]; const int b = in[0] - in[8]; const int c = @@ -136,7 +133,7 @@ static WEBP_INLINE void ITransformOne(const uint8_t* WEBP_RESTRICT ref, } tmp = C; - for (i = 0; i < 4; ++i) { // horizontal pass + for (i = 0; i < 4; ++i) { // horizontal pass const int dc = tmp[0] + 4; const int a = dc + tmp[8]; const int b = dc - tmp[8]; @@ -154,8 +151,7 @@ static WEBP_INLINE void ITransformOne(const uint8_t* WEBP_RESTRICT ref, static void ITransform_C(const uint8_t* WEBP_RESTRICT ref, const int16_t* WEBP_RESTRICT in, - uint8_t* WEBP_RESTRICT dst, - int do_two) { + uint8_t* WEBP_RESTRICT dst, int do_two) { ITransformOne(ref, in, dst); if (do_two) { ITransformOne(ref + 4, in + 16, dst + 4); @@ -168,28 +164,28 @@ static void FTransform_C(const uint8_t* WEBP_RESTRICT src, int i; int tmp[16]; for (i = 0; i < 4; ++i, src += BPS, ref += BPS) { - const int d0 = src[0] - ref[0]; // 9bit dynamic range ([-255,255]) + const int d0 = src[0] - ref[0]; // 9bit dynamic range ([-255,255]) const int d1 = src[1] - ref[1]; const int d2 = src[2] - ref[2]; const int d3 = src[3] - ref[3]; - const int a0 = (d0 + d3); // 10b [-510,510] + const int a0 = (d0 + d3); // 10b [-510,510] const int a1 = (d1 + d2); const int a2 = (d1 - d2); const int a3 = (d0 - d3); - tmp[0 + i * 4] = (a0 + a1) * 8; // 14b [-8160,8160] - tmp[1 + i * 4] = (a2 * 2217 + a3 * 5352 + 1812) >> 9; // [-7536,7542] + tmp[0 + i * 4] = (a0 + a1) * 8; // 14b [-8160,8160] + tmp[1 + i * 4] = (a2 * 2217 + a3 * 5352 + 1812) >> 9; // [-7536,7542] tmp[2 + i * 4] = (a0 - a1) * 8; - tmp[3 + i * 4] = (a3 * 2217 - a2 * 5352 + 937) >> 9; + tmp[3 + i * 4] = (a3 * 2217 - a2 * 5352 + 937) >> 9; } for (i = 0; i < 4; ++i) { const int a0 = (tmp[0 + i] + tmp[12 + i]); // 15b - const int a1 = (tmp[4 + i] + tmp[ 8 + i]); - const int a2 = (tmp[4 + i] - tmp[ 8 + i]); + const int a1 = (tmp[4 + i] + tmp[8 + i]); + const int a2 = (tmp[4 + i] - tmp[8 + i]); const int a3 = (tmp[0 + i] - tmp[12 + i]); - out[0 + i] = (a0 + a1 + 7) >> 4; // 12b + out[0 + i] = (a0 + a1 + 7) >> 4; // 12b out[4 + i] = ((a2 * 2217 + a3 * 5352 + 12000) >> 16) + (a3 != 0); out[8 + i] = (a0 - a1 + 7) >> 4; - out[12+ i] = ((a3 * 2217 - a2 * 5352 + 51000) >> 16); + out[12 + i] = ((a3 * 2217 - a2 * 5352 + 51000) >> 16); } } #endif // !WEBP_NEON_OMIT_C_CODE @@ -212,23 +208,23 @@ static void FTransformWHT_C(const int16_t* WEBP_RESTRICT in, const int a1 = (in[1 * 16] + in[3 * 16]); const int a2 = (in[1 * 16] - in[3 * 16]); const int a3 = (in[0 * 16] - in[2 * 16]); - tmp[0 + i * 4] = a0 + a1; // 14b + tmp[0 + i * 4] = a0 + a1; // 14b tmp[1 + i * 4] = a3 + a2; tmp[2 + i * 4] = a3 - a2; tmp[3 + i * 4] = a0 - a1; } for (i = 0; i < 4; ++i) { const int a0 = (tmp[0 + i] + tmp[8 + i]); // 15b - const int a1 = (tmp[4 + i] + tmp[12+ i]); - const int a2 = (tmp[4 + i] - tmp[12+ i]); + const int a1 = (tmp[4 + i] + tmp[12 + i]); + const int a2 = (tmp[4 + i] - tmp[12 + i]); const int a3 = (tmp[0 + i] - tmp[8 + i]); - const int b0 = a0 + a1; // 16b + const int b0 = a0 + a1; // 16b const int b1 = a3 + a2; const int b2 = a3 - a2; const int b3 = a0 - a1; - out[ 0 + i] = b0 >> 1; // 15b - out[ 4 + i] = b1 >> 1; - out[ 8 + i] = b2 >> 1; + out[0 + i] = b0 >> 1; // 15b + out[4 + i] = b1 >> 1; + out[8 + i] = b2 >> 1; out[12 + i] = b3 >> 1; } } @@ -303,23 +299,23 @@ static WEBP_INLINE void TrueMotion(uint8_t* WEBP_RESTRICT dst, static WEBP_INLINE void DCMode(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT left, - const uint8_t* WEBP_RESTRICT top, - int size, int round, int shift) { + const uint8_t* WEBP_RESTRICT top, int size, + int round, int shift) { int DC = 0; int j; if (top != NULL) { for (j = 0; j < size; ++j) DC += top[j]; - if (left != NULL) { // top and left present + if (left != NULL) { // top and left present for (j = 0; j < size; ++j) DC += left[j]; - } else { // top, but no left + } else { // top, but no left DC += DC; } DC = (DC + round) >> shift; - } else if (left != NULL) { // left but no top + } else if (left != NULL) { // left but no top for (j = 0; j < size; ++j) DC += left[j]; DC += DC; DC = (DC + round) >> shift; - } else { // no top, no left, nothing. + } else { // no top, no left, nothing. DC = 0x80; } Fill(dst, DC, size); @@ -372,10 +368,10 @@ static void Intra16Preds_C(uint8_t* WEBP_RESTRICT dst, // vertical static void VE4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { const uint8_t vals[4] = { - AVG3(top[-1], top[0], top[1]), - AVG3(top[ 0], top[1], top[2]), - AVG3(top[ 1], top[2], top[3]), - AVG3(top[ 2], top[3], top[4]) + AVG3(top[-1], top[0], top[1]), + AVG3(top[0], top[1], top[2]), + AVG3(top[1], top[2], top[3]), + AVG3(top[2], top[3], top[4]), }; int i; for (i = 0; i < 4; ++i) { @@ -413,13 +409,13 @@ static void RD4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { const int B = top[1]; const int C = top[2]; const int D = top[3]; - DST(0, 3) = AVG3(J, K, L); - DST(0, 2) = DST(1, 3) = AVG3(I, J, K); - DST(0, 1) = DST(1, 2) = DST(2, 3) = AVG3(X, I, J); + DST(0, 3) = AVG3(J, K, L); + DST(0, 2) = DST(1, 3) = AVG3(I, J, K); + DST(0, 1) = DST(1, 2) = DST(2, 3) = AVG3(X, I, J); DST(0, 0) = DST(1, 1) = DST(2, 2) = DST(3, 3) = AVG3(A, X, I); - DST(1, 0) = DST(2, 1) = DST(3, 2) = AVG3(B, A, X); - DST(2, 0) = DST(3, 1) = AVG3(C, B, A); - DST(3, 0) = AVG3(D, C, B); + DST(1, 0) = DST(2, 1) = DST(3, 2) = AVG3(B, A, X); + DST(2, 0) = DST(3, 1) = AVG3(C, B, A); + DST(3, 0) = AVG3(D, C, B); } static void LD4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { @@ -431,13 +427,13 @@ static void LD4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { const int F = top[5]; const int G = top[6]; const int H = top[7]; - DST(0, 0) = AVG3(A, B, C); - DST(1, 0) = DST(0, 1) = AVG3(B, C, D); - DST(2, 0) = DST(1, 1) = DST(0, 2) = AVG3(C, D, E); + DST(0, 0) = AVG3(A, B, C); + DST(1, 0) = DST(0, 1) = AVG3(B, C, D); + DST(2, 0) = DST(1, 1) = DST(0, 2) = AVG3(C, D, E); DST(3, 0) = DST(2, 1) = DST(1, 2) = DST(0, 3) = AVG3(D, E, F); - DST(3, 1) = DST(2, 2) = DST(1, 3) = AVG3(E, F, G); - DST(3, 2) = DST(2, 3) = AVG3(F, G, H); - DST(3, 3) = AVG3(G, H, H); + DST(3, 1) = DST(2, 2) = DST(1, 3) = AVG3(E, F, G); + DST(3, 2) = DST(2, 3) = AVG3(F, G, H); + DST(3, 3) = AVG3(G, H, H); } static void VR4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { @@ -452,14 +448,14 @@ static void VR4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { DST(0, 0) = DST(1, 2) = AVG2(X, A); DST(1, 0) = DST(2, 2) = AVG2(A, B); DST(2, 0) = DST(3, 2) = AVG2(B, C); - DST(3, 0) = AVG2(C, D); + DST(3, 0) = AVG2(C, D); - DST(0, 3) = AVG3(K, J, I); - DST(0, 2) = AVG3(J, I, X); + DST(0, 3) = AVG3(K, J, I); + DST(0, 2) = AVG3(J, I, X); DST(0, 1) = DST(1, 3) = AVG3(I, X, A); DST(1, 1) = DST(2, 3) = AVG3(X, A, B); DST(2, 1) = DST(3, 3) = AVG3(A, B, C); - DST(3, 1) = AVG3(B, C, D); + DST(3, 1) = AVG3(B, C, D); } static void VL4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { @@ -471,17 +467,17 @@ static void VL4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { const int F = top[5]; const int G = top[6]; const int H = top[7]; - DST(0, 0) = AVG2(A, B); + DST(0, 0) = AVG2(A, B); DST(1, 0) = DST(0, 2) = AVG2(B, C); DST(2, 0) = DST(1, 2) = AVG2(C, D); DST(3, 0) = DST(2, 2) = AVG2(D, E); - DST(0, 1) = AVG3(A, B, C); + DST(0, 1) = AVG3(A, B, C); DST(1, 1) = DST(0, 3) = AVG3(B, C, D); DST(2, 1) = DST(1, 3) = AVG3(C, D, E); DST(3, 1) = DST(2, 3) = AVG3(D, E, F); - DST(3, 2) = AVG3(E, F, G); - DST(3, 3) = AVG3(F, G, H); + DST(3, 2) = AVG3(E, F, G); + DST(3, 3) = AVG3(F, G, H); } static void HU4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { @@ -489,14 +485,13 @@ static void HU4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { const int J = top[-3]; const int K = top[-4]; const int L = top[-5]; - DST(0, 0) = AVG2(I, J); + DST(0, 0) = AVG2(I, J); DST(2, 0) = DST(0, 1) = AVG2(J, K); DST(2, 1) = DST(0, 2) = AVG2(K, L); - DST(1, 0) = AVG3(I, J, K); + DST(1, 0) = AVG3(I, J, K); DST(3, 0) = DST(1, 1) = AVG3(J, K, L); DST(3, 1) = DST(1, 2) = AVG3(K, L, L); - DST(3, 2) = DST(2, 2) = - DST(0, 3) = DST(1, 3) = DST(2, 3) = DST(3, 3) = L; + DST(3, 2) = DST(2, 2) = DST(0, 3) = DST(1, 3) = DST(2, 3) = DST(3, 3) = L; } static void HD4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { @@ -512,14 +507,14 @@ static void HD4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { DST(0, 0) = DST(2, 1) = AVG2(I, X); DST(0, 1) = DST(2, 2) = AVG2(J, I); DST(0, 2) = DST(2, 3) = AVG2(K, J); - DST(0, 3) = AVG2(L, K); + DST(0, 3) = AVG2(L, K); - DST(3, 0) = AVG3(A, B, C); - DST(2, 0) = AVG3(X, A, B); + DST(3, 0) = AVG3(A, B, C); + DST(2, 0) = AVG3(X, A, B); DST(1, 0) = DST(3, 1) = AVG3(I, X, A); DST(1, 1) = DST(3, 2) = AVG3(J, I, X); DST(1, 2) = DST(3, 3) = AVG3(K, J, I); - DST(1, 3) = AVG3(L, K, J); + DST(1, 3) = AVG3(L, K, J); } static void TM4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { @@ -561,8 +556,7 @@ static void Intra4Preds_C(uint8_t* WEBP_RESTRICT dst, #if !WEBP_NEON_OMIT_C_CODE static WEBP_INLINE int GetSSE(const uint8_t* WEBP_RESTRICT a, - const uint8_t* WEBP_RESTRICT b, - int w, int h) { + const uint8_t* WEBP_RESTRICT b, int w, int h) { int count = 0; int y, x; for (y = 0; y < h; ++y) { @@ -604,7 +598,7 @@ static void Mean16x4_C(const uint8_t* WEBP_RESTRICT ref, uint32_t dc[4]) { } } dc[k] = avg; - ref += 4; // go to next 4x4 block. + ref += 4; // go to next 4x4 block. } } @@ -637,17 +631,17 @@ static int TTransform(const uint8_t* WEBP_RESTRICT in, // vertical pass for (i = 0; i < 4; ++i, ++w) { const int a0 = tmp[0 + i] + tmp[8 + i]; - const int a1 = tmp[4 + i] + tmp[12+ i]; - const int a2 = tmp[4 + i] - tmp[12+ i]; + const int a1 = tmp[4 + i] + tmp[12 + i]; + const int a2 = tmp[4 + i] - tmp[12 + i]; const int a3 = tmp[0 + i] - tmp[8 + i]; const int b0 = a0 + a1; const int b1 = a3 + a2; const int b2 = a3 - a2; const int b3 = a0 - a1; - sum += w[ 0] * abs(b0); - sum += w[ 4] * abs(b1); - sum += w[ 8] * abs(b2); + sum += w[0] * abs(b0); + sum += w[4] * abs(b1); + sum += w[8] * abs(b2); sum += w[12] * abs(b3); } return sum; @@ -680,9 +674,8 @@ static int Disto16x16_C(const uint8_t* WEBP_RESTRICT const a, // #if !WEBP_NEON_OMIT_C_CODE || WEBP_NEON_WORK_AROUND_GCC -static const uint8_t kZigzag[16] = { - 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15 -}; +static const uint8_t kZigzag[16] = {0, 1, 4, 8, 5, 2, 3, 6, + 9, 12, 13, 10, 7, 11, 14, 15}; // Simple quantization static int QuantizeBlock_C(int16_t in[16], int16_t out[16], @@ -714,7 +707,7 @@ static int QuantizeBlock_C(int16_t in[16], int16_t out[16], static int Quantize2Blocks_C(int16_t in[32], int16_t out[32], const VP8Matrix* WEBP_RESTRICT const mtx) { int nz; - nz = VP8EncQuantizeBlock(in + 0 * 16, out + 0 * 16, mtx) << 0; + nz = VP8EncQuantizeBlock(in + 0 * 16, out + 0 * 16, mtx) << 0; nz |= VP8EncQuantizeBlock(in + 1 * 16, out + 1 * 16, mtx) << 1; return nz; } diff --git a/src/dsp/enc_mips32.c b/src/dsp/enc_mips32.c index 1a06ff3c..4161f7d5 100644 --- a/src/dsp/enc_mips32.c +++ b/src/dsp/enc_mips32.c @@ -18,8 +18,8 @@ #if defined(WEBP_USE_MIPS32) #include "src/dsp/mips_macro.h" -#include "src/enc/vp8i_enc.h" #include "src/enc/cost_enc.h" +#include "src/enc/vp8i_enc.h" static const int kC1 = WEBP_TRANSFORM_AC3_C1; static const int kC2 = WEBP_TRANSFORM_AC3_C2; @@ -30,6 +30,7 @@ static const int kC2 = WEBP_TRANSFORM_AC3_C2; // A..D - offsets in bytes to load from in buffer // TEMP0..TEMP3 - registers for corresponding tmp elements // TEMP4..TEMP5 - temporary registers +// clang-format off #define VERTICAL_PASS(A, B, C, D, TEMP4, TEMP0, TEMP1, TEMP2, TEMP3) \ "lh %[temp16], " #A "(%[temp20]) \n\t" \ "lh %[temp18], " #B "(%[temp20]) \n\t" \ @@ -107,6 +108,7 @@ static const int kC2 = WEBP_TRANSFORM_AC3_C2; "sb %[" #TEMP4 "], 1+" XSTR(BPS) "*" #A "(%[temp16]) \n\t" \ "sb %[" #TEMP8 "], 2+" XSTR(BPS) "*" #A "(%[temp16]) \n\t" \ "sb %[" #TEMP12 "], 3+" XSTR(BPS) "*" #A "(%[temp16]) \n\t" +// clang-format on // Does one or two inverse transforms. static WEBP_INLINE void ITransformOne_MIPS32(const uint8_t* WEBP_RESTRICT ref, @@ -118,27 +120,26 @@ static WEBP_INLINE void ITransformOne_MIPS32(const uint8_t* WEBP_RESTRICT ref, const int* args[3] = {(const int*)ref, (const int*)in, (const int*)dst}; __asm__ volatile( - "lw %[temp20], 4(%[args]) \n\t" - VERTICAL_PASS(0, 16, 8, 24, temp4, temp0, temp1, temp2, temp3) - VERTICAL_PASS(2, 18, 10, 26, temp8, temp4, temp5, temp6, temp7) - VERTICAL_PASS(4, 20, 12, 28, temp12, temp8, temp9, temp10, temp11) - VERTICAL_PASS(6, 22, 14, 30, temp20, temp12, temp13, temp14, temp15) + "lw %[temp20], 4(%[args]) \n\t" // + VERTICAL_PASS(0, 16, 8, 24, temp4, temp0, temp1, temp2, temp3) // + VERTICAL_PASS(2, 18, 10, 26, temp8, temp4, temp5, temp6, temp7) // + VERTICAL_PASS(4, 20, 12, 28, temp12, temp8, temp9, temp10, temp11) // + VERTICAL_PASS(6, 22, 14, 30, temp20, temp12, temp13, temp14, temp15) // - HORIZONTAL_PASS(0, temp0, temp4, temp8, temp12) - HORIZONTAL_PASS(1, temp1, temp5, temp9, temp13) - HORIZONTAL_PASS(2, temp2, temp6, temp10, temp14) - HORIZONTAL_PASS(3, temp3, temp7, temp11, temp15) + HORIZONTAL_PASS(0, temp0, temp4, temp8, temp12) // + HORIZONTAL_PASS(1, temp1, temp5, temp9, temp13) // + HORIZONTAL_PASS(2, temp2, temp6, temp10, temp14) // + HORIZONTAL_PASS(3, temp3, temp7, temp11, temp15) // - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [temp6]"=&r"(temp6), [temp7]"=&r"(temp7), [temp8]"=&r"(temp8), - [temp9]"=&r"(temp9), [temp10]"=&r"(temp10), [temp11]"=&r"(temp11), - [temp12]"=&r"(temp12), [temp13]"=&r"(temp13), [temp14]"=&r"(temp14), - [temp15]"=&r"(temp15), [temp16]"=&r"(temp16), [temp17]"=&r"(temp17), - [temp18]"=&r"(temp18), [temp19]"=&r"(temp19), [temp20]"=&r"(temp20) - : [args]"r"(args), [kC1]"r"(kC1), [kC2]"r"(kC2) - : "memory", "hi", "lo" - ); + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [temp6] "=&r"(temp6), [temp7] "=&r"(temp7), [temp8] "=&r"(temp8), + [temp9] "=&r"(temp9), [temp10] "=&r"(temp10), [temp11] "=&r"(temp11), + [temp12] "=&r"(temp12), [temp13] "=&r"(temp13), [temp14] "=&r"(temp14), + [temp15] "=&r"(temp15), [temp16] "=&r"(temp16), [temp17] "=&r"(temp17), + [temp18] "=&r"(temp18), [temp19] "=&r"(temp19), [temp20] "=&r"(temp20) + : [args] "r"(args), [kC1] "r"(kC1), [kC2] "r"(kC2) + : "memory", "hi", "lo"); } static void ITransform_MIPS32(const uint8_t* WEBP_RESTRICT ref, @@ -158,6 +159,7 @@ static void ITransform_MIPS32(const uint8_t* WEBP_RESTRICT ref, // J - offset in bytes (kZigzag[n] * 2) // K - offset in bytes (kZigzag[n] * 4) // N - offset in bytes (n * 2) +// clang-format off #define QUANTIZE_ONE(J, K, N) \ "lh %[temp0], " #J "(%[ppin]) \n\t" \ "lhu %[temp1], " #J "(%[ppsharpen]) \n\t" \ @@ -184,6 +186,7 @@ static void ITransform_MIPS32(const uint8_t* WEBP_RESTRICT ref, "2: \n\t" \ "sh %[temp5], " #J "(%[ppin]) \n\t" \ "sh %[level], " #N "(%[pout]) \n\t" +// clang-format on static int QuantizeBlock_MIPS32(int16_t in[16], int16_t out[16], const VP8Matrix* const mtx) { @@ -191,43 +194,39 @@ static int QuantizeBlock_MIPS32(int16_t in[16], int16_t out[16], int sign, coeff, level, i; int max_level = MAX_LEVEL; - int16_t* ppin = &in[0]; - int16_t* pout = &out[0]; + int16_t* ppin = &in[0]; + int16_t* pout = &out[0]; const uint16_t* ppsharpen = &mtx->sharpen[0]; const uint32_t* ppzthresh = &mtx->zthresh[0]; - const uint16_t* ppq = &mtx->q[0]; - const uint16_t* ppiq = &mtx->iq[0]; - const uint32_t* ppbias = &mtx->bias[0]; + const uint16_t* ppq = &mtx->q[0]; + const uint16_t* ppiq = &mtx->iq[0]; + const uint32_t* ppbias = &mtx->bias[0]; __asm__ volatile( - QUANTIZE_ONE( 0, 0, 0) - QUANTIZE_ONE( 2, 4, 2) - QUANTIZE_ONE( 8, 16, 4) - QUANTIZE_ONE(16, 32, 6) - QUANTIZE_ONE(10, 20, 8) - QUANTIZE_ONE( 4, 8, 10) - QUANTIZE_ONE( 6, 12, 12) - QUANTIZE_ONE(12, 24, 14) - QUANTIZE_ONE(18, 36, 16) - QUANTIZE_ONE(24, 48, 18) - QUANTIZE_ONE(26, 52, 20) - QUANTIZE_ONE(20, 40, 22) - QUANTIZE_ONE(14, 28, 24) - QUANTIZE_ONE(22, 44, 26) - QUANTIZE_ONE(28, 56, 28) - QUANTIZE_ONE(30, 60, 30) + QUANTIZE_ONE(0, 0, 0) // + QUANTIZE_ONE(2, 4, 2) // + QUANTIZE_ONE(8, 16, 4) // + QUANTIZE_ONE(16, 32, 6) // + QUANTIZE_ONE(10, 20, 8) // + QUANTIZE_ONE(4, 8, 10) // + QUANTIZE_ONE(6, 12, 12) // + QUANTIZE_ONE(12, 24, 14) // + QUANTIZE_ONE(18, 36, 16) // + QUANTIZE_ONE(24, 48, 18) // + QUANTIZE_ONE(26, 52, 20) // + QUANTIZE_ONE(20, 40, 22) // + QUANTIZE_ONE(14, 28, 24) // + QUANTIZE_ONE(22, 44, 26) // + QUANTIZE_ONE(28, 56, 28) // + QUANTIZE_ONE(30, 60, 30) // - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), - [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), - [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [sign]"=&r"(sign), [coeff]"=&r"(coeff), - [level]"=&r"(level) - : [pout]"r"(pout), [ppin]"r"(ppin), - [ppiq]"r"(ppiq), [max_level]"r"(max_level), - [ppbias]"r"(ppbias), [ppzthresh]"r"(ppzthresh), - [ppsharpen]"r"(ppsharpen), [ppq]"r"(ppq) - : "memory", "hi", "lo" - ); + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [sign] "=&r"(sign), [coeff] "=&r"(coeff), [level] "=&r"(level) + : [pout] "r"(pout), [ppin] "r"(ppin), [ppiq] "r"(ppiq), + [max_level] "r"(max_level), [ppbias] "r"(ppbias), + [ppzthresh] "r"(ppzthresh), [ppsharpen] "r"(ppsharpen), [ppq] "r"(ppq) + : "memory", "hi", "lo"); // moved out from macro to increase possibility for earlier breaking for (i = 15; i >= 0; i--) { @@ -239,7 +238,7 @@ static int QuantizeBlock_MIPS32(int16_t in[16], int16_t out[16], static int Quantize2Blocks_MIPS32(int16_t in[32], int16_t out[32], const VP8Matrix* WEBP_RESTRICT const mtx) { int nz; - nz = QuantizeBlock_MIPS32(in + 0 * 16, out + 0 * 16, mtx) << 0; + nz = QuantizeBlock_MIPS32(in + 0 * 16, out + 0 * 16, mtx) << 0; nz |= QuantizeBlock_MIPS32(in + 1 * 16, out + 1 * 16, mtx) << 1; return nz; } @@ -251,6 +250,7 @@ static int Quantize2Blocks_MIPS32(int16_t in[32], int16_t out[32], // A - offset in bytes to load from a and b buffers // E..H - offsets in bytes to store first results to tmp buffer // E1..H1 - offsets in bytes to store second results to tmp buffer +// clang-format off #define HORIZONTAL_PASS(A, E, F, G, H, E1, F1, G1, H1) \ "lbu %[temp0], 0+" XSTR(BPS) "*" #A "(%[a]) \n\t" \ "lbu %[temp1], 1+" XSTR(BPS) "*" #A "(%[a]) \n\t" \ @@ -358,6 +358,7 @@ static int Quantize2Blocks_MIPS32(int16_t in[32], int16_t out[32], "msub %[temp5], %[temp8] \n\t" \ "msub %[temp6], %[temp0] \n\t" \ "msub %[temp7], %[temp1] \n\t" +// clang-format on static int Disto4x4_MIPS32(const uint8_t* WEBP_RESTRICT const a, const uint8_t* WEBP_RESTRICT const b, @@ -366,28 +367,27 @@ static int Disto4x4_MIPS32(const uint8_t* WEBP_RESTRICT const a, int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8; __asm__ volatile( - HORIZONTAL_PASS(0, 0, 4, 8, 12, 64, 68, 72, 76) - HORIZONTAL_PASS(1, 16, 20, 24, 28, 80, 84, 88, 92) - HORIZONTAL_PASS(2, 32, 36, 40, 44, 96, 100, 104, 108) - HORIZONTAL_PASS(3, 48, 52, 56, 60, 112, 116, 120, 124) - "mthi $zero \n\t" - "mtlo $zero \n\t" - VERTICAL_PASS( 0, 16, 32, 48, 64, 80, 96, 112, 0, 8, 16, 24) - VERTICAL_PASS( 4, 20, 36, 52, 68, 84, 100, 116, 2, 10, 18, 26) - VERTICAL_PASS( 8, 24, 40, 56, 72, 88, 104, 120, 4, 12, 20, 28) - VERTICAL_PASS(12, 28, 44, 60, 76, 92, 108, 124, 6, 14, 22, 30) - "mflo %[temp0] \n\t" - "sra %[temp1], %[temp0], 31 \n\t" - "xor %[temp0], %[temp0], %[temp1] \n\t" - "subu %[temp0], %[temp0], %[temp1] \n\t" - "sra %[temp0], %[temp0], 5 \n\t" + HORIZONTAL_PASS(0, 0, 4, 8, 12, 64, 68, 72, 76) // + HORIZONTAL_PASS(1, 16, 20, 24, 28, 80, 84, 88, 92) // + HORIZONTAL_PASS(2, 32, 36, 40, 44, 96, 100, 104, 108) // + HORIZONTAL_PASS(3, 48, 52, 56, 60, 112, 116, 120, 124) // + "mthi $zero \n\t" + "mtlo $zero \n\t" // + VERTICAL_PASS(0, 16, 32, 48, 64, 80, 96, 112, 0, 8, 16, 24) // + VERTICAL_PASS(4, 20, 36, 52, 68, 84, 100, 116, 2, 10, 18, 26) // + VERTICAL_PASS(8, 24, 40, 56, 72, 88, 104, 120, 4, 12, 20, 28) // + VERTICAL_PASS(12, 28, 44, 60, 76, 92, 108, 124, 6, 14, 22, 30) // + "mflo %[temp0] \n\t" + "sra %[temp1], %[temp0], 31 \n\t" + "xor %[temp0], %[temp0], %[temp1] \n\t" + "subu %[temp0], %[temp0], %[temp1] \n\t" + "sra %[temp0], %[temp0], 5 \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [temp6]"=&r"(temp6), [temp7]"=&r"(temp7), [temp8]"=&r"(temp8) - : [a]"r"(a), [b]"r"(b), [w]"r"(w), [tmp]"r"(tmp) - : "memory", "hi", "lo" - ); + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [temp6] "=&r"(temp6), [temp7] "=&r"(temp7), [temp8] "=&r"(temp8) + : [a] "r"(a), [b] "r"(b), [w] "r"(w), [tmp] "r"(tmp) + : "memory", "hi", "lo"); return temp0; } @@ -412,6 +412,7 @@ static int Disto16x16_MIPS32(const uint8_t* WEBP_RESTRICT const a, // temp0..temp15 holds tmp[0]..tmp[15] // A - offset in bytes to load from src and ref buffers // TEMP0..TEMP3 - registers for corresponding tmp elements +// clang-format off #define HORIZONTAL_PASS(A, TEMP0, TEMP1, TEMP2, TEMP3) \ "lw %[" #TEMP1 "], 0(%[args]) \n\t" \ "lw %[" #TEMP2 "], 4(%[args]) \n\t" \ @@ -477,6 +478,7 @@ static int Disto16x16_MIPS32(const uint8_t* WEBP_RESTRICT const a, "sh %[" #TEMP4 "], " #C "(%[temp20]) \n\t" \ "sh %[" #TEMP8 "], " #D "(%[temp20]) \n\t" \ "sh %[" #TEMP12 "], " #B "(%[temp20]) \n\t" +// clang-format on static void FTransform_MIPS32(const uint8_t* WEBP_RESTRICT src, const uint8_t* WEBP_RESTRICT ref, @@ -486,8 +488,8 @@ static void FTransform_MIPS32(const uint8_t* WEBP_RESTRICT src, int temp17, temp18, temp19, temp20; const int c2217 = 2217; const int c5352 = 5352; - const int* const args[3] = - { (const int*)src, (const int*)ref, (const int*)out }; + const int* const args[3] = {(const int*)src, (const int*)ref, + (const int*)out}; __asm__ volatile( HORIZONTAL_PASS(0, temp0, temp1, temp2, temp3) @@ -517,6 +519,7 @@ static void FTransform_MIPS32(const uint8_t* WEBP_RESTRICT src, #if !defined(WORK_AROUND_GCC) +// clang-format off #define GET_SSE_INNER(A, B, C, D) \ "lbu %[temp0], " #A "(%[a]) \n\t" \ "lbu %[temp1], " #A "(%[b]) \n\t" \ @@ -534,11 +537,12 @@ static void FTransform_MIPS32(const uint8_t* WEBP_RESTRICT src, "madd %[temp2], %[temp2] \n\t" \ "madd %[temp4], %[temp4] \n\t" \ "madd %[temp6], %[temp6] \n\t" +// clang-format on -#define GET_SSE(A, B, C, D) \ - GET_SSE_INNER(A, A + 1, A + 2, A + 3) \ - GET_SSE_INNER(B, B + 1, B + 2, B + 3) \ - GET_SSE_INNER(C, C + 1, C + 2, C + 3) \ +#define GET_SSE(A, B, C, D) \ + GET_SSE_INNER(A, A + 1, A + 2, A + 3) \ + GET_SSE_INNER(B, B + 1, B + 2, B + 3) \ + GET_SSE_INNER(C, C + 1, C + 2, C + 3) \ GET_SSE_INNER(D, D + 1, D + 2, D + 3) static int SSE16x16_MIPS32(const uint8_t* WEBP_RESTRICT a, @@ -547,32 +551,31 @@ static int SSE16x16_MIPS32(const uint8_t* WEBP_RESTRICT a, int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7; __asm__ volatile( - "mult $zero, $zero \n\t" + "mult $zero, $zero \n\t" - GET_SSE( 0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS) - GET_SSE( 1 * BPS, 4 + 1 * BPS, 8 + 1 * BPS, 12 + 1 * BPS) - GET_SSE( 2 * BPS, 4 + 2 * BPS, 8 + 2 * BPS, 12 + 2 * BPS) - GET_SSE( 3 * BPS, 4 + 3 * BPS, 8 + 3 * BPS, 12 + 3 * BPS) - GET_SSE( 4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS) - GET_SSE( 5 * BPS, 4 + 5 * BPS, 8 + 5 * BPS, 12 + 5 * BPS) - GET_SSE( 6 * BPS, 4 + 6 * BPS, 8 + 6 * BPS, 12 + 6 * BPS) - GET_SSE( 7 * BPS, 4 + 7 * BPS, 8 + 7 * BPS, 12 + 7 * BPS) - GET_SSE( 8 * BPS, 4 + 8 * BPS, 8 + 8 * BPS, 12 + 8 * BPS) - GET_SSE( 9 * BPS, 4 + 9 * BPS, 8 + 9 * BPS, 12 + 9 * BPS) - GET_SSE(10 * BPS, 4 + 10 * BPS, 8 + 10 * BPS, 12 + 10 * BPS) - GET_SSE(11 * BPS, 4 + 11 * BPS, 8 + 11 * BPS, 12 + 11 * BPS) - GET_SSE(12 * BPS, 4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS) - GET_SSE(13 * BPS, 4 + 13 * BPS, 8 + 13 * BPS, 12 + 13 * BPS) - GET_SSE(14 * BPS, 4 + 14 * BPS, 8 + 14 * BPS, 12 + 14 * BPS) - GET_SSE(15 * BPS, 4 + 15 * BPS, 8 + 15 * BPS, 12 + 15 * BPS) + GET_SSE(0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS) // + GET_SSE(1 * BPS, 4 + 1 * BPS, 8 + 1 * BPS, 12 + 1 * BPS) // + GET_SSE(2 * BPS, 4 + 2 * BPS, 8 + 2 * BPS, 12 + 2 * BPS) // + GET_SSE(3 * BPS, 4 + 3 * BPS, 8 + 3 * BPS, 12 + 3 * BPS) // + GET_SSE(4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS) // + GET_SSE(5 * BPS, 4 + 5 * BPS, 8 + 5 * BPS, 12 + 5 * BPS) // + GET_SSE(6 * BPS, 4 + 6 * BPS, 8 + 6 * BPS, 12 + 6 * BPS) // + GET_SSE(7 * BPS, 4 + 7 * BPS, 8 + 7 * BPS, 12 + 7 * BPS) // + GET_SSE(8 * BPS, 4 + 8 * BPS, 8 + 8 * BPS, 12 + 8 * BPS) // + GET_SSE(9 * BPS, 4 + 9 * BPS, 8 + 9 * BPS, 12 + 9 * BPS) // + GET_SSE(10 * BPS, 4 + 10 * BPS, 8 + 10 * BPS, 12 + 10 * BPS) // + GET_SSE(11 * BPS, 4 + 11 * BPS, 8 + 11 * BPS, 12 + 11 * BPS) // + GET_SSE(12 * BPS, 4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS) // + GET_SSE(13 * BPS, 4 + 13 * BPS, 8 + 13 * BPS, 12 + 13 * BPS) // + GET_SSE(14 * BPS, 4 + 14 * BPS, 8 + 14 * BPS, 12 + 14 * BPS) // + GET_SSE(15 * BPS, 4 + 15 * BPS, 8 + 15 * BPS, 12 + 15 * BPS) // - "mflo %[count] \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [temp6]"=&r"(temp6), [temp7]"=&r"(temp7), [count]"=&r"(count) - : [a]"r"(a), [b]"r"(b) - : "memory", "hi", "lo" - ); + "mflo %[count] \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [temp6] "=&r"(temp6), [temp7] "=&r"(temp7), [count] "=&r"(count) + : [a] "r"(a), [b] "r"(b) + : "memory", "hi", "lo"); return count; } @@ -582,24 +585,23 @@ static int SSE16x8_MIPS32(const uint8_t* WEBP_RESTRICT a, int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7; __asm__ volatile( - "mult $zero, $zero \n\t" + "mult $zero, $zero \n\t" - GET_SSE( 0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS) - GET_SSE( 1 * BPS, 4 + 1 * BPS, 8 + 1 * BPS, 12 + 1 * BPS) - GET_SSE( 2 * BPS, 4 + 2 * BPS, 8 + 2 * BPS, 12 + 2 * BPS) - GET_SSE( 3 * BPS, 4 + 3 * BPS, 8 + 3 * BPS, 12 + 3 * BPS) - GET_SSE( 4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS) - GET_SSE( 5 * BPS, 4 + 5 * BPS, 8 + 5 * BPS, 12 + 5 * BPS) - GET_SSE( 6 * BPS, 4 + 6 * BPS, 8 + 6 * BPS, 12 + 6 * BPS) - GET_SSE( 7 * BPS, 4 + 7 * BPS, 8 + 7 * BPS, 12 + 7 * BPS) + GET_SSE(0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS) // + GET_SSE(1 * BPS, 4 + 1 * BPS, 8 + 1 * BPS, 12 + 1 * BPS) // + GET_SSE(2 * BPS, 4 + 2 * BPS, 8 + 2 * BPS, 12 + 2 * BPS) // + GET_SSE(3 * BPS, 4 + 3 * BPS, 8 + 3 * BPS, 12 + 3 * BPS) // + GET_SSE(4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS) // + GET_SSE(5 * BPS, 4 + 5 * BPS, 8 + 5 * BPS, 12 + 5 * BPS) // + GET_SSE(6 * BPS, 4 + 6 * BPS, 8 + 6 * BPS, 12 + 6 * BPS) // + GET_SSE(7 * BPS, 4 + 7 * BPS, 8 + 7 * BPS, 12 + 7 * BPS) // - "mflo %[count] \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [temp6]"=&r"(temp6), [temp7]"=&r"(temp7), [count]"=&r"(count) - : [a]"r"(a), [b]"r"(b) - : "memory", "hi", "lo" - ); + "mflo %[count] \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [temp6] "=&r"(temp6), [temp7] "=&r"(temp7), [count] "=&r"(count) + : [a] "r"(a), [b] "r"(b) + : "memory", "hi", "lo"); return count; } @@ -609,20 +611,19 @@ static int SSE8x8_MIPS32(const uint8_t* WEBP_RESTRICT a, int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7; __asm__ volatile( - "mult $zero, $zero \n\t" + "mult $zero, $zero \n\t" - GET_SSE(0 * BPS, 4 + 0 * BPS, 1 * BPS, 4 + 1 * BPS) - GET_SSE(2 * BPS, 4 + 2 * BPS, 3 * BPS, 4 + 3 * BPS) - GET_SSE(4 * BPS, 4 + 4 * BPS, 5 * BPS, 4 + 5 * BPS) - GET_SSE(6 * BPS, 4 + 6 * BPS, 7 * BPS, 4 + 7 * BPS) + GET_SSE(0 * BPS, 4 + 0 * BPS, 1 * BPS, 4 + 1 * BPS) // + GET_SSE(2 * BPS, 4 + 2 * BPS, 3 * BPS, 4 + 3 * BPS) // + GET_SSE(4 * BPS, 4 + 4 * BPS, 5 * BPS, 4 + 5 * BPS) // + GET_SSE(6 * BPS, 4 + 6 * BPS, 7 * BPS, 4 + 7 * BPS) // - "mflo %[count] \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [temp6]"=&r"(temp6), [temp7]"=&r"(temp7), [count]"=&r"(count) - : [a]"r"(a), [b]"r"(b) - : "memory", "hi", "lo" - ); + "mflo %[count] \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [temp6] "=&r"(temp6), [temp7] "=&r"(temp7), [count] "=&r"(count) + : [a] "r"(a), [b] "r"(b) + : "memory", "hi", "lo"); return count; } @@ -632,17 +633,16 @@ static int SSE4x4_MIPS32(const uint8_t* WEBP_RESTRICT a, int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7; __asm__ volatile( - "mult $zero, $zero \n\t" + "mult $zero, $zero \n\t" - GET_SSE(0 * BPS, 1 * BPS, 2 * BPS, 3 * BPS) + GET_SSE(0 * BPS, 1 * BPS, 2 * BPS, 3 * BPS) // - "mflo %[count] \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [temp6]"=&r"(temp6), [temp7]"=&r"(temp7), [count]"=&r"(count) - : [a]"r"(a), [b]"r"(b) - : "memory", "hi", "lo" - ); + "mflo %[count] \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [temp6] "=&r"(temp6), [temp7] "=&r"(temp7), [count] "=&r"(count) + : [a] "r"(a), [b] "r"(b) + : "memory", "hi", "lo"); return count; } diff --git a/src/dsp/enc_mips_dsp_r2.c b/src/dsp/enc_mips_dsp_r2.c index ecfa3da2..cbf579fc 100644 --- a/src/dsp/enc_mips_dsp_r2.c +++ b/src/dsp/enc_mips_dsp_r2.c @@ -25,6 +25,7 @@ static const int kC2 = WEBP_TRANSFORM_AC3_C2; // O - output // I - input (macro doesn't change it) +// clang-format off #define ADD_SUB_HALVES_X4(O0, O1, O2, O3, O4, O5, O6, O7, \ I0, I1, I2, I3, I4, I5, I6, I7) \ "addq.ph %[" #O0 "], %[" #I0 "], %[" #I1 "] \n\t" \ @@ -140,6 +141,7 @@ static const int kC2 = WEBP_TRANSFORM_AC3_C2; "sh %[" #TEMP4 "], " #C "(%[temp20]) \n\t" \ "sh %[" #TEMP8 "], " #D "(%[temp20]) \n\t" \ "sh %[" #TEMP12 "], " #B "(%[temp20]) \n\t" +// clang-format on static void FTransform_MIPSdspR2(const uint8_t* WEBP_RESTRICT src, const uint8_t* WEBP_RESTRICT ref, @@ -149,10 +151,10 @@ static void FTransform_MIPSdspR2(const uint8_t* WEBP_RESTRICT src, int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8; int temp9, temp10, temp11, temp12, temp13, temp14, temp15, temp16; int temp17, temp18, temp19, temp20; - const int* const args[3] = - { (const int*)src, (const int*)ref, (const int*)out }; + const int* const args[3] = {(const int*)src, (const int*)ref, + (const int*)out}; - __asm__ volatile ( + __asm__ volatile( HORIZONTAL_PASS(0, temp0, temp1, temp2, temp3) HORIZONTAL_PASS(1, temp4, temp5, temp6, temp7) HORIZONTAL_PASS(2, temp8, temp9, temp10, temp11) @@ -178,7 +180,7 @@ static WEBP_INLINE void ITransformOne(const uint8_t* WEBP_RESTRICT ref, int temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9; int temp10, temp11, temp12, temp13, temp14, temp15, temp16, temp17, temp18; - __asm__ volatile ( + __asm__ volatile( "ulw %[temp1], 0(%[in]) \n\t" "ulw %[temp2], 16(%[in]) \n\t" LOAD_IN_X2(temp5, temp6, 24, 26) @@ -250,13 +252,14 @@ static void ITransform_MIPSdspR2(const uint8_t* WEBP_RESTRICT ref, } } +// clang-format off static int Disto4x4_MIPSdspR2(const uint8_t* WEBP_RESTRICT const a, const uint8_t* WEBP_RESTRICT const b, const uint16_t* WEBP_RESTRICT const w) { int temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9; int temp10, temp11, temp12, temp13, temp14, temp15, temp16, temp17; - __asm__ volatile ( + __asm__ volatile( LOAD_WITH_OFFSET_X4(temp1, temp2, temp3, temp4, a, 0, 0, 0, 0, 0, 1, 2, 3, @@ -317,6 +320,7 @@ static int Disto4x4_MIPSdspR2(const uint8_t* WEBP_RESTRICT const a, ); return abs(temp3 - temp17) >> 5; } +// clang-format on static int Disto16x16_MIPSdspR2(const uint8_t* WEBP_RESTRICT const a, const uint8_t* WEBP_RESTRICT const b, @@ -334,6 +338,7 @@ static int Disto16x16_MIPSdspR2(const uint8_t* WEBP_RESTRICT const a, //------------------------------------------------------------------------------ // Intra predictions +// clang-format off #define FILL_PART(J, SIZE) \ "usw %[value], 0+" #J "*" XSTR(BPS) "(%[dst]) \n\t" \ "usw %[value], 4+" #J "*" XSTR(BPS) "(%[dst]) \n\t" \ @@ -342,118 +347,125 @@ static int Disto16x16_MIPSdspR2(const uint8_t* WEBP_RESTRICT const a, "usw %[value], 12+" #J "*" XSTR(BPS) "(%[dst]) \n\t" \ ".endif \n\t" -#define FILL_8_OR_16(DST, VALUE, SIZE) do { \ - int value = (VALUE); \ - __asm__ volatile ( \ - "replv.qb %[value], %[value] \n\t" \ - FILL_PART( 0, SIZE) \ - FILL_PART( 1, SIZE) \ - FILL_PART( 2, SIZE) \ - FILL_PART( 3, SIZE) \ - FILL_PART( 4, SIZE) \ - FILL_PART( 5, SIZE) \ - FILL_PART( 6, SIZE) \ - FILL_PART( 7, SIZE) \ - ".if " #SIZE " == 16 \n\t" \ - FILL_PART( 8, 16) \ - FILL_PART( 9, 16) \ - FILL_PART(10, 16) \ - FILL_PART(11, 16) \ - FILL_PART(12, 16) \ - FILL_PART(13, 16) \ - FILL_PART(14, 16) \ - FILL_PART(15, 16) \ - ".endif \n\t" \ - : [value]"+&r"(value) \ - : [dst]"r"((DST)) \ - : "memory" \ - ); \ -} while (0) +#define FILL_8_OR_16(DST, VALUE, SIZE) \ + do { \ + int value = (VALUE); \ + __asm__ volatile( \ + "replv.qb %[value], %[value] \n\t" \ + FILL_PART( 0, SIZE) \ + FILL_PART( 1, SIZE) \ + FILL_PART( 2, SIZE) \ + FILL_PART( 3, SIZE) \ + FILL_PART( 4, SIZE) \ + FILL_PART( 5, SIZE) \ + FILL_PART( 6, SIZE) \ + FILL_PART( 7, SIZE) \ + ".if " #SIZE " == 16 \n\t" \ + FILL_PART( 8, 16) \ + FILL_PART( 9, 16) \ + FILL_PART(10, 16) \ + FILL_PART(11, 16) \ + FILL_PART(12, 16) \ + FILL_PART(13, 16) \ + FILL_PART(14, 16) \ + FILL_PART(15, 16) \ + ".endif \n\t" \ + : [value]"+&r"(value) \ + : [dst]"r"((DST)) \ + : "memory" \ + ); \ + } while (0) +// clang-format on -#define VERTICAL_PRED(DST, TOP, SIZE) \ -static WEBP_INLINE void VerticalPred##SIZE( \ - uint8_t* WEBP_RESTRICT (DST), const uint8_t* WEBP_RESTRICT (TOP)) { \ - int j; \ - if ((TOP)) { \ - for (j = 0; j < (SIZE); ++j) memcpy((DST) + j * BPS, (TOP), (SIZE)); \ - } else { \ - FILL_8_OR_16((DST), 127, (SIZE)); \ - } \ -} +#define VERTICAL_PRED(DST, TOP, SIZE) \ + static WEBP_INLINE void VerticalPred##SIZE( \ + uint8_t* WEBP_RESTRICT(DST), const uint8_t* WEBP_RESTRICT(TOP)) { \ + int j; \ + if ((TOP)) { \ + for (j = 0; j < (SIZE); ++j) memcpy((DST) + j * BPS, (TOP), (SIZE)); \ + } else { \ + FILL_8_OR_16((DST), 127, (SIZE)); \ + } \ + } VERTICAL_PRED(dst, top, 8) VERTICAL_PRED(dst, top, 16) #undef VERTICAL_PRED -#define HORIZONTAL_PRED(DST, LEFT, SIZE) \ -static WEBP_INLINE void HorizontalPred##SIZE( \ - uint8_t* WEBP_RESTRICT (DST), const uint8_t* WEBP_RESTRICT (LEFT)) { \ - if (LEFT) { \ - int j; \ - for (j = 0; j < (SIZE); ++j) { \ - memset((DST) + j * BPS, (LEFT)[j], (SIZE)); \ - } \ - } else { \ - FILL_8_OR_16((DST), 129, (SIZE)); \ - } \ -} +#define HORIZONTAL_PRED(DST, LEFT, SIZE) \ + static WEBP_INLINE void HorizontalPred##SIZE( \ + uint8_t* WEBP_RESTRICT(DST), const uint8_t* WEBP_RESTRICT(LEFT)) { \ + if (LEFT) { \ + int j; \ + for (j = 0; j < (SIZE); ++j) { \ + memset((DST) + j * BPS, (LEFT)[j], (SIZE)); \ + } \ + } else { \ + FILL_8_OR_16((DST), 129, (SIZE)); \ + } \ + } HORIZONTAL_PRED(dst, left, 8) HORIZONTAL_PRED(dst, left, 16) #undef HORIZONTAL_PRED -#define CLIPPING() \ - "preceu.ph.qbl %[temp2], %[temp0] \n\t" \ - "preceu.ph.qbr %[temp0], %[temp0] \n\t" \ - "preceu.ph.qbl %[temp3], %[temp1] \n\t" \ - "preceu.ph.qbr %[temp1], %[temp1] \n\t" \ - "addu.ph %[temp2], %[temp2], %[leftY_1] \n\t" \ - "addu.ph %[temp0], %[temp0], %[leftY_1] \n\t" \ - "addu.ph %[temp3], %[temp3], %[leftY_1] \n\t" \ - "addu.ph %[temp1], %[temp1], %[leftY_1] \n\t" \ - "shll_s.ph %[temp2], %[temp2], 7 \n\t" \ - "shll_s.ph %[temp0], %[temp0], 7 \n\t" \ - "shll_s.ph %[temp3], %[temp3], 7 \n\t" \ - "shll_s.ph %[temp1], %[temp1], 7 \n\t" \ - "precrqu_s.qb.ph %[temp0], %[temp2], %[temp0] \n\t" \ +#define CLIPPING() \ + "preceu.ph.qbl %[temp2], %[temp0] \n\t" \ + "preceu.ph.qbr %[temp0], %[temp0] \n\t" \ + "preceu.ph.qbl %[temp3], %[temp1] \n\t" \ + "preceu.ph.qbr %[temp1], %[temp1] \n\t" \ + "addu.ph %[temp2], %[temp2], %[leftY_1] \n\t" \ + "addu.ph %[temp0], %[temp0], %[leftY_1] \n\t" \ + "addu.ph %[temp3], %[temp3], %[leftY_1] \n\t" \ + "addu.ph %[temp1], %[temp1], %[leftY_1] \n\t" \ + "shll_s.ph %[temp2], %[temp2], 7 \n\t" \ + "shll_s.ph %[temp0], %[temp0], 7 \n\t" \ + "shll_s.ph %[temp3], %[temp3], 7 \n\t" \ + "shll_s.ph %[temp1], %[temp1], 7 \n\t" \ + "precrqu_s.qb.ph %[temp0], %[temp2], %[temp0] \n\t" \ "precrqu_s.qb.ph %[temp1], %[temp3], %[temp1] \n\t" -#define CLIP_8B_TO_DST(DST, LEFT, TOP, SIZE) do { \ - int leftY_1 = ((int)(LEFT)[y] << 16) + (LEFT)[y]; \ - int temp0, temp1, temp2, temp3; \ - __asm__ volatile ( \ - "replv.ph %[leftY_1], %[leftY_1] \n\t" \ - "ulw %[temp0], 0(%[top]) \n\t" \ - "ulw %[temp1], 4(%[top]) \n\t" \ - "subu.ph %[leftY_1], %[leftY_1], %[left_1] \n\t" \ - CLIPPING() \ - "usw %[temp0], 0(%[dst]) \n\t" \ - "usw %[temp1], 4(%[dst]) \n\t" \ - ".if " #SIZE " == 16 \n\t" \ - "ulw %[temp0], 8(%[top]) \n\t" \ - "ulw %[temp1], 12(%[top]) \n\t" \ - CLIPPING() \ - "usw %[temp0], 8(%[dst]) \n\t" \ - "usw %[temp1], 12(%[dst]) \n\t" \ - ".endif \n\t" \ - : [leftY_1]"+&r"(leftY_1), [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), \ - [temp2]"=&r"(temp2), [temp3]"=&r"(temp3) \ - : [left_1]"r"(left_1), [top]"r"((TOP)), [dst]"r"((DST)) \ - : "memory" \ - ); \ -} while (0) +// clang-format off +#define CLIP_8B_TO_DST(DST, LEFT, TOP, SIZE) \ + do { \ + int leftY_1 = ((int)(LEFT)[y] << 16) + (LEFT)[y]; \ + int temp0, temp1, temp2, temp3; \ + __asm__ volatile( \ + "replv.ph %[leftY_1], %[leftY_1] \n\t" \ + "ulw %[temp0], 0(%[top]) \n\t" \ + "ulw %[temp1], 4(%[top]) \n\t" \ + "subu.ph %[leftY_1], %[leftY_1], %[left_1] \n\t" \ + CLIPPING() \ + "usw %[temp0], 0(%[dst]) \n\t" \ + "usw %[temp1], 4(%[dst]) \n\t" \ + ".if " #SIZE " == 16 \n\t" \ + "ulw %[temp0], 8(%[top]) \n\t" \ + "ulw %[temp1], 12(%[top]) \n\t" \ + CLIPPING() \ + "usw %[temp0], 8(%[dst]) \n\t" \ + "usw %[temp1], 12(%[dst]) \n\t" \ + ".endif \n\t" \ + : [leftY_1]"+&r"(leftY_1), [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), \ + [temp2]"=&r"(temp2), [temp3]"=&r"(temp3) \ + : [left_1]"r"(left_1), [top]"r"((TOP)), [dst]"r"((DST)) \ + : "memory" \ + ); \ + } while (0) +// clang-format on -#define CLIP_TO_DST(DST, LEFT, TOP, SIZE) do { \ - int y; \ - const int left_1 = ((int)(LEFT)[-1] << 16) + (LEFT)[-1]; \ - for (y = 0; y < (SIZE); ++y) { \ - CLIP_8B_TO_DST((DST), (LEFT), (TOP), (SIZE)); \ - (DST) += BPS; \ - } \ -} while (0) +#define CLIP_TO_DST(DST, LEFT, TOP, SIZE) \ + do { \ + int y; \ + const int left_1 = ((int)(LEFT)[-1] << 16) + (LEFT)[-1]; \ + for (y = 0; y < (SIZE); ++y) { \ + CLIP_8B_TO_DST((DST), (LEFT), (TOP), (SIZE)); \ + (DST) += BPS; \ + } \ + } while (0) +// clang-format off #define TRUE_MOTION(DST, LEFT, TOP, SIZE) \ static WEBP_INLINE void TrueMotion##SIZE(uint8_t* WEBP_RESTRICT (DST), \ const uint8_t* WEBP_RESTRICT (LEFT), \ @@ -476,6 +488,7 @@ static WEBP_INLINE void TrueMotion##SIZE(uint8_t* WEBP_RESTRICT (DST), \ } \ } \ } +// clang-format on TRUE_MOTION(dst, left, top, 8) TRUE_MOTION(dst, left, top, 16) @@ -556,41 +569,40 @@ static WEBP_INLINE void DCMode8(uint8_t* WEBP_RESTRICT dst, int temp0, temp1, temp2, temp3; __asm__ volatile( - "beqz %[top], 2f \n\t" - "ulw %[temp0], 0(%[top]) \n\t" - "ulw %[temp1], 4(%[top]) \n\t" - "raddu.w.qb %[temp0], %[temp0] \n\t" - "raddu.w.qb %[temp1], %[temp1] \n\t" - "addu %[DC], %[temp0], %[temp1] \n\t" - "move %[DC1], %[DC] \n\t" - "beqz %[left], 1f \n\t" - "ulw %[temp2], 0(%[left]) \n\t" - "ulw %[temp3], 4(%[left]) \n\t" - "raddu.w.qb %[temp2], %[temp2] \n\t" - "raddu.w.qb %[temp3], %[temp3] \n\t" - "addu %[DC1], %[temp2], %[temp3] \n\t" - "1: \n\t" - "addu %[DC], %[DC], %[DC1] \n\t" - "j 3f \n\t" - "2: \n\t" - "beqz %[left], 4f \n\t" - "ulw %[temp2], 0(%[left]) \n\t" - "ulw %[temp3], 4(%[left]) \n\t" - "raddu.w.qb %[temp2], %[temp2] \n\t" - "raddu.w.qb %[temp3], %[temp3] \n\t" - "addu %[DC], %[temp2], %[temp3] \n\t" - "addu %[DC], %[DC], %[DC] \n\t" - "3: \n\t" - "shra_r.w %[DC], %[DC], 4 \n\t" - "j 5f \n\t" - "4: \n\t" - "li %[DC], 0x80 \n\t" - "5: \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [DC]"=&r"(DC), - [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), [DC1]"=&r"(DC1) - : [left]"r"(left), [top]"r"(top) - : "memory" - ); + "beqz %[top], 2f \n\t" + "ulw %[temp0], 0(%[top]) \n\t" + "ulw %[temp1], 4(%[top]) \n\t" + "raddu.w.qb %[temp0], %[temp0] \n\t" + "raddu.w.qb %[temp1], %[temp1] \n\t" + "addu %[DC], %[temp0], %[temp1] \n\t" + "move %[DC1], %[DC] \n\t" + "beqz %[left], 1f \n\t" + "ulw %[temp2], 0(%[left]) \n\t" + "ulw %[temp3], 4(%[left]) \n\t" + "raddu.w.qb %[temp2], %[temp2] \n\t" + "raddu.w.qb %[temp3], %[temp3] \n\t" + "addu %[DC1], %[temp2], %[temp3] \n\t" + "1: \n\t" + "addu %[DC], %[DC], %[DC1] \n\t" + "j 3f \n\t" + "2: \n\t" + "beqz %[left], 4f \n\t" + "ulw %[temp2], 0(%[left]) \n\t" + "ulw %[temp3], 4(%[left]) \n\t" + "raddu.w.qb %[temp2], %[temp2] \n\t" + "raddu.w.qb %[temp3], %[temp3] \n\t" + "addu %[DC], %[temp2], %[temp3] \n\t" + "addu %[DC], %[DC], %[DC] \n\t" + "3: \n\t" + "shra_r.w %[DC], %[DC], 4 \n\t" + "j 5f \n\t" + "4: \n\t" + "li %[DC], 0x80 \n\t" + "5: \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [DC] "=&r"(DC), + [temp2] "=&r"(temp2), [temp3] "=&r"(temp3), [DC1] "=&r"(DC1) + : [left] "r"(left), [top] "r"(top) + : "memory"); FILL_8_OR_16(dst, DC, 8); } @@ -619,7 +631,7 @@ static void DC4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { static void TM4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { int a10, a32, temp0, temp1, temp2, temp3, temp4, temp5; const int c35 = 0xff00ff; - __asm__ volatile ( + __asm__ volatile( "lbu %[temp1], 0(%[top]) \n\t" "lbu %[a10], 1(%[top]) \n\t" "lbu %[temp2], 2(%[top]) \n\t" @@ -790,7 +802,7 @@ static void RD4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { static void VR4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { int temp0, temp1, temp2, temp3, temp4; int temp5, temp6, temp7, temp8, temp9; - __asm__ volatile ( + __asm__ volatile( "ulw %[temp0], -4(%[top]) \n\t" "ulw %[temp1], 0(%[top]) \n\t" "preceu.ph.qbl %[temp2], %[temp0] \n\t" @@ -887,7 +899,7 @@ static void LD4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { static void VL4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { int temp0, temp1, temp2, temp3, temp4; int temp5, temp6, temp7, temp8, temp9; - __asm__ volatile ( + __asm__ volatile( "ulw %[temp0], 0(%[top]) \n\t" "ulw %[temp1], 4(%[top]) \n\t" "preceu.ph.qbla %[temp2], %[temp0] \n\t" @@ -936,7 +948,7 @@ static void VL4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { static void HD4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { int temp0, temp1, temp2, temp3, temp4; int temp5, temp6, temp7, temp8, temp9; - __asm__ volatile ( + __asm__ volatile( "ulw %[temp0], -5(%[top]) \n\t" "ulw %[temp1], -1(%[top]) \n\t" "preceu.ph.qbla %[temp2], %[temp0] \n\t" @@ -983,7 +995,7 @@ static void HD4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { static void HU4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7; - __asm__ volatile ( + __asm__ volatile( "ulw %[temp0], -5(%[top]) \n\t" "preceu.ph.qbl %[temp1], %[temp0] \n\t" "preceu.ph.qbr %[temp2], %[temp0] \n\t" @@ -1071,6 +1083,7 @@ static void Intra4Preds_MIPSdspR2(uint8_t* WEBP_RESTRICT dst, #if !defined(WORK_AROUND_GCC) +// clang-format off #define GET_SSE_INNER(A) \ "lw %[temp0], " #A "(%[a]) \n\t" \ "lw %[temp1], " #A "(%[b]) \n\t" \ @@ -1082,41 +1095,41 @@ static void Intra4Preds_MIPSdspR2(uint8_t* WEBP_RESTRICT dst, "subq.ph %[temp0], %[temp0], %[temp1] \n\t" \ "dpa.w.ph $ac0, %[temp2], %[temp2] \n\t" \ "dpa.w.ph $ac0, %[temp0], %[temp0] \n\t" +// clang-format on -#define GET_SSE(A, B, C, D) \ - GET_SSE_INNER(A) \ - GET_SSE_INNER(B) \ - GET_SSE_INNER(C) \ +#define GET_SSE(A, B, C, D) \ + GET_SSE_INNER(A) \ + GET_SSE_INNER(B) \ + GET_SSE_INNER(C) \ GET_SSE_INNER(D) static int SSE16x16_MIPSdspR2(const uint8_t* WEBP_RESTRICT a, const uint8_t* WEBP_RESTRICT b) { int count; int temp0, temp1, temp2, temp3; - __asm__ volatile ( - "mult $zero, $zero \n\t" - GET_SSE( 0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS) - GET_SSE( 1 * BPS, 4 + 1 * BPS, 8 + 1 * BPS, 12 + 1 * BPS) - GET_SSE( 2 * BPS, 4 + 2 * BPS, 8 + 2 * BPS, 12 + 2 * BPS) - GET_SSE( 3 * BPS, 4 + 3 * BPS, 8 + 3 * BPS, 12 + 3 * BPS) - GET_SSE( 4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS) - GET_SSE( 5 * BPS, 4 + 5 * BPS, 8 + 5 * BPS, 12 + 5 * BPS) - GET_SSE( 6 * BPS, 4 + 6 * BPS, 8 + 6 * BPS, 12 + 6 * BPS) - GET_SSE( 7 * BPS, 4 + 7 * BPS, 8 + 7 * BPS, 12 + 7 * BPS) - GET_SSE( 8 * BPS, 4 + 8 * BPS, 8 + 8 * BPS, 12 + 8 * BPS) - GET_SSE( 9 * BPS, 4 + 9 * BPS, 8 + 9 * BPS, 12 + 9 * BPS) - GET_SSE(10 * BPS, 4 + 10 * BPS, 8 + 10 * BPS, 12 + 10 * BPS) - GET_SSE(11 * BPS, 4 + 11 * BPS, 8 + 11 * BPS, 12 + 11 * BPS) - GET_SSE(12 * BPS, 4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS) - GET_SSE(13 * BPS, 4 + 13 * BPS, 8 + 13 * BPS, 12 + 13 * BPS) - GET_SSE(14 * BPS, 4 + 14 * BPS, 8 + 14 * BPS, 12 + 14 * BPS) - GET_SSE(15 * BPS, 4 + 15 * BPS, 8 + 15 * BPS, 12 + 15 * BPS) - "mflo %[count] \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [count]"=&r"(count) - : [a]"r"(a), [b]"r"(b) - : "memory", "hi", "lo" - ); + __asm__ volatile( + "mult $zero, $zero \n\t" // + GET_SSE(0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS) // + GET_SSE(1 * BPS, 4 + 1 * BPS, 8 + 1 * BPS, 12 + 1 * BPS) // + GET_SSE(2 * BPS, 4 + 2 * BPS, 8 + 2 * BPS, 12 + 2 * BPS) // + GET_SSE(3 * BPS, 4 + 3 * BPS, 8 + 3 * BPS, 12 + 3 * BPS) // + GET_SSE(4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS) // + GET_SSE(5 * BPS, 4 + 5 * BPS, 8 + 5 * BPS, 12 + 5 * BPS) // + GET_SSE(6 * BPS, 4 + 6 * BPS, 8 + 6 * BPS, 12 + 6 * BPS) // + GET_SSE(7 * BPS, 4 + 7 * BPS, 8 + 7 * BPS, 12 + 7 * BPS) // + GET_SSE(8 * BPS, 4 + 8 * BPS, 8 + 8 * BPS, 12 + 8 * BPS) // + GET_SSE(9 * BPS, 4 + 9 * BPS, 8 + 9 * BPS, 12 + 9 * BPS) // + GET_SSE(10 * BPS, 4 + 10 * BPS, 8 + 10 * BPS, 12 + 10 * BPS) // + GET_SSE(11 * BPS, 4 + 11 * BPS, 8 + 11 * BPS, 12 + 11 * BPS) // + GET_SSE(12 * BPS, 4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS) // + GET_SSE(13 * BPS, 4 + 13 * BPS, 8 + 13 * BPS, 12 + 13 * BPS) // + GET_SSE(14 * BPS, 4 + 14 * BPS, 8 + 14 * BPS, 12 + 14 * BPS) // + GET_SSE(15 * BPS, 4 + 15 * BPS, 8 + 15 * BPS, 12 + 15 * BPS) // + "mflo %[count] \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [count] "=&r"(count) + : [a] "r"(a), [b] "r"(b) + : "memory", "hi", "lo"); return count; } @@ -1124,22 +1137,21 @@ static int SSE16x8_MIPSdspR2(const uint8_t* WEBP_RESTRICT a, const uint8_t* WEBP_RESTRICT b) { int count; int temp0, temp1, temp2, temp3; - __asm__ volatile ( - "mult $zero, $zero \n\t" - GET_SSE( 0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS) - GET_SSE( 1 * BPS, 4 + 1 * BPS, 8 + 1 * BPS, 12 + 1 * BPS) - GET_SSE( 2 * BPS, 4 + 2 * BPS, 8 + 2 * BPS, 12 + 2 * BPS) - GET_SSE( 3 * BPS, 4 + 3 * BPS, 8 + 3 * BPS, 12 + 3 * BPS) - GET_SSE( 4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS) - GET_SSE( 5 * BPS, 4 + 5 * BPS, 8 + 5 * BPS, 12 + 5 * BPS) - GET_SSE( 6 * BPS, 4 + 6 * BPS, 8 + 6 * BPS, 12 + 6 * BPS) - GET_SSE( 7 * BPS, 4 + 7 * BPS, 8 + 7 * BPS, 12 + 7 * BPS) - "mflo %[count] \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [count]"=&r"(count) - : [a]"r"(a), [b]"r"(b) - : "memory", "hi", "lo" - ); + __asm__ volatile( + "mult $zero, $zero \n\t" // + GET_SSE(0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS) // + GET_SSE(1 * BPS, 4 + 1 * BPS, 8 + 1 * BPS, 12 + 1 * BPS) // + GET_SSE(2 * BPS, 4 + 2 * BPS, 8 + 2 * BPS, 12 + 2 * BPS) // + GET_SSE(3 * BPS, 4 + 3 * BPS, 8 + 3 * BPS, 12 + 3 * BPS) // + GET_SSE(4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS) // + GET_SSE(5 * BPS, 4 + 5 * BPS, 8 + 5 * BPS, 12 + 5 * BPS) // + GET_SSE(6 * BPS, 4 + 6 * BPS, 8 + 6 * BPS, 12 + 6 * BPS) // + GET_SSE(7 * BPS, 4 + 7 * BPS, 8 + 7 * BPS, 12 + 7 * BPS) // + "mflo %[count] \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [count] "=&r"(count) + : [a] "r"(a), [b] "r"(b) + : "memory", "hi", "lo"); return count; } @@ -1147,18 +1159,17 @@ static int SSE8x8_MIPSdspR2(const uint8_t* WEBP_RESTRICT a, const uint8_t* WEBP_RESTRICT b) { int count; int temp0, temp1, temp2, temp3; - __asm__ volatile ( - "mult $zero, $zero \n\t" - GET_SSE(0 * BPS, 4 + 0 * BPS, 1 * BPS, 4 + 1 * BPS) - GET_SSE(2 * BPS, 4 + 2 * BPS, 3 * BPS, 4 + 3 * BPS) - GET_SSE(4 * BPS, 4 + 4 * BPS, 5 * BPS, 4 + 5 * BPS) - GET_SSE(6 * BPS, 4 + 6 * BPS, 7 * BPS, 4 + 7 * BPS) - "mflo %[count] \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [count]"=&r"(count) - : [a]"r"(a), [b]"r"(b) - : "memory", "hi", "lo" - ); + __asm__ volatile( + "mult $zero, $zero \n\t" // + GET_SSE(0 * BPS, 4 + 0 * BPS, 1 * BPS, 4 + 1 * BPS) // + GET_SSE(2 * BPS, 4 + 2 * BPS, 3 * BPS, 4 + 3 * BPS) // + GET_SSE(4 * BPS, 4 + 4 * BPS, 5 * BPS, 4 + 5 * BPS) // + GET_SSE(6 * BPS, 4 + 6 * BPS, 7 * BPS, 4 + 7 * BPS) // + "mflo %[count] \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [count] "=&r"(count) + : [a] "r"(a), [b] "r"(b) + : "memory", "hi", "lo"); return count; } @@ -1166,15 +1177,14 @@ static int SSE4x4_MIPSdspR2(const uint8_t* WEBP_RESTRICT a, const uint8_t* WEBP_RESTRICT b) { int count; int temp0, temp1, temp2, temp3; - __asm__ volatile ( - "mult $zero, $zero \n\t" - GET_SSE(0 * BPS, 1 * BPS, 2 * BPS, 3 * BPS) - "mflo %[count] \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [count]"=&r"(count) - : [a]"r"(a), [b]"r"(b) - : "memory", "hi", "lo" - ); + __asm__ volatile( + "mult $zero, $zero \n\t" // + GET_SSE(0 * BPS, 1 * BPS, 2 * BPS, 3 * BPS) // + "mflo %[count] \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [count] "=&r"(count) + : [a] "r"(a), [b] "r"(b) + : "memory", "hi", "lo"); return count; } @@ -1200,6 +1210,7 @@ static int SSE4x4_MIPSdspR2(const uint8_t* WEBP_RESTRICT a, // K - offset in bytes (kZigzag[n] * 4) // N - offset in bytes (n * 2) // N1 - offset in bytes ((n + 1) * 2) +// clang-format off #define QUANTIZE_ONE(J, K, N, N1) \ "ulw %[temp1], " #J "(%[ppin]) \n\t" \ "ulw %[temp2], " #J "(%[ppsharpen]) \n\t" \ @@ -1285,44 +1296,42 @@ static int SSE4x4_MIPSdspR2(const uint8_t* WEBP_RESTRICT a, "sh $0, " #N1 "(%[pout]) \n\t" \ "usw $0, " #J "(%[ppin]) \n\t" \ "3: \n\t" +// clang-format on static int QuantizeBlock_MIPSdspR2(int16_t in[16], int16_t out[16], const VP8Matrix* WEBP_RESTRICT const mtx) { - int temp0, temp1, temp2, temp3, temp4, temp5,temp6; + int temp0, temp1, temp2, temp3, temp4, temp5, temp6; int sign, coeff, level; int max_level = MAX_LEVEL; int max_level1 = max_level << 16 | max_level; int ret = 0; - int16_t* ppin = &in[0]; - int16_t* pout = &out[0]; + int16_t* ppin = &in[0]; + int16_t* pout = &out[0]; const uint16_t* ppsharpen = &mtx->sharpen[0]; const uint32_t* ppzthresh = &mtx->zthresh[0]; - const uint16_t* ppq = &mtx->q[0]; - const uint16_t* ppiq = &mtx->iq[0]; - const uint32_t* ppbias = &mtx->bias[0]; + const uint16_t* ppq = &mtx->q[0]; + const uint16_t* ppiq = &mtx->iq[0]; + const uint32_t* ppbias = &mtx->bias[0]; - __asm__ volatile ( - QUANTIZE_ONE( 0, 0, 0, 2) - QUANTIZE_ONE( 4, 8, 10, 12) - QUANTIZE_ONE( 8, 16, 4, 8) - QUANTIZE_ONE(12, 24, 14, 24) - QUANTIZE_ONE(16, 32, 6, 16) - QUANTIZE_ONE(20, 40, 22, 26) - QUANTIZE_ONE(24, 48, 18, 20) - QUANTIZE_ONE(28, 56, 28, 30) + __asm__ volatile( + QUANTIZE_ONE(0, 0, 0, 2) // + QUANTIZE_ONE(4, 8, 10, 12) // + QUANTIZE_ONE(8, 16, 4, 8) // + QUANTIZE_ONE(12, 24, 14, 24) // + QUANTIZE_ONE(16, 32, 6, 16) // + QUANTIZE_ONE(20, 40, 22, 26) // + QUANTIZE_ONE(24, 48, 18, 20) // + QUANTIZE_ONE(28, 56, 28, 30) // - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), - [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), - [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [sign]"=&r"(sign), [coeff]"=&r"(coeff), - [level]"=&r"(level), [temp6]"=&r"(temp6), [ret]"+&r"(ret) - : [ppin]"r"(ppin), [pout]"r"(pout), [max_level1]"r"(max_level1), - [ppiq]"r"(ppiq), [max_level]"r"(max_level), - [ppbias]"r"(ppbias), [ppzthresh]"r"(ppzthresh), - [ppsharpen]"r"(ppsharpen), [ppq]"r"(ppq) - : "memory", "hi", "lo" - ); + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [sign] "=&r"(sign), [coeff] "=&r"(coeff), [level] "=&r"(level), + [temp6] "=&r"(temp6), [ret] "+&r"(ret) + : [ppin] "r"(ppin), [pout] "r"(pout), [max_level1] "r"(max_level1), + [ppiq] "r"(ppiq), [max_level] "r"(max_level), [ppbias] "r"(ppbias), + [ppzthresh] "r"(ppzthresh), [ppsharpen] "r"(ppsharpen), [ppq] "r"(ppq) + : "memory", "hi", "lo"); return (ret != 0); } @@ -1330,7 +1339,7 @@ static int QuantizeBlock_MIPSdspR2(int16_t in[16], int16_t out[16], static int Quantize2Blocks_MIPSdspR2(int16_t in[32], int16_t out[32], const VP8Matrix* WEBP_RESTRICT const mtx) { int nz; - nz = QuantizeBlock_MIPSdspR2(in + 0 * 16, out + 0 * 16, mtx) << 0; + nz = QuantizeBlock_MIPSdspR2(in + 0 * 16, out + 0 * 16, mtx) << 0; nz |= QuantizeBlock_MIPSdspR2(in + 1 * 16, out + 1 * 16, mtx) << 1; return nz; } @@ -1341,6 +1350,7 @@ static int Quantize2Blocks_MIPSdspR2(int16_t in[32], int16_t out[32], // temp0..temp7 holds tmp[0]..tmp[15] // A, B, C, D - offset in bytes to load from in buffer // TEMP0, TEMP1 - registers for corresponding tmp elements +// clang-format off #define HORIZONTAL_PASS_WHT(A, B, C, D, TEMP0, TEMP1) \ "lh %[" #TEMP0 "], " #A "(%[in]) \n\t" \ "lh %[" #TEMP1 "], " #B "(%[in]) \n\t" \ @@ -1373,26 +1383,26 @@ static int Quantize2Blocks_MIPSdspR2(int16_t in[32], int16_t out[32], "usw %[" #TEMP2 "], " #B "(%[out]) \n\t" \ "usw %[" #TEMP4 "], " #C "(%[out]) \n\t" \ "usw %[" #TEMP6 "], " #D "(%[out]) \n\t" +// clang-format on static void FTransformWHT_MIPSdspR2(const int16_t* WEBP_RESTRICT in, int16_t* WEBP_RESTRICT out) { int temp0, temp1, temp2, temp3, temp4; int temp5, temp6, temp7, temp8, temp9; - __asm__ volatile ( - HORIZONTAL_PASS_WHT( 0, 32, 64, 96, temp0, temp1) - HORIZONTAL_PASS_WHT(128, 160, 192, 224, temp2, temp3) - HORIZONTAL_PASS_WHT(256, 288, 320, 352, temp4, temp5) - HORIZONTAL_PASS_WHT(384, 416, 448, 480, temp6, temp7) - VERTICAL_PASS_WHT(0, 8, 16, 24, temp0, temp2, temp4, temp6) - VERTICAL_PASS_WHT(4, 12, 20, 28, temp1, temp3, temp5, temp7) - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [temp6]"=&r"(temp6), [temp7]"=&r"(temp7), [temp8]"=&r"(temp8), - [temp9]"=&r"(temp9) - : [in]"r"(in), [out]"r"(out) - : "memory" - ); + __asm__ volatile( + HORIZONTAL_PASS_WHT(0, 32, 64, 96, temp0, temp1) // + HORIZONTAL_PASS_WHT(128, 160, 192, 224, temp2, temp3) // + HORIZONTAL_PASS_WHT(256, 288, 320, 352, temp4, temp5) // + HORIZONTAL_PASS_WHT(384, 416, 448, 480, temp6, temp7) // + VERTICAL_PASS_WHT(0, 8, 16, 24, temp0, temp2, temp4, temp6) // + VERTICAL_PASS_WHT(4, 12, 20, 28, temp1, temp3, temp5, temp7) // + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [temp6] "=&r"(temp6), [temp7] "=&r"(temp7), [temp8] "=&r"(temp8), + [temp9] "=&r"(temp9) + : [in] "r"(in), [out] "r"(out) + : "memory"); } #undef VERTICAL_PASS_WHT @@ -1401,6 +1411,7 @@ static void FTransformWHT_MIPSdspR2(const int16_t* WEBP_RESTRICT in, // macro for converting coefficients to bin // convert 8 coeffs at time // A, B, C, D - offsets in bytes to load from out buffer +// clang-format off #define CONVERT_COEFFS_TO_BIN(A, B, C, D) \ "ulw %[temp0], " #A "(%[out]) \n\t" \ "ulw %[temp1], " #B "(%[out]) \n\t" \ @@ -1466,12 +1477,13 @@ static void FTransformWHT_MIPSdspR2(const int16_t* WEBP_RESTRICT in, "lw %[temp8], 0(%[temp3]) \n\t" \ "addiu %[temp8], %[temp8], 1 \n\t" \ "sw %[temp8], 0(%[temp3]) \n\t" +// clang-format on static void CollectHistogram_MIPSdspR2(const uint8_t* ref, const uint8_t* pred, int start_block, int end_block, VP8Histogram* const histo) { int j; - int distribution[MAX_COEFF_THRESH + 1] = { 0 }; + int distribution[MAX_COEFF_THRESH + 1] = {0}; const int max_coeff = (MAX_COEFF_THRESH << 16) + MAX_COEFF_THRESH; for (j = start_block; j < end_block; ++j) { int16_t out[16]; @@ -1480,15 +1492,14 @@ static void CollectHistogram_MIPSdspR2(const uint8_t* ref, const uint8_t* pred, VP8FTransform(ref + VP8DspScan[j], pred + VP8DspScan[j], out); // Convert coefficients to bin. - __asm__ volatile ( - CONVERT_COEFFS_TO_BIN( 0, 4, 8, 12) - CONVERT_COEFFS_TO_BIN(16, 20, 24, 28) - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [temp6]"=&r"(temp6), [temp7]"=&r"(temp7), [temp8]"=&r"(temp8) - : [dist]"r"(distribution), [out]"r"(out), [max_coeff]"r"(max_coeff) - : "memory" - ); + __asm__ volatile( + CONVERT_COEFFS_TO_BIN(0, 4, 8, 12) // + CONVERT_COEFFS_TO_BIN(16, 20, 24, 28) // + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [temp6] "=&r"(temp6), [temp7] "=&r"(temp7), [temp8] "=&r"(temp8) + : [dist] "r"(distribution), [out] "r"(out), [max_coeff] "r"(max_coeff) + : "memory"); } VP8SetHistogramData(distribution, histo); } diff --git a/src/dsp/enc_msa.c b/src/dsp/enc_msa.c index 9a54e51a..9f73eff6 100644 --- a/src/dsp/enc_msa.c +++ b/src/dsp/enc_msa.c @@ -16,30 +16,32 @@ #if defined(WEBP_USE_MSA) #include + #include "src/dsp/msa_macro.h" #include "src/enc/vp8i_enc.h" //------------------------------------------------------------------------------ // Transforms -#define IDCT_1D_W(in0, in1, in2, in3, out0, out1, out2, out3) do { \ - v4i32 a1_m, b1_m, c1_m, d1_m; \ - const v4i32 cospi8sqrt2minus1 = __msa_fill_w(20091); \ - const v4i32 sinpi8sqrt2 = __msa_fill_w(35468); \ - v4i32 c_tmp1_m = in1 * sinpi8sqrt2; \ - v4i32 c_tmp2_m = in3 * cospi8sqrt2minus1; \ - v4i32 d_tmp1_m = in1 * cospi8sqrt2minus1; \ - v4i32 d_tmp2_m = in3 * sinpi8sqrt2; \ - \ - ADDSUB2(in0, in2, a1_m, b1_m); \ - SRAI_W2_SW(c_tmp1_m, c_tmp2_m, 16); \ - c_tmp2_m = c_tmp2_m + in3; \ - c1_m = c_tmp1_m - c_tmp2_m; \ - SRAI_W2_SW(d_tmp1_m, d_tmp2_m, 16); \ - d_tmp1_m = d_tmp1_m + in1; \ - d1_m = d_tmp1_m + d_tmp2_m; \ - BUTTERFLY_4(a1_m, b1_m, c1_m, d1_m, out0, out1, out2, out3); \ -} while (0) +#define IDCT_1D_W(in0, in1, in2, in3, out0, out1, out2, out3) \ + do { \ + v4i32 a1_m, b1_m, c1_m, d1_m; \ + const v4i32 cospi8sqrt2minus1 = __msa_fill_w(20091); \ + const v4i32 sinpi8sqrt2 = __msa_fill_w(35468); \ + v4i32 c_tmp1_m = in1 * sinpi8sqrt2; \ + v4i32 c_tmp2_m = in3 * cospi8sqrt2minus1; \ + v4i32 d_tmp1_m = in1 * cospi8sqrt2minus1; \ + v4i32 d_tmp2_m = in3 * sinpi8sqrt2; \ + \ + ADDSUB2(in0, in2, a1_m, b1_m); \ + SRAI_W2_SW(c_tmp1_m, c_tmp2_m, 16); \ + c_tmp2_m = c_tmp2_m + in3; \ + c1_m = c_tmp1_m - c_tmp2_m; \ + SRAI_W2_SW(d_tmp1_m, d_tmp2_m, 16); \ + d_tmp1_m = d_tmp1_m + in1; \ + d1_m = d_tmp1_m + d_tmp2_m; \ + BUTTERFLY_4(a1_m, b1_m, c1_m, d1_m, out0, out1, out2, out3); \ + } while (0) static WEBP_INLINE void ITransformOne(const uint8_t* WEBP_RESTRICT ref, const int16_t* WEBP_RESTRICT in, @@ -48,7 +50,7 @@ static WEBP_INLINE void ITransformOne(const uint8_t* WEBP_RESTRICT ref, v4i32 in0, in1, in2, in3, hz0, hz1, hz2, hz3, vt0, vt1, vt2, vt3; v4i32 res0, res1, res2, res3; v16i8 dest0, dest1, dest2, dest3; - const v16i8 zero = { 0 }; + const v16i8 zero = {0}; LD_SH2(in, 8, input0, input1); UNPCK_SH_SW(input0, in0, in1); @@ -59,10 +61,10 @@ static WEBP_INLINE void ITransformOne(const uint8_t* WEBP_RESTRICT ref, SRARI_W4_SW(vt0, vt1, vt2, vt3, 3); TRANSPOSE4x4_SW_SW(vt0, vt1, vt2, vt3, vt0, vt1, vt2, vt3); LD_SB4(ref, BPS, dest0, dest1, dest2, dest3); - ILVR_B4_SW(zero, dest0, zero, dest1, zero, dest2, zero, dest3, - res0, res1, res2, res3); - ILVR_H4_SW(zero, res0, zero, res1, zero, res2, zero, res3, - res0, res1, res2, res3); + ILVR_B4_SW(zero, dest0, zero, dest1, zero, dest2, zero, dest3, res0, res1, + res2, res3); + ILVR_H4_SW(zero, res0, zero, res1, zero, res2, zero, res3, res0, res1, res2, + res3); ADD4(res0, vt0, res1, vt1, res2, vt2, res3, vt3, res0, res1, res2, res3); CLIP_SW4_0_255(res0, res1, res2, res3); PCKEV_B2_SW(res0, res1, res2, res3, vt0, vt1); @@ -86,13 +88,13 @@ static void FTransform_MSA(const uint8_t* WEBP_RESTRICT src, uint32_t in0, in1, in2, in3; v4i32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; v8i16 t0, t1, t2, t3; - v16u8 srcl0, srcl1, src0 = { 0 }, src1 = { 0 }; - const v8i16 mask0 = { 0, 4, 8, 12, 1, 5, 9, 13 }; - const v8i16 mask1 = { 3, 7, 11, 15, 2, 6, 10, 14 }; - const v8i16 mask2 = { 4, 0, 5, 1, 6, 2, 7, 3 }; - const v8i16 mask3 = { 0, 4, 1, 5, 2, 6, 3, 7 }; - const v8i16 cnst0 = { 2217, -5352, 2217, -5352, 2217, -5352, 2217, -5352 }; - const v8i16 cnst1 = { 5352, 2217, 5352, 2217, 5352, 2217, 5352, 2217 }; + v16u8 srcl0, srcl1, src0 = {0}, src1 = {0}; + const v8i16 mask0 = {0, 4, 8, 12, 1, 5, 9, 13}; + const v8i16 mask1 = {3, 7, 11, 15, 2, 6, 10, 14}; + const v8i16 mask2 = {4, 0, 5, 1, 6, 2, 7, 3}; + const v8i16 mask3 = {0, 4, 1, 5, 2, 6, 3, 7}; + const v8i16 cnst0 = {2217, -5352, 2217, -5352, 2217, -5352, 2217, -5352}; + const v8i16 cnst1 = {5352, 2217, 5352, 2217, 5352, 2217, 5352, 2217}; LW4(src, BPS, in0, in1, in2, in3); INSERT_W4_UB(in0, in1, in2, in3, src0); @@ -136,29 +138,29 @@ static void FTransform_MSA(const uint8_t* WEBP_RESTRICT src, static void FTransformWHT_MSA(const int16_t* WEBP_RESTRICT in, int16_t* WEBP_RESTRICT out) { - v8i16 in0 = { 0 }; - v8i16 in1 = { 0 }; + v8i16 in0 = {0}; + v8i16 in1 = {0}; v8i16 tmp0, tmp1, tmp2, tmp3; v8i16 out0, out1; - const v8i16 mask0 = { 0, 1, 2, 3, 8, 9, 10, 11 }; - const v8i16 mask1 = { 4, 5, 6, 7, 12, 13, 14, 15 }; - const v8i16 mask2 = { 0, 4, 8, 12, 1, 5, 9, 13 }; - const v8i16 mask3 = { 3, 7, 11, 15, 2, 6, 10, 14 }; + const v8i16 mask0 = {0, 1, 2, 3, 8, 9, 10, 11}; + const v8i16 mask1 = {4, 5, 6, 7, 12, 13, 14, 15}; + const v8i16 mask2 = {0, 4, 8, 12, 1, 5, 9, 13}; + const v8i16 mask3 = {3, 7, 11, 15, 2, 6, 10, 14}; - in0 = __msa_insert_h(in0, 0, in[ 0]); - in0 = __msa_insert_h(in0, 1, in[ 64]); + in0 = __msa_insert_h(in0, 0, in[0]); + in0 = __msa_insert_h(in0, 1, in[64]); in0 = __msa_insert_h(in0, 2, in[128]); in0 = __msa_insert_h(in0, 3, in[192]); - in0 = __msa_insert_h(in0, 4, in[ 16]); - in0 = __msa_insert_h(in0, 5, in[ 80]); + in0 = __msa_insert_h(in0, 4, in[16]); + in0 = __msa_insert_h(in0, 5, in[80]); in0 = __msa_insert_h(in0, 6, in[144]); in0 = __msa_insert_h(in0, 7, in[208]); - in1 = __msa_insert_h(in1, 0, in[ 48]); + in1 = __msa_insert_h(in1, 0, in[48]); in1 = __msa_insert_h(in1, 1, in[112]); in1 = __msa_insert_h(in1, 2, in[176]); in1 = __msa_insert_h(in1, 3, in[240]); - in1 = __msa_insert_h(in1, 4, in[ 32]); - in1 = __msa_insert_h(in1, 5, in[ 96]); + in1 = __msa_insert_h(in1, 4, in[32]); + in1 = __msa_insert_h(in1, 5, in[96]); in1 = __msa_insert_h(in1, 6, in[160]); in1 = __msa_insert_h(in1, 7, in[224]); ADDSUB2(in0, in1, tmp0, tmp1); @@ -176,14 +178,14 @@ static int TTransform_MSA(const uint8_t* WEBP_RESTRICT in, const uint16_t* WEBP_RESTRICT w) { int sum; uint32_t in0_m, in1_m, in2_m, in3_m; - v16i8 src0 = { 0 }; + v16i8 src0 = {0}; v8i16 in0, in1, tmp0, tmp1, tmp2, tmp3; v4i32 dst0, dst1; - const v16i8 zero = { 0 }; - const v8i16 mask0 = { 0, 1, 2, 3, 8, 9, 10, 11 }; - const v8i16 mask1 = { 4, 5, 6, 7, 12, 13, 14, 15 }; - const v8i16 mask2 = { 0, 4, 8, 12, 1, 5, 9, 13 }; - const v8i16 mask3 = { 3, 7, 11, 15, 2, 6, 10, 14 }; + const v16i8 zero = {0}; + const v8i16 mask0 = {0, 1, 2, 3, 8, 9, 10, 11}; + const v8i16 mask1 = {4, 5, 6, 7, 12, 13, 14, 15}; + const v8i16 mask2 = {0, 4, 8, 12, 1, 5, 9, 13}; + const v8i16 mask3 = {3, 7, 11, 15, 2, 6, 10, 14}; LW4(in, BPS, in0_m, in1_m, in2_m, in3_m); INSERT_W4_SB(in0_m, in1_m, in2_m, in3_m, src0); @@ -233,14 +235,14 @@ static void CollectHistogram_MSA(const uint8_t* ref, const uint8_t* pred, int start_block, int end_block, VP8Histogram* const histo) { int j; - int distribution[MAX_COEFF_THRESH + 1] = { 0 }; + int distribution[MAX_COEFF_THRESH + 1] = {0}; for (j = start_block; j < end_block; ++j) { int16_t out[16]; VP8FTransform(ref + VP8DspScan[j], pred + VP8DspScan[j], out); { int k; v8i16 coeff0, coeff1; - const v8i16 zero = { 0 }; + const v8i16 zero = {0}; const v8i16 max_coeff_thr = __msa_ldi_h(MAX_COEFF_THRESH); LD_SH2(&out[0], 8, coeff0, coeff1); coeff0 = __msa_add_a_h(coeff0, zero); @@ -269,7 +271,7 @@ static void CollectHistogram_MSA(const uint8_t* ref, const uint8_t* pred, // vertical static WEBP_INLINE void VE4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { - const v16u8 A1 = { 0 }; + const v16u8 A1 = {0}; const uint64_t val_m = LD(top - 1); const v16u8 A = (v16u8)__msa_insert_d((v2i64)A1, 0, val_m); const v16u8 B = SLDI_UB(A, A, 1); @@ -307,7 +309,7 @@ static WEBP_INLINE void DC4(uint8_t* WEBP_RESTRICT dst, static WEBP_INLINE void RD4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { - const v16u8 A2 = { 0 }; + const v16u8 A2 = {0}; const uint64_t val_m = LD(top - 5); const v16u8 A1 = (v16u8)__msa_insert_d((v2i64)A2, 0, val_m); const v16u8 A = (v16u8)__msa_insert_b((v16i8)A1, 8, top[3]); @@ -328,7 +330,7 @@ static WEBP_INLINE void RD4(uint8_t* WEBP_RESTRICT dst, static WEBP_INLINE void LD4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { - const v16u8 A1 = { 0 }; + const v16u8 A1 = {0}; const uint64_t val_m = LD(top); const v16u8 A = (v16u8)__msa_insert_d((v2i64)A1, 0, val_m); const v16u8 B = SLDI_UB(A, A, 1); @@ -360,13 +362,13 @@ static WEBP_INLINE void VR4(uint8_t* WEBP_RESTRICT dst, DST(0, 0) = DST(1, 2) = AVG2(X, A); DST(1, 0) = DST(2, 2) = AVG2(A, B); DST(2, 0) = DST(3, 2) = AVG2(B, C); - DST(3, 0) = AVG2(C, D); - DST(0, 3) = AVG3(K, J, I); - DST(0, 2) = AVG3(J, I, X); + DST(3, 0) = AVG2(C, D); + DST(0, 3) = AVG3(K, J, I); + DST(0, 2) = AVG3(J, I, X); DST(0, 1) = DST(1, 3) = AVG3(I, X, A); DST(1, 1) = DST(2, 3) = AVG3(X, A, B); DST(2, 1) = DST(3, 3) = AVG3(A, B, C); - DST(3, 1) = AVG3(B, C, D); + DST(3, 1) = AVG3(B, C, D); } static WEBP_INLINE void VL4(uint8_t* WEBP_RESTRICT dst, @@ -379,16 +381,16 @@ static WEBP_INLINE void VL4(uint8_t* WEBP_RESTRICT dst, const int F = top[5]; const int G = top[6]; const int H = top[7]; - DST(0, 0) = AVG2(A, B); + DST(0, 0) = AVG2(A, B); DST(1, 0) = DST(0, 2) = AVG2(B, C); DST(2, 0) = DST(1, 2) = AVG2(C, D); DST(3, 0) = DST(2, 2) = AVG2(D, E); - DST(0, 1) = AVG3(A, B, C); + DST(0, 1) = AVG3(A, B, C); DST(1, 1) = DST(0, 3) = AVG3(B, C, D); DST(2, 1) = DST(1, 3) = AVG3(C, D, E); DST(3, 1) = DST(2, 3) = AVG3(D, E, F); - DST(3, 2) = AVG3(E, F, G); - DST(3, 3) = AVG3(F, G, H); + DST(3, 2) = AVG3(E, F, G); + DST(3, 3) = AVG3(F, G, H); } static WEBP_INLINE void HU4(uint8_t* WEBP_RESTRICT dst, @@ -397,14 +399,13 @@ static WEBP_INLINE void HU4(uint8_t* WEBP_RESTRICT dst, const int J = top[-3]; const int K = top[-4]; const int L = top[-5]; - DST(0, 0) = AVG2(I, J); + DST(0, 0) = AVG2(I, J); DST(2, 0) = DST(0, 1) = AVG2(J, K); DST(2, 1) = DST(0, 2) = AVG2(K, L); - DST(1, 0) = AVG3(I, J, K); + DST(1, 0) = AVG3(I, J, K); DST(3, 0) = DST(1, 1) = AVG3(J, K, L); DST(3, 1) = DST(1, 2) = AVG3(K, L, L); - DST(3, 2) = DST(2, 2) = - DST(0, 3) = DST(1, 3) = DST(2, 3) = DST(3, 3) = L; + DST(3, 2) = DST(2, 2) = DST(0, 3) = DST(1, 3) = DST(2, 3) = DST(3, 3) = L; } static WEBP_INLINE void HD4(uint8_t* WEBP_RESTRICT dst, @@ -420,25 +421,25 @@ static WEBP_INLINE void HD4(uint8_t* WEBP_RESTRICT dst, DST(0, 0) = DST(2, 1) = AVG2(I, X); DST(0, 1) = DST(2, 2) = AVG2(J, I); DST(0, 2) = DST(2, 3) = AVG2(K, J); - DST(0, 3) = AVG2(L, K); - DST(3, 0) = AVG3(A, B, C); - DST(2, 0) = AVG3(X, A, B); + DST(0, 3) = AVG2(L, K); + DST(3, 0) = AVG3(A, B, C); + DST(2, 0) = AVG3(X, A, B); DST(1, 0) = DST(3, 1) = AVG3(I, X, A); DST(1, 1) = DST(3, 2) = AVG3(J, I, X); DST(1, 2) = DST(3, 3) = AVG3(K, J, I); - DST(1, 3) = AVG3(L, K, J); + DST(1, 3) = AVG3(L, K, J); } static WEBP_INLINE void TM4(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { - const v16i8 zero = { 0 }; + const v16i8 zero = {0}; const v8i16 TL = (v8i16)__msa_fill_h(top[-1]); const v8i16 L0 = (v8i16)__msa_fill_h(top[-2]); const v8i16 L1 = (v8i16)__msa_fill_h(top[-3]); const v8i16 L2 = (v8i16)__msa_fill_h(top[-4]); const v8i16 L3 = (v8i16)__msa_fill_h(top[-5]); const v16u8 T1 = LD_UB(top); - const v8i16 T = (v8i16)__msa_ilvr_b(zero, (v16i8)T1); + const v8i16 T = (v8i16)__msa_ilvr_b(zero, (v16i8)T1); const v8i16 d = T - TL; v8i16 r0, r1, r2, r3; ADD4(d, L0, d, L1, d, L2, d, L3, r0, r1, r2, r3); @@ -466,10 +467,11 @@ static void Intra4Preds_MSA(uint8_t* WEBP_RESTRICT dst, // luma 16x16 prediction -#define STORE16x16(out, dst) do { \ - ST_UB8(out, out, out, out, out, out, out, out, dst + 0 * BPS, BPS); \ - ST_UB8(out, out, out, out, out, out, out, out, dst + 8 * BPS, BPS); \ -} while (0) +#define STORE16x16(out, dst) \ + do { \ + ST_UB8(out, out, out, out, out, out, out, out, dst + 0 * BPS, BPS); \ + ST_UB8(out, out, out, out, out, out, out, out, dst + 8 * BPS, BPS); \ + } while (0) static WEBP_INLINE void VerticalPred16x16(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { @@ -508,7 +510,7 @@ static WEBP_INLINE void TrueMotion16x16(uint8_t* WEBP_RESTRICT dst, if (top != NULL) { int j; v8i16 d1, d2; - const v16i8 zero = { 0 }; + const v16i8 zero = {0}; const v8i16 TL = (v8i16)__msa_fill_h(left[-1]); const v16u8 T = LD_UB(top); ILVRL_B2_SH(zero, T, d1, d2); @@ -554,17 +556,17 @@ static WEBP_INLINE void DCMode16x16(uint8_t* WEBP_RESTRICT dst, const v8u16 dctemp = dctop + dcleft; DC = HADD_UH_U32(dctemp); DC = (DC + 16) >> 5; - } else if (left != NULL) { // left but no top + } else if (left != NULL) { // left but no top const v16u8 rleft = LD_UB(left); const v8u16 dcleft = __msa_hadd_u_h(rleft, rleft); DC = HADD_UH_U32(dcleft); DC = (DC + DC + 16) >> 5; - } else if (top != NULL) { // top but no left + } else if (top != NULL) { // top but no left const v16u8 rtop = LD_UB(top); const v8u16 dctop = __msa_hadd_u_h(rtop, rtop); DC = HADD_UH_U32(dctop); DC = (DC + DC + 16) >> 5; - } else { // no top, no left, nothing. + } else { // no top, no left, nothing. DC = 0x80; } out = (v16u8)__msa_fill_b(DC); @@ -582,21 +584,23 @@ static void Intra16Preds_MSA(uint8_t* WEBP_RESTRICT dst, // Chroma 8x8 prediction -#define CALC_DC8(in, out) do { \ - const v8u16 temp0 = __msa_hadd_u_h(in, in); \ - const v4u32 temp1 = __msa_hadd_u_w(temp0, temp0); \ - const v2i64 temp2 = (v2i64)__msa_hadd_u_d(temp1, temp1); \ - const v2i64 temp3 = __msa_splati_d(temp2, 1); \ - const v2i64 temp4 = temp3 + temp2; \ - const v16i8 temp5 = (v16i8)__msa_srari_d(temp4, 4); \ - const v2i64 temp6 = (v2i64)__msa_splati_b(temp5, 0); \ - out = __msa_copy_s_d(temp6, 0); \ -} while (0) +#define CALC_DC8(in, out) \ + do { \ + const v8u16 temp0 = __msa_hadd_u_h(in, in); \ + const v4u32 temp1 = __msa_hadd_u_w(temp0, temp0); \ + const v2i64 temp2 = (v2i64)__msa_hadd_u_d(temp1, temp1); \ + const v2i64 temp3 = __msa_splati_d(temp2, 1); \ + const v2i64 temp4 = temp3 + temp2; \ + const v16i8 temp5 = (v16i8)__msa_srari_d(temp4, 4); \ + const v2i64 temp6 = (v2i64)__msa_splati_b(temp5, 0); \ + out = __msa_copy_s_d(temp6, 0); \ + } while (0) -#define STORE8x8(out, dst) do { \ - SD4(out, out, out, out, dst + 0 * BPS, BPS); \ - SD4(out, out, out, out, dst + 4 * BPS, BPS); \ -} while (0) +#define STORE8x8(out, dst) \ + do { \ + SD4(out, out, out, out, dst + 0 * BPS, BPS); \ + SD4(out, out, out, out, dst + 4 * BPS, BPS); \ + } while (0) static WEBP_INLINE void VerticalPred8x8(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT top) { @@ -640,8 +644,8 @@ static WEBP_INLINE void TrueMotion8x8(uint8_t* WEBP_RESTRICT dst, int j; const v8i16 TL = (v8i16)__msa_fill_h(left[-1]); const v16u8 T1 = LD_UB(top); - const v16i8 zero = { 0 }; - const v8i16 T = (v8i16)__msa_ilvr_b(zero, (v16i8)T1); + const v16i8 zero = {0}; + const v8i16 T = (v8i16)__msa_ilvr_b(zero, (v16i8)T1); const v8i16 d = T - TL; for (j = 0; j < 8; j += 4) { uint64_t out0, out1, out2, out3; @@ -677,21 +681,21 @@ static WEBP_INLINE void DCMode8x8(uint8_t* WEBP_RESTRICT dst, const uint8_t* WEBP_RESTRICT left, const uint8_t* WEBP_RESTRICT top) { uint64_t out; - v16u8 src = { 0 }; + v16u8 src = {0}; if (top != NULL && left != NULL) { const uint64_t left_m = LD(left); const uint64_t top_m = LD(top); INSERT_D2_UB(left_m, top_m, src); CALC_DC8(src, out); - } else if (left != NULL) { // left but no top + } else if (left != NULL) { // left but no top const uint64_t left_m = LD(left); INSERT_D2_UB(left_m, left_m, src); CALC_DC8(src, out); - } else if (top != NULL) { // top but no left + } else if (top != NULL) { // top but no left const uint64_t top_m = LD(top); INSERT_D2_UB(top_m, top_m, src); CALC_DC8(src, out); - } else { // no top, no left, nothing. + } else { // no top, no left, nothing. src = (v16u8)__msa_fill_b(0x80); out = __msa_copy_s_d((v2i64)src, 0); } @@ -719,27 +723,29 @@ static void IntraChromaPreds_MSA(uint8_t* WEBP_RESTRICT dst, //------------------------------------------------------------------------------ // Metric -#define PACK_DOTP_UB4_SW(in0, in1, in2, in3, out0, out1, out2, out3) do { \ - v16u8 tmp0, tmp1; \ - v8i16 tmp2, tmp3; \ - ILVRL_B2_UB(in0, in1, tmp0, tmp1); \ - HSUB_UB2_SH(tmp0, tmp1, tmp2, tmp3); \ - DOTP_SH2_SW(tmp2, tmp3, tmp2, tmp3, out0, out1); \ - ILVRL_B2_UB(in2, in3, tmp0, tmp1); \ - HSUB_UB2_SH(tmp0, tmp1, tmp2, tmp3); \ - DOTP_SH2_SW(tmp2, tmp3, tmp2, tmp3, out2, out3); \ -} while (0) +#define PACK_DOTP_UB4_SW(in0, in1, in2, in3, out0, out1, out2, out3) \ + do { \ + v16u8 tmp0, tmp1; \ + v8i16 tmp2, tmp3; \ + ILVRL_B2_UB(in0, in1, tmp0, tmp1); \ + HSUB_UB2_SH(tmp0, tmp1, tmp2, tmp3); \ + DOTP_SH2_SW(tmp2, tmp3, tmp2, tmp3, out0, out1); \ + ILVRL_B2_UB(in2, in3, tmp0, tmp1); \ + HSUB_UB2_SH(tmp0, tmp1, tmp2, tmp3); \ + DOTP_SH2_SW(tmp2, tmp3, tmp2, tmp3, out2, out3); \ + } while (0) -#define PACK_DPADD_UB4_SW(in0, in1, in2, in3, out0, out1, out2, out3) do { \ - v16u8 tmp0, tmp1; \ - v8i16 tmp2, tmp3; \ - ILVRL_B2_UB(in0, in1, tmp0, tmp1); \ - HSUB_UB2_SH(tmp0, tmp1, tmp2, tmp3); \ - DPADD_SH2_SW(tmp2, tmp3, tmp2, tmp3, out0, out1); \ - ILVRL_B2_UB(in2, in3, tmp0, tmp1); \ - HSUB_UB2_SH(tmp0, tmp1, tmp2, tmp3); \ - DPADD_SH2_SW(tmp2, tmp3, tmp2, tmp3, out2, out3); \ -} while (0) +#define PACK_DPADD_UB4_SW(in0, in1, in2, in3, out0, out1, out2, out3) \ + do { \ + v16u8 tmp0, tmp1; \ + v8i16 tmp2, tmp3; \ + ILVRL_B2_UB(in0, in1, tmp0, tmp1); \ + HSUB_UB2_SH(tmp0, tmp1, tmp2, tmp3); \ + DPADD_SH2_SW(tmp2, tmp3, tmp2, tmp3, out0, out1); \ + ILVRL_B2_UB(in2, in3, tmp0, tmp1); \ + HSUB_UB2_SH(tmp0, tmp1, tmp2, tmp3); \ + DPADD_SH2_SW(tmp2, tmp3, tmp2, tmp3, out2, out3); \ + } while (0) static int SSE16x16_MSA(const uint8_t* WEBP_RESTRICT a, const uint8_t* WEBP_RESTRICT b) { @@ -814,7 +820,7 @@ static int SSE4x4_MSA(const uint8_t* WEBP_RESTRICT a, const uint8_t* WEBP_RESTRICT b) { uint32_t sum = 0; uint32_t src0, src1, src2, src3, ref0, ref1, ref2, ref3; - v16u8 src = { 0 }, ref = { 0 }, tmp0, tmp1; + v16u8 src = {0}, ref = {0}, tmp0, tmp1; v8i16 diff0, diff1; v4i32 out0, out1; @@ -839,9 +845,9 @@ static int QuantizeBlock_MSA(int16_t in[16], int16_t out[16], v8i16 in0, in1, sh0, sh1, out0, out1; v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, sign0, sign1; v4i32 s0, s1, s2, s3, b0, b1, b2, b3, t0, t1, t2, t3; - const v8i16 zero = { 0 }; - const v8i16 zigzag0 = { 0, 1, 4, 8, 5, 2, 3, 6 }; - const v8i16 zigzag1 = { 9, 12, 13, 10, 7, 11, 14, 15 }; + const v8i16 zero = {0}; + const v8i16 zigzag0 = {0, 1, 4, 8, 5, 2, 3, 6}; + const v8i16 zigzag1 = {9, 12, 13, 10, 7, 11, 14, 15}; const v8i16 maxlevel = __msa_fill_h(MAX_LEVEL); LD_SH2(&in[0], 8, in0, in1); @@ -852,11 +858,11 @@ static int QuantizeBlock_MSA(int16_t in[16], int16_t out[16], ILVRL_H2_SH(sh1, tmp5, tmp2, tmp3); HADD_SH4_SW(tmp0, tmp1, tmp2, tmp3, s0, s1, s2, s3); sign0 = (in0 < zero); - sign1 = (in1 < zero); // sign - LD_SH2(&mtx->iq[0], 8, tmp0, tmp1); // iq + sign1 = (in1 < zero); // sign + LD_SH2(&mtx->iq[0], 8, tmp0, tmp1); // iq ILVRL_H2_SW(zero, tmp0, t0, t1); ILVRL_H2_SW(zero, tmp1, t2, t3); - LD_SW4(&mtx->bias[0], 4, b0, b1, b2, b3); // bias + LD_SW4(&mtx->bias[0], 4, b0, b1, b2, b3); // bias MUL4(t0, s0, t1, s1, t2, s2, t3, s3, t0, t1, t2, t3); ADD4(b0, t0, b1, t1, b2, t2, b3, t3, b0, b1, b2, b3); SRAI_W4_SW(b0, b1, b2, b3, 17); @@ -868,7 +874,7 @@ static int QuantizeBlock_MSA(int16_t in[16], int16_t out[16], SUB2(zero, tmp2, zero, tmp3, tmp0, tmp1); tmp2 = (v8i16)__msa_bmnz_v((v16u8)tmp2, (v16u8)tmp0, (v16u8)sign0); tmp3 = (v8i16)__msa_bmnz_v((v16u8)tmp3, (v16u8)tmp1, (v16u8)sign1); - LD_SW4(&mtx->zthresh[0], 4, t0, t1, t2, t3); // zthresh + LD_SW4(&mtx->zthresh[0], 4, t0, t1, t2, t3); // zthresh t0 = (s0 > t0); t1 = (s1 > t1); t2 = (s2 > t2); @@ -889,7 +895,7 @@ static int QuantizeBlock_MSA(int16_t in[16], int16_t out[16], static int Quantize2Blocks_MSA(int16_t in[32], int16_t out[32], const VP8Matrix* WEBP_RESTRICT const mtx) { int nz; - nz = VP8EncQuantizeBlock(in + 0 * 16, out + 0 * 16, mtx) << 0; + nz = VP8EncQuantizeBlock(in + 0 * 16, out + 0 * 16, mtx) << 0; nz |= VP8EncQuantizeBlock(in + 1 * 16, out + 1 * 16, mtx) << 1; return nz; } diff --git a/src/dsp/enc_neon.c b/src/dsp/enc_neon.c index 128454d3..d38ac667 100644 --- a/src/dsp/enc_neon.c +++ b/src/dsp/enc_neon.c @@ -89,8 +89,8 @@ static WEBP_INLINE void Transpose8x2_NEON(const int16x8_t in0, int16x8x2_t* const out) { // a0 a1 a2 a3 | b0 b1 b2 b3 => a0 b0 c0 d0 | a1 b1 c1 d1 // c0 c1 c2 c3 | d0 d1 d2 d3 a2 b2 c2 d2 | a3 b3 c3 d3 - const int16x8x2_t tmp0 = vzipq_s16(in0, in1); // a0 c0 a1 c1 a2 c2 ... - // b0 d0 b1 d1 b2 d2 ... + const int16x8x2_t tmp0 = vzipq_s16(in0, in1); // a0 c0 a1 c1 a2 c2 ... + // b0 d0 b1 d1 b2 d2 ... *out = vzipq_s16(tmp0.val[0], tmp0.val[1]); } @@ -105,17 +105,17 @@ static WEBP_INLINE void TransformPass_NEON(int16x8x2_t* const rows) { const int16x8_t C0 = vsraq_n_s16(B1, vqdmulhq_n_s16(B1, kC1), 1); const int16x8_t C1 = vqdmulhq_n_s16(B1, kC2); const int16x4_t a = vqadd_s16(vget_low_s16(rows->val[0]), - vget_low_s16(rows->val[1])); // in0 + in8 + vget_low_s16(rows->val[1])); // in0 + in8 const int16x4_t b = vqsub_s16(vget_low_s16(rows->val[0]), - vget_low_s16(rows->val[1])); // in0 - in8 + vget_low_s16(rows->val[1])); // in0 - in8 // c = kC2 * in4 - kC1 * in12 // d = kC1 * in4 + kC2 * in12 const int16x4_t c = vqsub_s16(vget_low_s16(C1), vget_high_s16(C0)); const int16x4_t d = vqadd_s16(vget_low_s16(C0), vget_high_s16(C1)); - const int16x8_t D0 = vcombine_s16(a, b); // D0 = a | b - const int16x8_t D1 = vcombine_s16(d, c); // D1 = d | c - const int16x8_t E0 = vqaddq_s16(D0, D1); // a+d | b+c - const int16x8_t E_tmp = vqsubq_s16(D0, D1); // a-d | b-c + const int16x8_t D0 = vcombine_s16(a, b); // D0 = a | b + const int16x8_t D1 = vcombine_s16(d, c); // D1 = d | c + const int16x8_t E0 = vqaddq_s16(D0, D1); // a+d | b+c + const int16x8_t E_tmp = vqsubq_s16(D0, D1); // a-d | b-c const int16x8_t E1 = vcombine_s16(vget_high_s16(E_tmp), vget_low_s16(E_tmp)); Transpose8x2_NEON(E0, E1, rows); } @@ -136,118 +136,118 @@ static void ITransformOne_NEON(const uint8_t* WEBP_RESTRICT ref, const int16_t* WEBP_RESTRICT in, uint8_t* WEBP_RESTRICT dst) { const int kBPS = BPS; - const int16_t kC1C2[] = { kC1, kC2, 0, 0 }; + const int16_t kC1C2[] = {kC1, kC2, 0, 0}; - __asm__ volatile ( - "vld1.16 {q1, q2}, [%[in]] \n" - "vld1.16 {d0}, [%[kC1C2]] \n" + __asm__ volatile( + "vld1.16 {q1, q2}, [%[in]] \n" + "vld1.16 {d0}, [%[kC1C2]] \n" - // d2: in[0] - // d3: in[8] - // d4: in[4] - // d5: in[12] - "vswp d3, d4 \n" + // d2: in[0] + // d3: in[8] + // d4: in[4] + // d5: in[12] + "vswp d3, d4 \n" - // q8 = {in[4], in[12]} * kC1 * 2 >> 16 - // q9 = {in[4], in[12]} * kC2 >> 16 - "vqdmulh.s16 q8, q2, d0[0] \n" - "vqdmulh.s16 q9, q2, d0[1] \n" + // q8 = {in[4], in[12]} * kC1 * 2 >> 16 + // q9 = {in[4], in[12]} * kC2 >> 16 + "vqdmulh.s16 q8, q2, d0[0] \n" + "vqdmulh.s16 q9, q2, d0[1] \n" - // d22 = a = in[0] + in[8] - // d23 = b = in[0] - in[8] - "vqadd.s16 d22, d2, d3 \n" - "vqsub.s16 d23, d2, d3 \n" + // d22 = a = in[0] + in[8] + // d23 = b = in[0] - in[8] + "vqadd.s16 d22, d2, d3 \n" + "vqsub.s16 d23, d2, d3 \n" - // q8 = in[4]/[12] * kC1 >> 16 - "vshr.s16 q8, q8, #1 \n" + // q8 = in[4]/[12] * kC1 >> 16 + "vshr.s16 q8, q8, #1 \n" - // Add {in[4], in[12]} back after the multiplication. - "vqadd.s16 q8, q2, q8 \n" + // Add {in[4], in[12]} back after the multiplication. + "vqadd.s16 q8, q2, q8 \n" - // d20 = c = in[4]*kC2 - in[12]*kC1 - // d21 = d = in[4]*kC1 + in[12]*kC2 - "vqsub.s16 d20, d18, d17 \n" - "vqadd.s16 d21, d19, d16 \n" + // d20 = c = in[4]*kC2 - in[12]*kC1 + // d21 = d = in[4]*kC1 + in[12]*kC2 + "vqsub.s16 d20, d18, d17 \n" + "vqadd.s16 d21, d19, d16 \n" - // d2 = tmp[0] = a + d - // d3 = tmp[1] = b + c - // d4 = tmp[2] = b - c - // d5 = tmp[3] = a - d - "vqadd.s16 d2, d22, d21 \n" - "vqadd.s16 d3, d23, d20 \n" - "vqsub.s16 d4, d23, d20 \n" - "vqsub.s16 d5, d22, d21 \n" + // d2 = tmp[0] = a + d + // d3 = tmp[1] = b + c + // d4 = tmp[2] = b - c + // d5 = tmp[3] = a - d + "vqadd.s16 d2, d22, d21 \n" + "vqadd.s16 d3, d23, d20 \n" + "vqsub.s16 d4, d23, d20 \n" + "vqsub.s16 d5, d22, d21 \n" - "vzip.16 q1, q2 \n" - "vzip.16 q1, q2 \n" + "vzip.16 q1, q2 \n" + "vzip.16 q1, q2 \n" - "vswp d3, d4 \n" + "vswp d3, d4 \n" - // q8 = {tmp[4], tmp[12]} * kC1 * 2 >> 16 - // q9 = {tmp[4], tmp[12]} * kC2 >> 16 - "vqdmulh.s16 q8, q2, d0[0] \n" - "vqdmulh.s16 q9, q2, d0[1] \n" + // q8 = {tmp[4], tmp[12]} * kC1 * 2 >> 16 + // q9 = {tmp[4], tmp[12]} * kC2 >> 16 + "vqdmulh.s16 q8, q2, d0[0] \n" + "vqdmulh.s16 q9, q2, d0[1] \n" - // d22 = a = tmp[0] + tmp[8] - // d23 = b = tmp[0] - tmp[8] - "vqadd.s16 d22, d2, d3 \n" - "vqsub.s16 d23, d2, d3 \n" + // d22 = a = tmp[0] + tmp[8] + // d23 = b = tmp[0] - tmp[8] + "vqadd.s16 d22, d2, d3 \n" + "vqsub.s16 d23, d2, d3 \n" - "vshr.s16 q8, q8, #1 \n" - "vqadd.s16 q8, q2, q8 \n" + "vshr.s16 q8, q8, #1 \n" + "vqadd.s16 q8, q2, q8 \n" - // d20 = c = in[4]*kC2 - in[12]*kC1 - // d21 = d = in[4]*kC1 + in[12]*kC2 - "vqsub.s16 d20, d18, d17 \n" - "vqadd.s16 d21, d19, d16 \n" + // d20 = c = in[4]*kC2 - in[12]*kC1 + // d21 = d = in[4]*kC1 + in[12]*kC2 + "vqsub.s16 d20, d18, d17 \n" + "vqadd.s16 d21, d19, d16 \n" - // d2 = tmp[0] = a + d - // d3 = tmp[1] = b + c - // d4 = tmp[2] = b - c - // d5 = tmp[3] = a - d - "vqadd.s16 d2, d22, d21 \n" - "vqadd.s16 d3, d23, d20 \n" - "vqsub.s16 d4, d23, d20 \n" - "vqsub.s16 d5, d22, d21 \n" + // d2 = tmp[0] = a + d + // d3 = tmp[1] = b + c + // d4 = tmp[2] = b - c + // d5 = tmp[3] = a - d + "vqadd.s16 d2, d22, d21 \n" + "vqadd.s16 d3, d23, d20 \n" + "vqsub.s16 d4, d23, d20 \n" + "vqsub.s16 d5, d22, d21 \n" - "vld1.32 d6[0], [%[ref]], %[kBPS] \n" - "vld1.32 d6[1], [%[ref]], %[kBPS] \n" - "vld1.32 d7[0], [%[ref]], %[kBPS] \n" - "vld1.32 d7[1], [%[ref]], %[kBPS] \n" + "vld1.32 d6[0], [%[ref]], %[kBPS] \n" + "vld1.32 d6[1], [%[ref]], %[kBPS] \n" + "vld1.32 d7[0], [%[ref]], %[kBPS] \n" + "vld1.32 d7[1], [%[ref]], %[kBPS] \n" - "sub %[ref], %[ref], %[kBPS], lsl #2 \n" + "sub %[ref], %[ref], %[kBPS], lsl #2 \n" - // (val) + 4 >> 3 - "vrshr.s16 d2, d2, #3 \n" - "vrshr.s16 d3, d3, #3 \n" - "vrshr.s16 d4, d4, #3 \n" - "vrshr.s16 d5, d5, #3 \n" + // (val) + 4 >> 3 + "vrshr.s16 d2, d2, #3 \n" + "vrshr.s16 d3, d3, #3 \n" + "vrshr.s16 d4, d4, #3 \n" + "vrshr.s16 d5, d5, #3 \n" - "vzip.16 q1, q2 \n" - "vzip.16 q1, q2 \n" + "vzip.16 q1, q2 \n" + "vzip.16 q1, q2 \n" - // Must accumulate before saturating - "vmovl.u8 q8, d6 \n" - "vmovl.u8 q9, d7 \n" + // Must accumulate before saturating + "vmovl.u8 q8, d6 \n" + "vmovl.u8 q9, d7 \n" - "vqadd.s16 q1, q1, q8 \n" - "vqadd.s16 q2, q2, q9 \n" + "vqadd.s16 q1, q1, q8 \n" + "vqadd.s16 q2, q2, q9 \n" - "vqmovun.s16 d0, q1 \n" - "vqmovun.s16 d1, q2 \n" + "vqmovun.s16 d0, q1 \n" + "vqmovun.s16 d1, q2 \n" - "vst1.32 d0[0], [%[dst]], %[kBPS] \n" - "vst1.32 d0[1], [%[dst]], %[kBPS] \n" - "vst1.32 d1[0], [%[dst]], %[kBPS] \n" - "vst1.32 d1[1], [%[dst]] \n" + "vst1.32 d0[0], [%[dst]], %[kBPS] \n" + "vst1.32 d0[1], [%[dst]], %[kBPS] \n" + "vst1.32 d1[0], [%[dst]], %[kBPS] \n" + "vst1.32 d1[1], [%[dst]] \n" - : [in] "+r"(in), [dst] "+r"(dst) // modified registers - : [kBPS] "r"(kBPS), [kC1C2] "r"(kC1C2), [ref] "r"(ref) // constants - : "memory", "q0", "q1", "q2", "q8", "q9", "q10", "q11" // clobbered + : [in] "+r"(in), [dst] "+r"(dst) // modified registers + : [kBPS] "r"(kBPS), [kC1C2] "r"(kC1C2), [ref] "r"(ref) // constants + : "memory", "q0", "q1", "q2", "q8", "q9", "q10", "q11" // clobbered ); } -#endif // WEBP_USE_INTRINSICS +#endif // WEBP_USE_INTRINSICS static void ITransform_NEON(const uint8_t* WEBP_RESTRICT ref, const int16_t* WEBP_RESTRICT in, @@ -272,24 +272,19 @@ static uint8x16_t Load4x4_NEON(const uint8_t* src) { #if defined(WEBP_USE_INTRINSICS) -static WEBP_INLINE void Transpose4x4_S16_NEON(const int16x4_t A, - const int16x4_t B, - const int16x4_t C, - const int16x4_t D, - int16x8_t* const out01, - int16x8_t* const out32) { +static WEBP_INLINE void Transpose4x4_S16_NEON( + const int16x4_t A, const int16x4_t B, const int16x4_t C, const int16x4_t D, + int16x8_t* const out01, int16x8_t* const out32) { const int16x4x2_t AB = vtrn_s16(A, B); const int16x4x2_t CD = vtrn_s16(C, D); const int32x2x2_t tmp02 = vtrn_s32(vreinterpret_s32_s16(AB.val[0]), vreinterpret_s32_s16(CD.val[0])); const int32x2x2_t tmp13 = vtrn_s32(vreinterpret_s32_s16(AB.val[1]), vreinterpret_s32_s16(CD.val[1])); - *out01 = vreinterpretq_s16_s64( - vcombine_s64(vreinterpret_s64_s32(tmp02.val[0]), - vreinterpret_s64_s32(tmp13.val[0]))); - *out32 = vreinterpretq_s16_s64( - vcombine_s64(vreinterpret_s64_s32(tmp13.val[1]), - vreinterpret_s64_s32(tmp02.val[1]))); + *out01 = vreinterpretq_s16_s64(vcombine_s64( + vreinterpret_s64_s32(tmp02.val[0]), vreinterpret_s64_s32(tmp13.val[0]))); + *out32 = vreinterpretq_s16_s64(vcombine_s64( + vreinterpret_s64_s32(tmp13.val[1]), vreinterpret_s64_s32(tmp02.val[1]))); } static WEBP_INLINE int16x8_t DiffU8ToS16_NEON(const uint8x8_t a, @@ -300,7 +295,7 @@ static WEBP_INLINE int16x8_t DiffU8ToS16_NEON(const uint8x8_t a, static void FTransform_NEON(const uint8_t* WEBP_RESTRICT src, const uint8_t* WEBP_RESTRICT ref, int16_t* WEBP_RESTRICT out) { - int16x8_t d0d1, d3d2; // working 4x4 int16 variables + int16x8_t d0d1, d3d2; // working 4x4 int16 variables { const uint8x16_t S0 = Load4x4_NEON(src); const uint8x16_t R0 = Load4x4_NEON(ref); @@ -312,16 +307,16 @@ static void FTransform_NEON(const uint8_t* WEBP_RESTRICT src, const int16x4_t D3 = vget_high_s16(D2D3); Transpose4x4_S16_NEON(D0, D1, D2, D3, &d0d1, &d3d2); } - { // 1rst pass + { // 1rst pass const int32x4_t kCst937 = vdupq_n_s32(937); const int32x4_t kCst1812 = vdupq_n_s32(1812); - const int16x8_t a0a1 = vaddq_s16(d0d1, d3d2); // d0+d3 | d1+d2 (=a0|a1) - const int16x8_t a3a2 = vsubq_s16(d0d1, d3d2); // d0-d3 | d1-d2 (=a3|a2) + const int16x8_t a0a1 = vaddq_s16(d0d1, d3d2); // d0+d3 | d1+d2 (=a0|a1) + const int16x8_t a3a2 = vsubq_s16(d0d1, d3d2); // d0-d3 | d1-d2 (=a3|a2) const int16x8_t a0a1_2 = vshlq_n_s16(a0a1, 3); - const int16x4_t tmp0 = vadd_s16(vget_low_s16(a0a1_2), - vget_high_s16(a0a1_2)); - const int16x4_t tmp2 = vsub_s16(vget_low_s16(a0a1_2), - vget_high_s16(a0a1_2)); + const int16x4_t tmp0 = + vadd_s16(vget_low_s16(a0a1_2), vget_high_s16(a0a1_2)); + const int16x4_t tmp2 = + vsub_s16(vget_low_s16(a0a1_2), vget_high_s16(a0a1_2)); const int32x4_t a3_2217 = vmull_n_s16(vget_low_s16(a3a2), 2217); const int32x4_t a2_2217 = vmull_n_s16(vget_high_s16(a3a2), 2217); const int32x4_t a2_p_a3 = vmlal_n_s16(a2_2217, vget_low_s16(a3a2), 5352); @@ -330,12 +325,12 @@ static void FTransform_NEON(const uint8_t* WEBP_RESTRICT src, const int16x4_t tmp3 = vshrn_n_s32(vaddq_s32(a3_m_a2, kCst937), 9); Transpose4x4_S16_NEON(tmp0, tmp1, tmp2, tmp3, &d0d1, &d3d2); } - { // 2nd pass + { // 2nd pass // the (1<<16) addition is for the replacement: a3!=0 <-> 1-(a3==0) const int32x4_t kCst12000 = vdupq_n_s32(12000 + (1 << 16)); const int32x4_t kCst51000 = vdupq_n_s32(51000); - const int16x8_t a0a1 = vaddq_s16(d0d1, d3d2); // d0+d3 | d1+d2 (=a0|a1) - const int16x8_t a3a2 = vsubq_s16(d0d1, d3d2); // d0-d3 | d1-d2 (=a3|a2) + const int16x8_t a0a1 = vaddq_s16(d0d1, d3d2); // d0+d3 | d1+d2 (=a0|a1) + const int16x8_t a3a2 = vsubq_s16(d0d1, d3d2); // d0-d3 | d1-d2 (=a3|a2) const int16x4_t a0_k7 = vadd_s16(vget_low_s16(a0a1), vdup_n_s16(7)); const int16x4_t out0 = vshr_n_s16(vadd_s16(a0_k7, vget_high_s16(a0a1)), 4); const int16x4_t out2 = vshr_n_s16(vsub_s16(a0_k7, vget_high_s16(a0a1)), 4); @@ -348,9 +343,9 @@ static void FTransform_NEON(const uint8_t* WEBP_RESTRICT src, const int16x4_t a3_eq_0 = vreinterpret_s16_u16(vceq_s16(vget_low_s16(a3a2), vdup_n_s16(0))); const int16x4_t out1 = vadd_s16(tmp1, a3_eq_0); - vst1_s16(out + 0, out0); - vst1_s16(out + 4, out1); - vst1_s16(out + 8, out2); + vst1_s16(out + 0, out0); + vst1_s16(out + 4, out1); + vst1_s16(out + 8, out2); vst1_s16(out + 12, out3); } } @@ -358,15 +353,11 @@ static void FTransform_NEON(const uint8_t* WEBP_RESTRICT src, #else // adapted from vp8/encoder/arm/neon/shortfdct_neon.asm -static const int16_t kCoeff16[] = { - 5352, 5352, 5352, 5352, 2217, 2217, 2217, 2217 -}; -static const int32_t kCoeff32[] = { - 1812, 1812, 1812, 1812, - 937, 937, 937, 937, - 12000, 12000, 12000, 12000, - 51000, 51000, 51000, 51000 -}; +static const int16_t kCoeff16[] = {5352, 5352, 5352, 5352, + 2217, 2217, 2217, 2217}; +static const int32_t kCoeff32[] = {1812, 1812, 1812, 1812, 937, 937, + 937, 937, 12000, 12000, 12000, 12000, + 51000, 51000, 51000, 51000}; static void FTransform_NEON(const uint8_t* WEBP_RESTRICT src, const uint8_t* WEBP_RESTRICT ref, @@ -377,117 +368,122 @@ static void FTransform_NEON(const uint8_t* WEBP_RESTRICT src, const int16_t* coeff16 = kCoeff16; const int32_t* coeff32 = kCoeff32; - __asm__ volatile ( - // load src into q4, q5 in high half - "vld1.8 {d8}, [%[src_ptr]], %[kBPS] \n" - "vld1.8 {d10}, [%[src_ptr]], %[kBPS] \n" - "vld1.8 {d9}, [%[src_ptr]], %[kBPS] \n" - "vld1.8 {d11}, [%[src_ptr]] \n" + __asm__ volatile( + // load src into q4, q5 in high half + "vld1.8 {d8}, [%[src_ptr]], %[kBPS] \n" + "vld1.8 {d10}, [%[src_ptr]], %[kBPS] \n" + "vld1.8 {d9}, [%[src_ptr]], %[kBPS] \n" + "vld1.8 {d11}, [%[src_ptr]] \n" - // load ref into q6, q7 in high half - "vld1.8 {d12}, [%[ref_ptr]], %[kBPS] \n" - "vld1.8 {d14}, [%[ref_ptr]], %[kBPS] \n" - "vld1.8 {d13}, [%[ref_ptr]], %[kBPS] \n" - "vld1.8 {d15}, [%[ref_ptr]] \n" + // load ref into q6, q7 in high half + "vld1.8 {d12}, [%[ref_ptr]], %[kBPS] \n" + "vld1.8 {d14}, [%[ref_ptr]], %[kBPS] \n" + "vld1.8 {d13}, [%[ref_ptr]], %[kBPS] \n" + "vld1.8 {d15}, [%[ref_ptr]] \n" - // Pack the high values in to q4 and q6 - "vtrn.32 q4, q5 \n" - "vtrn.32 q6, q7 \n" + // Pack the high values in to q4 and q6 + "vtrn.32 q4, q5 \n" + "vtrn.32 q6, q7 \n" - // d[0-3] = src - ref - "vsubl.u8 q0, d8, d12 \n" - "vsubl.u8 q1, d9, d13 \n" + // d[0-3] = src - ref + "vsubl.u8 q0, d8, d12 \n" + "vsubl.u8 q1, d9, d13 \n" - // load coeff16 into q8(d16=5352, d17=2217) - "vld1.16 {q8}, [%[coeff16]] \n" + // load coeff16 into q8(d16=5352, d17=2217) + "vld1.16 {q8}, [%[coeff16]] \n" - // load coeff32 high half into q9 = 1812, q10 = 937 - "vld1.32 {q9, q10}, [%[coeff32]]! \n" + // load coeff32 high half into q9 = 1812, q10 = 937 + "vld1.32 {q9, q10}, [%[coeff32]]! \n" - // load coeff32 low half into q11=12000, q12=51000 - "vld1.32 {q11,q12}, [%[coeff32]] \n" + // load coeff32 low half into q11=12000, q12=51000 + "vld1.32 {q11,q12}, [%[coeff32]] \n" - // part 1 - // Transpose. Register dN is the same as dN in C - "vtrn.32 d0, d2 \n" - "vtrn.32 d1, d3 \n" - "vtrn.16 d0, d1 \n" - "vtrn.16 d2, d3 \n" + // part 1 + // Transpose. Register dN is the same as dN in C + "vtrn.32 d0, d2 \n" + "vtrn.32 d1, d3 \n" + "vtrn.16 d0, d1 \n" + "vtrn.16 d2, d3 \n" - "vadd.s16 d4, d0, d3 \n" // a0 = d0 + d3 - "vadd.s16 d5, d1, d2 \n" // a1 = d1 + d2 - "vsub.s16 d6, d1, d2 \n" // a2 = d1 - d2 - "vsub.s16 d7, d0, d3 \n" // a3 = d0 - d3 + "vadd.s16 d4, d0, d3 \n" // a0 = d0 + d3 + "vadd.s16 d5, d1, d2 \n" // a1 = d1 + d2 + "vsub.s16 d6, d1, d2 \n" // a2 = d1 - d2 + "vsub.s16 d7, d0, d3 \n" // a3 = d0 - d3 - "vadd.s16 d0, d4, d5 \n" // a0 + a1 - "vshl.s16 d0, d0, #3 \n" // temp[0+i*4] = (a0+a1) << 3 - "vsub.s16 d2, d4, d5 \n" // a0 - a1 - "vshl.s16 d2, d2, #3 \n" // (temp[2+i*4] = (a0-a1) << 3 + "vadd.s16 d0, d4, d5 \n" // a0 + a1 + "vshl.s16 d0, d0, #3 \n" // temp[0+i*4] = (a0+a1) << + // 3 + "vsub.s16 d2, d4, d5 \n" // a0 - a1 + "vshl.s16 d2, d2, #3 \n" // (temp[2+i*4] = (a0-a1) + // << 3 - "vmlal.s16 q9, d7, d16 \n" // a3*5352 + 1812 - "vmlal.s16 q10, d7, d17 \n" // a3*2217 + 937 - "vmlal.s16 q9, d6, d17 \n" // a2*2217 + a3*5352 + 1812 - "vmlsl.s16 q10, d6, d16 \n" // a3*2217 + 937 - a2*5352 + "vmlal.s16 q9, d7, d16 \n" // a3*5352 + 1812 + "vmlal.s16 q10, d7, d17 \n" // a3*2217 + 937 + "vmlal.s16 q9, d6, d17 \n" // a2*2217 + a3*5352 + 1812 + "vmlsl.s16 q10, d6, d16 \n" // a3*2217 + 937 - a2*5352 - // temp[1+i*4] = (d2*2217 + d3*5352 + 1812) >> 9 - // temp[3+i*4] = (d3*2217 + 937 - d2*5352) >> 9 - "vshrn.s32 d1, q9, #9 \n" - "vshrn.s32 d3, q10, #9 \n" + // temp[1+i*4] = (d2*2217 + d3*5352 + 1812) >> 9 + // temp[3+i*4] = (d3*2217 + 937 - d2*5352) >> 9 + "vshrn.s32 d1, q9, #9 \n" + "vshrn.s32 d3, q10, #9 \n" - // part 2 - // transpose d0=ip[0], d1=ip[4], d2=ip[8], d3=ip[12] - "vtrn.32 d0, d2 \n" - "vtrn.32 d1, d3 \n" - "vtrn.16 d0, d1 \n" - "vtrn.16 d2, d3 \n" + // part 2 + // transpose d0=ip[0], d1=ip[4], d2=ip[8], d3=ip[12] + "vtrn.32 d0, d2 \n" + "vtrn.32 d1, d3 \n" + "vtrn.16 d0, d1 \n" + "vtrn.16 d2, d3 \n" - "vmov.s16 d26, #7 \n" + "vmov.s16 d26, #7 \n" - "vadd.s16 d4, d0, d3 \n" // a1 = ip[0] + ip[12] - "vadd.s16 d5, d1, d2 \n" // b1 = ip[4] + ip[8] - "vsub.s16 d6, d1, d2 \n" // c1 = ip[4] - ip[8] - "vadd.s16 d4, d4, d26 \n" // a1 + 7 - "vsub.s16 d7, d0, d3 \n" // d1 = ip[0] - ip[12] + "vadd.s16 d4, d0, d3 \n" // a1 = ip[0] + ip[12] + "vadd.s16 d5, d1, d2 \n" // b1 = ip[4] + ip[8] + "vsub.s16 d6, d1, d2 \n" // c1 = ip[4] - ip[8] + "vadd.s16 d4, d4, d26 \n" // a1 + 7 + "vsub.s16 d7, d0, d3 \n" // d1 = ip[0] - ip[12] - "vadd.s16 d0, d4, d5 \n" // op[0] = a1 + b1 + 7 - "vsub.s16 d2, d4, d5 \n" // op[8] = a1 - b1 + 7 + "vadd.s16 d0, d4, d5 \n" // op[0] = a1 + b1 + 7 + "vsub.s16 d2, d4, d5 \n" // op[8] = a1 - b1 + 7 - "vmlal.s16 q11, d7, d16 \n" // d1*5352 + 12000 - "vmlal.s16 q12, d7, d17 \n" // d1*2217 + 51000 + "vmlal.s16 q11, d7, d16 \n" // d1*5352 + 12000 + "vmlal.s16 q12, d7, d17 \n" // d1*2217 + 51000 - "vceq.s16 d4, d7, #0 \n" + "vceq.s16 d4, d7, #0 \n" - "vshr.s16 d0, d0, #4 \n" - "vshr.s16 d2, d2, #4 \n" + "vshr.s16 d0, d0, #4 \n" + "vshr.s16 d2, d2, #4 \n" - "vmlal.s16 q11, d6, d17 \n" // c1*2217 + d1*5352 + 12000 - "vmlsl.s16 q12, d6, d16 \n" // d1*2217 - c1*5352 + 51000 + "vmlal.s16 q11, d6, d17 \n" // c1*2217 + d1*5352 + + // 12000 + "vmlsl.s16 q12, d6, d16 \n" // d1*2217 - c1*5352 + + // 51000 - "vmvn d4, d4 \n" // !(d1 == 0) - // op[4] = (c1*2217 + d1*5352 + 12000)>>16 - "vshrn.s32 d1, q11, #16 \n" - // op[4] += (d1!=0) - "vsub.s16 d1, d1, d4 \n" - // op[12]= (d1*2217 - c1*5352 + 51000)>>16 - "vshrn.s32 d3, q12, #16 \n" + "vmvn d4, d4 \n" // !(d1 == 0) + // op[4] = (c1*2217 + d1*5352 + 12000)>>16 + "vshrn.s32 d1, q11, #16 \n" + // op[4] += (d1!=0) + "vsub.s16 d1, d1, d4 \n" + // op[12]= (d1*2217 - c1*5352 + 51000)>>16 + "vshrn.s32 d3, q12, #16 \n" - // set result to out array - "vst1.16 {q0, q1}, [%[out]] \n" - : [src_ptr] "+r"(src_ptr), [ref_ptr] "+r"(ref_ptr), - [coeff32] "+r"(coeff32) // modified registers - : [kBPS] "r"(kBPS), [coeff16] "r"(coeff16), - [out] "r"(out) // constants - : "memory", "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8", "q9", - "q10", "q11", "q12", "q13" // clobbered + // set result to out array + "vst1.16 {q0, q1}, [%[out]] \n" + : [src_ptr] "+r"(src_ptr), [ref_ptr] "+r"(ref_ptr), + [coeff32] "+r"(coeff32) // modified registers + : [kBPS] "r"(kBPS), [coeff16] "r"(coeff16), + [out] "r"(out) // constants + : "memory", "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8", "q9", + "q10", "q11", "q12", "q13" // clobbered ); } #endif -#define LOAD_LANE_16b(VALUE, LANE) do { \ - (VALUE) = vld1_lane_s16(src, (VALUE), (LANE)); \ - src += stride; \ -} while (0) +#define LOAD_LANE_16b(VALUE, LANE) \ + do { \ + (VALUE) = vld1_lane_s16(src, (VALUE), (LANE)); \ + src += stride; \ + } while (0) static void FTransformWHT_NEON(const int16_t* WEBP_RESTRICT src, int16_t* WEBP_RESTRICT out) { @@ -546,9 +542,9 @@ static void FTransformWHT_NEON(const int16_t* WEBP_RESTRICT src, const int16x4_t out2 = vmovn_s32(b2); const int16x4_t out3 = vmovn_s32(b3); - vst1_s16(out + 0, out0); - vst1_s16(out + 4, out1); - vst1_s16(out + 8, out2); + vst1_s16(out + 0, out0); + vst1_s16(out + 4, out1); + vst1_s16(out + 8, out2); vst1_s16(out + 12, out3); } } @@ -586,8 +582,8 @@ static WEBP_INLINE int16x8x4_t DistoTranspose4x4S16_NEON(int16x8x4_t q4_in) { return q4_in; } -static WEBP_INLINE int16x8x4_t DistoHorizontalPass_NEON( - const int16x8x4_t q4_in) { +static WEBP_INLINE int16x8x4_t +DistoHorizontalPass_NEON(const int16x8x4_t q4_in) { // {a0, a1} = {in[0] + in[2], in[1] + in[3]} // {a3, a2} = {in[0] - in[2], in[1] - in[3]} const int16x8_t q_a0 = vaddq_s16(q4_in.val[0], q4_in.val[2]); @@ -599,26 +595,24 @@ static WEBP_INLINE int16x8x4_t DistoHorizontalPass_NEON( // tmp[1] = a3 + a2 // tmp[2] = a3 - a2 // tmp[3] = a0 - a1 - INIT_VECTOR4(q4_out, - vabsq_s16(vaddq_s16(q_a0, q_a1)), - vabsq_s16(vaddq_s16(q_a3, q_a2)), - vabdq_s16(q_a3, q_a2), vabdq_s16(q_a0, q_a1)); + INIT_VECTOR4(q4_out, vabsq_s16(vaddq_s16(q_a0, q_a1)), + vabsq_s16(vaddq_s16(q_a3, q_a2)), vabdq_s16(q_a3, q_a2), + vabdq_s16(q_a0, q_a1)); return q4_out; } static WEBP_INLINE int16x8x4_t DistoVerticalPass_NEON(const uint8x8x4_t q4_in) { - const int16x8_t q_a0 = vreinterpretq_s16_u16(vaddl_u8(q4_in.val[0], - q4_in.val[2])); - const int16x8_t q_a1 = vreinterpretq_s16_u16(vaddl_u8(q4_in.val[1], - q4_in.val[3])); - const int16x8_t q_a2 = vreinterpretq_s16_u16(vsubl_u8(q4_in.val[1], - q4_in.val[3])); - const int16x8_t q_a3 = vreinterpretq_s16_u16(vsubl_u8(q4_in.val[0], - q4_in.val[2])); + const int16x8_t q_a0 = + vreinterpretq_s16_u16(vaddl_u8(q4_in.val[0], q4_in.val[2])); + const int16x8_t q_a1 = + vreinterpretq_s16_u16(vaddl_u8(q4_in.val[1], q4_in.val[3])); + const int16x8_t q_a2 = + vreinterpretq_s16_u16(vsubl_u8(q4_in.val[1], q4_in.val[3])); + const int16x8_t q_a3 = + vreinterpretq_s16_u16(vsubl_u8(q4_in.val[0], q4_in.val[2])); int16x8x4_t q4_out; - INIT_VECTOR4(q4_out, - vaddq_s16(q_a0, q_a1), vaddq_s16(q_a3, q_a2), + INIT_VECTOR4(q4_out, vaddq_s16(q_a0, q_a1), vaddq_s16(q_a3, q_a2), vsubq_s16(q_a3, q_a2), vsubq_s16(q_a0, q_a1)); return q4_out; } @@ -627,8 +621,7 @@ static WEBP_INLINE int16x4x4_t DistoLoadW_NEON(const uint16_t* w) { const uint16x8_t q_w07 = vld1q_u16(&w[0]); const uint16x8_t q_w8f = vld1q_u16(&w[8]); int16x4x4_t d4_w; - INIT_VECTOR4(d4_w, - vget_low_s16(vreinterpretq_s16_u16(q_w07)), + INIT_VECTOR4(d4_w, vget_low_s16(vreinterpretq_s16_u16(q_w07)), vget_high_s16(vreinterpretq_s16_u16(q_w07)), vget_low_s16(vreinterpretq_s16_u16(q_w8f)), vget_high_s16(vreinterpretq_s16_u16(q_w8f))); @@ -660,7 +653,7 @@ static WEBP_INLINE int32x2_t DistoSum_NEON(const int16x8x4_t q4_in, } #define LOAD_LANE_32b(src, VALUE, LANE) \ - (VALUE) = vld1_lane_u32((const uint32_t*)(src), (VALUE), (LANE)) + (VALUE) = vld1_lane_u32((const uint32_t*)(src), (VALUE), (LANE)) // Hadamard transform // Returns the weighted sum of the absolute value of transformed coefficients. @@ -683,8 +676,7 @@ static int Disto4x4_NEON(const uint8_t* WEBP_RESTRICT const a, LOAD_LANE_32b(b + 1 * BPS, d_in_ab_4567, 1); LOAD_LANE_32b(b + 2 * BPS, d_in_ab_89ab, 1); LOAD_LANE_32b(b + 3 * BPS, d_in_ab_cdef, 1); - INIT_VECTOR4(d4_in, - vreinterpret_u8_u32(d_in_ab_0123), + INIT_VECTOR4(d4_in, vreinterpret_u8_u32(d_in_ab_0123), vreinterpret_u8_u32(d_in_ab_4567), vreinterpret_u8_u32(d_in_ab_89ab), vreinterpret_u8_u32(d_in_ab_cdef)); @@ -729,7 +721,7 @@ static void CollectHistogram_NEON(const uint8_t* WEBP_RESTRICT ref, VP8Histogram* WEBP_RESTRICT const histo) { const uint16x8_t max_coeff_thresh = vdupq_n_u16(MAX_COEFF_THRESH); int j; - int distribution[MAX_COEFF_THRESH + 1] = { 0 }; + int distribution[MAX_COEFF_THRESH + 1] = {0}; for (j = start_block; j < end_block; ++j) { int16_t out[16]; FTransform_NEON(ref + VP8DspScan[j], pred + VP8DspScan[j], out); @@ -762,10 +754,10 @@ static WEBP_INLINE void AccumulateSSE16_NEON( const uint8x16_t a0 = vld1q_u8(a); const uint8x16_t b0 = vld1q_u8(b); const uint8x16_t abs_diff = vabdq_u8(a0, b0); - const uint16x8_t prod1 = vmull_u8(vget_low_u8(abs_diff), - vget_low_u8(abs_diff)); - const uint16x8_t prod2 = vmull_u8(vget_high_u8(abs_diff), - vget_high_u8(abs_diff)); + const uint16x8_t prod1 = + vmull_u8(vget_low_u8(abs_diff), vget_low_u8(abs_diff)); + const uint16x8_t prod2 = + vmull_u8(vget_high_u8(abs_diff), vget_high_u8(abs_diff)); /* pair-wise adds and widen */ const uint32x4_t sum1 = vpaddlq_u16(prod1); const uint32x4_t sum2 = vpaddlq_u16(prod2); @@ -823,10 +815,10 @@ static int SSE4x4_NEON(const uint8_t* WEBP_RESTRICT a, const uint8x16_t a0 = Load4x4_NEON(a); const uint8x16_t b0 = Load4x4_NEON(b); const uint8x16_t abs_diff = vabdq_u8(a0, b0); - const uint16x8_t prod1 = vmull_u8(vget_low_u8(abs_diff), - vget_low_u8(abs_diff)); - const uint16x8_t prod2 = vmull_u8(vget_high_u8(abs_diff), - vget_high_u8(abs_diff)); + const uint16x8_t prod1 = + vmull_u8(vget_low_u8(abs_diff), vget_low_u8(abs_diff)); + const uint16x8_t prod2 = + vmull_u8(vget_high_u8(abs_diff), vget_high_u8(abs_diff)); /* pair-wise adds and widen */ const uint32x4_t sum1 = vpaddlq_u16(prod1); const uint32x4_t sum2 = vpaddlq_u16(prod2); @@ -854,24 +846,22 @@ static int16x8_t Quantize_NEON(int16_t* WEBP_RESTRICT const in, const uint32x4_t m0 = vmull_u16(vget_low_u16(c), vget_low_u16(iq)); const uint32x4_t m1 = vmull_u16(vget_high_u16(c), vget_high_u16(iq)); const uint32x4_t m2 = vhaddq_u32(m0, bias0); - const uint32x4_t m3 = vhaddq_u32(m1, bias1); // (coeff * iQ + bias) >> 1 - const uint16x8_t c0 = vcombine_u16(vshrn_n_u32(m2, 16), - vshrn_n_u32(m3, 16)); // QFIX=17 = 16+1 + const uint32x4_t m3 = vhaddq_u32(m1, bias1); // (coeff * iQ + bias) >> 1 + const uint16x8_t c0 = + vcombine_u16(vshrn_n_u32(m2, 16), vshrn_n_u32(m3, 16)); // QFIX=17 = 16+1 const uint16x8_t c1 = vminq_u16(c0, vdupq_n_u16(MAX_LEVEL)); const int16x8_t c2 = veorq_s16(vreinterpretq_s16_u16(c1), sign); - const int16x8_t c3 = vsubq_s16(c2, sign); // restore sign + const int16x8_t c3 = vsubq_s16(c2, sign); // restore sign const int16x8_t c4 = vmulq_s16(c3, vreinterpretq_s16_u16(q)); vst1q_s16(in + offset, c4); assert(QFIX == 17); // this function can't work as is if QFIX != 16+1 return c3; } -static const uint8_t kShuffles[4][8] = { - { 0, 1, 2, 3, 8, 9, 16, 17 }, - { 10, 11, 4, 5, 6, 7, 12, 13 }, - { 18, 19, 24, 25, 26, 27, 20, 21 }, - { 14, 15, 22, 23, 28, 29, 30, 31 } -}; +static const uint8_t kShuffles[4][8] = {{0, 1, 2, 3, 8, 9, 16, 17}, + {10, 11, 4, 5, 6, 7, 12, 13}, + {18, 19, 24, 25, 26, 27, 20, 21}, + {14, 15, 22, 23, 28, 29, 30, 31}}; static int QuantizeBlock_NEON(int16_t in[16], int16_t out[16], const VP8Matrix* WEBP_RESTRICT const mtx) { @@ -880,37 +870,34 @@ static int QuantizeBlock_NEON(int16_t in[16], int16_t out[16], uint8x8x4_t shuffles; // vtbl?_u8 are marked unavailable for iOS arm64 with Xcode < 6.3, use // non-standard versions there. -#if defined(__APPLE__) && WEBP_AARCH64 && \ - defined(__apple_build_version__) && (__apple_build_version__< 6020037) +#if defined(__APPLE__) && WEBP_AARCH64 && defined(__apple_build_version__) && \ + (__apple_build_version__ < 6020037) uint8x16x2_t all_out; INIT_VECTOR2(all_out, vreinterpretq_u8_s16(out0), vreinterpretq_u8_s16(out1)); - INIT_VECTOR4(shuffles, - vtbl2q_u8(all_out, vld1_u8(kShuffles[0])), + INIT_VECTOR4(shuffles, vtbl2q_u8(all_out, vld1_u8(kShuffles[0])), vtbl2q_u8(all_out, vld1_u8(kShuffles[1])), vtbl2q_u8(all_out, vld1_u8(kShuffles[2])), vtbl2q_u8(all_out, vld1_u8(kShuffles[3]))); #else uint8x8x4_t all_out; - INIT_VECTOR4(all_out, - vreinterpret_u8_s16(vget_low_s16(out0)), + INIT_VECTOR4(all_out, vreinterpret_u8_s16(vget_low_s16(out0)), vreinterpret_u8_s16(vget_high_s16(out0)), vreinterpret_u8_s16(vget_low_s16(out1)), vreinterpret_u8_s16(vget_high_s16(out1))); - INIT_VECTOR4(shuffles, - vtbl4_u8(all_out, vld1_u8(kShuffles[0])), + INIT_VECTOR4(shuffles, vtbl4_u8(all_out, vld1_u8(kShuffles[0])), vtbl4_u8(all_out, vld1_u8(kShuffles[1])), vtbl4_u8(all_out, vld1_u8(kShuffles[2])), vtbl4_u8(all_out, vld1_u8(kShuffles[3]))); #endif // Zigzag reordering - vst1_u8((uint8_t*)(out + 0), shuffles.val[0]); - vst1_u8((uint8_t*)(out + 4), shuffles.val[1]); - vst1_u8((uint8_t*)(out + 8), shuffles.val[2]); + vst1_u8((uint8_t*)(out + 0), shuffles.val[0]); + vst1_u8((uint8_t*)(out + 4), shuffles.val[1]); + vst1_u8((uint8_t*)(out + 8), shuffles.val[2]); vst1_u8((uint8_t*)(out + 12), shuffles.val[3]); // test zeros - if (*(uint64_t*)(out + 0) != 0) return 1; - if (*(uint64_t*)(out + 4) != 0) return 1; - if (*(uint64_t*)(out + 8) != 0) return 1; + if (*(uint64_t*)(out + 0) != 0) return 1; + if (*(uint64_t*)(out + 4) != 0) return 1; + if (*(uint64_t*)(out + 8) != 0) return 1; if (*(uint64_t*)(out + 12) != 0) return 1; return 0; } @@ -918,31 +905,31 @@ static int QuantizeBlock_NEON(int16_t in[16], int16_t out[16], static int Quantize2Blocks_NEON(int16_t in[32], int16_t out[32], const VP8Matrix* WEBP_RESTRICT const mtx) { int nz; - nz = QuantizeBlock_NEON(in + 0 * 16, out + 0 * 16, mtx) << 0; + nz = QuantizeBlock_NEON(in + 0 * 16, out + 0 * 16, mtx) << 0; nz |= QuantizeBlock_NEON(in + 1 * 16, out + 1 * 16, mtx) << 1; return nz; } -#endif // !WORK_AROUND_GCC +#endif // !WORK_AROUND_GCC #if WEBP_AARCH64 #if BPS == 32 -#define DC4_VE4_HE4_TM4_NEON(dst, tbl, res, lane) \ - do { \ - uint8x16_t r; \ - r = vqtbl2q_u8(qcombined, tbl); \ - r = vreinterpretq_u8_u32( \ - vsetq_lane_u32(vget_lane_u32(vreinterpret_u32_u8(res), lane), \ - vreinterpretq_u32_u8(r), 1)); \ - vst1q_u8(dst, r); \ +#define DC4_VE4_HE4_TM4_NEON(dst, tbl, res, lane) \ + do { \ + uint8x16_t r; \ + r = vqtbl2q_u8(qcombined, tbl); \ + r = vreinterpretq_u8_u32( \ + vsetq_lane_u32(vget_lane_u32(vreinterpret_u32_u8(res), lane), \ + vreinterpretq_u32_u8(r), 1)); \ + vst1q_u8(dst, r); \ } while (0) -#define RD4_VR4_LD4_VL4_NEON(dst, tbl) \ - do { \ - uint8x16_t r; \ - r = vqtbl2q_u8(qcombined, tbl); \ - vst1q_u8(dst, r); \ +#define RD4_VR4_LD4_VL4_NEON(dst, tbl) \ + do { \ + uint8x16_t r; \ + r = vqtbl2q_u8(qcombined, tbl); \ + vst1q_u8(dst, r); \ } while (0) static WEBP_INLINE uint8x8x2_t Vld1U8x2(const uint8_t* ptr) { @@ -960,8 +947,7 @@ static WEBP_INLINE uint8x16x4_t Vld1qU8x4(const uint8_t* ptr) { return vld1q_u8_x4(ptr); #else uint8x16x4_t res; - INIT_VECTOR4(res, - vld1q_u8(ptr + 0 * 16), vld1q_u8(ptr + 1 * 16), + INIT_VECTOR4(res, vld1q_u8(ptr + 0 * 16), vld1q_u8(ptr + 1 * 16), vld1q_u8(ptr + 2 * 16), vld1q_u8(ptr + 3 * 16)); return res; #endif @@ -973,25 +959,22 @@ static void Intra4Preds_NEON(uint8_t* WEBP_RESTRICT dst, // L K J I X A B C D E F G H // -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 static const uint8_t kLookupTbl1[64] = { - 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 12, - 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, - 4, 20, 21, 22, 3, 18, 2, 17, 3, 19, 4, 20, 2, 17, 1, 16, - 2, 18, 3, 19, 1, 16, 31, 31, 1, 17, 2, 18, 31, 31, 31, 31 - }; + 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 12, + 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, + 4, 20, 21, 22, 3, 18, 2, 17, 3, 19, 4, 20, 2, 17, 1, 16, + 2, 18, 3, 19, 1, 16, 31, 31, 1, 17, 2, 18, 31, 31, 31, 31}; static const uint8_t kLookupTbl2[64] = { - 20, 21, 22, 23, 5, 6, 7, 8, 22, 23, 24, 25, 6, 7, 8, 9, - 19, 20, 21, 22, 20, 21, 22, 23, 23, 24, 25, 26, 22, 23, 24, 25, - 18, 19, 20, 21, 19, 5, 6, 7, 24, 25, 26, 27, 7, 8, 9, 26, - 17, 18, 19, 20, 18, 20, 21, 22, 25, 26, 27, 28, 23, 24, 25, 27 - }; + 20, 21, 22, 23, 5, 6, 7, 8, 22, 23, 24, 25, 6, 7, 8, 9, + 19, 20, 21, 22, 20, 21, 22, 23, 23, 24, 25, 26, 22, 23, 24, 25, + 18, 19, 20, 21, 19, 5, 6, 7, 24, 25, 26, 27, 7, 8, 9, 26, + 17, 18, 19, 20, 18, 20, 21, 22, 25, 26, 27, 28, 23, 24, 25, 27}; static const uint8_t kLookupTbl3[64] = { - 30, 30, 30, 30, 0, 0, 0, 0, 21, 22, 23, 24, 19, 19, 19, 19, - 30, 30, 30, 30, 0, 0, 0, 0, 21, 22, 23, 24, 18, 18, 18, 18, - 30, 30, 30, 30, 0, 0, 0, 0, 21, 22, 23, 24, 17, 17, 17, 17, - 30, 30, 30, 30, 0, 0, 0, 0, 21, 22, 23, 24, 16, 16, 16, 16 - }; + 30, 30, 30, 30, 0, 0, 0, 0, 21, 22, 23, 24, 19, 19, 19, 19, + 30, 30, 30, 30, 0, 0, 0, 0, 21, 22, 23, 24, 18, 18, 18, 18, + 30, 30, 30, 30, 0, 0, 0, 0, 21, 22, 23, 24, 17, 17, 17, 17, + 30, 30, 30, 30, 0, 0, 0, 0, 21, 22, 23, 24, 16, 16, 16, 16}; const uint8x16x4_t lookup_avgs1 = Vld1qU8x4(kLookupTbl1); const uint8x16x4_t lookup_avgs2 = Vld1qU8x4(kLookupTbl2); @@ -1210,7 +1193,7 @@ static void Intra16Preds_NEON(uint8_t* WEBP_RESTRICT dst, TrueMotion_NEON(I16TM16 + dst, left, top); } -#endif // WEBP_AARCH64 +#endif // WEBP_AARCH64 //------------------------------------------------------------------------------ // Entry point diff --git a/src/dsp/enc_sse2.c b/src/dsp/enc_sse2.c index 6fc04343..e3fb4d47 100644 --- a/src/dsp/enc_sse2.c +++ b/src/dsp/enc_sse2.c @@ -14,9 +14,8 @@ #include "src/dsp/dsp.h" #if defined(WEBP_USE_SSE2) -#include - #include +#include #include // for abs() #include @@ -50,10 +49,10 @@ static void ITransform_One_SSE2(const uint8_t* WEBP_RESTRICT ref, // variable and the multiplication of that variable by the associated // constant: // (x * K) >> 16 = (x * (k + (1 << 16))) >> 16 = ((x * k ) >> 16) + x - const __m128i k1k2 = _mm_set_epi16(-30068, -30068, -30068, -30068, - 20091, 20091, 20091, 20091); - const __m128i k2k1 = _mm_set_epi16(20091, 20091, 20091, 20091, - -30068, -30068, -30068, -30068); + const __m128i k1k2 = + _mm_set_epi16(-30068, -30068, -30068, -30068, 20091, 20091, 20091, 20091); + const __m128i k2k1 = + _mm_set_epi16(20091, 20091, 20091, 20091, -30068, -30068, -30068, -30068); const __m128i zero = _mm_setzero_si128(); const __m128i zero_four = _mm_set_epi16(0, 0, 0, 0, 4, 4, 4, 4); __m128i T01, T23; @@ -172,7 +171,7 @@ static void ITransform_One_SSE2(const uint8_t* WEBP_RESTRICT ref, // Unsigned saturate to 8b. ref0123 = _mm_packus_epi16(ref01, ref23); - _mm_storeu_si128((__m128i *)buf, ref0123); + _mm_storeu_si128((__m128i*)buf, ref0123); // Store four bytes/pixels per line. WebPInt32ToMem(&dst[0 * BPS], buf[0]); @@ -259,8 +258,8 @@ static void ITransform_Two_SSE2(const uint8_t* WEBP_RESTRICT ref, // multiplications. const __m128i four = _mm_set1_epi16(4); const __m128i dc = _mm_add_epi16(T0, four); - const __m128i a = _mm_add_epi16(dc, T2); - const __m128i b = _mm_sub_epi16(dc, T2); + const __m128i a = _mm_add_epi16(dc, T2); + const __m128i b = _mm_sub_epi16(dc, T2); // c = MUL(T1, K2) - MUL(T3, K1) = MUL(T1, k2) - MUL(T3, k1) + T1 - T3 const __m128i c1 = _mm_mulhi_epi16(T1, k2); const __m128i c2 = _mm_mulhi_epi16(T3, k1); @@ -325,8 +324,7 @@ static void ITransform_Two_SSE2(const uint8_t* WEBP_RESTRICT ref, // Does one or two inverse transforms. static void ITransform_SSE2(const uint8_t* WEBP_RESTRICT ref, const int16_t* WEBP_RESTRICT in, - uint8_t* WEBP_RESTRICT dst, - int do_two) { + uint8_t* WEBP_RESTRICT dst, int do_two) { if (do_two) { ITransform_Two_SSE2(ref, in, dst); } else { @@ -336,17 +334,16 @@ static void ITransform_SSE2(const uint8_t* WEBP_RESTRICT ref, static void FTransformPass1_SSE2(const __m128i* const in01, const __m128i* const in23, - __m128i* const out01, - __m128i* const out32) { + __m128i* const out01, __m128i* const out32) { const __m128i k937 = _mm_set1_epi32(937); const __m128i k1812 = _mm_set1_epi32(1812); const __m128i k88p = _mm_set_epi16(8, 8, 8, 8, 8, 8, 8, 8); const __m128i k88m = _mm_set_epi16(-8, 8, -8, 8, -8, 8, -8, 8); - const __m128i k5352_2217p = _mm_set_epi16(2217, 5352, 2217, 5352, - 2217, 5352, 2217, 5352); - const __m128i k5352_2217m = _mm_set_epi16(-5352, 2217, -5352, 2217, - -5352, 2217, -5352, 2217); + const __m128i k5352_2217p = + _mm_set_epi16(2217, 5352, 2217, 5352, 2217, 5352, 2217, 5352); + const __m128i k5352_2217m = + _mm_set_epi16(-5352, 2217, -5352, 2217, -5352, 2217, -5352, 2217); // *in01 = 00 01 10 11 02 03 12 13 // *in23 = 20 21 30 31 22 23 32 33 @@ -363,19 +360,19 @@ static void FTransformPass1_SSE2(const __m128i* const in01, // [d0 + d3 | d1 + d2 | ...] = [a0 a1 | a0' a1' | ... ] // [d0 - d3 | d1 - d2 | ...] = [a3 a2 | a3' a2' | ... ] - const __m128i tmp0 = _mm_madd_epi16(a01, k88p); // [ (a0 + a1) << 3, ... ] - const __m128i tmp2 = _mm_madd_epi16(a01, k88m); // [ (a0 - a1) << 3, ... ] + const __m128i tmp0 = _mm_madd_epi16(a01, k88p); // [ (a0 + a1) << 3, ... ] + const __m128i tmp2 = _mm_madd_epi16(a01, k88m); // [ (a0 - a1) << 3, ... ] const __m128i tmp1_1 = _mm_madd_epi16(a32, k5352_2217p); const __m128i tmp3_1 = _mm_madd_epi16(a32, k5352_2217m); const __m128i tmp1_2 = _mm_add_epi32(tmp1_1, k1812); const __m128i tmp3_2 = _mm_add_epi32(tmp3_1, k937); - const __m128i tmp1 = _mm_srai_epi32(tmp1_2, 9); - const __m128i tmp3 = _mm_srai_epi32(tmp3_2, 9); - const __m128i s03 = _mm_packs_epi32(tmp0, tmp2); - const __m128i s12 = _mm_packs_epi32(tmp1, tmp3); - const __m128i s_lo = _mm_unpacklo_epi16(s03, s12); // 0 1 0 1 0 1... - const __m128i s_hi = _mm_unpackhi_epi16(s03, s12); // 2 3 2 3 2 3 - const __m128i v23 = _mm_unpackhi_epi32(s_lo, s_hi); + const __m128i tmp1 = _mm_srai_epi32(tmp1_2, 9); + const __m128i tmp3 = _mm_srai_epi32(tmp3_2, 9); + const __m128i s03 = _mm_packs_epi32(tmp0, tmp2); + const __m128i s12 = _mm_packs_epi32(tmp1, tmp3); + const __m128i s_lo = _mm_unpacklo_epi16(s03, s12); // 0 1 0 1 0 1... + const __m128i s_hi = _mm_unpackhi_epi16(s03, s12); // 2 3 2 3 2 3 + const __m128i v23 = _mm_unpackhi_epi32(s_lo, s_hi); *out01 = _mm_unpacklo_epi32(s_lo, s_hi); *out32 = _mm_shuffle_epi32(v23, _MM_SHUFFLE(1, 0, 3, 2)); // 3 2 3 2 3 2.. } @@ -385,10 +382,10 @@ static void FTransformPass2_SSE2(const __m128i* const v01, int16_t* WEBP_RESTRICT out) { const __m128i zero = _mm_setzero_si128(); const __m128i seven = _mm_set1_epi16(7); - const __m128i k5352_2217 = _mm_set_epi16(5352, 2217, 5352, 2217, - 5352, 2217, 5352, 2217); - const __m128i k2217_5352 = _mm_set_epi16(2217, -5352, 2217, -5352, - 2217, -5352, 2217, -5352); + const __m128i k5352_2217 = + _mm_set_epi16(5352, 2217, 5352, 2217, 5352, 2217, 5352, 2217); + const __m128i k2217_5352 = + _mm_set_epi16(2217, -5352, 2217, -5352, 2217, -5352, 2217, -5352); const __m128i k12000_plus_one = _mm_set1_epi32(12000 + (1 << 16)); const __m128i k51000 = _mm_set1_epi32(51000); @@ -537,8 +534,8 @@ static void FTransformWHTRow_SSE2(const int16_t* WEBP_RESTRICT const in, const __m128i src3 = _mm_loadl_epi64((__m128i*)&in[3 * 16]); const __m128i A01 = _mm_unpacklo_epi16(src0, src1); // A0 A1 | ... const __m128i A23 = _mm_unpacklo_epi16(src2, src3); // A2 A3 | ... - const __m128i B0 = _mm_adds_epi16(A01, A23); // a0 | a1 | ... - const __m128i B1 = _mm_subs_epi16(A01, A23); // a3 | a2 | ... + const __m128i B0 = _mm_adds_epi16(A01, A23); // a0 | a1 | ... + const __m128i B1 = _mm_subs_epi16(A01, A23); // a3 | a2 | ... const __m128i C0 = _mm_unpacklo_epi32(B0, B1); // a0 | a1 | a3 | a2 | ... const __m128i C1 = _mm_unpacklo_epi32(B1, B0); // a3 | a2 | a0 | a1 | ... const __m128i D = _mm_unpacklo_epi64(C0, C1); // a0 a1 a3 a2 a3 a2 a0 a1 @@ -586,7 +583,7 @@ static void CollectHistogram_SSE2(const uint8_t* WEBP_RESTRICT ref, const __m128i zero = _mm_setzero_si128(); const __m128i max_coeff_thresh = _mm_set1_epi16(MAX_COEFF_THRESH); int j; - int distribution[MAX_COEFF_THRESH + 1] = { 0 }; + int distribution[MAX_COEFF_THRESH + 1] = {0}; for (j = start_block; j < end_block; ++j) { int16_t out[16]; int k; @@ -600,7 +597,7 @@ static void CollectHistogram_SSE2(const uint8_t* WEBP_RESTRICT ref, const __m128i out1 = _mm_loadu_si128((__m128i*)&out[8]); const __m128i d0 = _mm_sub_epi16(zero, out0); const __m128i d1 = _mm_sub_epi16(zero, out1); - const __m128i abs0 = _mm_max_epi16(out0, d0); // abs(v), 16b + const __m128i abs0 = _mm_max_epi16(out0, d0); // abs(v), 16b const __m128i abs1 = _mm_max_epi16(out1, d1); // v = abs(out) >> 3 const __m128i v0 = _mm_srai_epi16(abs0, 3); @@ -927,7 +924,7 @@ static WEBP_INLINE void LD4_SSE2(uint8_t* WEBP_RESTRICT dst, const __m128i lsb = _mm_and_si128(_mm_xor_si128(ABCDEFGH, CDEFGHH0), one); const __m128i avg2 = _mm_subs_epu8(avg1, lsb); const __m128i abcdefg = _mm_avg_epu8(avg2, BCDEFGH0); - WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcdefg )); + WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(abcdefg)); WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1))); WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2))); WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3))); @@ -950,8 +947,8 @@ static WEBP_INLINE void VR4_SSE2(uint8_t* WEBP_RESTRICT dst, const __m128i lsb = _mm_and_si128(_mm_xor_si128(IXABCD, ABCD0), one); const __m128i avg2 = _mm_subs_epu8(avg1, lsb); const __m128i efgh = _mm_avg_epu8(avg2, XABCD); - WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcd )); - WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( efgh )); + WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(abcd)); + WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(efgh)); WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(abcd, 1))); WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(efgh, 1))); @@ -978,8 +975,8 @@ static WEBP_INLINE void VL4_SSE2(uint8_t* WEBP_RESTRICT dst, const __m128i avg4 = _mm_subs_epu8(avg3, lsb2); const uint32_t extra_out = (uint32_t)_mm_cvtsi128_si32(_mm_srli_si128(avg4, 4)); - WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( avg1 )); - WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( avg4 )); + WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(avg1)); + WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(avg4)); WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg1, 1))); WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg4, 1))); @@ -1000,7 +997,7 @@ static WEBP_INLINE void RD4_SSE2(uint8_t* WEBP_RESTRICT dst, const __m128i lsb = _mm_and_si128(_mm_xor_si128(JIXABCD__, LKJIXABCD), one); const __m128i avg2 = _mm_subs_epu8(avg1, lsb); const __m128i abcdefg = _mm_avg_epu8(avg2, KJIXABCD_); - WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32( abcdefg )); + WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(abcdefg)); WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1))); WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2))); WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3))); @@ -1012,14 +1009,13 @@ static WEBP_INLINE void HU4_SSE2(uint8_t* WEBP_RESTRICT dst, const int J = top[-3]; const int K = top[-4]; const int L = top[-5]; - DST(0, 0) = AVG2(I, J); + DST(0, 0) = AVG2(I, J); DST(2, 0) = DST(0, 1) = AVG2(J, K); DST(2, 1) = DST(0, 2) = AVG2(K, L); - DST(1, 0) = AVG3(I, J, K); + DST(1, 0) = AVG3(I, J, K); DST(3, 0) = DST(1, 1) = AVG3(J, K, L); DST(3, 1) = DST(1, 2) = AVG3(K, L, L); - DST(3, 2) = DST(2, 2) = - DST(0, 3) = DST(1, 3) = DST(2, 3) = DST(3, 3) = L; + DST(3, 2) = DST(2, 2) = DST(0, 3) = DST(1, 3) = DST(2, 3) = DST(3, 3) = L; } static WEBP_INLINE void HD4_SSE2(uint8_t* WEBP_RESTRICT dst, @@ -1036,14 +1032,14 @@ static WEBP_INLINE void HD4_SSE2(uint8_t* WEBP_RESTRICT dst, DST(0, 0) = DST(2, 1) = AVG2(I, X); DST(0, 1) = DST(2, 2) = AVG2(J, I); DST(0, 2) = DST(2, 3) = AVG2(K, J); - DST(0, 3) = AVG2(L, K); + DST(0, 3) = AVG2(L, K); - DST(3, 0) = AVG3(A, B, C); - DST(2, 0) = AVG3(X, A, B); + DST(3, 0) = AVG3(A, B, C); + DST(2, 0) = AVG3(X, A, B); DST(1, 0) = DST(3, 1) = AVG3(I, X, A); DST(1, 1) = DST(3, 2) = AVG3(J, I, X); DST(1, 2) = DST(3, 3) = AVG3(K, J, I); - DST(1, 3) = AVG3(L, K, J); + DST(1, 3) = AVG3(L, K, J); } static WEBP_INLINE void TM4_SSE2(uint8_t* WEBP_RESTRICT dst, @@ -1244,11 +1240,11 @@ static void Mean16x4_SSE2(const uint8_t* WEBP_RESTRICT ref, uint32_t dc[4]) { const __m128i a1 = _mm_loadu_si128((const __m128i*)&ref[BPS * 1]); const __m128i a2 = _mm_loadu_si128((const __m128i*)&ref[BPS * 2]); const __m128i a3 = _mm_loadu_si128((const __m128i*)&ref[BPS * 3]); - const __m128i b0 = _mm_srli_epi16(a0, 8); // hi byte + const __m128i b0 = _mm_srli_epi16(a0, 8); // hi byte const __m128i b1 = _mm_srli_epi16(a1, 8); const __m128i b2 = _mm_srli_epi16(a2, 8); const __m128i b3 = _mm_srli_epi16(a3, 8); - const __m128i c0 = _mm_and_si128(a0, mask); // lo byte + const __m128i c0 = _mm_and_si128(a0, mask); // lo byte const __m128i c1 = _mm_and_si128(a1, mask); const __m128i c2 = _mm_and_si128(a2, mask); const __m128i c3 = _mm_and_si128(a3, mask); @@ -1357,7 +1353,7 @@ static int TTransform_SSE2(const uint8_t* WEBP_RESTRICT inA, const __m128i d1 = _mm_sub_epi16(zero, A_b2); const __m128i d2 = _mm_sub_epi16(zero, B_b0); const __m128i d3 = _mm_sub_epi16(zero, B_b2); - A_b0 = _mm_max_epi16(A_b0, d0); // abs(v), 16b + A_b0 = _mm_max_epi16(A_b0, d0); // abs(v), 16b A_b2 = _mm_max_epi16(A_b2, d1); B_b0 = _mm_max_epi16(B_b0, d2); B_b2 = _mm_max_epi16(B_b2, d3); @@ -1494,11 +1490,11 @@ static WEBP_INLINE int DoQuantizeBlock_SSE2( // position instead of twelfth) and 8th values. { __m128i outZ0, outZ8; - outZ0 = _mm_shufflehi_epi16(out0, _MM_SHUFFLE(2, 1, 3, 0)); - outZ0 = _mm_shuffle_epi32 (outZ0, _MM_SHUFFLE(3, 1, 2, 0)); + outZ0 = _mm_shufflehi_epi16(out0, _MM_SHUFFLE(2, 1, 3, 0)); + outZ0 = _mm_shuffle_epi32(outZ0, _MM_SHUFFLE(3, 1, 2, 0)); outZ0 = _mm_shufflehi_epi16(outZ0, _MM_SHUFFLE(3, 1, 0, 2)); - outZ8 = _mm_shufflelo_epi16(out8, _MM_SHUFFLE(3, 0, 2, 1)); - outZ8 = _mm_shuffle_epi32 (outZ8, _MM_SHUFFLE(3, 1, 2, 0)); + outZ8 = _mm_shufflelo_epi16(out8, _MM_SHUFFLE(3, 0, 2, 1)); + outZ8 = _mm_shuffle_epi32(outZ8, _MM_SHUFFLE(3, 1, 2, 0)); outZ8 = _mm_shufflelo_epi16(outZ8, _MM_SHUFFLE(1, 3, 2, 0)); _mm_storeu_si128((__m128i*)&out[0], outZ0); _mm_storeu_si128((__m128i*)&out[8], outZ8); @@ -1529,7 +1525,7 @@ static int Quantize2Blocks_SSE2(int16_t in[32], int16_t out[32], const VP8Matrix* WEBP_RESTRICT const mtx) { int nz; const uint16_t* const sharpen = &mtx->sharpen[0]; - nz = DoQuantizeBlock_SSE2(in + 0 * 16, out + 0 * 16, sharpen, mtx) << 0; + nz = DoQuantizeBlock_SSE2(in + 0 * 16, out + 0 * 16, sharpen, mtx) << 0; nz |= DoQuantizeBlock_SSE2(in + 1 * 16, out + 1 * 16, sharpen, mtx) << 1; return nz; } diff --git a/src/dsp/enc_sse41.c b/src/dsp/enc_sse41.c index 4d73e321..89b1a4a6 100644 --- a/src/dsp/enc_sse41.c +++ b/src/dsp/enc_sse41.c @@ -16,7 +16,6 @@ #if defined(WEBP_USE_SSE41) #include #include - #include // for abs() #include "src/dsp/common_sse2.h" @@ -33,7 +32,7 @@ static void CollectHistogram_SSE41(const uint8_t* WEBP_RESTRICT ref, VP8Histogram* WEBP_RESTRICT const histo) { const __m128i max_coeff_thresh = _mm_set1_epi16(MAX_COEFF_THRESH); int j; - int distribution[MAX_COEFF_THRESH + 1] = { 0 }; + int distribution[MAX_COEFF_THRESH + 1] = {0}; for (j = start_block; j < end_block; ++j) { int16_t out[16]; int k; @@ -198,7 +197,7 @@ static int Disto16x16_SSE41(const uint8_t* WEBP_RESTRICT const a, // // Generates a pshufb constant for shuffling 16b words. -#define PSHUFB_CST(A,B,C,D,E,F,G,H) \ +#define PSHUFB_CST(A, B, C, D, E, F, G, H) \ _mm_set_epi8(2 * (H) + 1, 2 * (H) + 0, 2 * (G) + 1, 2 * (G) + 0, \ 2 * (F) + 1, 2 * (F) + 0, 2 * (E) + 1, 2 * (E) + 0, \ 2 * (D) + 1, 2 * (D) + 0, 2 * (C) + 1, 2 * (C) + 0, \ @@ -321,7 +320,7 @@ static int Quantize2Blocks_SSE41(int16_t in[32], int16_t out[32], const VP8Matrix* WEBP_RESTRICT const mtx) { int nz; const uint16_t* const sharpen = &mtx->sharpen[0]; - nz = DoQuantizeBlock_SSE41(in + 0 * 16, out + 0 * 16, sharpen, mtx) << 0; + nz = DoQuantizeBlock_SSE41(in + 0 * 16, out + 0 * 16, sharpen, mtx) << 0; nz |= DoQuantizeBlock_SSE41(in + 1 * 16, out + 1 * 16, sharpen, mtx) << 1; return nz; } diff --git a/src/dsp/filters.c b/src/dsp/filters.c index 38da5252..65acfb92 100644 --- a/src/dsp/filters.c +++ b/src/dsp/filters.c @@ -22,14 +22,14 @@ //------------------------------------------------------------------------------ // Helpful macro. -#define DCHECK(in, out) \ - do { \ - assert((in) != NULL); \ - assert((out) != NULL); \ - assert((in) != (out)); \ - assert(width > 0); \ - assert(height > 0); \ - assert(stride >= width); \ +#define DCHECK(in, out) \ + do { \ + assert((in) != NULL); \ + assert((out) != NULL); \ + assert((in) != (out)); \ + assert(width > 0); \ + assert(height > 0); \ + assert(stride >= width); \ } while (0) #if !WEBP_NEON_OMIT_C_CODE @@ -124,8 +124,7 @@ static WEBP_INLINE void DoGradientFilter_C(const uint8_t* WEBP_RESTRICT in, // leftmost pixel: predict from above. PredictLine_C(in, preds - stride, out, 1); for (w = 1; w < width; ++w) { - const int pred = GradientPredictor_C(preds[w - 1], - preds[w - stride], + const int pred = GradientPredictor_C(preds[w - 1], preds[w - stride], preds[w - stride - 1]); out[w] = (uint8_t)(in[w] - pred); } @@ -141,20 +140,20 @@ static WEBP_INLINE void DoGradientFilter_C(const uint8_t* WEBP_RESTRICT in, //------------------------------------------------------------------------------ #if !WEBP_NEON_OMIT_C_CODE -static void HorizontalFilter_C(const uint8_t* WEBP_RESTRICT data, - int width, int height, int stride, +static void HorizontalFilter_C(const uint8_t* WEBP_RESTRICT data, int width, + int height, int stride, uint8_t* WEBP_RESTRICT filtered_data) { DoHorizontalFilter_C(data, width, height, stride, filtered_data); } -static void VerticalFilter_C(const uint8_t* WEBP_RESTRICT data, - int width, int height, int stride, +static void VerticalFilter_C(const uint8_t* WEBP_RESTRICT data, int width, + int height, int stride, uint8_t* WEBP_RESTRICT filtered_data) { DoVerticalFilter_C(data, width, height, stride, filtered_data); } -static void GradientFilter_C(const uint8_t* WEBP_RESTRICT data, - int width, int height, int stride, +static void GradientFilter_C(const uint8_t* WEBP_RESTRICT data, int width, + int height, int stride, uint8_t* WEBP_RESTRICT filtered_data) { DoGradientFilter_C(data, width, height, stride, filtered_data); } @@ -162,8 +161,8 @@ static void GradientFilter_C(const uint8_t* WEBP_RESTRICT data, //------------------------------------------------------------------------------ -static void NoneUnfilter_C(const uint8_t* prev, const uint8_t* in, - uint8_t* out, int width) { +static void NoneUnfilter_C(const uint8_t* prev, const uint8_t* in, uint8_t* out, + int width) { (void)prev; if (out != in) memcpy(out, in, width * sizeof(*out)); } diff --git a/src/dsp/filters_mips_dsp_r2.c b/src/dsp/filters_mips_dsp_r2.c index c62bb872..213e9c89 100644 --- a/src/dsp/filters_mips_dsp_r2.c +++ b/src/dsp/filters_mips_dsp_r2.c @@ -16,30 +16,33 @@ #if defined(WEBP_USE_MIPS_DSP_R2) -#include "src/dsp/dsp.h" #include #include #include +#include "src/dsp/dsp.h" + //------------------------------------------------------------------------------ // Helpful macro. -#define DCHECK(in, out) \ - do { \ - assert((in) != NULL); \ - assert((out) != NULL); \ - assert((in) != (out)); \ - assert(width > 0); \ - assert(height > 0); \ - assert(stride >= width); \ +#define DCHECK(in, out) \ + do { \ + assert((in) != NULL); \ + assert((out) != NULL); \ + assert((in) != (out)); \ + assert(width > 0); \ + assert(height > 0); \ + assert(stride >= width); \ } while (0) -#define DO_PREDICT_LINE(SRC, DST, LENGTH, INVERSE) do { \ +// clang-format off +#define DO_PREDICT_LINE(SRC, DST, LENGTH, INVERSE) \ + do { \ const uint8_t* psrc = (uint8_t*)(SRC); \ uint8_t* pdst = (uint8_t*)(DST); \ const int ilength = (int)(LENGTH); \ int temp0, temp1, temp2, temp3, temp4, temp5, temp6; \ - __asm__ volatile ( \ + __asm__ volatile( \ ".set push \n\t" \ ".set noreorder \n\t" \ "srl %[temp0], %[length], 2 \n\t" \ @@ -101,6 +104,7 @@ : "memory" \ ); \ } while (0) +// clang-format on static WEBP_INLINE void PredictLine_MIPSdspR2(const uint8_t* WEBP_RESTRICT src, uint8_t* WEBP_RESTRICT dst, @@ -108,13 +112,15 @@ static WEBP_INLINE void PredictLine_MIPSdspR2(const uint8_t* WEBP_RESTRICT src, DO_PREDICT_LINE(src, dst, length, 0); } -#define DO_PREDICT_LINE_VERTICAL(SRC, PRED, DST, LENGTH, INVERSE) do { \ +// clang-format off +#define DO_PREDICT_LINE_VERTICAL(SRC, PRED, DST, LENGTH, INVERSE) \ + do { \ const uint8_t* psrc = (uint8_t*)(SRC); \ const uint8_t* ppred = (uint8_t*)(PRED); \ uint8_t* pdst = (uint8_t*)(DST); \ const int ilength = (int)(LENGTH); \ int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7; \ - __asm__ volatile ( \ + __asm__ volatile( \ ".set push \n\t" \ ".set noreorder \n\t" \ "srl %[temp0], %[length], 0x3 \n\t" \ @@ -167,9 +173,10 @@ static WEBP_INLINE void PredictLine_MIPSdspR2(const uint8_t* WEBP_RESTRICT src, ); \ } while (0) -#define PREDICT_LINE_ONE_PASS(SRC, PRED, DST) do { \ +#define PREDICT_LINE_ONE_PASS(SRC, PRED, DST) \ + do { \ int temp1, temp2, temp3; \ - __asm__ volatile ( \ + __asm__ volatile( \ "lbu %[temp1], 0(%[src]) \n\t" \ "lbu %[temp2], 0(%[pred]) \n\t" \ "subu %[temp3], %[temp1], %[temp2] \n\t" \ @@ -179,18 +186,20 @@ static WEBP_INLINE void PredictLine_MIPSdspR2(const uint8_t* WEBP_RESTRICT src, : "memory" \ ); \ } while (0) +// clang-format on //------------------------------------------------------------------------------ // Horizontal filter. -#define FILTER_LINE_BY_LINE do { \ - for (row = 1; row < height; ++row) { \ - PREDICT_LINE_ONE_PASS(in, preds - stride, out); \ - DO_PREDICT_LINE(in + 1, out + 1, width - 1, 0); \ - preds += stride; \ - in += stride; \ - out += stride; \ - } \ +#define FILTER_LINE_BY_LINE \ + do { \ + for (row = 1; row < height; ++row) { \ + PREDICT_LINE_ONE_PASS(in, preds - stride, out); \ + DO_PREDICT_LINE(in + 1, out + 1, width - 1, 0); \ + preds += stride; \ + in += stride; \ + out += stride; \ + } \ } while (0) static WEBP_INLINE void DoHorizontalFilter_MIPSdspR2( @@ -221,13 +230,14 @@ static void HorizontalFilter_MIPSdspR2(const uint8_t* WEBP_RESTRICT data, //------------------------------------------------------------------------------ // Vertical filter. -#define FILTER_LINE_BY_LINE do { \ - for (row = 1; row < height; ++row) { \ - DO_PREDICT_LINE_VERTICAL(in, preds, out, width, 0); \ - preds += stride; \ - in += stride; \ - out += stride; \ - } \ +#define FILTER_LINE_BY_LINE \ + do { \ + for (row = 1; row < height; ++row) { \ + DO_PREDICT_LINE_VERTICAL(in, preds, out, width, 0); \ + preds += stride; \ + in += stride; \ + out += stride; \ + } \ } while (0) static WEBP_INLINE void DoVerticalFilter_MIPSdspR2( @@ -260,31 +270,30 @@ static void VerticalFilter_MIPSdspR2(const uint8_t* WEBP_RESTRICT data, static int GradientPredictor_MIPSdspR2(uint8_t a, uint8_t b, uint8_t c) { int temp0; - __asm__ volatile ( - "addu %[temp0], %[a], %[b] \n\t" - "subu %[temp0], %[temp0], %[c] \n\t" - "shll_s.w %[temp0], %[temp0], 23 \n\t" - "precrqu_s.qb.ph %[temp0], %[temp0], $zero \n\t" - "srl %[temp0], %[temp0], 24 \n\t" - : [temp0]"=&r"(temp0) - : [a]"r"(a),[b]"r"(b),[c]"r"(c) - ); + __asm__ volatile( + "addu %[temp0], %[a], %[b] \n\t" + "subu %[temp0], %[temp0], %[c] \n\t" + "shll_s.w %[temp0], %[temp0], 23 \n\t" + "precrqu_s.qb.ph %[temp0], %[temp0], $zero \n\t" + "srl %[temp0], %[temp0], 24 \n\t" + : [temp0] "=&r"(temp0) + : [a] "r"(a), [b] "r"(b), [c] "r"(c)); return temp0; } -#define FILTER_LINE_BY_LINE(PREDS, OPERATION) do { \ - for (row = 1; row < height; ++row) { \ - int w; \ - PREDICT_LINE_ONE_PASS(in, PREDS - stride, out); \ - for (w = 1; w < width; ++w) { \ - const int pred = GradientPredictor_MIPSdspR2(PREDS[w - 1], \ - PREDS[w - stride], \ - PREDS[w - stride - 1]); \ - out[w] = in[w] OPERATION pred; \ - } \ - in += stride; \ - out += stride; \ - } \ +#define FILTER_LINE_BY_LINE(PREDS, OPERATION) \ + do { \ + for (row = 1; row < height; ++row) { \ + int w; \ + PREDICT_LINE_ONE_PASS(in, PREDS - stride, out); \ + for (w = 1; w < width; ++w) { \ + const int pred = GradientPredictor_MIPSdspR2( \ + PREDS[w - 1], PREDS[w - stride], PREDS[w - stride - 1]); \ + out[w] = in[w] OPERATION pred; \ + } \ + in += stride; \ + out += stride; \ + } \ } while (0) static void DoGradientFilter_MIPSdspR2(const uint8_t* WEBP_RESTRICT in, @@ -316,8 +325,8 @@ static void GradientFilter_MIPSdspR2(const uint8_t* WEBP_RESTRICT data, static void HorizontalUnfilter_MIPSdspR2(const uint8_t* prev, const uint8_t* in, uint8_t* out, int width) { - out[0] = in[0] + (prev == NULL ? 0 : prev[0]); - DO_PREDICT_LINE(in + 1, out + 1, width - 1, 1); + out[0] = in[0] + (prev == NULL ? 0 : prev[0]); + DO_PREDICT_LINE(in + 1, out + 1, width - 1, 1); } static void VerticalUnfilter_MIPSdspR2(const uint8_t* prev, const uint8_t* in, diff --git a/src/dsp/filters_msa.c b/src/dsp/filters_msa.c index ae3d3699..f6d34cb6 100644 --- a/src/dsp/filters_msa.c +++ b/src/dsp/filters_msa.c @@ -15,10 +15,10 @@ #if defined(WEBP_USE_MSA) -#include "src/dsp/msa_macro.h" - #include +#include "src/dsp/msa_macro.h" + static WEBP_INLINE void PredictLineInverse0(const uint8_t* src, const uint8_t* pred, uint8_t* WEBP_RESTRICT dst, @@ -57,21 +57,21 @@ static WEBP_INLINE void PredictLineInverse0(const uint8_t* src, //------------------------------------------------------------------------------ // Helpful macro. -#define DCHECK(in, out) \ - do { \ - assert((in) != NULL); \ - assert((out) != NULL); \ - assert((in) != (out)); \ - assert(width > 0); \ - assert(height > 0); \ - assert(stride >= width); \ +#define DCHECK(in, out) \ + do { \ + assert((in) != NULL); \ + assert((out) != NULL); \ + assert((in) != (out)); \ + assert(width > 0); \ + assert(height > 0); \ + assert(stride >= width); \ } while (0) //------------------------------------------------------------------------------ // Horrizontal filter -static void HorizontalFilter_MSA(const uint8_t* WEBP_RESTRICT data, - int width, int height, int stride, +static void HorizontalFilter_MSA(const uint8_t* WEBP_RESTRICT data, int width, + int height, int stride, uint8_t* WEBP_RESTRICT filtered_data) { const uint8_t* preds = data; const uint8_t* in = data; @@ -105,7 +105,7 @@ static WEBP_INLINE void PredictLineGradient(const uint8_t* pinput, uint8_t* WEBP_RESTRICT poutput, int stride, int size) { int w; - const v16i8 zero = { 0 }; + const v16i8 zero = {0}; while (size >= 16) { v16u8 pred0, dst0; v8i16 a0, a1, b0, b1, c0, c1; @@ -133,9 +133,8 @@ static WEBP_INLINE void PredictLineGradient(const uint8_t* pinput, } } - -static void GradientFilter_MSA(const uint8_t* WEBP_RESTRICT data, - int width, int height, int stride, +static void GradientFilter_MSA(const uint8_t* WEBP_RESTRICT data, int width, + int height, int stride, uint8_t* WEBP_RESTRICT filtered_data) { const uint8_t* in = data; const uint8_t* preds = data; @@ -151,7 +150,7 @@ static void GradientFilter_MSA(const uint8_t* WEBP_RESTRICT data, out += stride; // Filter line-by-line. while (row < height) { - out[0] = in[0] - preds[- stride]; + out[0] = in[0] - preds[-stride]; PredictLineGradient(preds + 1, in + 1, out + 1, stride, width - 1); ++row; preds += stride; @@ -163,8 +162,8 @@ static void GradientFilter_MSA(const uint8_t* WEBP_RESTRICT data, //------------------------------------------------------------------------------ // Vertical filter -static void VerticalFilter_MSA(const uint8_t* WEBP_RESTRICT data, - int width, int height, int stride, +static void VerticalFilter_MSA(const uint8_t* WEBP_RESTRICT data, int width, + int height, int stride, uint8_t* WEBP_RESTRICT filtered_data) { const uint8_t* in = data; const uint8_t* preds = data; diff --git a/src/dsp/filters_neon.c b/src/dsp/filters_neon.c index 4df10172..64a2296f 100644 --- a/src/dsp/filters_neon.c +++ b/src/dsp/filters_neon.c @@ -16,19 +16,20 @@ #if defined(WEBP_USE_NEON) #include + #include "src/dsp/neon.h" //------------------------------------------------------------------------------ // Helpful macros. -#define DCHECK(in, out) \ - do { \ - assert((in) != NULL); \ - assert((out) != NULL); \ - assert((in) != (out)); \ - assert(width > 0); \ - assert(height > 0); \ - assert(stride >= width); \ +#define DCHECK(in, out) \ + do { \ + assert((in) != NULL); \ + assert((out) != NULL); \ + assert((in) != (out)); \ + assert(width > 0); \ + assert(height > 0); \ + assert(stride >= width); \ } while (0) // load eight u8 and widen to s16 @@ -40,9 +41,9 @@ #define SHIFT_LEFT_N_Q(A, N) vextq_u8(zero, (A), (16 - (N)) % 16) // rotate left by N bytes -#define ROTATE_LEFT_N(A, N) vext_u8((A), (A), (N)) +#define ROTATE_LEFT_N(A, N) vext_u8((A), (A), (N)) // rotate right by N bytes -#define ROTATE_RIGHT_N(A, N) vext_u8((A), (A), (8 - (N)) % 8) +#define ROTATE_RIGHT_N(A, N) vext_u8((A), (A), (8 - (N)) % 8) static void PredictLine_NEON(const uint8_t* src, const uint8_t* pred, uint8_t* WEBP_RESTRICT dst, int length) { @@ -66,9 +67,10 @@ static void PredictLineLeft_NEON(const uint8_t* WEBP_RESTRICT src, //------------------------------------------------------------------------------ // Horizontal filter. -static WEBP_INLINE void DoHorizontalFilter_NEON( - const uint8_t* WEBP_RESTRICT in, int width, int height, int stride, - uint8_t* WEBP_RESTRICT out) { +static WEBP_INLINE void DoHorizontalFilter_NEON(const uint8_t* WEBP_RESTRICT in, + int width, int height, + int stride, + uint8_t* WEBP_RESTRICT out) { int row; DCHECK(in, out); @@ -88,8 +90,8 @@ static WEBP_INLINE void DoHorizontalFilter_NEON( } } -static void HorizontalFilter_NEON(const uint8_t* WEBP_RESTRICT data, - int width, int height, int stride, +static void HorizontalFilter_NEON(const uint8_t* WEBP_RESTRICT data, int width, + int height, int stride, uint8_t* WEBP_RESTRICT filtered_data) { DoHorizontalFilter_NEON(data, width, height, stride, filtered_data); } @@ -118,8 +120,8 @@ static WEBP_INLINE void DoVerticalFilter_NEON(const uint8_t* WEBP_RESTRICT in, } } -static void VerticalFilter_NEON(const uint8_t* WEBP_RESTRICT data, - int width, int height, int stride, +static void VerticalFilter_NEON(const uint8_t* WEBP_RESTRICT data, int width, + int height, int stride, uint8_t* WEBP_RESTRICT filtered_data) { DoVerticalFilter_NEON(data, width, height, stride, filtered_data); } @@ -172,8 +174,8 @@ static WEBP_INLINE void DoGradientFilter_NEON(const uint8_t* WEBP_RESTRICT in, } } -static void GradientFilter_NEON(const uint8_t* WEBP_RESTRICT data, - int width, int height, int stride, +static void GradientFilter_NEON(const uint8_t* WEBP_RESTRICT data, int width, + int height, int stride, uint8_t* WEBP_RESTRICT filtered_data) { DoGradientFilter_NEON(data, width, height, stride, filtered_data); } @@ -229,24 +231,25 @@ static void VerticalUnfilter_NEON(const uint8_t* prev, const uint8_t* in, // at least on ARM64. For armv7, it's a wash. // So best is to disable it for now, but keep the idea around... #if !defined(USE_GRADIENT_UNFILTER) -#define USE_GRADIENT_UNFILTER 0 // ALTERNATE_CODE +#define USE_GRADIENT_UNFILTER 0 // ALTERNATE_CODE #endif #if (USE_GRADIENT_UNFILTER == 1) -#define GRAD_PROCESS_LANE(L) do { \ - const uint8x8_t tmp1 = ROTATE_RIGHT_N(pred, 1); /* rotate predictor in */ \ - const int16x8_t tmp2 = vaddq_s16(BC, U8_TO_S16(tmp1)); \ - const uint8x8_t delta = vqmovun_s16(tmp2); \ - pred = vadd_u8(D, delta); \ - out = vext_u8(out, ROTATE_LEFT_N(pred, (L)), 1); \ -} while (0) +#define GRAD_PROCESS_LANE(L) \ + do { \ + const uint8x8_t tmp1 = ROTATE_RIGHT_N(pred, 1); /* rotate predictor in */ \ + const int16x8_t tmp2 = vaddq_s16(BC, U8_TO_S16(tmp1)); \ + const uint8x8_t delta = vqmovun_s16(tmp2); \ + pred = vadd_u8(D, delta); \ + out = vext_u8(out, ROTATE_LEFT_N(pred, (L)), 1); \ + } while (0) static void GradientPredictInverse_NEON(const uint8_t* const in, const uint8_t* const top, uint8_t* const row, int length) { if (length > 0) { int i; - uint8x8_t pred = vdup_n_u8(row[-1]); // left sample + uint8x8_t pred = vdup_n_u8(row[-1]); // left sample uint8x8_t out = vdup_n_u8(0); for (i = 0; i + 8 <= length; i += 8) { const int16x8_t B = LOAD_U8_TO_S16(&top[i + 0]); @@ -280,7 +283,7 @@ static void GradientUnfilter_NEON(const uint8_t* prev, const uint8_t* in, } } -#endif // USE_GRADIENT_UNFILTER +#endif // USE_GRADIENT_UNFILTER //------------------------------------------------------------------------------ // Entry point diff --git a/src/dsp/filters_sse2.c b/src/dsp/filters_sse2.c index b9a7aefd..a410d68c 100644 --- a/src/dsp/filters_sse2.c +++ b/src/dsp/filters_sse2.c @@ -26,14 +26,14 @@ //------------------------------------------------------------------------------ // Helpful macro. -#define DCHECK(in, out) \ - do { \ - assert((in) != NULL); \ - assert((out) != NULL); \ - assert((in) != (out)); \ - assert(width > 0); \ - assert(height > 0); \ - assert(stride >= width); \ +#define DCHECK(in, out) \ + do { \ + assert((in) != NULL); \ + assert((out) != NULL); \ + assert((in) != (out)); \ + assert(width > 0); \ + assert(height > 0); \ + assert(stride >= width); \ } while (0) static void PredictLineTop_SSE2(const uint8_t* WEBP_RESTRICT src, @@ -43,13 +43,13 @@ static void PredictLineTop_SSE2(const uint8_t* WEBP_RESTRICT src, const int max_pos = length & ~31; assert(length >= 0); for (i = 0; i < max_pos; i += 32) { - const __m128i A0 = _mm_loadu_si128((const __m128i*)&src[i + 0]); + const __m128i A0 = _mm_loadu_si128((const __m128i*)&src[i + 0]); const __m128i A1 = _mm_loadu_si128((const __m128i*)&src[i + 16]); - const __m128i B0 = _mm_loadu_si128((const __m128i*)&pred[i + 0]); + const __m128i B0 = _mm_loadu_si128((const __m128i*)&pred[i + 0]); const __m128i B1 = _mm_loadu_si128((const __m128i*)&pred[i + 16]); const __m128i C0 = _mm_sub_epi8(A0, B0); const __m128i C1 = _mm_sub_epi8(A1, B1); - _mm_storeu_si128((__m128i*)&dst[i + 0], C0); + _mm_storeu_si128((__m128i*)&dst[i + 0], C0); _mm_storeu_si128((__m128i*)&dst[i + 16], C1); } for (; i < length; ++i) dst[i] = src[i] - pred[i]; @@ -62,13 +62,13 @@ static void PredictLineLeft_SSE2(const uint8_t* WEBP_RESTRICT src, const int max_pos = length & ~31; assert(length >= 0); for (i = 0; i < max_pos; i += 32) { - const __m128i A0 = _mm_loadu_si128((const __m128i*)(src + i + 0 )); - const __m128i B0 = _mm_loadu_si128((const __m128i*)(src + i + 0 - 1)); - const __m128i A1 = _mm_loadu_si128((const __m128i*)(src + i + 16 )); + const __m128i A0 = _mm_loadu_si128((const __m128i*)(src + i + 0)); + const __m128i B0 = _mm_loadu_si128((const __m128i*)(src + i + 0 - 1)); + const __m128i A1 = _mm_loadu_si128((const __m128i*)(src + i + 16)); const __m128i B1 = _mm_loadu_si128((const __m128i*)(src + i + 16 - 1)); const __m128i C0 = _mm_sub_epi8(A0, B0); const __m128i C1 = _mm_sub_epi8(A1, B1); - _mm_storeu_si128((__m128i*)(dst + i + 0), C0); + _mm_storeu_si128((__m128i*)(dst + i + 0), C0); _mm_storeu_si128((__m128i*)(dst + i + 16), C1); } for (; i < length; ++i) dst[i] = src[i] - src[i - 1]; @@ -77,9 +77,10 @@ static void PredictLineLeft_SSE2(const uint8_t* WEBP_RESTRICT src, //------------------------------------------------------------------------------ // Horizontal filter. -static WEBP_INLINE void DoHorizontalFilter_SSE2( - const uint8_t* WEBP_RESTRICT in, int width, int height, int stride, - uint8_t* WEBP_RESTRICT out) { +static WEBP_INLINE void DoHorizontalFilter_SSE2(const uint8_t* WEBP_RESTRICT in, + int width, int height, + int stride, + uint8_t* WEBP_RESTRICT out) { int row; DCHECK(in, out); @@ -183,20 +184,20 @@ static WEBP_INLINE void DoGradientFilter_SSE2(const uint8_t* WEBP_RESTRICT in, //------------------------------------------------------------------------------ -static void HorizontalFilter_SSE2(const uint8_t* WEBP_RESTRICT data, - int width, int height, int stride, +static void HorizontalFilter_SSE2(const uint8_t* WEBP_RESTRICT data, int width, + int height, int stride, uint8_t* WEBP_RESTRICT filtered_data) { DoHorizontalFilter_SSE2(data, width, height, stride, filtered_data); } -static void VerticalFilter_SSE2(const uint8_t* WEBP_RESTRICT data, - int width, int height, int stride, +static void VerticalFilter_SSE2(const uint8_t* WEBP_RESTRICT data, int width, + int height, int stride, uint8_t* WEBP_RESTRICT filtered_data) { DoVerticalFilter_SSE2(data, width, height, stride, filtered_data); } -static void GradientFilter_SSE2(const uint8_t* WEBP_RESTRICT data, - int width, int height, int stride, +static void GradientFilter_SSE2(const uint8_t* WEBP_RESTRICT data, int width, + int height, int stride, uint8_t* WEBP_RESTRICT filtered_data) { DoGradientFilter_SSE2(data, width, height, stride, filtered_data); } @@ -235,13 +236,13 @@ static void VerticalUnfilter_SSE2(const uint8_t* prev, const uint8_t* in, const int max_pos = width & ~31; assert(width >= 0); for (i = 0; i < max_pos; i += 32) { - const __m128i A0 = _mm_loadu_si128((const __m128i*)&in[i + 0]); + const __m128i A0 = _mm_loadu_si128((const __m128i*)&in[i + 0]); const __m128i A1 = _mm_loadu_si128((const __m128i*)&in[i + 16]); - const __m128i B0 = _mm_loadu_si128((const __m128i*)&prev[i + 0]); + const __m128i B0 = _mm_loadu_si128((const __m128i*)&prev[i + 0]); const __m128i B1 = _mm_loadu_si128((const __m128i*)&prev[i + 16]); const __m128i C0 = _mm_add_epi8(A0, B0); const __m128i C1 = _mm_add_epi8(A1, B1); - _mm_storeu_si128((__m128i*)&out[i + 0], C0); + _mm_storeu_si128((__m128i*)&out[i + 0], C0); _mm_storeu_si128((__m128i*)&out[i + 16], C1); } for (; i < width; ++i) out[i] = (uint8_t)(in[i] + prev[i]); @@ -255,7 +256,7 @@ static void GradientPredictInverse_SSE2(const uint8_t* const in, int i; const int max_pos = length & ~7; const __m128i zero = _mm_setzero_si128(); - __m128i A = _mm_set_epi32(0, 0, 0, row[-1]); // left sample + __m128i A = _mm_set_epi32(0, 0, 0, row[-1]); // left sample for (i = 0; i < max_pos; i += 8) { const __m128i tmp0 = _mm_loadl_epi64((const __m128i*)&top[i]); const __m128i tmp1 = _mm_loadl_epi64((const __m128i*)&top[i - 1]); @@ -273,11 +274,11 @@ static void GradientPredictInverse_SSE2(const uint8_t* const in, A = _mm_and_si128(tmp5, mask_hi); // 1-complement clip out = _mm_or_si128(out, A); // accumulate output if (--k == 0) break; - A = _mm_slli_si128(A, 1); // rotate left sample - mask_hi = _mm_slli_si128(mask_hi, 1); // rotate mask - A = _mm_unpacklo_epi8(A, zero); // convert 8b->16b + A = _mm_slli_si128(A, 1); // rotate left sample + mask_hi = _mm_slli_si128(mask_hi, 1); // rotate mask + A = _mm_unpacklo_epi8(A, zero); // convert 8b->16b } - A = _mm_srli_si128(A, 7); // prepare left sample for next iteration + A = _mm_srli_si128(A, 7); // prepare left sample for next iteration _mm_storel_epi64((__m128i*)&row[i], out); } for (; i < length; ++i) { diff --git a/src/dsp/lossless.c b/src/dsp/lossless.c index 1a3d800c..1780bd2b 100644 --- a/src/dsp/lossless.c +++ b/src/dsp/lossless.c @@ -40,8 +40,8 @@ static WEBP_INLINE uint32_t Average3(uint32_t a0, uint32_t a1, uint32_t a2) { return Average2(Average2(a0, a2), a1); } -static WEBP_INLINE uint32_t Average4(uint32_t a0, uint32_t a1, - uint32_t a2, uint32_t a3) { +static WEBP_INLINE uint32_t Average4(uint32_t a0, uint32_t a1, uint32_t a2, + uint32_t a3) { return Average2(Average2(a0, a1), Average2(a2, a3)); } @@ -61,11 +61,9 @@ static WEBP_INLINE int AddSubtractComponentFull(int a, int b, int c) { static WEBP_INLINE uint32_t ClampedAddSubtractFull(uint32_t c0, uint32_t c1, uint32_t c2) { const int a = AddSubtractComponentFull(c0 >> 24, c1 >> 24, c2 >> 24); - const int r = AddSubtractComponentFull((c0 >> 16) & 0xff, - (c1 >> 16) & 0xff, + const int r = AddSubtractComponentFull((c0 >> 16) & 0xff, (c1 >> 16) & 0xff, (c2 >> 16) & 0xff); - const int g = AddSubtractComponentFull((c0 >> 8) & 0xff, - (c1 >> 8) & 0xff, + const int g = AddSubtractComponentFull((c0 >> 8) & 0xff, (c1 >> 8) & 0xff, (c2 >> 8) & 0xff); const int b = AddSubtractComponentFull(c0 & 0xff, c1 & 0xff, c2 & 0xff); return ((uint32_t)a << 24) | (r << 16) | (g << 8) | b; @@ -88,9 +86,9 @@ static WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1, // gcc <= 4.9 on ARM generates incorrect code in Select() when Sub3() is // inlined. #if defined(__arm__) && defined(__GNUC__) && LOCAL_GCC_VERSION <= 0x409 -# define LOCAL_INLINE __attribute__ ((noinline)) +#define LOCAL_INLINE __attribute__((noinline)) #else -# define LOCAL_INLINE WEBP_INLINE +#define LOCAL_INLINE WEBP_INLINE #endif static LOCAL_INLINE int Sub3(int a, int b, int c) { @@ -103,10 +101,10 @@ static LOCAL_INLINE int Sub3(int a, int b, int c) { static WEBP_INLINE uint32_t Select(uint32_t a, uint32_t b, uint32_t c) { const int pa_minus_pb = - Sub3((a >> 24) , (b >> 24) , (c >> 24) ) + + Sub3((a >> 24), (b >> 24), (c >> 24)) + Sub3((a >> 16) & 0xff, (b >> 16) & 0xff, (c >> 16) & 0xff) + - Sub3((a >> 8) & 0xff, (b >> 8) & 0xff, (c >> 8) & 0xff) + - Sub3((a ) & 0xff, (b ) & 0xff, (c ) & 0xff); + Sub3((a >> 8) & 0xff, (b >> 8) & 0xff, (c >> 8) & 0xff) + + Sub3((a) & 0xff, (b) & 0xff, (c) & 0xff); return (pa_minus_pb <= 0) ? a : b; } @@ -255,7 +253,7 @@ static void PredictorInverseTransform_C(const VP8LTransform* const transform, in += width; out += width; ++y; - if ((y & mask) == 0) { // Use the same mask, since tiles are squares. + if ((y & mask) == 0) { // Use the same mask, since tiles are squares. pred_mode_base += tiles_per_row; } } @@ -277,16 +275,15 @@ void VP8LAddGreenToBlueAndRed_C(const uint32_t* src, int num_pixels, } } -static WEBP_INLINE int ColorTransformDelta(int8_t color_pred, - int8_t color) { +static WEBP_INLINE int ColorTransformDelta(int8_t color_pred, int8_t color) { return ((int)color_pred * color) >> 5; } static WEBP_INLINE void ColorCodeToMultipliers(uint32_t color_code, VP8LMultipliers* const m) { - m->green_to_red = (color_code >> 0) & 0xff; - m->green_to_blue = (color_code >> 8) & 0xff; - m->red_to_blue = (color_code >> 16) & 0xff; + m->green_to_red = (color_code >> 0) & 0xff; + m->green_to_blue = (color_code >> 8) & 0xff; + m->red_to_blue = (color_code >> 16) & 0xff; } void VP8LTransformColorInverse_C(const VP8LMultipliers* const m, @@ -324,7 +321,7 @@ static void ColorSpaceInverseTransform_C(const VP8LTransform* const transform, while (y < y_end) { const uint32_t* pred = pred_row; - VP8LMultipliers m = { 0, 0, 0 }; + VP8LMultipliers m = {0, 0, 0}; const uint32_t* const src_safe_end = src + safe_width; const uint32_t* const src_end = src + width; while (src < src_safe_end) { @@ -346,6 +343,7 @@ static void ColorSpaceInverseTransform_C(const VP8LTransform* const transform, // Separate out pixels packed together using pixel-bundling. // We define two methods for ARGB data (uint32_t) and alpha-only data (uint8_t). +// clang-format off #define COLOR_INDEX_INVERSE(FUNC_NAME, F_NAME, STATIC_DECL, TYPE, BIT_SUFFIX, \ GET_INDEX, GET_VALUE) \ static void F_NAME(const TYPE* src, const uint32_t* const color_map, \ @@ -386,17 +384,18 @@ STATIC_DECL void FUNC_NAME(const VP8LTransform* const transform, \ VP8LMapColor##BIT_SUFFIX(src, color_map, dst, y_start, y_end, width); \ } \ } +// clang-format on -COLOR_INDEX_INVERSE(ColorIndexInverseTransform_C, MapARGB_C, static, - uint32_t, 32b, VP8GetARGBIndex, VP8GetARGBValue) -COLOR_INDEX_INVERSE(VP8LColorIndexInverseTransformAlpha, MapAlpha_C, , - uint8_t, 8b, VP8GetAlphaIndex, VP8GetAlphaValue) +COLOR_INDEX_INVERSE(ColorIndexInverseTransform_C, MapARGB_C, static, uint32_t, + 32b, VP8GetARGBIndex, VP8GetARGBValue) +COLOR_INDEX_INVERSE(VP8LColorIndexInverseTransformAlpha, MapAlpha_C, , uint8_t, + 8b, VP8GetAlphaIndex, VP8GetAlphaValue) #undef COLOR_INDEX_INVERSE -void VP8LInverseTransform(const VP8LTransform* const transform, - int row_start, int row_end, - const uint32_t* const in, uint32_t* const out) { +void VP8LInverseTransform(const VP8LTransform* const transform, int row_start, + int row_end, const uint32_t* const in, + uint32_t* const out) { const int width = transform->xsize; assert(row_start < row_end); assert(row_end <= transform->ysize); @@ -424,7 +423,8 @@ void VP8LInverseTransform(const VP8LTransform* const transform, // the effective width of VP8LSubSampleSize(xsize, bits). All other // transforms work on effective width of 'xsize'. const int out_stride = (row_end - row_start) * width; - const int in_stride = (row_end - row_start) * + const int in_stride = + (row_end - row_start) * VP8LSubSampleSize(transform->xsize, transform->bits); uint32_t* const src = out + out_stride - in_stride; memmove(src, out, in_stride * sizeof(*src)); @@ -443,29 +443,29 @@ static int is_big_endian(void) { static const union { uint16_t w; uint8_t b[2]; - } tmp = { 1 }; + } tmp = {1}; return (tmp.b[0] != 1); } -void VP8LConvertBGRAToRGB_C(const uint32_t* WEBP_RESTRICT src, - int num_pixels, uint8_t* WEBP_RESTRICT dst) { +void VP8LConvertBGRAToRGB_C(const uint32_t* WEBP_RESTRICT src, int num_pixels, + uint8_t* WEBP_RESTRICT dst) { const uint32_t* const src_end = src + num_pixels; while (src < src_end) { const uint32_t argb = *src++; *dst++ = (argb >> 16) & 0xff; - *dst++ = (argb >> 8) & 0xff; - *dst++ = (argb >> 0) & 0xff; + *dst++ = (argb >> 8) & 0xff; + *dst++ = (argb >> 0) & 0xff; } } -void VP8LConvertBGRAToRGBA_C(const uint32_t* WEBP_RESTRICT src, - int num_pixels, uint8_t* WEBP_RESTRICT dst) { +void VP8LConvertBGRAToRGBA_C(const uint32_t* WEBP_RESTRICT src, int num_pixels, + uint8_t* WEBP_RESTRICT dst) { const uint32_t* const src_end = src + num_pixels; while (src < src_end) { const uint32_t argb = *src++; *dst++ = (argb >> 16) & 0xff; - *dst++ = (argb >> 8) & 0xff; - *dst++ = (argb >> 0) & 0xff; + *dst++ = (argb >> 8) & 0xff; + *dst++ = (argb >> 0) & 0xff; *dst++ = (argb >> 24) & 0xff; } } @@ -476,7 +476,7 @@ void VP8LConvertBGRAToRGBA4444_C(const uint32_t* WEBP_RESTRICT src, while (src < src_end) { const uint32_t argb = *src++; const uint8_t rg = ((argb >> 16) & 0xf0) | ((argb >> 12) & 0xf); - const uint8_t ba = ((argb >> 0) & 0xf0) | ((argb >> 28) & 0xf); + const uint8_t ba = ((argb >> 0) & 0xf0) | ((argb >> 28) & 0xf); #if (WEBP_SWAP_16BIT_CSP == 1) *dst++ = ba; *dst++ = rg; @@ -493,7 +493,7 @@ void VP8LConvertBGRAToRGB565_C(const uint32_t* WEBP_RESTRICT src, while (src < src_end) { const uint32_t argb = *src++; const uint8_t rg = ((argb >> 16) & 0xf8) | ((argb >> 13) & 0x7); - const uint8_t gb = ((argb >> 5) & 0xe0) | ((argb >> 3) & 0x1f); + const uint8_t gb = ((argb >> 5) & 0xe0) | ((argb >> 3) & 0x1f); #if (WEBP_SWAP_16BIT_CSP == 1) *dst++ = gb; *dst++ = rg; @@ -504,13 +504,13 @@ void VP8LConvertBGRAToRGB565_C(const uint32_t* WEBP_RESTRICT src, } } -void VP8LConvertBGRAToBGR_C(const uint32_t* WEBP_RESTRICT src, - int num_pixels, uint8_t* WEBP_RESTRICT dst) { +void VP8LConvertBGRAToBGR_C(const uint32_t* WEBP_RESTRICT src, int num_pixels, + uint8_t* WEBP_RESTRICT dst) { const uint32_t* const src_end = src + num_pixels; while (src < src_end) { const uint32_t argb = *src++; - *dst++ = (argb >> 0) & 0xff; - *dst++ = (argb >> 8) & 0xff; + *dst++ = (argb >> 0) & 0xff; + *dst++ = (argb >> 8) & 0xff; *dst++ = (argb >> 16) & 0xff; } } @@ -570,7 +570,7 @@ void VP8LConvertFromBGRA(const uint32_t* const in_data, int num_pixels, VP8LConvertBGRAToRGB565(in_data, num_pixels, rgba); break; default: - assert(0); // Code flow should not reach here. + assert(0); // Code flow should not reach here. } } @@ -607,24 +607,25 @@ extern void VP8LDspInitNEON(void); extern void VP8LDspInitMIPSdspR2(void); extern void VP8LDspInitMSA(void); -#define COPY_PREDICTOR_ARRAY(IN, OUT) do { \ - (OUT)[0] = IN##0_C; \ - (OUT)[1] = IN##1_C; \ - (OUT)[2] = IN##2_C; \ - (OUT)[3] = IN##3_C; \ - (OUT)[4] = IN##4_C; \ - (OUT)[5] = IN##5_C; \ - (OUT)[6] = IN##6_C; \ - (OUT)[7] = IN##7_C; \ - (OUT)[8] = IN##8_C; \ - (OUT)[9] = IN##9_C; \ - (OUT)[10] = IN##10_C; \ - (OUT)[11] = IN##11_C; \ - (OUT)[12] = IN##12_C; \ - (OUT)[13] = IN##13_C; \ - (OUT)[14] = IN##0_C; /* <- padding security sentinels*/ \ - (OUT)[15] = IN##0_C; \ -} while (0); +#define COPY_PREDICTOR_ARRAY(IN, OUT) \ + do { \ + (OUT)[0] = IN##0_C; \ + (OUT)[1] = IN##1_C; \ + (OUT)[2] = IN##2_C; \ + (OUT)[3] = IN##3_C; \ + (OUT)[4] = IN##4_C; \ + (OUT)[5] = IN##5_C; \ + (OUT)[6] = IN##6_C; \ + (OUT)[7] = IN##7_C; \ + (OUT)[8] = IN##8_C; \ + (OUT)[9] = IN##9_C; \ + (OUT)[10] = IN##10_C; \ + (OUT)[11] = IN##11_C; \ + (OUT)[12] = IN##12_C; \ + (OUT)[13] = IN##13_C; \ + (OUT)[14] = IN##0_C; /* <- padding security sentinels*/ \ + (OUT)[15] = IN##0_C; \ + } while (0); WEBP_DSP_INIT_FUNC(VP8LDspInit) { COPY_PREDICTOR_ARRAY(VP8LPredictor, VP8LPredictors) diff --git a/src/dsp/lossless.h b/src/dsp/lossless.h index c66ec5da..a80efcb8 100644 --- a/src/dsp/lossless.h +++ b/src/dsp/lossless.h @@ -16,8 +16,8 @@ #define WEBP_DSP_LOSSLESS_H_ #include "src/dsp/dsp.h" -#include "src/webp/types.h" #include "src/webp/decode.h" +#include "src/webp/types.h" #ifdef __cplusplus extern "C" { @@ -88,8 +88,8 @@ struct VP8LTransform; // Defined in dec/vp8li.h. // The *in and *out pointers refer to source and destination data respectively // corresponding to the intermediate row (row_start). void VP8LInverseTransform(const struct VP8LTransform* const transform, - int row_start, int row_end, - const uint32_t* const in, uint32_t* const out); + int row_start, int row_end, const uint32_t* const in, + uint32_t* const out); // Color space conversion. typedef void (*VP8LConvertFunc)(const uint32_t* WEBP_RESTRICT src, @@ -107,13 +107,11 @@ void VP8LConvertFromBGRA(const uint32_t* const in_data, int num_pixels, WEBP_CSP_MODE out_colorspace, uint8_t* const rgba); typedef void (*VP8LMapARGBFunc)(const uint32_t* src, - const uint32_t* const color_map, - uint32_t* dst, int y_start, - int y_end, int width); + const uint32_t* const color_map, uint32_t* dst, + int y_start, int y_end, int width); typedef void (*VP8LMapAlphaFunc)(const uint8_t* src, - const uint32_t* const color_map, - uint8_t* dst, int y_start, - int y_end, int width); + const uint32_t* const color_map, uint8_t* dst, + int y_start, int y_end, int width); extern VP8LMapARGBFunc VP8LMapColor32b; extern VP8LMapAlphaFunc VP8LMapColor8b; @@ -158,16 +156,14 @@ typedef void (*VP8LTransformColorFunc)( extern VP8LTransformColorFunc VP8LTransformColor; extern VP8LTransformColorFunc VP8LTransformColor_SSE; typedef void (*VP8LCollectColorBlueTransformsFunc)( - const uint32_t* WEBP_RESTRICT argb, int stride, - int tile_width, int tile_height, - int green_to_blue, int red_to_blue, uint32_t histo[]); + const uint32_t* WEBP_RESTRICT argb, int stride, int tile_width, + int tile_height, int green_to_blue, int red_to_blue, uint32_t histo[]); extern VP8LCollectColorBlueTransformsFunc VP8LCollectColorBlueTransforms; extern VP8LCollectColorBlueTransformsFunc VP8LCollectColorBlueTransforms_SSE; typedef void (*VP8LCollectColorRedTransformsFunc)( - const uint32_t* WEBP_RESTRICT argb, int stride, - int tile_width, int tile_height, - int green_to_red, uint32_t histo[]); + const uint32_t* WEBP_RESTRICT argb, int stride, int tile_width, + int tile_height, int green_to_red, uint32_t histo[]); extern VP8LCollectColorRedTransformsFunc VP8LCollectColorRedTransforms; extern VP8LCollectColorRedTransformsFunc VP8LCollectColorRedTransforms_SSE; @@ -176,14 +172,13 @@ void VP8LTransformColor_C(const VP8LMultipliers* WEBP_RESTRICT const m, uint32_t* WEBP_RESTRICT data, int num_pixels); void VP8LSubtractGreenFromBlueAndRed_C(uint32_t* argb_data, int num_pixels); void VP8LCollectColorRedTransforms_C(const uint32_t* WEBP_RESTRICT argb, - int stride, - int tile_width, int tile_height, - int green_to_red, uint32_t histo[]); + int stride, int tile_width, + int tile_height, int green_to_red, + uint32_t histo[]); void VP8LCollectColorBlueTransforms_C(const uint32_t* WEBP_RESTRICT argb, - int stride, - int tile_width, int tile_height, - int green_to_blue, int red_to_blue, - uint32_t histo[]); + int stride, int tile_width, + int tile_height, int green_to_blue, + int red_to_blue, uint32_t histo[]); extern VP8LPredictorAddSubFunc VP8LPredictorsSub[16]; extern VP8LPredictorAddSubFunc VP8LPredictorsSub_C[16]; @@ -201,17 +196,17 @@ extern VP8LCostFunc VP8LExtraCost; extern VP8LCombinedShannonEntropyFunc VP8LCombinedShannonEntropy; extern VP8LShannonEntropyFunc VP8LShannonEntropy; -typedef struct { // small struct to hold counters - int counts[2]; // index: 0=zero streak, 1=non-zero streak - int streaks[2][2]; // [zero/non-zero][streak<3 / streak>=3] +typedef struct { // small struct to hold counters + int counts[2]; // index: 0=zero streak, 1=non-zero streak + int streaks[2][2]; // [zero/non-zero][streak<3 / streak>=3] } VP8LStreaks; -typedef struct { // small struct to hold bit entropy results - uint64_t entropy; // entropy - uint32_t sum; // sum of the population - int nonzeros; // number of non-zero elements in the population - uint32_t max_val; // maximum value in the population - uint32_t nonzero_code; // index of the last non-zero in the population +typedef struct { // small struct to hold bit entropy results + uint64_t entropy; // entropy + uint32_t sum; // sum of the population + int nonzeros; // number of non-zero elements in the population + uint32_t max_val; // maximum value in the population + uint32_t nonzero_code; // index of the last non-zero in the population } VP8LBitEntropy; void VP8LBitEntropyInit(VP8LBitEntropy* const entropy); @@ -256,8 +251,8 @@ typedef void (*VP8LBundleColorMapFunc)(const uint8_t* WEBP_RESTRICT const row, uint32_t* WEBP_RESTRICT dst); extern VP8LBundleColorMapFunc VP8LBundleColorMap; extern VP8LBundleColorMapFunc VP8LBundleColorMap_SSE; -void VP8LBundleColorMap_C(const uint8_t* WEBP_RESTRICT const row, - int width, int xbits, uint32_t* WEBP_RESTRICT dst); +void VP8LBundleColorMap_C(const uint8_t* WEBP_RESTRICT const row, int width, + int xbits, uint32_t* WEBP_RESTRICT dst); // Must be called before calling any of the above methods. void VP8LEncDspInit(void); @@ -265,7 +260,7 @@ void VP8LEncDspInit(void); //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_DSP_LOSSLESS_H_ diff --git a/src/dsp/lossless_avx2.c b/src/dsp/lossless_avx2.c index dc866049..00ee0122 100644 --- a/src/dsp/lossless_avx2.c +++ b/src/dsp/lossless_avx2.c @@ -15,8 +15,8 @@ #if defined(WEBP_USE_AVX2) -#include #include +#include #include "src/dsp/cpu.h" #include "src/dsp/lossless.h" @@ -90,20 +90,20 @@ static void PredictorAdd1_AVX2(const uint32_t* in, const uint32_t* upper, // Macro that adds 32-bit integers from IN using mod 256 arithmetic // per 8 bit channel. -#define GENERATE_PREDICTOR_1(X, IN) \ - static void PredictorAdd##X##_AVX2(const uint32_t* in, \ - const uint32_t* upper, int num_pixels, \ - uint32_t* WEBP_RESTRICT out) { \ - int i; \ - for (i = 0; i + 8 <= num_pixels; i += 8) { \ - const __m256i src = _mm256_loadu_si256((const __m256i*)&in[i]); \ - const __m256i other = _mm256_loadu_si256((const __m256i*)&(IN)); \ - const __m256i res = _mm256_add_epi8(src, other); \ - _mm256_storeu_si256((__m256i*)&out[i], res); \ - } \ - if (i != num_pixels) { \ +#define GENERATE_PREDICTOR_1(X, IN) \ + static void PredictorAdd##X##_AVX2(const uint32_t* in, \ + const uint32_t* upper, int num_pixels, \ + uint32_t* WEBP_RESTRICT out) { \ + int i; \ + for (i = 0; i + 8 <= num_pixels; i += 8) { \ + const __m256i src = _mm256_loadu_si256((const __m256i*)&in[i]); \ + const __m256i other = _mm256_loadu_si256((const __m256i*)&(IN)); \ + const __m256i res = _mm256_add_epi8(src, other); \ + _mm256_storeu_si256((__m256i*)&out[i], res); \ + } \ + if (i != num_pixels) { \ VP8LPredictorsAdd_SSE[(X)](in + i, upper + i, num_pixels - i, out + i); \ - } \ + } \ } // Predictor2: Top. @@ -117,23 +117,23 @@ GENERATE_PREDICTOR_1(4, upper[i - 1]) // Due to averages with integers, values cannot be accumulated in parallel for // predictors 5 to 7. -#define GENERATE_PREDICTOR_2(X, IN) \ - static void PredictorAdd##X##_AVX2(const uint32_t* in, \ - const uint32_t* upper, int num_pixels, \ - uint32_t* WEBP_RESTRICT out) { \ - int i; \ - for (i = 0; i + 8 <= num_pixels; i += 8) { \ - const __m256i Tother = _mm256_loadu_si256((const __m256i*)&(IN)); \ - const __m256i T = _mm256_loadu_si256((const __m256i*)&upper[i]); \ - const __m256i src = _mm256_loadu_si256((const __m256i*)&in[i]); \ - __m256i avg, res; \ - Average2_m256i(&T, &Tother, &avg); \ - res = _mm256_add_epi8(avg, src); \ - _mm256_storeu_si256((__m256i*)&out[i], res); \ - } \ - if (i != num_pixels) { \ +#define GENERATE_PREDICTOR_2(X, IN) \ + static void PredictorAdd##X##_AVX2(const uint32_t* in, \ + const uint32_t* upper, int num_pixels, \ + uint32_t* WEBP_RESTRICT out) { \ + int i; \ + for (i = 0; i + 8 <= num_pixels; i += 8) { \ + const __m256i Tother = _mm256_loadu_si256((const __m256i*)&(IN)); \ + const __m256i T = _mm256_loadu_si256((const __m256i*)&upper[i]); \ + const __m256i src = _mm256_loadu_si256((const __m256i*)&in[i]); \ + __m256i avg, res; \ + Average2_m256i(&T, &Tother, &avg); \ + res = _mm256_add_epi8(avg, src); \ + _mm256_storeu_si256((__m256i*)&out[i], res); \ + } \ + if (i != num_pixels) { \ VP8LPredictorsAdd_SSE[(X)](in + i, upper + i, num_pixels - i, out + i); \ - } \ + } \ } // Predictor8: average TL T. GENERATE_PREDICTOR_2(8, upper[i - 1]) @@ -361,10 +361,9 @@ static void TransformColorInverse_AVX2(const VP8LMultipliers* const m, const uint32_t* const src, int num_pixels, uint32_t* dst) { // sign-extended multiplying constants, pre-shifted by 5. -#define CST(X) (((int16_t)(m->X << 8)) >> 5) // sign-extend - const __m256i mults_rb = - _mm256_set1_epi32((int)((uint32_t)CST(green_to_red) << 16 | - (CST(green_to_blue) & 0xffff))); +#define CST(X) (((int16_t)(m->X << 8)) >> 5) // sign-extend + const __m256i mults_rb = _mm256_set1_epi32( + (int)((uint32_t)CST(green_to_red) << 16 | (CST(green_to_blue) & 0xffff))); const __m256i mults_b2 = _mm256_set1_epi32(CST(red_to_blue)); #undef CST const __m256i mask_ag = _mm256_set1_epi32((int)0xff00ff00); diff --git a/src/dsp/lossless_common.h b/src/dsp/lossless_common.h index c856679d..f3f733aa 100644 --- a/src/dsp/lossless_common.h +++ b/src/dsp/lossless_common.h @@ -35,13 +35,9 @@ static WEBP_INLINE uint32_t VP8GetARGBIndex(uint32_t idx) { return (idx >> 8) & 0xff; } -static WEBP_INLINE uint8_t VP8GetAlphaIndex(uint8_t idx) { - return idx; -} +static WEBP_INLINE uint8_t VP8GetAlphaIndex(uint8_t idx) { return idx; } -static WEBP_INLINE uint32_t VP8GetARGBValue(uint32_t val) { - return val; -} +static WEBP_INLINE uint32_t VP8GetARGBValue(uint32_t val) { return val; } static WEBP_INLINE uint8_t VP8GetAlphaValue(uint32_t val) { return (val >> 8) & 0xff; @@ -74,8 +70,8 @@ static WEBP_INLINE int VP8LNearLosslessBits(int near_lossless_quality) { // Practically, we can get rid of the call to log() as the two values match to // very high degree (the ratio of these two is 0.99999x). // Keeping a high threshold for now. -#define APPROX_LOG_WITH_CORRECTION_MAX 65536 -#define APPROX_LOG_MAX 4096 +#define APPROX_LOG_WITH_CORRECTION_MAX 65536 +#define APPROX_LOG_MAX 4096 // VP8LFastLog2 and VP8LFastSLog2 are used on elements from image histograms. // The histogram values cannot exceed the maximum number of pixels, which // is (1 << 14) * (1 << 14). Therefore S * log(S) < (1 << 33). @@ -138,7 +134,7 @@ static WEBP_INLINE void VP8LPrefixEncodeNoLUT(int distance, int* const code, *code = 2 * highest_bit + second_highest_bit; } -#define PREFIX_LOOKUP_IDX_MAX 512 +#define PREFIX_LOOKUP_IDX_MAX 512 typedef struct { int8_t code; int8_t extra_bits; @@ -172,16 +168,16 @@ static WEBP_INLINE void VP8LPrefixEncode(int distance, int* const code, } // Sum of each component, mod 256. -static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE -uint32_t VP8LAddPixels(uint32_t a, uint32_t b) { +static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE uint32_t +VP8LAddPixels(uint32_t a, uint32_t b) { const uint32_t alpha_and_green = (a & 0xff00ff00u) + (b & 0xff00ff00u); const uint32_t red_and_blue = (a & 0x00ff00ffu) + (b & 0x00ff00ffu); return (alpha_and_green & 0xff00ff00u) | (red_and_blue & 0x00ff00ffu); } // Difference of each component, mod 256. -static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE -uint32_t VP8LSubPixels(uint32_t a, uint32_t b) { +static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE uint32_t +VP8LSubPixels(uint32_t a, uint32_t b) { const uint32_t alpha_and_green = 0x00ff00ffu + (a & 0xff00ff00u) - (b & 0xff00ff00u); const uint32_t red_and_blue = @@ -197,19 +193,19 @@ uint32_t VP8LSubPixels(uint32_t a, uint32_t b) { // The predictor is added to the output pixel (which // is therefore considered as a residual) to get the final prediction. -#define GENERATE_PREDICTOR_ADD(PREDICTOR, PREDICTOR_ADD) \ -static void PREDICTOR_ADD(const uint32_t* in, const uint32_t* upper, \ - int num_pixels, uint32_t* WEBP_RESTRICT out) { \ - int x; \ - assert(upper != NULL); \ - for (x = 0; x < num_pixels; ++x) { \ - const uint32_t pred = (PREDICTOR)(&out[x - 1], upper + x); \ - out[x] = VP8LAddPixels(in[x], pred); \ - } \ -} +#define GENERATE_PREDICTOR_ADD(PREDICTOR, PREDICTOR_ADD) \ + static void PREDICTOR_ADD(const uint32_t* in, const uint32_t* upper, \ + int num_pixels, uint32_t* WEBP_RESTRICT out) { \ + int x; \ + assert(upper != NULL); \ + for (x = 0; x < num_pixels; ++x) { \ + const uint32_t pred = (PREDICTOR)(&out[x - 1], upper + x); \ + out[x] = VP8LAddPixels(in[x], pred); \ + } \ + } #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_DSP_LOSSLESS_COMMON_H_ diff --git a/src/dsp/lossless_enc.c b/src/dsp/lossless_enc.c index 13a98a70..284bf7e6 100644 --- a/src/dsp/lossless_enc.c +++ b/src/dsp/lossless_enc.c @@ -33,44 +33,43 @@ // print(',\n'.join([' '+','.join(v) // for v in batched([i.rjust(9) for i in a],7)])) const uint32_t kLog2Table[LOG_LOOKUP_IDX_MAX] = { - 0, 0, 8388608, 13295629, 16777216, 19477745, 21684237, - 23549800, 25165824, 26591258, 27866353, 29019816, 30072845, 31041538, - 31938408, 32773374, 33554432, 34288123, 34979866, 35634199, 36254961, - 36845429, 37408424, 37946388, 38461453, 38955489, 39430146, 39886887, - 40327016, 40751698, 41161982, 41558811, 41943040, 42315445, 42676731, - 43027545, 43368474, 43700062, 44022807, 44337167, 44643569, 44942404, - 45234037, 45518808, 45797032, 46069003, 46334996, 46595268, 46850061, - 47099600, 47344097, 47583753, 47818754, 48049279, 48275495, 48497560, - 48715624, 48929828, 49140306, 49347187, 49550590, 49750631, 49947419, - 50141058, 50331648, 50519283, 50704053, 50886044, 51065339, 51242017, - 51416153, 51587818, 51757082, 51924012, 52088670, 52251118, 52411415, - 52569616, 52725775, 52879946, 53032177, 53182516, 53331012, 53477707, - 53622645, 53765868, 53907416, 54047327, 54185640, 54322389, 54457611, - 54591338, 54723604, 54854440, 54983876, 55111943, 55238669, 55364082, - 55488208, 55611074, 55732705, 55853126, 55972361, 56090432, 56207362, - 56323174, 56437887, 56551524, 56664103, 56775645, 56886168, 56995691, - 57104232, 57211808, 57318436, 57424133, 57528914, 57632796, 57735795, - 57837923, 57939198, 58039632, 58139239, 58238033, 58336027, 58433234, - 58529666, 58625336, 58720256, 58814437, 58907891, 59000628, 59092661, - 59183999, 59274652, 59364632, 59453947, 59542609, 59630625, 59718006, - 59804761, 59890898, 59976426, 60061354, 60145690, 60229443, 60312620, - 60395229, 60477278, 60558775, 60639726, 60720140, 60800023, 60879382, - 60958224, 61036555, 61114383, 61191714, 61268554, 61344908, 61420785, - 61496188, 61571124, 61645600, 61719620, 61793189, 61866315, 61939001, - 62011253, 62083076, 62154476, 62225457, 62296024, 62366182, 62435935, - 62505289, 62574248, 62642816, 62710997, 62778797, 62846219, 62913267, - 62979946, 63046260, 63112212, 63177807, 63243048, 63307939, 63372484, - 63436687, 63500551, 63564080, 63627277, 63690146, 63752690, 63814912, - 63876816, 63938405, 63999682, 64060650, 64121313, 64181673, 64241734, - 64301498, 64360969, 64420148, 64479040, 64537646, 64595970, 64654014, - 64711782, 64769274, 64826495, 64883447, 64940132, 64996553, 65052711, - 65108611, 65164253, 65219641, 65274776, 65329662, 65384299, 65438691, - 65492840, 65546747, 65600416, 65653847, 65707044, 65760008, 65812741, - 65865245, 65917522, 65969575, 66021404, 66073013, 66124403, 66175575, - 66226531, 66277275, 66327806, 66378127, 66428240, 66478146, 66527847, - 66577345, 66626641, 66675737, 66724635, 66773336, 66821842, 66870154, - 66918274, 66966204, 67013944, 67061497 -}; + 0, 0, 8388608, 13295629, 16777216, 19477745, 21684237, + 23549800, 25165824, 26591258, 27866353, 29019816, 30072845, 31041538, + 31938408, 32773374, 33554432, 34288123, 34979866, 35634199, 36254961, + 36845429, 37408424, 37946388, 38461453, 38955489, 39430146, 39886887, + 40327016, 40751698, 41161982, 41558811, 41943040, 42315445, 42676731, + 43027545, 43368474, 43700062, 44022807, 44337167, 44643569, 44942404, + 45234037, 45518808, 45797032, 46069003, 46334996, 46595268, 46850061, + 47099600, 47344097, 47583753, 47818754, 48049279, 48275495, 48497560, + 48715624, 48929828, 49140306, 49347187, 49550590, 49750631, 49947419, + 50141058, 50331648, 50519283, 50704053, 50886044, 51065339, 51242017, + 51416153, 51587818, 51757082, 51924012, 52088670, 52251118, 52411415, + 52569616, 52725775, 52879946, 53032177, 53182516, 53331012, 53477707, + 53622645, 53765868, 53907416, 54047327, 54185640, 54322389, 54457611, + 54591338, 54723604, 54854440, 54983876, 55111943, 55238669, 55364082, + 55488208, 55611074, 55732705, 55853126, 55972361, 56090432, 56207362, + 56323174, 56437887, 56551524, 56664103, 56775645, 56886168, 56995691, + 57104232, 57211808, 57318436, 57424133, 57528914, 57632796, 57735795, + 57837923, 57939198, 58039632, 58139239, 58238033, 58336027, 58433234, + 58529666, 58625336, 58720256, 58814437, 58907891, 59000628, 59092661, + 59183999, 59274652, 59364632, 59453947, 59542609, 59630625, 59718006, + 59804761, 59890898, 59976426, 60061354, 60145690, 60229443, 60312620, + 60395229, 60477278, 60558775, 60639726, 60720140, 60800023, 60879382, + 60958224, 61036555, 61114383, 61191714, 61268554, 61344908, 61420785, + 61496188, 61571124, 61645600, 61719620, 61793189, 61866315, 61939001, + 62011253, 62083076, 62154476, 62225457, 62296024, 62366182, 62435935, + 62505289, 62574248, 62642816, 62710997, 62778797, 62846219, 62913267, + 62979946, 63046260, 63112212, 63177807, 63243048, 63307939, 63372484, + 63436687, 63500551, 63564080, 63627277, 63690146, 63752690, 63814912, + 63876816, 63938405, 63999682, 64060650, 64121313, 64181673, 64241734, + 64301498, 64360969, 64420148, 64479040, 64537646, 64595970, 64654014, + 64711782, 64769274, 64826495, 64883447, 64940132, 64996553, 65052711, + 65108611, 65164253, 65219641, 65274776, 65329662, 65384299, 65438691, + 65492840, 65546747, 65600416, 65653847, 65707044, 65760008, 65812741, + 65865245, 65917522, 65969575, 66021404, 66073013, 66124403, 66175575, + 66226531, 66277275, 66327806, 66378127, 66428240, 66478146, 66527847, + 66577345, 66626641, 66675737, 66724635, 66773336, 66821842, 66870154, + 66918274, 66966204, 67013944, 67061497}; // lookup table for small values of int*log2(int) * (1 << LOG_2_PRECISION_BITS). // Obtained in Python with: @@ -80,174 +79,174 @@ const uint32_t kLog2Table[LOG_LOOKUP_IDX_MAX] = { // print(',\n '.join([','.join(v) for v in batched([i.rjust(15) // for i in a],4)])) const uint64_t kSLog2Table[LOG_LOOKUP_IDX_MAX] = { - 0, 0, 16777216, 39886887, - 67108864, 97388723, 130105423, 164848600, - 201326592, 239321324, 278663526, 319217973, - 360874141, 403539997, 447137711, 491600606, - 536870912, 582898099, 629637592, 677049776, - 725099212, 773754010, 822985323, 872766924, - 923074875, 973887230, 1025183802, 1076945958, - 1129156447, 1181799249, 1234859451, 1288323135, - 1342177280, 1396409681, 1451008871, 1505964059, - 1561265072, 1616902301, 1672866655, 1729149526, - 1785742744, 1842638548, 1899829557, 1957308741, - 2015069397, 2073105127, 2131409817, 2189977618ull, - 2248802933ull, 2307880396ull, 2367204859ull, 2426771383ull, - 2486575220ull, 2546611805ull, 2606876748ull, 2667365819ull, - 2728074942ull, 2789000187ull, 2850137762ull, 2911484006ull, - 2973035382ull, 3034788471ull, 3096739966ull, 3158886666ull, - 3221225472ull, 3283753383ull, 3346467489ull, 3409364969ull, - 3472443085ull, 3535699182ull, 3599130679ull, 3662735070ull, - 3726509920ull, 3790452862ull, 3854561593ull, 3918833872ull, - 3983267519ull, 4047860410ull, 4112610476ull, 4177515704ull, - 4242574127ull, 4307783833ull, 4373142952ull, 4438649662ull, - 4504302186ull, 4570098787ull, 4636037770ull, 4702117480ull, - 4768336298ull, 4834692645ull, 4901184974ull, 4967811774ull, - 5034571569ull, 5101462912ull, 5168484389ull, 5235634615ull, - 5302912235ull, 5370315922ull, 5437844376ull, 5505496324ull, - 5573270518ull, 5641165737ull, 5709180782ull, 5777314477ull, - 5845565671ull, 5913933235ull, 5982416059ull, 6051013057ull, - 6119723161ull, 6188545324ull, 6257478518ull, 6326521733ull, - 6395673979ull, 6464934282ull, 6534301685ull, 6603775250ull, - 6673354052ull, 6743037185ull, 6812823756ull, 6882712890ull, - 6952703725ull, 7022795412ull, 7092987118ull, 7163278025ull, - 7233667324ull, 7304154222ull, 7374737939ull, 7445417707ull, - 7516192768ull, 7587062379ull, 7658025806ull, 7729082328ull, - 7800231234ull, 7871471825ull, 7942803410ull, 8014225311ull, - 8085736859ull, 8157337394ull, 8229026267ull, 8300802839ull, - 8372666477ull, 8444616560ull, 8516652476ull, 8588773618ull, - 8660979393ull, 8733269211ull, 8805642493ull, 8878098667ull, - 8950637170ull, 9023257446ull, 9095958945ull, 9168741125ull, - 9241603454ull, 9314545403ull, 9387566451ull, 9460666086ull, - 9533843800ull, 9607099093ull, 9680431471ull, 9753840445ull, - 9827325535ull, 9900886263ull, 9974522161ull, 10048232765ull, - 10122017615ull, 10195876260ull, 10269808253ull, 10343813150ull, - 10417890516ull, 10492039919ull, 10566260934ull, 10640553138ull, - 10714916116ull, 10789349456ull, 10863852751ull, 10938425600ull, - 11013067604ull, 11087778372ull, 11162557513ull, 11237404645ull, - 11312319387ull, 11387301364ull, 11462350205ull, 11537465541ull, - 11612647010ull, 11687894253ull, 11763206912ull, 11838584638ull, - 11914027082ull, 11989533899ull, 12065104750ull, 12140739296ull, - 12216437206ull, 12292198148ull, 12368021795ull, 12443907826ull, - 12519855920ull, 12595865759ull, 12671937032ull, 12748069427ull, - 12824262637ull, 12900516358ull, 12976830290ull, 13053204134ull, - 13129637595ull, 13206130381ull, 13282682202ull, 13359292772ull, - 13435961806ull, 13512689025ull, 13589474149ull, 13666316903ull, - 13743217014ull, 13820174211ull, 13897188225ull, 13974258793ull, - 14051385649ull, 14128568535ull, 14205807192ull, 14283101363ull, - 14360450796ull, 14437855239ull, 14515314443ull, 14592828162ull, - 14670396151ull, 14748018167ull, 14825693972ull, 14903423326ull, - 14981205995ull, 15059041743ull, 15136930339ull, 15214871554ull, - 15292865160ull, 15370910930ull, 15449008641ull, 15527158071ull, - 15605359001ull, 15683611210ull, 15761914485ull, 15840268608ull, - 15918673369ull, 15997128556ull, 16075633960ull, 16154189373ull, - 16232794589ull, 16311449405ull, 16390153617ull, 16468907026ull, - 16547709431ull, 16626560636ull, 16705460444ull, 16784408661ull, - 16863405094ull, 16942449552ull, 17021541845ull, 17100681785ull -}; + 0ull, 0ull, 16777216ull, 39886887ull, + 67108864ull, 97388723ull, 130105423ull, 164848600ull, + 201326592ull, 239321324ull, 278663526ull, 319217973ull, + 360874141ull, 403539997ull, 447137711ull, 491600606ull, + 536870912ull, 582898099ull, 629637592ull, 677049776ull, + 725099212ull, 773754010ull, 822985323ull, 872766924ull, + 923074875ull, 973887230ull, 1025183802ull, 1076945958ull, + 1129156447ull, 1181799249ull, 1234859451ull, 1288323135ull, + 1342177280ull, 1396409681ull, 1451008871ull, 1505964059ull, + 1561265072ull, 1616902301ull, 1672866655ull, 1729149526ull, + 1785742744ull, 1842638548ull, 1899829557ull, 1957308741ull, + 2015069397ull, 2073105127ull, 2131409817ull, 2189977618ull, + 2248802933ull, 2307880396ull, 2367204859ull, 2426771383ull, + 2486575220ull, 2546611805ull, 2606876748ull, 2667365819ull, + 2728074942ull, 2789000187ull, 2850137762ull, 2911484006ull, + 2973035382ull, 3034788471ull, 3096739966ull, 3158886666ull, + 3221225472ull, 3283753383ull, 3346467489ull, 3409364969ull, + 3472443085ull, 3535699182ull, 3599130679ull, 3662735070ull, + 3726509920ull, 3790452862ull, 3854561593ull, 3918833872ull, + 3983267519ull, 4047860410ull, 4112610476ull, 4177515704ull, + 4242574127ull, 4307783833ull, 4373142952ull, 4438649662ull, + 4504302186ull, 4570098787ull, 4636037770ull, 4702117480ull, + 4768336298ull, 4834692645ull, 4901184974ull, 4967811774ull, + 5034571569ull, 5101462912ull, 5168484389ull, 5235634615ull, + 5302912235ull, 5370315922ull, 5437844376ull, 5505496324ull, + 5573270518ull, 5641165737ull, 5709180782ull, 5777314477ull, + 5845565671ull, 5913933235ull, 5982416059ull, 6051013057ull, + 6119723161ull, 6188545324ull, 6257478518ull, 6326521733ull, + 6395673979ull, 6464934282ull, 6534301685ull, 6603775250ull, + 6673354052ull, 6743037185ull, 6812823756ull, 6882712890ull, + 6952703725ull, 7022795412ull, 7092987118ull, 7163278025ull, + 7233667324ull, 7304154222ull, 7374737939ull, 7445417707ull, + 7516192768ull, 7587062379ull, 7658025806ull, 7729082328ull, + 7800231234ull, 7871471825ull, 7942803410ull, 8014225311ull, + 8085736859ull, 8157337394ull, 8229026267ull, 8300802839ull, + 8372666477ull, 8444616560ull, 8516652476ull, 8588773618ull, + 8660979393ull, 8733269211ull, 8805642493ull, 8878098667ull, + 8950637170ull, 9023257446ull, 9095958945ull, 9168741125ull, + 9241603454ull, 9314545403ull, 9387566451ull, 9460666086ull, + 9533843800ull, 9607099093ull, 9680431471ull, 9753840445ull, + 9827325535ull, 9900886263ull, 9974522161ull, 10048232765ull, + 10122017615ull, 10195876260ull, 10269808253ull, 10343813150ull, + 10417890516ull, 10492039919ull, 10566260934ull, 10640553138ull, + 10714916116ull, 10789349456ull, 10863852751ull, 10938425600ull, + 11013067604ull, 11087778372ull, 11162557513ull, 11237404645ull, + 11312319387ull, 11387301364ull, 11462350205ull, 11537465541ull, + 11612647010ull, 11687894253ull, 11763206912ull, 11838584638ull, + 11914027082ull, 11989533899ull, 12065104750ull, 12140739296ull, + 12216437206ull, 12292198148ull, 12368021795ull, 12443907826ull, + 12519855920ull, 12595865759ull, 12671937032ull, 12748069427ull, + 12824262637ull, 12900516358ull, 12976830290ull, 13053204134ull, + 13129637595ull, 13206130381ull, 13282682202ull, 13359292772ull, + 13435961806ull, 13512689025ull, 13589474149ull, 13666316903ull, + 13743217014ull, 13820174211ull, 13897188225ull, 13974258793ull, + 14051385649ull, 14128568535ull, 14205807192ull, 14283101363ull, + 14360450796ull, 14437855239ull, 14515314443ull, 14592828162ull, + 14670396151ull, 14748018167ull, 14825693972ull, 14903423326ull, + 14981205995ull, 15059041743ull, 15136930339ull, 15214871554ull, + 15292865160ull, 15370910930ull, 15449008641ull, 15527158071ull, + 15605359001ull, 15683611210ull, 15761914485ull, 15840268608ull, + 15918673369ull, 15997128556ull, 16075633960ull, 16154189373ull, + 16232794589ull, 16311449405ull, 16390153617ull, 16468907026ull, + 16547709431ull, 16626560636ull, 16705460444ull, 16784408661ull, + 16863405094ull, 16942449552ull, 17021541845ull, 17100681785ull}; const VP8LPrefixCode kPrefixEncodeCode[PREFIX_LOOKUP_IDX_MAX] = { - { 0, 0}, { 0, 0}, { 1, 0}, { 2, 0}, { 3, 0}, { 4, 1}, { 4, 1}, { 5, 1}, - { 5, 1}, { 6, 2}, { 6, 2}, { 6, 2}, { 6, 2}, { 7, 2}, { 7, 2}, { 7, 2}, - { 7, 2}, { 8, 3}, { 8, 3}, { 8, 3}, { 8, 3}, { 8, 3}, { 8, 3}, { 8, 3}, - { 8, 3}, { 9, 3}, { 9, 3}, { 9, 3}, { 9, 3}, { 9, 3}, { 9, 3}, { 9, 3}, - { 9, 3}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, - {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, - {10, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, - {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, - {11, 4}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, - {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, - {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, - {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, - {12, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, - {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, - {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, - {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, - {13, 5}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, - {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, - {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, - {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, - {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, - {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, - {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, - {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, - {14, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, - {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, - {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, - {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, - {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, - {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, - {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, - {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, - {15, 6}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, - {16, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, - {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {0, 0}, {0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 1}, {4, 1}, {5, 1}, + {5, 1}, {6, 2}, {6, 2}, {6, 2}, {6, 2}, {7, 2}, {7, 2}, {7, 2}, + {7, 2}, {8, 3}, {8, 3}, {8, 3}, {8, 3}, {8, 3}, {8, 3}, {8, 3}, + {8, 3}, {9, 3}, {9, 3}, {9, 3}, {9, 3}, {9, 3}, {9, 3}, {9, 3}, + {9, 3}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, + {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, + {10, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, + {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, + {11, 4}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, + {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, + {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, + {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, + {12, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, + {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, + {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, + {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, + {13, 5}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, + {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, + {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, + {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, + {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, + {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, + {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, + {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, + {14, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, + {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, + {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, + {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, + {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, + {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, + {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, + {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, + {15, 6}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, + {16, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, }; const uint8_t kPrefixEncodeExtraBitsValue[PREFIX_LOOKUP_IDX_MAX] = { - 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, - 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126 -}; + 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 2, 3, 0, 1, + 2, 3, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, + 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126}; static uint64_t FastSLog2Slow_C(uint32_t v) { assert(v >= LOG_LOOKUP_IDX_MAX); @@ -460,7 +459,7 @@ void VP8LSubtractGreenFromBlueAndRed_C(uint32_t* argb_data, int num_pixels) { const int argb = (int)argb_data[i]; const int green = (argb >> 8) & 0xff; const uint32_t new_r = (((argb >> 16) & 0xff) - green) & 0xff; - const uint32_t new_b = (((argb >> 0) & 0xff) - green) & 0xff; + const uint32_t new_b = (((argb >> 0) & 0xff) - green) & 0xff; argb_data[i] = ((uint32_t)argb & 0xff00ff00u) | (new_r << 16) | new_b; } } @@ -469,17 +468,15 @@ static WEBP_INLINE int ColorTransformDelta(int8_t color_pred, int8_t color) { return ((int)color_pred * color) >> 5; } -static WEBP_INLINE int8_t U32ToS8(uint32_t v) { - return (int8_t)(v & 0xff); -} +static WEBP_INLINE int8_t U32ToS8(uint32_t v) { return (int8_t)(v & 0xff); } void VP8LTransformColor_C(const VP8LMultipliers* WEBP_RESTRICT const m, uint32_t* WEBP_RESTRICT data, int num_pixels) { int i; for (i = 0; i < num_pixels; ++i) { const uint32_t argb = data[i]; - const int8_t green = U32ToS8(argb >> 8); - const int8_t red = U32ToS8(argb >> 16); + const int8_t green = U32ToS8(argb >> 8); + const int8_t red = U32ToS8(argb >> 16); int new_red = red & 0xff; int new_blue = argb & 0xff; new_red -= ColorTransformDelta((int8_t)m->green_to_red, green); @@ -502,8 +499,8 @@ static WEBP_INLINE uint8_t TransformColorRed(uint8_t green_to_red, static WEBP_INLINE uint8_t TransformColorBlue(uint8_t green_to_blue, uint8_t red_to_blue, uint32_t argb) { - const int8_t green = U32ToS8(argb >> 8); - const int8_t red = U32ToS8(argb >> 16); + const int8_t green = U32ToS8(argb >> 8); + const int8_t red = U32ToS8(argb >> 16); int new_blue = argb & 0xff; new_blue -= ColorTransformDelta((int8_t)green_to_blue, green); new_blue -= ColorTransformDelta((int8_t)red_to_blue, red); @@ -511,9 +508,9 @@ static WEBP_INLINE uint8_t TransformColorBlue(uint8_t green_to_blue, } void VP8LCollectColorRedTransforms_C(const uint32_t* WEBP_RESTRICT argb, - int stride, - int tile_width, int tile_height, - int green_to_red, uint32_t histo[]) { + int stride, int tile_width, + int tile_height, int green_to_red, + uint32_t histo[]) { while (tile_height-- > 0) { int x; for (x = 0; x < tile_width; ++x) { @@ -524,10 +521,9 @@ void VP8LCollectColorRedTransforms_C(const uint32_t* WEBP_RESTRICT argb, } void VP8LCollectColorBlueTransforms_C(const uint32_t* WEBP_RESTRICT argb, - int stride, - int tile_width, int tile_height, - int green_to_blue, int red_to_blue, - uint32_t histo[]) { + int stride, int tile_width, + int tile_height, int green_to_blue, + int red_to_blue, uint32_t histo[]) { while (tile_height-- > 0) { int x; for (x = 0; x < tile_width; ++x) { @@ -551,8 +547,8 @@ static int VectorMismatch_C(const uint32_t* const array1, } // Bundles multiple (1, 2, 4 or 8) pixels into a single pixel. -void VP8LBundleColorMap_C(const uint8_t* WEBP_RESTRICT const row, - int width, int xbits, uint32_t* WEBP_RESTRICT dst) { +void VP8LBundleColorMap_C(const uint8_t* WEBP_RESTRICT const row, int width, + int xbits, uint32_t* WEBP_RESTRICT dst) { int x; if (xbits > 0) { const int bit_depth = 1 << (3 - xbits); @@ -617,19 +613,18 @@ static void PredictorSub1_C(const uint32_t* in, const uint32_t* upper, // It subtracts the prediction from the input pixel and stores the residual // in the output pixel. -#define GENERATE_PREDICTOR_SUB(PREDICTOR_I) \ -static void PredictorSub##PREDICTOR_I##_C(const uint32_t* in, \ - const uint32_t* upper, \ - int num_pixels, \ - uint32_t* WEBP_RESTRICT out) { \ - int x; \ - assert(upper != NULL); \ - for (x = 0; x < num_pixels; ++x) { \ - const uint32_t pred = \ - VP8LPredictor##PREDICTOR_I##_C(&in[x - 1], upper + x); \ - out[x] = VP8LSubPixels(in[x], pred); \ - } \ -} +#define GENERATE_PREDICTOR_SUB(PREDICTOR_I) \ + static void PredictorSub##PREDICTOR_I##_C( \ + const uint32_t* in, const uint32_t* upper, int num_pixels, \ + uint32_t* WEBP_RESTRICT out) { \ + int x; \ + assert(upper != NULL); \ + for (x = 0; x < num_pixels; ++x) { \ + const uint32_t pred = \ + VP8LPredictor##PREDICTOR_I##_C(&in[x - 1], upper + x); \ + out[x] = VP8LSubPixels(in[x], pred); \ + } \ + } GENERATE_PREDICTOR_SUB(2) GENERATE_PREDICTOR_SUB(3) diff --git a/src/dsp/lossless_enc_avx2.c b/src/dsp/lossless_enc_avx2.c index 32f9fae0..519d6e6e 100644 --- a/src/dsp/lossless_enc_avx2.c +++ b/src/dsp/lossless_enc_avx2.c @@ -14,10 +14,9 @@ #include "src/dsp/dsp.h" #if defined(WEBP_USE_AVX2) +#include #include #include - -#include #include #include "src/dsp/cpu.h" @@ -329,7 +328,7 @@ static uint64_t CombinedShannonEntropy_AVX2(const uint32_t X[256], #else -#define DONT_USE_COMBINED_SHANNON_ENTROPY_SSE2_FUNC // won't be faster +#define DONT_USE_COMBINED_SHANNON_ENTROPY_SSE2_FUNC // won't be faster #endif @@ -512,10 +511,10 @@ static void PredictorSub0_AVX2(const uint32_t* in, const uint32_t* upper, } \ } -GENERATE_PREDICTOR_1(1, in[i - 1]) // Predictor1: L -GENERATE_PREDICTOR_1(2, upper[i]) // Predictor2: T -GENERATE_PREDICTOR_1(3, upper[i + 1]) // Predictor3: TR -GENERATE_PREDICTOR_1(4, upper[i - 1]) // Predictor4: TL +GENERATE_PREDICTOR_1(1, in[i - 1]) // Predictor1: L +GENERATE_PREDICTOR_1(2, upper[i]) // Predictor2: T +GENERATE_PREDICTOR_1(3, upper[i + 1]) // Predictor3: TR +GENERATE_PREDICTOR_1(4, upper[i - 1]) // Predictor4: TL #undef GENERATE_PREDICTOR_1 // Predictor5: avg2(avg2(L, TR), T) @@ -557,10 +556,10 @@ static void PredictorSub5_AVX2(const uint32_t* in, const uint32_t* upper, } \ } -GENERATE_PREDICTOR_2(6, in[i - 1], upper[i - 1]) // Predictor6: avg(L, TL) -GENERATE_PREDICTOR_2(7, in[i - 1], upper[i]) // Predictor7: avg(L, T) -GENERATE_PREDICTOR_2(8, upper[i - 1], upper[i]) // Predictor8: avg(TL, T) -GENERATE_PREDICTOR_2(9, upper[i], upper[i + 1]) // Predictor9: average(T, TR) +GENERATE_PREDICTOR_2(6, in[i - 1], upper[i - 1]) // Predictor6: avg(L, TL) +GENERATE_PREDICTOR_2(7, in[i - 1], upper[i]) // Predictor7: avg(L, T) +GENERATE_PREDICTOR_2(8, upper[i - 1], upper[i]) // Predictor8: avg(TL, T) +GENERATE_PREDICTOR_2(9, upper[i], upper[i + 1]) // Predictor9: average(T, TR) #undef GENERATE_PREDICTOR_2 // Predictor10: avg(avg(L,TL), avg(T, TR)). diff --git a/src/dsp/lossless_enc_mips32.c b/src/dsp/lossless_enc_mips32.c index bf2ed0ac..a8faed76 100644 --- a/src/dsp/lossless_enc_mips32.c +++ b/src/dsp/lossless_enc_mips32.c @@ -34,15 +34,13 @@ static uint64_t FastSLog2Slow_MIPS32(uint32_t v) { // Xf = 256 = 2^8 // log_cnt is index of leading one in upper 24 bits __asm__ volatile( - "clz %[log_cnt], %[v] \n\t" - "addiu %[y], $zero, 1 \n\t" - "subu %[log_cnt], %[c24], %[log_cnt] \n\t" - "sllv %[y], %[y], %[log_cnt] \n\t" - "srlv %[temp], %[v], %[log_cnt] \n\t" - : [log_cnt]"=&r"(log_cnt), [y]"=&r"(y), - [temp]"=r"(temp) - : [c24]"r"(c24), [v]"r"(v) - ); + "clz %[log_cnt], %[v] \n\t" + "addiu %[y], $zero, 1 \n\t" + "subu %[log_cnt], %[c24], %[log_cnt] \n\t" + "sllv %[y], %[y], %[log_cnt] \n\t" + "srlv %[temp], %[v], %[log_cnt] \n\t" + : [log_cnt] "=&r"(log_cnt), [y] "=&r"(y), [temp] "=r"(temp) + : [c24] "r"(c24), [v] "r"(v)); // vf = (2^log_cnt) * Xf; where y = 2^log_cnt and Xf < 256 // Xf = floor(Xf) * (1 + (v % y) / v) @@ -69,15 +67,13 @@ static uint32_t FastLog2Slow_MIPS32(uint32_t v) { uint32_t temp; __asm__ volatile( - "clz %[log_cnt], %[v] \n\t" - "addiu %[y], $zero, 1 \n\t" - "subu %[log_cnt], %[c24], %[log_cnt] \n\t" - "sllv %[y], %[y], %[log_cnt] \n\t" - "srlv %[temp], %[v], %[log_cnt] \n\t" - : [log_cnt]"=&r"(log_cnt), [y]"=&r"(y), - [temp]"=r"(temp) - : [c24]"r"(c24), [v]"r"(v) - ); + "clz %[log_cnt], %[v] \n\t" + "addiu %[y], $zero, 1 \n\t" + "subu %[log_cnt], %[c24], %[log_cnt] \n\t" + "sllv %[y], %[y], %[log_cnt] \n\t" + "srlv %[temp], %[v], %[log_cnt] \n\t" + : [log_cnt] "=&r"(log_cnt), [y] "=&r"(y), [temp] "=r"(temp) + : [c24] "r"(c24), [v] "r"(v)); log_2 = kLog2Table[temp] + (log_cnt << LOG_2_PRECISION_BITS); if (v >= APPROX_LOG_MAX) { @@ -110,55 +106,52 @@ static uint32_t ExtraCost_MIPS32(const uint32_t* const population, int length) { const uint32_t* const LoopEnd = &population[length]; __asm__ volatile( - "mult $zero, $zero \n\t" - "xor %[i], %[i], %[i] \n\t" - "beq %[pop], %[LoopEnd], 2f \n\t" - "1: \n\t" - "lw %[temp0], 0(%[pop]) \n\t" - "lw %[temp1], 4(%[pop]) \n\t" - "addiu %[i], %[i], 1 \n\t" - "addiu %[pop], %[pop], 8 \n\t" - "madd %[i], %[temp0] \n\t" - "madd %[i], %[temp1] \n\t" - "bne %[pop], %[LoopEnd], 1b \n\t" - "2: \n\t" - "mfhi %[temp0] \n\t" - "mflo %[temp1] \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), - [i]"=&r"(i), [pop]"+r"(pop) - : [LoopEnd]"r"(LoopEnd) - : "memory", "hi", "lo" - ); + "mult $zero, $zero \n\t" + "xor %[i], %[i], %[i] \n\t" + "beq %[pop], %[LoopEnd], 2f \n\t" + "1: \n\t" + "lw %[temp0], 0(%[pop]) \n\t" + "lw %[temp1], 4(%[pop]) \n\t" + "addiu %[i], %[i], 1 \n\t" + "addiu %[pop], %[pop], 8 \n\t" + "madd %[i], %[temp0] \n\t" + "madd %[i], %[temp1] \n\t" + "bne %[pop], %[LoopEnd], 1b \n\t" + "2: \n\t" + "mfhi %[temp0] \n\t" + "mflo %[temp1] \n\t" + : + [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [i] "=&r"(i), [pop] "+r"(pop) + : [LoopEnd] "r"(LoopEnd) + : "memory", "hi", "lo"); return ((int64_t)temp0 << 32 | temp1); } -#define HUFFMAN_COST_PASS \ - __asm__ volatile( \ - "sll %[temp1], %[temp0], 3 \n\t" \ - "addiu %[temp3], %[streak], -3 \n\t" \ - "addu %[temp2], %[pstreaks], %[temp1] \n\t" \ - "blez %[temp3], 1f \n\t" \ - "srl %[temp1], %[temp1], 1 \n\t" \ - "addu %[temp3], %[pcnts], %[temp1] \n\t" \ - "lw %[temp0], 4(%[temp2]) \n\t" \ - "lw %[temp1], 0(%[temp3]) \n\t" \ - "addu %[temp0], %[temp0], %[streak] \n\t" \ - "addiu %[temp1], %[temp1], 1 \n\t" \ - "sw %[temp0], 4(%[temp2]) \n\t" \ - "sw %[temp1], 0(%[temp3]) \n\t" \ - "b 2f \n\t" \ - "1: \n\t" \ - "lw %[temp0], 0(%[temp2]) \n\t" \ - "addu %[temp0], %[temp0], %[streak] \n\t" \ - "sw %[temp0], 0(%[temp2]) \n\t" \ - "2: \n\t" \ - : [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), \ - [temp3]"=&r"(temp3), [temp0]"+r"(temp0) \ - : [pstreaks]"r"(pstreaks), [pcnts]"r"(pcnts), \ - [streak]"r"(streak) \ - : "memory" \ - ); +#define HUFFMAN_COST_PASS \ + __asm__ volatile( \ + "sll %[temp1], %[temp0], 3 \n\t" \ + "addiu %[temp3], %[streak], -3 \n\t" \ + "addu %[temp2], %[pstreaks], %[temp1] \n\t" \ + "blez %[temp3], 1f \n\t" \ + "srl %[temp1], %[temp1], 1 \n\t" \ + "addu %[temp3], %[pcnts], %[temp1] \n\t" \ + "lw %[temp0], 4(%[temp2]) \n\t" \ + "lw %[temp1], 0(%[temp3]) \n\t" \ + "addu %[temp0], %[temp0], %[streak] \n\t" \ + "addiu %[temp1], %[temp1], 1 \n\t" \ + "sw %[temp0], 4(%[temp2]) \n\t" \ + "sw %[temp1], 0(%[temp3]) \n\t" \ + "b 2f \n\t" \ + "1: \n\t" \ + "lw %[temp0], 0(%[temp2]) \n\t" \ + "addu %[temp0], %[temp0], %[streak] \n\t" \ + "sw %[temp0], 0(%[temp2]) \n\t" \ + "2: \n\t" \ + : [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), [temp3] "=&r"(temp3), \ + [temp0] "+r"(temp0) \ + : [pstreaks] "r"(pstreaks), [pcnts] "r"(pcnts), [streak] "r"(streak) \ + : "memory"); // Returns the various RLE counts static WEBP_INLINE void GetEntropyUnrefinedHelper( @@ -234,7 +227,7 @@ static void GetCombinedEntropyUnrefined_MIPS32( entropy->entropy = VP8LFastSLog2(entropy->sum) - entropy->entropy; } -#define ASM_START \ +#define ASM_START \ __asm__ volatile( \ ".set push \n\t" \ ".set at \n\t" \ @@ -247,6 +240,7 @@ static void GetCombinedEntropyUnrefined_MIPS32( // if pointer should be incremented // 'literal' and successive histograms could be unaligned // so we must use ulw and usw +// clang-format off #define ADD_TO_OUT(A, B, C, D, E, P0, P1, P2) \ "ulw %[temp0], " #A "(%[" #P0 "]) \n\t" \ "ulw %[temp1], " #B "(%[" #P0 "]) \n\t" \ @@ -270,28 +264,28 @@ static void GetCombinedEntropyUnrefined_MIPS32( "usw %[temp7], " #D "(%[" #P2 "]) \n\t" \ "addiu %[" #P2 "], %[" #P2 "], 16 \n\t" \ "bne %[" #P0 "], %[LoopEnd], 1b \n\t" \ - ".set pop \n\t" \ + ".set pop \n\t" +// clang-format on -#define ASM_END_COMMON_0 \ +#define ASM_END_COMMON_0 \ : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), \ [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), \ [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), \ [temp6]"=&r"(temp6), [temp7]"=&r"(temp7), \ [pa]"+r"(pa), [pout]"+r"(pout) -#define ASM_END_COMMON_1 \ +#define ASM_END_COMMON_1 \ : [LoopEnd]"r"(LoopEnd) \ : "memory", "at" \ ); -#define ASM_END_0 \ - ASM_END_COMMON_0 \ - , [pb]"+r"(pb) \ - ASM_END_COMMON_1 +#define ASM_END_0 \ + ASM_END_COMMON_0 \ + , [pb] "+r"(pb)ASM_END_COMMON_1 -#define ASM_END_1 \ - ASM_END_COMMON_0 \ - ASM_END_COMMON_1 +#define ASM_END_1 \ + ASM_END_COMMON_0 \ + ASM_END_COMMON_1 static void AddVector_MIPS32(const uint32_t* WEBP_RESTRICT pa, const uint32_t* WEBP_RESTRICT pb, diff --git a/src/dsp/lossless_enc_mips_dsp_r2.c b/src/dsp/lossless_enc_mips_dsp_r2.c index b93e98bf..aff6c1bd 100644 --- a/src/dsp/lossless_enc_mips_dsp_r2.c +++ b/src/dsp/lossless_enc_mips_dsp_r2.c @@ -23,59 +23,58 @@ static void SubtractGreenFromBlueAndRed_MIPSdspR2(uint32_t* argb_data, uint32_t temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7; uint32_t* const p_loop1_end = argb_data + (num_pixels & ~3); uint32_t* const p_loop2_end = p_loop1_end + (num_pixels & 3); - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "beq %[argb_data], %[p_loop1_end], 3f \n\t" - " nop \n\t" - "0: \n\t" - "lw %[temp0], 0(%[argb_data]) \n\t" - "lw %[temp1], 4(%[argb_data]) \n\t" - "lw %[temp2], 8(%[argb_data]) \n\t" - "lw %[temp3], 12(%[argb_data]) \n\t" - "ext %[temp4], %[temp0], 8, 8 \n\t" - "ext %[temp5], %[temp1], 8, 8 \n\t" - "ext %[temp6], %[temp2], 8, 8 \n\t" - "ext %[temp7], %[temp3], 8, 8 \n\t" - "addiu %[argb_data], %[argb_data], 16 \n\t" - "replv.ph %[temp4], %[temp4] \n\t" - "replv.ph %[temp5], %[temp5] \n\t" - "replv.ph %[temp6], %[temp6] \n\t" - "replv.ph %[temp7], %[temp7] \n\t" - "subu.qb %[temp0], %[temp0], %[temp4] \n\t" - "subu.qb %[temp1], %[temp1], %[temp5] \n\t" - "subu.qb %[temp2], %[temp2], %[temp6] \n\t" - "subu.qb %[temp3], %[temp3], %[temp7] \n\t" - "sw %[temp0], -16(%[argb_data]) \n\t" - "sw %[temp1], -12(%[argb_data]) \n\t" - "sw %[temp2], -8(%[argb_data]) \n\t" - "bne %[argb_data], %[p_loop1_end], 0b \n\t" - " sw %[temp3], -4(%[argb_data]) \n\t" - "3: \n\t" - "beq %[argb_data], %[p_loop2_end], 2f \n\t" - " nop \n\t" - "1: \n\t" - "lw %[temp0], 0(%[argb_data]) \n\t" - "addiu %[argb_data], %[argb_data], 4 \n\t" - "ext %[temp4], %[temp0], 8, 8 \n\t" - "replv.ph %[temp4], %[temp4] \n\t" - "subu.qb %[temp0], %[temp0], %[temp4] \n\t" - "bne %[argb_data], %[p_loop2_end], 1b \n\t" - " sw %[temp0], -4(%[argb_data]) \n\t" - "2: \n\t" - ".set pop \n\t" - : [argb_data]"+&r"(argb_data), [temp0]"=&r"(temp0), - [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), - [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), [temp6]"=&r"(temp6), - [temp7]"=&r"(temp7) - : [p_loop1_end]"r"(p_loop1_end), [p_loop2_end]"r"(p_loop2_end) - : "memory" - ); + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "beq %[argb_data], %[p_loop1_end], 3f \n\t" + " nop \n\t" + "0: \n\t" + "lw %[temp0], 0(%[argb_data]) \n\t" + "lw %[temp1], 4(%[argb_data]) \n\t" + "lw %[temp2], 8(%[argb_data]) \n\t" + "lw %[temp3], 12(%[argb_data]) \n\t" + "ext %[temp4], %[temp0], 8, 8 \n\t" + "ext %[temp5], %[temp1], 8, 8 \n\t" + "ext %[temp6], %[temp2], 8, 8 \n\t" + "ext %[temp7], %[temp3], 8, 8 \n\t" + "addiu %[argb_data], %[argb_data], 16 \n\t" + "replv.ph %[temp4], %[temp4] \n\t" + "replv.ph %[temp5], %[temp5] \n\t" + "replv.ph %[temp6], %[temp6] \n\t" + "replv.ph %[temp7], %[temp7] \n\t" + "subu.qb %[temp0], %[temp0], %[temp4] \n\t" + "subu.qb %[temp1], %[temp1], %[temp5] \n\t" + "subu.qb %[temp2], %[temp2], %[temp6] \n\t" + "subu.qb %[temp3], %[temp3], %[temp7] \n\t" + "sw %[temp0], -16(%[argb_data]) \n\t" + "sw %[temp1], -12(%[argb_data]) \n\t" + "sw %[temp2], -8(%[argb_data]) \n\t" + "bne %[argb_data], %[p_loop1_end], 0b \n\t" + " sw %[temp3], -4(%[argb_data]) \n\t" + "3: \n\t" + "beq %[argb_data], %[p_loop2_end], 2f \n\t" + " nop \n\t" + "1: \n\t" + "lw %[temp0], 0(%[argb_data]) \n\t" + "addiu %[argb_data], %[argb_data], 4 \n\t" + "ext %[temp4], %[temp0], 8, 8 \n\t" + "replv.ph %[temp4], %[temp4] \n\t" + "subu.qb %[temp0], %[temp0], %[temp4] \n\t" + "bne %[argb_data], %[p_loop2_end], 1b \n\t" + " sw %[temp0], -4(%[argb_data]) \n\t" + "2: \n\t" + ".set pop \n\t" + : [argb_data] "+&r"(argb_data), [temp0] "=&r"(temp0), + [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), [temp3] "=&r"(temp3), + [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), [temp6] "=&r"(temp6), + [temp7] "=&r"(temp7) + : [p_loop1_end] "r"(p_loop1_end), [p_loop2_end] "r"(p_loop2_end) + : "memory"); } static WEBP_INLINE uint32_t ColorTransformDelta(int8_t color_pred, int8_t color) { - return (uint32_t)((int)(color_pred) * color) >> 5; + return (uint32_t)((int)(color_pred)*color) >> 5; } static void TransformColor_MIPSdspR2( @@ -87,64 +86,63 @@ static void TransformColor_MIPSdspR2( const uint32_t G_to_B = m->green_to_blue; const uint32_t R_to_B = m->red_to_blue; uint32_t* const p_loop_end = data + (num_pixels & ~1); - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "beq %[data], %[p_loop_end], 1f \n\t" - " nop \n\t" - "replv.ph %[temp0], %[G_to_R] \n\t" - "replv.ph %[temp1], %[G_to_B] \n\t" - "replv.ph %[temp2], %[R_to_B] \n\t" - "shll.ph %[temp0], %[temp0], 8 \n\t" - "shll.ph %[temp1], %[temp1], 8 \n\t" - "shll.ph %[temp2], %[temp2], 8 \n\t" - "shra.ph %[temp0], %[temp0], 8 \n\t" - "shra.ph %[temp1], %[temp1], 8 \n\t" - "shra.ph %[temp2], %[temp2], 8 \n\t" - "0: \n\t" - "lw %[argb], 0(%[data]) \n\t" - "lw %[argb1], 4(%[data]) \n\t" - "lhu %[new_red], 2(%[data]) \n\t" - "lhu %[new_red1], 6(%[data]) \n\t" - "precrq.qb.ph %[temp3], %[argb], %[argb1] \n\t" - "precr.qb.ph %[temp4], %[argb], %[argb1] \n\t" - "preceu.ph.qbra %[temp3], %[temp3] \n\t" - "preceu.ph.qbla %[temp4], %[temp4] \n\t" - "shll.ph %[temp3], %[temp3], 8 \n\t" - "shll.ph %[temp4], %[temp4], 8 \n\t" - "shra.ph %[temp3], %[temp3], 8 \n\t" - "shra.ph %[temp4], %[temp4], 8 \n\t" - "mul.ph %[temp5], %[temp3], %[temp0] \n\t" - "mul.ph %[temp3], %[temp3], %[temp1] \n\t" - "mul.ph %[temp4], %[temp4], %[temp2] \n\t" - "addiu %[data], %[data], 8 \n\t" - "ins %[new_red1], %[new_red], 16, 16 \n\t" - "ins %[argb1], %[argb], 16, 16 \n\t" - "shra.ph %[temp5], %[temp5], 5 \n\t" - "shra.ph %[temp3], %[temp3], 5 \n\t" - "shra.ph %[temp4], %[temp4], 5 \n\t" - "subu.ph %[new_red1], %[new_red1], %[temp5] \n\t" - "subu.ph %[argb1], %[argb1], %[temp3] \n\t" - "preceu.ph.qbra %[temp5], %[new_red1] \n\t" - "subu.ph %[argb1], %[argb1], %[temp4] \n\t" - "preceu.ph.qbra %[temp3], %[argb1] \n\t" - "sb %[temp5], -2(%[data]) \n\t" - "sb %[temp3], -4(%[data]) \n\t" - "sra %[temp5], %[temp5], 16 \n\t" - "sra %[temp3], %[temp3], 16 \n\t" - "sb %[temp5], -6(%[data]) \n\t" - "bne %[data], %[p_loop_end], 0b \n\t" - " sb %[temp3], -8(%[data]) \n\t" - "1: \n\t" - ".set pop \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [new_red1]"=&r"(new_red1), [new_red]"=&r"(new_red), - [argb]"=&r"(argb), [argb1]"=&r"(argb1), [data]"+&r"(data) - : [G_to_R]"r"(G_to_R), [R_to_B]"r"(R_to_B), - [G_to_B]"r"(G_to_B), [p_loop_end]"r"(p_loop_end) - : "memory", "hi", "lo" - ); + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "beq %[data], %[p_loop_end], 1f \n\t" + " nop \n\t" + "replv.ph %[temp0], %[G_to_R] \n\t" + "replv.ph %[temp1], %[G_to_B] \n\t" + "replv.ph %[temp2], %[R_to_B] \n\t" + "shll.ph %[temp0], %[temp0], 8 \n\t" + "shll.ph %[temp1], %[temp1], 8 \n\t" + "shll.ph %[temp2], %[temp2], 8 \n\t" + "shra.ph %[temp0], %[temp0], 8 \n\t" + "shra.ph %[temp1], %[temp1], 8 \n\t" + "shra.ph %[temp2], %[temp2], 8 \n\t" + "0: \n\t" + "lw %[argb], 0(%[data]) \n\t" + "lw %[argb1], 4(%[data]) \n\t" + "lhu %[new_red], 2(%[data]) \n\t" + "lhu %[new_red1], 6(%[data]) \n\t" + "precrq.qb.ph %[temp3], %[argb], %[argb1] \n\t" + "precr.qb.ph %[temp4], %[argb], %[argb1] \n\t" + "preceu.ph.qbra %[temp3], %[temp3] \n\t" + "preceu.ph.qbla %[temp4], %[temp4] \n\t" + "shll.ph %[temp3], %[temp3], 8 \n\t" + "shll.ph %[temp4], %[temp4], 8 \n\t" + "shra.ph %[temp3], %[temp3], 8 \n\t" + "shra.ph %[temp4], %[temp4], 8 \n\t" + "mul.ph %[temp5], %[temp3], %[temp0] \n\t" + "mul.ph %[temp3], %[temp3], %[temp1] \n\t" + "mul.ph %[temp4], %[temp4], %[temp2] \n\t" + "addiu %[data], %[data], 8 \n\t" + "ins %[new_red1], %[new_red], 16, 16 \n\t" + "ins %[argb1], %[argb], 16, 16 \n\t" + "shra.ph %[temp5], %[temp5], 5 \n\t" + "shra.ph %[temp3], %[temp3], 5 \n\t" + "shra.ph %[temp4], %[temp4], 5 \n\t" + "subu.ph %[new_red1], %[new_red1], %[temp5] \n\t" + "subu.ph %[argb1], %[argb1], %[temp3] \n\t" + "preceu.ph.qbra %[temp5], %[new_red1] \n\t" + "subu.ph %[argb1], %[argb1], %[temp4] \n\t" + "preceu.ph.qbra %[temp3], %[argb1] \n\t" + "sb %[temp5], -2(%[data]) \n\t" + "sb %[temp3], -4(%[data]) \n\t" + "sra %[temp5], %[temp5], 16 \n\t" + "sra %[temp3], %[temp3], 16 \n\t" + "sb %[temp5], -6(%[data]) \n\t" + "bne %[data], %[p_loop_end], 0b \n\t" + " sb %[temp3], -8(%[data]) \n\t" + "1: \n\t" + ".set pop \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [new_red1] "=&r"(new_red1), [new_red] "=&r"(new_red), + [argb] "=&r"(argb), [argb1] "=&r"(argb1), [data] "+&r"(data) + : [G_to_R] "r"(G_to_R), [R_to_B] "r"(R_to_B), [G_to_B] "r"(G_to_B), + [p_loop_end] "r"(p_loop_end) + : "memory", "hi", "lo"); if (num_pixels & 1) { const uint32_t argb_ = data[0]; @@ -173,9 +171,8 @@ static WEBP_INLINE uint8_t TransformColorBlue(uint8_t green_to_blue, } static void CollectColorBlueTransforms_MIPSdspR2( - const uint32_t* WEBP_RESTRICT argb, int stride, - int tile_width, int tile_height, - int green_to_blue, int red_to_blue, uint32_t histo[]) { + const uint32_t* WEBP_RESTRICT argb, int stride, int tile_width, + int tile_height, int green_to_blue, int red_to_blue, uint32_t histo[]) { const int rtb = (red_to_blue << 16) | (red_to_blue & 0xffff); const int gtb = (green_to_blue << 16) | (green_to_blue & 0xffff); const uint32_t mask = 0xff00ffu; @@ -185,27 +182,26 @@ static void CollectColorBlueTransforms_MIPSdspR2( argb += stride; for (x = 0; x < (tile_width >> 1); ++x) { int temp0, temp1, temp2, temp3, temp4, temp5, temp6; - __asm__ volatile ( - "lw %[temp0], 0(%[p_argb]) \n\t" - "lw %[temp1], 4(%[p_argb]) \n\t" - "precr.qb.ph %[temp2], %[temp0], %[temp1] \n\t" - "ins %[temp1], %[temp0], 16, 16 \n\t" - "shra.ph %[temp2], %[temp2], 8 \n\t" - "shra.ph %[temp3], %[temp1], 8 \n\t" - "mul.ph %[temp5], %[temp2], %[rtb] \n\t" - "mul.ph %[temp6], %[temp3], %[gtb] \n\t" - "and %[temp4], %[temp1], %[mask] \n\t" - "addiu %[p_argb], %[p_argb], 8 \n\t" - "shra.ph %[temp5], %[temp5], 5 \n\t" - "shra.ph %[temp6], %[temp6], 5 \n\t" - "subu.qb %[temp2], %[temp4], %[temp5] \n\t" - "subu.qb %[temp2], %[temp2], %[temp6] \n\t" - : [p_argb]"+&r"(p_argb), [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), - [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), - [temp5]"=&r"(temp5), [temp6]"=&r"(temp6) - : [rtb]"r"(rtb), [gtb]"r"(gtb), [mask]"r"(mask) - : "memory", "hi", "lo" - ); + __asm__ volatile( + "lw %[temp0], 0(%[p_argb]) \n\t" + "lw %[temp1], 4(%[p_argb]) \n\t" + "precr.qb.ph %[temp2], %[temp0], %[temp1] \n\t" + "ins %[temp1], %[temp0], 16, 16 \n\t" + "shra.ph %[temp2], %[temp2], 8 \n\t" + "shra.ph %[temp3], %[temp1], 8 \n\t" + "mul.ph %[temp5], %[temp2], %[rtb] \n\t" + "mul.ph %[temp6], %[temp3], %[gtb] \n\t" + "and %[temp4], %[temp1], %[mask] \n\t" + "addiu %[p_argb], %[p_argb], 8 \n\t" + "shra.ph %[temp5], %[temp5], 5 \n\t" + "shra.ph %[temp6], %[temp6], 5 \n\t" + "subu.qb %[temp2], %[temp4], %[temp5] \n\t" + "subu.qb %[temp2], %[temp2], %[temp6] \n\t" + : [p_argb] "+&r"(p_argb), [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), + [temp2] "=&r"(temp2), [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), + [temp5] "=&r"(temp5), [temp6] "=&r"(temp6) + : [rtb] "r"(rtb), [gtb] "r"(gtb), [mask] "r"(mask) + : "memory", "hi", "lo"); ++histo[(uint8_t)(temp2 >> 16)]; ++histo[(uint8_t)temp2]; } @@ -224,8 +220,8 @@ static WEBP_INLINE uint8_t TransformColorRed(uint8_t green_to_red, } static void CollectColorRedTransforms_MIPSdspR2( - const uint32_t* WEBP_RESTRICT argb, int stride, - int tile_width, int tile_height, int green_to_red, uint32_t histo[]) { + const uint32_t* WEBP_RESTRICT argb, int stride, int tile_width, + int tile_height, int green_to_red, uint32_t histo[]) { const int gtr = (green_to_red << 16) | (green_to_red & 0xffff); while (tile_height-- > 0) { int x; @@ -233,21 +229,20 @@ static void CollectColorRedTransforms_MIPSdspR2( argb += stride; for (x = 0; x < (tile_width >> 1); ++x) { int temp0, temp1, temp2, temp3, temp4; - __asm__ volatile ( - "lw %[temp0], 0(%[p_argb]) \n\t" - "lw %[temp1], 4(%[p_argb]) \n\t" - "precrq.ph.w %[temp4], %[temp0], %[temp1] \n\t" - "ins %[temp1], %[temp0], 16, 16 \n\t" - "shra.ph %[temp3], %[temp1], 8 \n\t" - "mul.ph %[temp2], %[temp3], %[gtr] \n\t" - "addiu %[p_argb], %[p_argb], 8 \n\t" - "shra.ph %[temp2], %[temp2], 5 \n\t" - "subu.qb %[temp2], %[temp4], %[temp2] \n\t" - : [p_argb]"+&r"(p_argb), [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), - [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), [temp4]"=&r"(temp4) - : [gtr]"r"(gtr) - : "memory", "hi", "lo" - ); + __asm__ volatile( + "lw %[temp0], 0(%[p_argb]) \n\t" + "lw %[temp1], 4(%[p_argb]) \n\t" + "precrq.ph.w %[temp4], %[temp0], %[temp1] \n\t" + "ins %[temp1], %[temp0], 16, 16 \n\t" + "shra.ph %[temp3], %[temp1], 8 \n\t" + "mul.ph %[temp2], %[temp3], %[gtr] \n\t" + "addiu %[p_argb], %[p_argb], 8 \n\t" + "shra.ph %[temp2], %[temp2], 5 \n\t" + "subu.qb %[temp2], %[temp4], %[temp2] \n\t" + : [p_argb] "+&r"(p_argb), [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), + [temp2] "=&r"(temp2), [temp3] "=&r"(temp3), [temp4] "=&r"(temp4) + : [gtr] "r"(gtr) + : "memory", "hi", "lo"); ++histo[(uint8_t)(temp2 >> 16)]; ++histo[(uint8_t)temp2]; } diff --git a/src/dsp/lossless_enc_msa.c b/src/dsp/lossless_enc_msa.c index 722a98b2..5c76dd9b 100644 --- a/src/dsp/lossless_enc_msa.c +++ b/src/dsp/lossless_enc_msa.c @@ -18,46 +18,48 @@ #include "src/dsp/lossless.h" #include "src/dsp/msa_macro.h" -#define TRANSFORM_COLOR_8(src0, src1, dst0, dst1, c0, c1, mask0, mask1) do { \ - v8i16 g0, g1, t0, t1, t2, t3; \ - v4i32 t4, t5; \ - VSHF_B2_SH(src0, src0, src1, src1, mask0, mask0, g0, g1); \ - DOTP_SB2_SH(g0, g1, c0, c0, t0, t1); \ - SRAI_H2_SH(t0, t1, 5); \ - t0 = __msa_subv_h((v8i16)src0, t0); \ - t1 = __msa_subv_h((v8i16)src1, t1); \ - t4 = __msa_srli_w((v4i32)src0, 16); \ - t5 = __msa_srli_w((v4i32)src1, 16); \ - DOTP_SB2_SH(t4, t5, c1, c1, t2, t3); \ - SRAI_H2_SH(t2, t3, 5); \ - SUB2(t0, t2, t1, t3, t0, t1); \ - VSHF_B2_UB(src0, t0, src1, t1, mask1, mask1, dst0, dst1); \ -} while (0) +#define TRANSFORM_COLOR_8(src0, src1, dst0, dst1, c0, c1, mask0, mask1) \ + do { \ + v8i16 g0, g1, t0, t1, t2, t3; \ + v4i32 t4, t5; \ + VSHF_B2_SH(src0, src0, src1, src1, mask0, mask0, g0, g1); \ + DOTP_SB2_SH(g0, g1, c0, c0, t0, t1); \ + SRAI_H2_SH(t0, t1, 5); \ + t0 = __msa_subv_h((v8i16)src0, t0); \ + t1 = __msa_subv_h((v8i16)src1, t1); \ + t4 = __msa_srli_w((v4i32)src0, 16); \ + t5 = __msa_srli_w((v4i32)src1, 16); \ + DOTP_SB2_SH(t4, t5, c1, c1, t2, t3); \ + SRAI_H2_SH(t2, t3, 5); \ + SUB2(t0, t2, t1, t3, t0, t1); \ + VSHF_B2_UB(src0, t0, src1, t1, mask1, mask1, dst0, dst1); \ + } while (0) -#define TRANSFORM_COLOR_4(src, dst, c0, c1, mask0, mask1) do { \ - const v16i8 g0 = VSHF_SB(src, src, mask0); \ - v8i16 t0 = __msa_dotp_s_h(c0, g0); \ - v8i16 t1; \ - v4i32 t2; \ - t0 = SRAI_H(t0, 5); \ - t0 = __msa_subv_h((v8i16)src, t0); \ - t2 = __msa_srli_w((v4i32)src, 16); \ - t1 = __msa_dotp_s_h(c1, (v16i8)t2); \ - t1 = SRAI_H(t1, 5); \ - t0 = t0 - t1; \ - dst = VSHF_UB(src, t0, mask1); \ -} while (0) +#define TRANSFORM_COLOR_4(src, dst, c0, c1, mask0, mask1) \ + do { \ + const v16i8 g0 = VSHF_SB(src, src, mask0); \ + v8i16 t0 = __msa_dotp_s_h(c0, g0); \ + v8i16 t1; \ + v4i32 t2; \ + t0 = SRAI_H(t0, 5); \ + t0 = __msa_subv_h((v8i16)src, t0); \ + t2 = __msa_srli_w((v4i32)src, 16); \ + t1 = __msa_dotp_s_h(c1, (v16i8)t2); \ + t1 = SRAI_H(t1, 5); \ + t0 = t0 - t1; \ + dst = VSHF_UB(src, t0, mask1); \ + } while (0) static void TransformColor_MSA(const VP8LMultipliers* WEBP_RESTRICT const m, uint32_t* WEBP_RESTRICT data, int num_pixels) { v16u8 src0, dst0; - const v16i8 g2br = (v16i8)__msa_fill_w(m->green_to_blue | - (m->green_to_red << 16)); + const v16i8 g2br = + (v16i8)__msa_fill_w(m->green_to_blue | (m->green_to_red << 16)); const v16i8 r2b = (v16i8)__msa_fill_w(m->red_to_blue); - const v16u8 mask0 = { 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255, - 13, 255, 13, 255 }; - const v16u8 mask1 = { 16, 1, 18, 3, 20, 5, 22, 7, 24, 9, 26, 11, - 28, 13, 30, 15 }; + const v16u8 mask0 = {1, 255, 1, 255, 5, 255, 5, 255, + 9, 255, 9, 255, 13, 255, 13, 255}; + const v16u8 mask1 = {16, 1, 18, 3, 20, 5, 22, 7, + 24, 9, 26, 11, 28, 13, 30, 15}; while (num_pixels >= 8) { v16u8 src1, dst1; @@ -99,8 +101,8 @@ static void SubtractGreenFromBlueAndRed_MSA(uint32_t* argb_data, int i; uint8_t* ptemp_data = (uint8_t*)argb_data; v16u8 src0, dst0, tmp0; - const v16u8 mask = { 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255, - 13, 255, 13, 255 }; + const v16u8 mask = {1, 255, 1, 255, 5, 255, 5, 255, + 9, 255, 9, 255, 13, 255, 13, 255}; while (num_pixels >= 8) { v16u8 src1, dst1, tmp1; diff --git a/src/dsp/lossless_enc_neon.c b/src/dsp/lossless_enc_neon.c index ff1858eb..c82ce85c 100644 --- a/src/dsp/lossless_enc_neon.c +++ b/src/dsp/lossless_enc_neon.c @@ -25,25 +25,24 @@ // vtbl?_u8 are marked unavailable for iOS arm64 with Xcode < 6.3, use // non-standard versions there. -#if defined(__APPLE__) && WEBP_AARCH64 && \ - defined(__apple_build_version__) && (__apple_build_version__< 6020037) +#if defined(__APPLE__) && WEBP_AARCH64 && defined(__apple_build_version__) && \ + (__apple_build_version__ < 6020037) #define USE_VTBLQ #endif #ifdef USE_VTBLQ // 255 = byte will be zeroed -static const uint8_t kGreenShuffle[16] = { - 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255, 13, 255, 13, 255 -}; +static const uint8_t kGreenShuffle[16] = {1, 255, 1, 255, 5, 255, 5, 255, + 9, 255, 9, 255, 13, 255, 13, 255}; static WEBP_INLINE uint8x16_t DoGreenShuffle_NEON(const uint8x16_t argb, const uint8x16_t shuffle) { return vcombine_u8(vtbl1q_u8(argb, vget_low_u8(shuffle)), vtbl1q_u8(argb, vget_high_u8(shuffle))); } -#else // !USE_VTBLQ +#else // !USE_VTBLQ // 255 = byte will be zeroed -static const uint8_t kGreenShuffle[8] = { 1, 255, 1, 255, 5, 255, 5, 255 }; +static const uint8_t kGreenShuffle[8] = {1, 255, 1, 255, 5, 255, 5, 255}; static WEBP_INLINE uint8x16_t DoGreenShuffle_NEON(const uint8x16_t argb, const uint8x8_t shuffle) { @@ -76,27 +75,24 @@ static void TransformColor_NEON(const VP8LMultipliers* WEBP_RESTRICT const m, uint32_t* WEBP_RESTRICT argb_data, int num_pixels) { // sign-extended multiplying constants, pre-shifted by 6. -#define CST(X) (((int16_t)(m->X << 8)) >> 6) - const int16_t rb[8] = { - CST(green_to_blue), CST(green_to_red), - CST(green_to_blue), CST(green_to_red), - CST(green_to_blue), CST(green_to_red), - CST(green_to_blue), CST(green_to_red) - }; +#define CST(X) (((int16_t)(m->X << 8)) >> 6) + const int16_t rb[8] = {CST(green_to_blue), CST(green_to_red), + CST(green_to_blue), CST(green_to_red), + CST(green_to_blue), CST(green_to_red), + CST(green_to_blue), CST(green_to_red)}; const int16x8_t mults_rb = vld1q_s16(rb); const int16_t b2[8] = { - 0, CST(red_to_blue), 0, CST(red_to_blue), - 0, CST(red_to_blue), 0, CST(red_to_blue), + 0, CST(red_to_blue), 0, CST(red_to_blue), + 0, CST(red_to_blue), 0, CST(red_to_blue), }; const int16x8_t mults_b2 = vld1q_s16(b2); #undef CST #ifdef USE_VTBLQ - static const uint8_t kg0g0[16] = { - 255, 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255, 13, 255, 13 - }; + static const uint8_t kg0g0[16] = {255, 1, 255, 1, 255, 5, 255, 5, + 255, 9, 255, 9, 255, 13, 255, 13}; const uint8x16_t shuffle = vld1q_u8(kg0g0); #else - static const uint8_t k0g0g[8] = { 255, 1, 255, 1, 255, 5, 255, 5 }; + static const uint8_t k0g0g[8] = {255, 1, 255, 1, 255, 5, 255, 5}; const uint8x8_t shuffle = vld1_u8(k0g0g); #endif const uint32x4_t mask_rb = vdupq_n_u32(0x00ff00ffu); // red-blue masks @@ -114,12 +110,12 @@ static void TransformColor_NEON(const VP8LMultipliers* WEBP_RESTRICT const m, // 0 0 x db2 const uint32x4_t D = vshrq_n_u32(vreinterpretq_u32_s16(C), 16); // x dr x db - const int8x16_t E = vaddq_s8(vreinterpretq_s8_u32(D), - vreinterpretq_s8_s16(A)); + const int8x16_t E = + vaddq_s8(vreinterpretq_s8_u32(D), vreinterpretq_s8_s16(A)); // 0 dr 0 db const uint32x4_t F = vandq_u32(vreinterpretq_u32_s8(E), mask_rb); - const int8x16_t out = vsubq_s8(vreinterpretq_s8_u8(in), - vreinterpretq_s8_u32(F)); + const int8x16_t out = + vsubq_s8(vreinterpretq_s8_u8(in), vreinterpretq_s8_u32(F)); vst1q_s8((int8_t*)(argb_data + i), out); } // fallthrough and finish off with plain-C diff --git a/src/dsp/lossless_enc_sse2.c b/src/dsp/lossless_enc_sse2.c index 88276f4f..026f5045 100644 --- a/src/dsp/lossless_enc_sse2.c +++ b/src/dsp/lossless_enc_sse2.c @@ -14,9 +14,8 @@ #include "src/dsp/dsp.h" #if defined(WEBP_USE_SSE2) -#include - #include +#include #include #include "src/dsp/cpu.h" @@ -27,7 +26,7 @@ #include "src/webp/types.h" // For sign-extended multiplying constants, pre-shifted by 5: -#define CST_5b(X) (((int16_t)((uint16_t)(X) << 8)) >> 5) +#define CST_5b(X) (((int16_t)((uint16_t)(X) << 8)) >> 5) //------------------------------------------------------------------------------ // Subtract-Green Transform @@ -36,8 +35,8 @@ static void SubtractGreenFromBlueAndRed_SSE2(uint32_t* argb_data, int num_pixels) { int i; for (i = 0; i + 4 <= num_pixels; i += 4) { - const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]); // argb - const __m128i A = _mm_srli_epi16(in, 8); // 0 a 0 g + const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]); // argb + const __m128i A = _mm_srli_epi16(in, 8); // 0 a 0 g const __m128i B = _mm_shufflelo_epi16(A, _MM_SHUFFLE(2, 2, 0, 0)); const __m128i C = _mm_shufflehi_epi16(B, _MM_SHUFFLE(2, 2, 0, 0)); // 0g0g const __m128i out = _mm_sub_epi8(in, C); @@ -58,23 +57,23 @@ static void SubtractGreenFromBlueAndRed_SSE2(uint32_t* argb_data, static void TransformColor_SSE2(const VP8LMultipliers* WEBP_RESTRICT const m, uint32_t* WEBP_RESTRICT argb_data, int num_pixels) { - const __m128i mults_rb = MK_CST_16(CST_5b(m->green_to_red), - CST_5b(m->green_to_blue)); + const __m128i mults_rb = + MK_CST_16(CST_5b(m->green_to_red), CST_5b(m->green_to_blue)); const __m128i mults_b2 = MK_CST_16(CST_5b(m->red_to_blue), 0); const __m128i mask_ag = _mm_set1_epi32((int)0xff00ff00); // alpha-green masks const __m128i mask_rb = _mm_set1_epi32(0x00ff00ff); // red-blue masks int i; for (i = 0; i + 4 <= num_pixels; i += 4) { - const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]); // argb - const __m128i A = _mm_and_si128(in, mask_ag); // a 0 g 0 + const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]); // argb + const __m128i A = _mm_and_si128(in, mask_ag); // a 0 g 0 const __m128i B = _mm_shufflelo_epi16(A, _MM_SHUFFLE(2, 2, 0, 0)); const __m128i C = _mm_shufflehi_epi16(B, _MM_SHUFFLE(2, 2, 0, 0)); // g0g0 - const __m128i D = _mm_mulhi_epi16(C, mults_rb); // x dr x db1 - const __m128i E = _mm_slli_epi16(in, 8); // r 0 b 0 - const __m128i F = _mm_mulhi_epi16(E, mults_b2); // x db2 0 0 - const __m128i G = _mm_srli_epi32(F, 16); // 0 0 x db2 - const __m128i H = _mm_add_epi8(G, D); // x dr x db - const __m128i I = _mm_and_si128(H, mask_rb); // 0 dr 0 db + const __m128i D = _mm_mulhi_epi16(C, mults_rb); // x dr x db1 + const __m128i E = _mm_slli_epi16(in, 8); // r 0 b 0 + const __m128i F = _mm_mulhi_epi16(E, mults_b2); // x db2 0 0 + const __m128i G = _mm_srli_epi32(F, 16); // 0 0 x db2 + const __m128i H = _mm_add_epi8(G, D); // x dr x db + const __m128i I = _mm_and_si128(H, mask_rb); // 0 dr 0 db const __m128i out = _mm_sub_epi8(in, I); _mm_storeu_si128((__m128i*)&argb_data[i], out); } @@ -87,10 +86,9 @@ static void TransformColor_SSE2(const VP8LMultipliers* WEBP_RESTRICT const m, //------------------------------------------------------------------------------ #define SPAN 8 static void CollectColorBlueTransforms_SSE2(const uint32_t* WEBP_RESTRICT argb, - int stride, - int tile_width, int tile_height, - int green_to_blue, int red_to_blue, - uint32_t histo[]) { + int stride, int tile_width, + int tile_height, int green_to_blue, + int red_to_blue, uint32_t histo[]) { const __m128i mults_r = MK_CST_16(CST_5b(red_to_blue), 0); const __m128i mults_g = MK_CST_16(0, CST_5b(green_to_blue)); const __m128i mask_g = _mm_set1_epi32(0x00ff00); // green mask @@ -101,25 +99,25 @@ static void CollectColorBlueTransforms_SSE2(const uint32_t* WEBP_RESTRICT argb, int i, x; for (x = 0; x + SPAN <= tile_width; x += SPAN) { uint16_t values[SPAN]; - const __m128i in0 = _mm_loadu_si128((__m128i*)&src[x + 0]); + const __m128i in0 = _mm_loadu_si128((__m128i*)&src[x + 0]); const __m128i in1 = _mm_loadu_si128((__m128i*)&src[x + SPAN / 2]); - const __m128i A0 = _mm_slli_epi16(in0, 8); // r 0 | b 0 + const __m128i A0 = _mm_slli_epi16(in0, 8); // r 0 | b 0 const __m128i A1 = _mm_slli_epi16(in1, 8); - const __m128i B0 = _mm_and_si128(in0, mask_g); // 0 0 | g 0 + const __m128i B0 = _mm_and_si128(in0, mask_g); // 0 0 | g 0 const __m128i B1 = _mm_and_si128(in1, mask_g); const __m128i C0 = _mm_mulhi_epi16(A0, mults_r); // x db | 0 0 const __m128i C1 = _mm_mulhi_epi16(A1, mults_r); const __m128i D0 = _mm_mulhi_epi16(B0, mults_g); // 0 0 | x db const __m128i D1 = _mm_mulhi_epi16(B1, mults_g); - const __m128i E0 = _mm_sub_epi8(in0, D0); // x x | x b' + const __m128i E0 = _mm_sub_epi8(in0, D0); // x x | x b' const __m128i E1 = _mm_sub_epi8(in1, D1); - const __m128i F0 = _mm_srli_epi32(C0, 16); // 0 0 | x db + const __m128i F0 = _mm_srli_epi32(C0, 16); // 0 0 | x db const __m128i F1 = _mm_srli_epi32(C1, 16); - const __m128i G0 = _mm_sub_epi8(E0, F0); // 0 0 | x b' + const __m128i G0 = _mm_sub_epi8(E0, F0); // 0 0 | x b' const __m128i G1 = _mm_sub_epi8(E1, F1); - const __m128i H0 = _mm_and_si128(G0, mask_b); // 0 0 | 0 b + const __m128i H0 = _mm_and_si128(G0, mask_b); // 0 0 | 0 b const __m128i H1 = _mm_and_si128(G1, mask_b); - const __m128i I = _mm_packs_epi32(H0, H1); // 0 b' | 0 b' + const __m128i I = _mm_packs_epi32(H0, H1); // 0 b' | 0 b' _mm_storeu_si128((__m128i*)values, I); for (i = 0; i < SPAN; ++i) ++histo[values[i]]; } @@ -128,16 +126,16 @@ static void CollectColorBlueTransforms_SSE2(const uint32_t* WEBP_RESTRICT argb, const int left_over = tile_width & (SPAN - 1); if (left_over > 0) { VP8LCollectColorBlueTransforms_C(argb + tile_width - left_over, stride, - left_over, tile_height, - green_to_blue, red_to_blue, histo); + left_over, tile_height, green_to_blue, + red_to_blue, histo); } } } static void CollectColorRedTransforms_SSE2(const uint32_t* WEBP_RESTRICT argb, - int stride, - int tile_width, int tile_height, - int green_to_red, uint32_t histo[]) { + int stride, int tile_width, + int tile_height, int green_to_red, + uint32_t histo[]) { const __m128i mults_g = MK_CST_16(0, CST_5b(green_to_red)); const __m128i mask_g = _mm_set1_epi32(0x00ff00); // green mask const __m128i mask = _mm_set1_epi32(0xff); @@ -148,17 +146,17 @@ static void CollectColorRedTransforms_SSE2(const uint32_t* WEBP_RESTRICT argb, int i, x; for (x = 0; x + SPAN <= tile_width; x += SPAN) { uint16_t values[SPAN]; - const __m128i in0 = _mm_loadu_si128((__m128i*)&src[x + 0]); + const __m128i in0 = _mm_loadu_si128((__m128i*)&src[x + 0]); const __m128i in1 = _mm_loadu_si128((__m128i*)&src[x + SPAN / 2]); - const __m128i A0 = _mm_and_si128(in0, mask_g); // 0 0 | g 0 + const __m128i A0 = _mm_and_si128(in0, mask_g); // 0 0 | g 0 const __m128i A1 = _mm_and_si128(in1, mask_g); - const __m128i B0 = _mm_srli_epi32(in0, 16); // 0 0 | x r + const __m128i B0 = _mm_srli_epi32(in0, 16); // 0 0 | x r const __m128i B1 = _mm_srli_epi32(in1, 16); const __m128i C0 = _mm_mulhi_epi16(A0, mults_g); // 0 0 | x dr const __m128i C1 = _mm_mulhi_epi16(A1, mults_g); - const __m128i E0 = _mm_sub_epi8(B0, C0); // x x | x r' + const __m128i E0 = _mm_sub_epi8(B0, C0); // x x | x r' const __m128i E1 = _mm_sub_epi8(B1, C1); - const __m128i F0 = _mm_and_si128(E0, mask); // 0 0 | 0 r' + const __m128i F0 = _mm_and_si128(E0, mask); // 0 0 | 0 r' const __m128i F1 = _mm_and_si128(E1, mask); const __m128i I = _mm_packs_epi32(F0, F1); _mm_storeu_si128((__m128i*)values, I); @@ -169,8 +167,8 @@ static void CollectColorRedTransforms_SSE2(const uint32_t* WEBP_RESTRICT argb, const int left_over = tile_width & (SPAN - 1); if (left_over > 0) { VP8LCollectColorRedTransforms_C(argb + tile_width - left_over, stride, - left_over, tile_height, - green_to_red, histo); + left_over, tile_height, green_to_red, + histo); } } } @@ -193,17 +191,17 @@ static void AddVector_SSE2(const uint32_t* WEBP_RESTRICT a, assert(size % 2 == 0); do { - const __m128i a0 = _mm_loadu_si128((const __m128i*)&a[i + 0]); - const __m128i a1 = _mm_loadu_si128((const __m128i*)&a[i + 4]); - const __m128i a2 = _mm_loadu_si128((const __m128i*)&a[i + 8]); + const __m128i a0 = _mm_loadu_si128((const __m128i*)&a[i + 0]); + const __m128i a1 = _mm_loadu_si128((const __m128i*)&a[i + 4]); + const __m128i a2 = _mm_loadu_si128((const __m128i*)&a[i + 8]); const __m128i a3 = _mm_loadu_si128((const __m128i*)&a[i + 12]); - const __m128i b0 = _mm_loadu_si128((const __m128i*)&b[i + 0]); - const __m128i b1 = _mm_loadu_si128((const __m128i*)&b[i + 4]); - const __m128i b2 = _mm_loadu_si128((const __m128i*)&b[i + 8]); + const __m128i b0 = _mm_loadu_si128((const __m128i*)&b[i + 0]); + const __m128i b1 = _mm_loadu_si128((const __m128i*)&b[i + 4]); + const __m128i b2 = _mm_loadu_si128((const __m128i*)&b[i + 8]); const __m128i b3 = _mm_loadu_si128((const __m128i*)&b[i + 12]); - _mm_storeu_si128((__m128i*)&out[i + 0], _mm_add_epi32(a0, b0)); - _mm_storeu_si128((__m128i*)&out[i + 4], _mm_add_epi32(a1, b1)); - _mm_storeu_si128((__m128i*)&out[i + 8], _mm_add_epi32(a2, b2)); + _mm_storeu_si128((__m128i*)&out[i + 0], _mm_add_epi32(a0, b0)); + _mm_storeu_si128((__m128i*)&out[i + 4], _mm_add_epi32(a1, b1)); + _mm_storeu_si128((__m128i*)&out[i + 8], _mm_add_epi32(a2, b2)); _mm_storeu_si128((__m128i*)&out[i + 12], _mm_add_epi32(a3, b3)); i += 16; } while (i != aligned_size); @@ -241,17 +239,17 @@ static void AddVectorEq_SSE2(const uint32_t* WEBP_RESTRICT a, assert(size % 2 == 0); do { - const __m128i a0 = _mm_loadu_si128((const __m128i*)&a[i + 0]); - const __m128i a1 = _mm_loadu_si128((const __m128i*)&a[i + 4]); - const __m128i a2 = _mm_loadu_si128((const __m128i*)&a[i + 8]); + const __m128i a0 = _mm_loadu_si128((const __m128i*)&a[i + 0]); + const __m128i a1 = _mm_loadu_si128((const __m128i*)&a[i + 4]); + const __m128i a2 = _mm_loadu_si128((const __m128i*)&a[i + 8]); const __m128i a3 = _mm_loadu_si128((const __m128i*)&a[i + 12]); - const __m128i b0 = _mm_loadu_si128((const __m128i*)&out[i + 0]); - const __m128i b1 = _mm_loadu_si128((const __m128i*)&out[i + 4]); - const __m128i b2 = _mm_loadu_si128((const __m128i*)&out[i + 8]); + const __m128i b0 = _mm_loadu_si128((const __m128i*)&out[i + 0]); + const __m128i b1 = _mm_loadu_si128((const __m128i*)&out[i + 4]); + const __m128i b2 = _mm_loadu_si128((const __m128i*)&out[i + 8]); const __m128i b3 = _mm_loadu_si128((const __m128i*)&out[i + 12]); - _mm_storeu_si128((__m128i*)&out[i + 0], _mm_add_epi32(a0, b0)); - _mm_storeu_si128((__m128i*)&out[i + 4], _mm_add_epi32(a1, b1)); - _mm_storeu_si128((__m128i*)&out[i + 8], _mm_add_epi32(a2, b2)); + _mm_storeu_si128((__m128i*)&out[i + 0], _mm_add_epi32(a0, b0)); + _mm_storeu_si128((__m128i*)&out[i + 4], _mm_add_epi32(a1, b1)); + _mm_storeu_si128((__m128i*)&out[i + 8], _mm_add_epi32(a2, b2)); _mm_storeu_si128((__m128i*)&out[i + 12], _mm_add_epi32(a3, b3)); i += 16; } while (i != aligned_size); @@ -291,18 +289,18 @@ static uint64_t CombinedShannonEntropy_SSE2(const uint32_t X[256], const __m128i zero = _mm_setzero_si128(); for (i = 0; i < 256; i += 16) { - const __m128i x0 = _mm_loadu_si128((const __m128i*)(X + i + 0)); - const __m128i y0 = _mm_loadu_si128((const __m128i*)(Y + i + 0)); - const __m128i x1 = _mm_loadu_si128((const __m128i*)(X + i + 4)); - const __m128i y1 = _mm_loadu_si128((const __m128i*)(Y + i + 4)); - const __m128i x2 = _mm_loadu_si128((const __m128i*)(X + i + 8)); - const __m128i y2 = _mm_loadu_si128((const __m128i*)(Y + i + 8)); + const __m128i x0 = _mm_loadu_si128((const __m128i*)(X + i + 0)); + const __m128i y0 = _mm_loadu_si128((const __m128i*)(Y + i + 0)); + const __m128i x1 = _mm_loadu_si128((const __m128i*)(X + i + 4)); + const __m128i y1 = _mm_loadu_si128((const __m128i*)(Y + i + 4)); + const __m128i x2 = _mm_loadu_si128((const __m128i*)(X + i + 8)); + const __m128i y2 = _mm_loadu_si128((const __m128i*)(Y + i + 8)); const __m128i x3 = _mm_loadu_si128((const __m128i*)(X + i + 12)); const __m128i y3 = _mm_loadu_si128((const __m128i*)(Y + i + 12)); - const __m128i x4 = _mm_packs_epi16(_mm_packs_epi32(x0, x1), - _mm_packs_epi32(x2, x3)); - const __m128i y4 = _mm_packs_epi16(_mm_packs_epi32(y0, y1), - _mm_packs_epi32(y2, y3)); + const __m128i x4 = + _mm_packs_epi16(_mm_packs_epi32(x0, x1), _mm_packs_epi32(x2, x3)); + const __m128i y4 = + _mm_packs_epi16(_mm_packs_epi32(y0, y1), _mm_packs_epi32(y2, y3)); const int32_t mx = _mm_movemask_epi8(_mm_cmpgt_epi8(x4, zero)); int32_t my = _mm_movemask_epi8(_mm_cmpgt_epi8(y4, zero)) | mx; while (my) { @@ -325,7 +323,7 @@ static uint64_t CombinedShannonEntropy_SSE2(const uint32_t X[256], #else -#define DONT_USE_COMBINED_SHANNON_ENTROPY_SSE2_FUNC // won't be faster +#define DONT_USE_COMBINED_SHANNON_ENTROPY_SSE2_FUNC // won't be faster #endif @@ -487,28 +485,27 @@ static void PredictorSub0_SSE2(const uint32_t* in, const uint32_t* upper, (void)upper; } -#define GENERATE_PREDICTOR_1(X, IN) \ - static void PredictorSub##X##_SSE2(const uint32_t* const in, \ - const uint32_t* const upper, \ - int num_pixels, \ - uint32_t* WEBP_RESTRICT const out) { \ - int i; \ - for (i = 0; i + 4 <= num_pixels; i += 4) { \ - const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); \ - const __m128i pred = _mm_loadu_si128((const __m128i*)&(IN)); \ - const __m128i res = _mm_sub_epi8(src, pred); \ - _mm_storeu_si128((__m128i*)&out[i], res); \ - } \ - if (i != num_pixels) { \ - VP8LPredictorsSub_C[(X)](in + i, WEBP_OFFSET_PTR(upper, i), \ - num_pixels - i, out + i); \ - } \ +#define GENERATE_PREDICTOR_1(X, IN) \ + static void PredictorSub##X##_SSE2( \ + const uint32_t* const in, const uint32_t* const upper, int num_pixels, \ + uint32_t* WEBP_RESTRICT const out) { \ + int i; \ + for (i = 0; i + 4 <= num_pixels; i += 4) { \ + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); \ + const __m128i pred = _mm_loadu_si128((const __m128i*)&(IN)); \ + const __m128i res = _mm_sub_epi8(src, pred); \ + _mm_storeu_si128((__m128i*)&out[i], res); \ + } \ + if (i != num_pixels) { \ + VP8LPredictorsSub_C[(X)](in + i, WEBP_OFFSET_PTR(upper, i), \ + num_pixels - i, out + i); \ + } \ } -GENERATE_PREDICTOR_1(1, in[i - 1]) // Predictor1: L -GENERATE_PREDICTOR_1(2, upper[i]) // Predictor2: T -GENERATE_PREDICTOR_1(3, upper[i + 1]) // Predictor3: TR -GENERATE_PREDICTOR_1(4, upper[i - 1]) // Predictor4: TL +GENERATE_PREDICTOR_1(1, in[i - 1]) // Predictor1: L +GENERATE_PREDICTOR_1(2, upper[i]) // Predictor2: T +GENERATE_PREDICTOR_1(3, upper[i + 1]) // Predictor3: TR +GENERATE_PREDICTOR_1(4, upper[i - 1]) // Predictor4: TL #undef GENERATE_PREDICTOR_1 // Predictor5: avg2(avg2(L, TR), T) @@ -531,29 +528,29 @@ static void PredictorSub5_SSE2(const uint32_t* in, const uint32_t* upper, } } -#define GENERATE_PREDICTOR_2(X, A, B) \ -static void PredictorSub##X##_SSE2(const uint32_t* in, const uint32_t* upper, \ - int num_pixels, \ - uint32_t* WEBP_RESTRICT out) { \ - int i; \ - for (i = 0; i + 4 <= num_pixels; i += 4) { \ - const __m128i tA = _mm_loadu_si128((const __m128i*)&(A)); \ - const __m128i tB = _mm_loadu_si128((const __m128i*)&(B)); \ - const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); \ - __m128i pred, res; \ - Average2_m128i(&tA, &tB, &pred); \ - res = _mm_sub_epi8(src, pred); \ - _mm_storeu_si128((__m128i*)&out[i], res); \ - } \ - if (i != num_pixels) { \ - VP8LPredictorsSub_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ - } \ -} +#define GENERATE_PREDICTOR_2(X, A, B) \ + static void PredictorSub##X##_SSE2(const uint32_t* in, \ + const uint32_t* upper, int num_pixels, \ + uint32_t* WEBP_RESTRICT out) { \ + int i; \ + for (i = 0; i + 4 <= num_pixels; i += 4) { \ + const __m128i tA = _mm_loadu_si128((const __m128i*)&(A)); \ + const __m128i tB = _mm_loadu_si128((const __m128i*)&(B)); \ + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); \ + __m128i pred, res; \ + Average2_m128i(&tA, &tB, &pred); \ + res = _mm_sub_epi8(src, pred); \ + _mm_storeu_si128((__m128i*)&out[i], res); \ + } \ + if (i != num_pixels) { \ + VP8LPredictorsSub_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ + } \ + } -GENERATE_PREDICTOR_2(6, in[i - 1], upper[i - 1]) // Predictor6: avg(L, TL) -GENERATE_PREDICTOR_2(7, in[i - 1], upper[i]) // Predictor7: avg(L, T) -GENERATE_PREDICTOR_2(8, upper[i - 1], upper[i]) // Predictor8: avg(TL, T) -GENERATE_PREDICTOR_2(9, upper[i], upper[i + 1]) // Predictor9: average(T, TR) +GENERATE_PREDICTOR_2(6, in[i - 1], upper[i - 1]) // Predictor6: avg(L, TL) +GENERATE_PREDICTOR_2(7, in[i - 1], upper[i]) // Predictor7: avg(L, T) +GENERATE_PREDICTOR_2(8, upper[i - 1], upper[i]) // Predictor8: avg(TL, T) +GENERATE_PREDICTOR_2(9, upper[i], upper[i + 1]) // Predictor9: average(T, TR) #undef GENERATE_PREDICTOR_2 // Predictor10: avg(avg(L,TL), avg(T, TR)). @@ -601,13 +598,13 @@ static void PredictorSub11_SSE2(const uint32_t* in, const uint32_t* upper, const __m128i TL = _mm_loadu_si128((const __m128i*)&upper[i - 1]); const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); __m128i pa, pb; - GetSumAbsDiff32_SSE2(&T, &TL, &pa); // pa = sum |T-TL| - GetSumAbsDiff32_SSE2(&L, &TL, &pb); // pb = sum |L-TL| + GetSumAbsDiff32_SSE2(&T, &TL, &pa); // pa = sum |T-TL| + GetSumAbsDiff32_SSE2(&L, &TL, &pb); // pb = sum |L-TL| { const __m128i mask = _mm_cmpgt_epi32(pb, pa); const __m128i A = _mm_and_si128(mask, L); const __m128i B = _mm_andnot_si128(mask, T); - const __m128i pred = _mm_or_si128(A, B); // pred = (L > T)? L : T + const __m128i pred = _mm_or_si128(A, B); // pred = (L > T)? L : T const __m128i res = _mm_sub_epi8(src, pred); _mm_storeu_si128((__m128i*)&out[i], res); } diff --git a/src/dsp/lossless_enc_sse41.c b/src/dsp/lossless_enc_sse41.c index 2c2950a0..bfc3e14d 100644 --- a/src/dsp/lossless_enc_sse41.c +++ b/src/dsp/lossless_enc_sse41.c @@ -14,11 +14,10 @@ #include "src/dsp/dsp.h" #if defined(WEBP_USE_SSE41) +#include #include #include -#include - #include "src/dsp/cpu.h" #include "src/dsp/lossless.h" #include "src/webp/types.h" @@ -55,8 +54,8 @@ static uint32_t ExtraCost_SSE41(const uint32_t* const a, int length) { static void SubtractGreenFromBlueAndRed_SSE41(uint32_t* argb_data, int num_pixels) { int i; - const __m128i kCstShuffle = _mm_set_epi8(-1, 13, -1, 13, -1, 9, -1, 9, - -1, 5, -1, 5, -1, 1, -1, 1); + const __m128i kCstShuffle = + _mm_set_epi8(-1, 13, -1, 13, -1, 9, -1, 9, -1, 5, -1, 5, -1, 1, -1, 1); for (i = 0; i + 4 <= num_pixels; i += 4) { const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]); const __m128i in_0g0g = _mm_shuffle_epi8(in, kCstShuffle); @@ -79,12 +78,12 @@ static void SubtractGreenFromBlueAndRed_SSE41(uint32_t* argb_data, _mm_set1_epi32((int)(((uint32_t)(HI) << 16) | ((LO) & 0xffff))) static void CollectColorBlueTransforms_SSE41(const uint32_t* WEBP_RESTRICT argb, - int stride, - int tile_width, int tile_height, - int green_to_blue, int red_to_blue, + int stride, int tile_width, + int tile_height, int green_to_blue, + int red_to_blue, uint32_t histo[]) { const __m128i mult = - MK_CST_16(CST_5b(red_to_blue) + 256,CST_5b(green_to_blue)); + MK_CST_16(CST_5b(red_to_blue) + 256, CST_5b(green_to_blue)); const __m128i perm = _mm_setr_epi8(-1, 1, -1, 2, -1, 5, -1, 6, -1, 9, -1, 10, -1, 13, -1, 14); if (tile_width >= 4) { @@ -100,18 +99,18 @@ static void CollectColorBlueTransforms_SSE41(const uint32_t* WEBP_RESTRICT argb, for (x = 4; x + 4 <= tile_width; x += 4) { const __m128i A2 = _mm_loadu_si128((const __m128i*)(src + x)); __m128i B2, C2, D2; - ++histo[_mm_extract_epi8(E, 0)]; + ++histo[_mm_extract_epi8(E, 0)]; B2 = _mm_shuffle_epi8(A2, perm); - ++histo[_mm_extract_epi8(E, 4)]; + ++histo[_mm_extract_epi8(E, 4)]; C2 = _mm_mulhi_epi16(B2, mult); - ++histo[_mm_extract_epi8(E, 8)]; + ++histo[_mm_extract_epi8(E, 8)]; D2 = _mm_sub_epi16(A2, C2); ++histo[_mm_extract_epi8(E, 12)]; E = _mm_add_epi16(_mm_srli_epi32(D2, 16), D2); } - ++histo[_mm_extract_epi8(E, 0)]; - ++histo[_mm_extract_epi8(E, 4)]; - ++histo[_mm_extract_epi8(E, 8)]; + ++histo[_mm_extract_epi8(E, 0)]; + ++histo[_mm_extract_epi8(E, 4)]; + ++histo[_mm_extract_epi8(E, 8)]; ++histo[_mm_extract_epi8(E, 12)]; } } @@ -119,16 +118,15 @@ static void CollectColorBlueTransforms_SSE41(const uint32_t* WEBP_RESTRICT argb, const int left_over = tile_width & 3; if (left_over > 0) { VP8LCollectColorBlueTransforms_C(argb + tile_width - left_over, stride, - left_over, tile_height, - green_to_blue, red_to_blue, histo); + left_over, tile_height, green_to_blue, + red_to_blue, histo); } } } static void CollectColorRedTransforms_SSE41(const uint32_t* WEBP_RESTRICT argb, - int stride, - int tile_width, int tile_height, - int green_to_red, + int stride, int tile_width, + int tile_height, int green_to_red, uint32_t histo[]) { const __m128i mult = MK_CST_16(0, CST_5b(green_to_red)); const __m128i mask_g = _mm_set1_epi32(0x0000ff00); @@ -144,16 +142,16 @@ static void CollectColorRedTransforms_SSE41(const uint32_t* WEBP_RESTRICT argb, for (x = 4; x + 4 <= tile_width; x += 4) { const __m128i A2 = _mm_loadu_si128((const __m128i*)(src + x)); __m128i B2, C2; - ++histo[_mm_extract_epi8(D, 2)]; + ++histo[_mm_extract_epi8(D, 2)]; B2 = _mm_and_si128(A2, mask_g); - ++histo[_mm_extract_epi8(D, 6)]; + ++histo[_mm_extract_epi8(D, 6)]; C2 = _mm_madd_epi16(B2, mult); ++histo[_mm_extract_epi8(D, 10)]; ++histo[_mm_extract_epi8(D, 14)]; D = _mm_sub_epi16(A2, C2); } - ++histo[_mm_extract_epi8(D, 2)]; - ++histo[_mm_extract_epi8(D, 6)]; + ++histo[_mm_extract_epi8(D, 2)]; + ++histo[_mm_extract_epi8(D, 6)]; ++histo[_mm_extract_epi8(D, 10)]; ++histo[_mm_extract_epi8(D, 14)]; } diff --git a/src/dsp/lossless_mips_dsp_r2.c b/src/dsp/lossless_mips_dsp_r2.c index 4b4f0564..2a38e0ba 100644 --- a/src/dsp/lossless_mips_dsp_r2.c +++ b/src/dsp/lossless_mips_dsp_r2.c @@ -19,6 +19,7 @@ #include "src/dsp/lossless.h" #include "src/dsp/lossless_common.h" +// clang-format off #define MAP_COLOR_FUNCS(FUNC_NAME, TYPE, GET_INDEX, GET_VALUE) \ static void FUNC_NAME(const TYPE* src, \ const uint32_t* const color_map, \ @@ -29,7 +30,7 @@ static void FUNC_NAME(const TYPE* src, \ int x; \ for (x = 0; x < (width >> 2); ++x) { \ int tmp1, tmp2, tmp3, tmp4; \ - __asm__ volatile ( \ + __asm__ volatile( \ ".ifc " #TYPE ", uint8_t \n\t" \ "lbu %[tmp1], 0(%[src]) \n\t" \ "lbu %[tmp2], 1(%[src]) \n\t" \ @@ -85,6 +86,7 @@ static void FUNC_NAME(const TYPE* src, \ } \ } \ } +// clang-format on MAP_COLOR_FUNCS(MapARGB_MIPSdspR2, uint32_t, VP8GetARGBIndex, VP8GetARGBValue) MAP_COLOR_FUNCS(MapAlpha_MIPSdspR2, uint8_t, VP8GetAlphaIndex, VP8GetAlphaValue) @@ -94,88 +96,83 @@ MAP_COLOR_FUNCS(MapAlpha_MIPSdspR2, uint8_t, VP8GetAlphaIndex, VP8GetAlphaValue) static WEBP_INLINE uint32_t ClampedAddSubtractFull(uint32_t c0, uint32_t c1, uint32_t c2) { int temp0, temp1, temp2, temp3, temp4, temp5; - __asm__ volatile ( - "preceu.ph.qbr %[temp1], %[c0] \n\t" - "preceu.ph.qbl %[temp2], %[c0] \n\t" - "preceu.ph.qbr %[temp3], %[c1] \n\t" - "preceu.ph.qbl %[temp4], %[c1] \n\t" - "preceu.ph.qbr %[temp5], %[c2] \n\t" - "preceu.ph.qbl %[temp0], %[c2] \n\t" - "subq.ph %[temp3], %[temp3], %[temp5] \n\t" - "subq.ph %[temp4], %[temp4], %[temp0] \n\t" - "addq.ph %[temp1], %[temp1], %[temp3] \n\t" - "addq.ph %[temp2], %[temp2], %[temp4] \n\t" - "shll_s.ph %[temp1], %[temp1], 7 \n\t" - "shll_s.ph %[temp2], %[temp2], 7 \n\t" - "precrqu_s.qb.ph %[temp2], %[temp2], %[temp1] \n\t" - : [temp0]"=r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5) - : [c0]"r"(c0), [c1]"r"(c1), [c2]"r"(c2) - : "memory" - ); + __asm__ volatile( + "preceu.ph.qbr %[temp1], %[c0] \n\t" + "preceu.ph.qbl %[temp2], %[c0] \n\t" + "preceu.ph.qbr %[temp3], %[c1] \n\t" + "preceu.ph.qbl %[temp4], %[c1] \n\t" + "preceu.ph.qbr %[temp5], %[c2] \n\t" + "preceu.ph.qbl %[temp0], %[c2] \n\t" + "subq.ph %[temp3], %[temp3], %[temp5] \n\t" + "subq.ph %[temp4], %[temp4], %[temp0] \n\t" + "addq.ph %[temp1], %[temp1], %[temp3] \n\t" + "addq.ph %[temp2], %[temp2], %[temp4] \n\t" + "shll_s.ph %[temp1], %[temp1], 7 \n\t" + "shll_s.ph %[temp2], %[temp2], 7 \n\t" + "precrqu_s.qb.ph %[temp2], %[temp2], %[temp1] \n\t" + : [temp0] "=r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5) + : [c0] "r"(c0), [c1] "r"(c1), [c2] "r"(c2) + : "memory"); return temp2; } static WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1, uint32_t c2) { int temp0, temp1, temp2, temp3, temp4, temp5; - __asm__ volatile ( - "adduh.qb %[temp5], %[c0], %[c1] \n\t" - "preceu.ph.qbr %[temp3], %[c2] \n\t" - "preceu.ph.qbr %[temp1], %[temp5] \n\t" - "preceu.ph.qbl %[temp2], %[temp5] \n\t" - "preceu.ph.qbl %[temp4], %[c2] \n\t" - "subq.ph %[temp3], %[temp1], %[temp3] \n\t" - "subq.ph %[temp4], %[temp2], %[temp4] \n\t" - "shrl.ph %[temp5], %[temp3], 15 \n\t" - "shrl.ph %[temp0], %[temp4], 15 \n\t" - "addq.ph %[temp3], %[temp3], %[temp5] \n\t" - "addq.ph %[temp4], %[temp0], %[temp4] \n\t" - "shra.ph %[temp3], %[temp3], 1 \n\t" - "shra.ph %[temp4], %[temp4], 1 \n\t" - "addq.ph %[temp1], %[temp1], %[temp3] \n\t" - "addq.ph %[temp2], %[temp2], %[temp4] \n\t" - "shll_s.ph %[temp1], %[temp1], 7 \n\t" - "shll_s.ph %[temp2], %[temp2], 7 \n\t" - "precrqu_s.qb.ph %[temp1], %[temp2], %[temp1] \n\t" - : [temp0]"=r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=r"(temp4), [temp5]"=&r"(temp5) - : [c0]"r"(c0), [c1]"r"(c1), [c2]"r"(c2) - : "memory" - ); + __asm__ volatile( + "adduh.qb %[temp5], %[c0], %[c1] \n\t" + "preceu.ph.qbr %[temp3], %[c2] \n\t" + "preceu.ph.qbr %[temp1], %[temp5] \n\t" + "preceu.ph.qbl %[temp2], %[temp5] \n\t" + "preceu.ph.qbl %[temp4], %[c2] \n\t" + "subq.ph %[temp3], %[temp1], %[temp3] \n\t" + "subq.ph %[temp4], %[temp2], %[temp4] \n\t" + "shrl.ph %[temp5], %[temp3], 15 \n\t" + "shrl.ph %[temp0], %[temp4], 15 \n\t" + "addq.ph %[temp3], %[temp3], %[temp5] \n\t" + "addq.ph %[temp4], %[temp0], %[temp4] \n\t" + "shra.ph %[temp3], %[temp3], 1 \n\t" + "shra.ph %[temp4], %[temp4], 1 \n\t" + "addq.ph %[temp1], %[temp1], %[temp3] \n\t" + "addq.ph %[temp2], %[temp2], %[temp4] \n\t" + "shll_s.ph %[temp1], %[temp1], 7 \n\t" + "shll_s.ph %[temp2], %[temp2], 7 \n\t" + "precrqu_s.qb.ph %[temp1], %[temp2], %[temp1] \n\t" + : [temp0] "=r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=r"(temp4), [temp5] "=&r"(temp5) + : [c0] "r"(c0), [c1] "r"(c1), [c2] "r"(c2) + : "memory"); return temp1; } static WEBP_INLINE uint32_t Select(uint32_t a, uint32_t b, uint32_t c) { int temp0, temp1, temp2, temp3, temp4, temp5; - __asm__ volatile ( - "cmpgdu.lt.qb %[temp1], %[c], %[b] \n\t" - "pick.qb %[temp1], %[b], %[c] \n\t" - "pick.qb %[temp2], %[c], %[b] \n\t" - "cmpgdu.lt.qb %[temp4], %[c], %[a] \n\t" - "pick.qb %[temp4], %[a], %[c] \n\t" - "pick.qb %[temp5], %[c], %[a] \n\t" - "subu.qb %[temp3], %[temp1], %[temp2] \n\t" - "subu.qb %[temp0], %[temp4], %[temp5] \n\t" - "raddu.w.qb %[temp3], %[temp3] \n\t" - "raddu.w.qb %[temp0], %[temp0] \n\t" - "subu %[temp3], %[temp3], %[temp0] \n\t" - "slti %[temp0], %[temp3], 0x1 \n\t" - "movz %[a], %[b], %[temp0] \n\t" - : [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), - [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), [temp0]"=&r"(temp0), - [a]"+&r"(a) - : [b]"r"(b), [c]"r"(c) - ); + __asm__ volatile( + "cmpgdu.lt.qb %[temp1], %[c], %[b] \n\t" + "pick.qb %[temp1], %[b], %[c] \n\t" + "pick.qb %[temp2], %[c], %[b] \n\t" + "cmpgdu.lt.qb %[temp4], %[c], %[a] \n\t" + "pick.qb %[temp4], %[a], %[c] \n\t" + "pick.qb %[temp5], %[c], %[a] \n\t" + "subu.qb %[temp3], %[temp1], %[temp2] \n\t" + "subu.qb %[temp0], %[temp4], %[temp5] \n\t" + "raddu.w.qb %[temp3], %[temp3] \n\t" + "raddu.w.qb %[temp0], %[temp0] \n\t" + "subu %[temp3], %[temp3], %[temp0] \n\t" + "slti %[temp0], %[temp3], 0x1 \n\t" + "movz %[a], %[b], %[temp0] \n\t" + : [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), [temp3] "=&r"(temp3), + [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), [temp0] "=&r"(temp0), + [a] "+&r"(a) + : [b] "r"(b), [c] "r"(c)); return a; } static WEBP_INLINE uint32_t Average2(uint32_t a0, uint32_t a1) { - __asm__ volatile ( - "adduh.qb %[a0], %[a0], %[a1] \n\t" - : [a0]"+r"(a0) - : [a1]"r"(a1) - ); + __asm__ volatile("adduh.qb %[a0], %[a0], %[a1] \n\t" + : [a0] "+r"(a0) + : [a1] "r"(a1)); return a0; } @@ -183,8 +180,8 @@ static WEBP_INLINE uint32_t Average3(uint32_t a0, uint32_t a1, uint32_t a2) { return Average2(Average2(a0, a2), a1); } -static WEBP_INLINE uint32_t Average4(uint32_t a0, uint32_t a1, - uint32_t a2, uint32_t a3) { +static WEBP_INLINE uint32_t Average4(uint32_t a0, uint32_t a1, uint32_t a2, + uint32_t a3) { return Average2(Average2(a0, a1), Average2(a2, a3)); } @@ -242,56 +239,55 @@ static void AddGreenToBlueAndRed_MIPSdspR2(const uint32_t* src, int num_pixels, uint32_t temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7; const uint32_t* const p_loop1_end = src + (num_pixels & ~3); const uint32_t* const p_loop2_end = src + num_pixels; - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "beq %[src], %[p_loop1_end], 3f \n\t" - " nop \n\t" - "0: \n\t" - "lw %[temp0], 0(%[src]) \n\t" - "lw %[temp1], 4(%[src]) \n\t" - "lw %[temp2], 8(%[src]) \n\t" - "lw %[temp3], 12(%[src]) \n\t" - "ext %[temp4], %[temp0], 8, 8 \n\t" - "ext %[temp5], %[temp1], 8, 8 \n\t" - "ext %[temp6], %[temp2], 8, 8 \n\t" - "ext %[temp7], %[temp3], 8, 8 \n\t" - "addiu %[src], %[src], 16 \n\t" - "addiu %[dst], %[dst], 16 \n\t" - "replv.ph %[temp4], %[temp4] \n\t" - "replv.ph %[temp5], %[temp5] \n\t" - "replv.ph %[temp6], %[temp6] \n\t" - "replv.ph %[temp7], %[temp7] \n\t" - "addu.qb %[temp0], %[temp0], %[temp4] \n\t" - "addu.qb %[temp1], %[temp1], %[temp5] \n\t" - "addu.qb %[temp2], %[temp2], %[temp6] \n\t" - "addu.qb %[temp3], %[temp3], %[temp7] \n\t" - "sw %[temp0], -16(%[dst]) \n\t" - "sw %[temp1], -12(%[dst]) \n\t" - "sw %[temp2], -8(%[dst]) \n\t" - "bne %[src], %[p_loop1_end], 0b \n\t" - " sw %[temp3], -4(%[dst]) \n\t" - "3: \n\t" - "beq %[src], %[p_loop2_end], 2f \n\t" - " nop \n\t" - "1: \n\t" - "lw %[temp0], 0(%[src]) \n\t" - "addiu %[src], %[src], 4 \n\t" - "addiu %[dst], %[dst], 4 \n\t" - "ext %[temp4], %[temp0], 8, 8 \n\t" - "replv.ph %[temp4], %[temp4] \n\t" - "addu.qb %[temp0], %[temp0], %[temp4] \n\t" - "bne %[src], %[p_loop2_end], 1b \n\t" - " sw %[temp0], -4(%[dst]) \n\t" - "2: \n\t" - ".set pop \n\t" - : [dst]"+&r"(dst), [src]"+&r"(src), [temp0]"=&r"(temp0), - [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), - [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), [temp6]"=&r"(temp6), - [temp7]"=&r"(temp7) - : [p_loop1_end]"r"(p_loop1_end), [p_loop2_end]"r"(p_loop2_end) - : "memory" - ); + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "beq %[src], %[p_loop1_end], 3f \n\t" + " nop \n\t" + "0: \n\t" + "lw %[temp0], 0(%[src]) \n\t" + "lw %[temp1], 4(%[src]) \n\t" + "lw %[temp2], 8(%[src]) \n\t" + "lw %[temp3], 12(%[src]) \n\t" + "ext %[temp4], %[temp0], 8, 8 \n\t" + "ext %[temp5], %[temp1], 8, 8 \n\t" + "ext %[temp6], %[temp2], 8, 8 \n\t" + "ext %[temp7], %[temp3], 8, 8 \n\t" + "addiu %[src], %[src], 16 \n\t" + "addiu %[dst], %[dst], 16 \n\t" + "replv.ph %[temp4], %[temp4] \n\t" + "replv.ph %[temp5], %[temp5] \n\t" + "replv.ph %[temp6], %[temp6] \n\t" + "replv.ph %[temp7], %[temp7] \n\t" + "addu.qb %[temp0], %[temp0], %[temp4] \n\t" + "addu.qb %[temp1], %[temp1], %[temp5] \n\t" + "addu.qb %[temp2], %[temp2], %[temp6] \n\t" + "addu.qb %[temp3], %[temp3], %[temp7] \n\t" + "sw %[temp0], -16(%[dst]) \n\t" + "sw %[temp1], -12(%[dst]) \n\t" + "sw %[temp2], -8(%[dst]) \n\t" + "bne %[src], %[p_loop1_end], 0b \n\t" + " sw %[temp3], -4(%[dst]) \n\t" + "3: \n\t" + "beq %[src], %[p_loop2_end], 2f \n\t" + " nop \n\t" + "1: \n\t" + "lw %[temp0], 0(%[src]) \n\t" + "addiu %[src], %[src], 4 \n\t" + "addiu %[dst], %[dst], 4 \n\t" + "ext %[temp4], %[temp0], 8, 8 \n\t" + "replv.ph %[temp4], %[temp4] \n\t" + "addu.qb %[temp0], %[temp0], %[temp4] \n\t" + "bne %[src], %[p_loop2_end], 1b \n\t" + " sw %[temp0], -4(%[dst]) \n\t" + "2: \n\t" + ".set pop \n\t" + : [dst] "+&r"(dst), [src] "+&r"(src), [temp0] "=&r"(temp0), + [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), [temp3] "=&r"(temp3), + [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), [temp6] "=&r"(temp6), + [temp7] "=&r"(temp7) + : [p_loop1_end] "r"(p_loop1_end), [p_loop2_end] "r"(p_loop2_end) + : "memory"); } static void TransformColorInverse_MIPSdspR2(const VP8LMultipliers* const m, @@ -303,366 +299,360 @@ static void TransformColorInverse_MIPSdspR2(const VP8LMultipliers* const m, const uint32_t G_to_B = m->green_to_blue; const uint32_t R_to_B = m->red_to_blue; const uint32_t* const p_loop_end = src + (num_pixels & ~1); - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "beq %[src], %[p_loop_end], 1f \n\t" - " nop \n\t" - "replv.ph %[temp0], %[G_to_R] \n\t" - "replv.ph %[temp1], %[G_to_B] \n\t" - "replv.ph %[temp2], %[R_to_B] \n\t" - "shll.ph %[temp0], %[temp0], 8 \n\t" - "shll.ph %[temp1], %[temp1], 8 \n\t" - "shll.ph %[temp2], %[temp2], 8 \n\t" - "shra.ph %[temp0], %[temp0], 8 \n\t" - "shra.ph %[temp1], %[temp1], 8 \n\t" - "shra.ph %[temp2], %[temp2], 8 \n\t" - "0: \n\t" - "lw %[argb], 0(%[src]) \n\t" - "lw %[argb1], 4(%[src]) \n\t" - "sw %[argb], 0(%[dst]) \n\t" - "sw %[argb1], 4(%[dst]) \n\t" - "addiu %[src], %[src], 8 \n\t" - "addiu %[dst], %[dst], 8 \n\t" - "precrq.qb.ph %[temp3], %[argb], %[argb1] \n\t" - "preceu.ph.qbra %[temp3], %[temp3] \n\t" - "shll.ph %[temp3], %[temp3], 8 \n\t" - "shra.ph %[temp3], %[temp3], 8 \n\t" - "mul.ph %[temp5], %[temp3], %[temp0] \n\t" - "mul.ph %[temp3], %[temp3], %[temp1] \n\t" - "precrq.ph.w %[new_red], %[argb], %[argb1] \n\t" - "ins %[argb1], %[argb], 16, 16 \n\t" - "shra.ph %[temp5], %[temp5], 5 \n\t" - "shra.ph %[temp3], %[temp3], 5 \n\t" - "addu.ph %[new_red], %[new_red], %[temp5] \n\t" - "addu.ph %[argb1], %[argb1], %[temp3] \n\t" - "preceu.ph.qbra %[temp5], %[new_red] \n\t" - "shll.ph %[temp4], %[temp5], 8 \n\t" - "shra.ph %[temp4], %[temp4], 8 \n\t" - "mul.ph %[temp4], %[temp4], %[temp2] \n\t" - "sb %[temp5], -2(%[dst]) \n\t" - "sra %[temp5], %[temp5], 16 \n\t" - "shra.ph %[temp4], %[temp4], 5 \n\t" - "addu.ph %[argb1], %[argb1], %[temp4] \n\t" - "preceu.ph.qbra %[temp3], %[argb1] \n\t" - "sb %[temp5], -6(%[dst]) \n\t" - "sb %[temp3], -4(%[dst]) \n\t" - "sra %[temp3], %[temp3], 16 \n\t" - "bne %[src], %[p_loop_end], 0b \n\t" - " sb %[temp3], -8(%[dst]) \n\t" - "1: \n\t" - ".set pop \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [new_red]"=&r"(new_red), [argb]"=&r"(argb), - [argb1]"=&r"(argb1), [dst]"+&r"(dst), [src]"+&r"(src) - : [G_to_R]"r"(G_to_R), [R_to_B]"r"(R_to_B), - [G_to_B]"r"(G_to_B), [p_loop_end]"r"(p_loop_end) - : "memory", "hi", "lo" - ); + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "beq %[src], %[p_loop_end], 1f \n\t" + " nop \n\t" + "replv.ph %[temp0], %[G_to_R] \n\t" + "replv.ph %[temp1], %[G_to_B] \n\t" + "replv.ph %[temp2], %[R_to_B] \n\t" + "shll.ph %[temp0], %[temp0], 8 \n\t" + "shll.ph %[temp1], %[temp1], 8 \n\t" + "shll.ph %[temp2], %[temp2], 8 \n\t" + "shra.ph %[temp0], %[temp0], 8 \n\t" + "shra.ph %[temp1], %[temp1], 8 \n\t" + "shra.ph %[temp2], %[temp2], 8 \n\t" + "0: \n\t" + "lw %[argb], 0(%[src]) \n\t" + "lw %[argb1], 4(%[src]) \n\t" + "sw %[argb], 0(%[dst]) \n\t" + "sw %[argb1], 4(%[dst]) \n\t" + "addiu %[src], %[src], 8 \n\t" + "addiu %[dst], %[dst], 8 \n\t" + "precrq.qb.ph %[temp3], %[argb], %[argb1] \n\t" + "preceu.ph.qbra %[temp3], %[temp3] \n\t" + "shll.ph %[temp3], %[temp3], 8 \n\t" + "shra.ph %[temp3], %[temp3], 8 \n\t" + "mul.ph %[temp5], %[temp3], %[temp0] \n\t" + "mul.ph %[temp3], %[temp3], %[temp1] \n\t" + "precrq.ph.w %[new_red], %[argb], %[argb1] \n\t" + "ins %[argb1], %[argb], 16, 16 \n\t" + "shra.ph %[temp5], %[temp5], 5 \n\t" + "shra.ph %[temp3], %[temp3], 5 \n\t" + "addu.ph %[new_red], %[new_red], %[temp5] \n\t" + "addu.ph %[argb1], %[argb1], %[temp3] \n\t" + "preceu.ph.qbra %[temp5], %[new_red] \n\t" + "shll.ph %[temp4], %[temp5], 8 \n\t" + "shra.ph %[temp4], %[temp4], 8 \n\t" + "mul.ph %[temp4], %[temp4], %[temp2] \n\t" + "sb %[temp5], -2(%[dst]) \n\t" + "sra %[temp5], %[temp5], 16 \n\t" + "shra.ph %[temp4], %[temp4], 5 \n\t" + "addu.ph %[argb1], %[argb1], %[temp4] \n\t" + "preceu.ph.qbra %[temp3], %[argb1] \n\t" + "sb %[temp5], -6(%[dst]) \n\t" + "sb %[temp3], -4(%[dst]) \n\t" + "sra %[temp3], %[temp3], 16 \n\t" + "bne %[src], %[p_loop_end], 0b \n\t" + " sb %[temp3], -8(%[dst]) \n\t" + "1: \n\t" + ".set pop \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [new_red] "=&r"(new_red), [argb] "=&r"(argb), [argb1] "=&r"(argb1), + [dst] "+&r"(dst), [src] "+&r"(src) + : [G_to_R] "r"(G_to_R), [R_to_B] "r"(R_to_B), [G_to_B] "r"(G_to_B), + [p_loop_end] "r"(p_loop_end) + : "memory", "hi", "lo"); // Fall-back to C-version for left-overs. if (num_pixels & 1) VP8LTransformColorInverse_C(m, src, 1, dst); } -static void ConvertBGRAToRGB_MIPSdspR2(const uint32_t* src, - int num_pixels, uint8_t* dst) { +static void ConvertBGRAToRGB_MIPSdspR2(const uint32_t* src, int num_pixels, + uint8_t* dst) { int temp0, temp1, temp2, temp3; const uint32_t* const p_loop1_end = src + (num_pixels & ~3); const uint32_t* const p_loop2_end = src + num_pixels; - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "beq %[src], %[p_loop1_end], 3f \n\t" - " nop \n\t" - "0: \n\t" - "lw %[temp3], 12(%[src]) \n\t" - "lw %[temp2], 8(%[src]) \n\t" - "lw %[temp1], 4(%[src]) \n\t" - "lw %[temp0], 0(%[src]) \n\t" - "ins %[temp3], %[temp2], 24, 8 \n\t" - "sll %[temp2], %[temp2], 8 \n\t" - "rotr %[temp3], %[temp3], 16 \n\t" - "ins %[temp2], %[temp1], 0, 16 \n\t" - "sll %[temp1], %[temp1], 8 \n\t" - "wsbh %[temp3], %[temp3] \n\t" - "balign %[temp0], %[temp1], 1 \n\t" - "wsbh %[temp2], %[temp2] \n\t" - "wsbh %[temp0], %[temp0] \n\t" - "usw %[temp3], 8(%[dst]) \n\t" - "rotr %[temp0], %[temp0], 16 \n\t" - "usw %[temp2], 4(%[dst]) \n\t" - "addiu %[src], %[src], 16 \n\t" - "usw %[temp0], 0(%[dst]) \n\t" - "bne %[src], %[p_loop1_end], 0b \n\t" - " addiu %[dst], %[dst], 12 \n\t" - "3: \n\t" - "beq %[src], %[p_loop2_end], 2f \n\t" - " nop \n\t" - "1: \n\t" - "lw %[temp0], 0(%[src]) \n\t" - "addiu %[src], %[src], 4 \n\t" - "wsbh %[temp1], %[temp0] \n\t" - "addiu %[dst], %[dst], 3 \n\t" - "ush %[temp1], -2(%[dst]) \n\t" - "sra %[temp0], %[temp0], 16 \n\t" - "bne %[src], %[p_loop2_end], 1b \n\t" - " sb %[temp0], -3(%[dst]) \n\t" - "2: \n\t" - ".set pop \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [dst]"+&r"(dst), [src]"+&r"(src) - : [p_loop1_end]"r"(p_loop1_end), [p_loop2_end]"r"(p_loop2_end) - : "memory" - ); + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "beq %[src], %[p_loop1_end], 3f \n\t" + " nop \n\t" + "0: \n\t" + "lw %[temp3], 12(%[src]) \n\t" + "lw %[temp2], 8(%[src]) \n\t" + "lw %[temp1], 4(%[src]) \n\t" + "lw %[temp0], 0(%[src]) \n\t" + "ins %[temp3], %[temp2], 24, 8 \n\t" + "sll %[temp2], %[temp2], 8 \n\t" + "rotr %[temp3], %[temp3], 16 \n\t" + "ins %[temp2], %[temp1], 0, 16 \n\t" + "sll %[temp1], %[temp1], 8 \n\t" + "wsbh %[temp3], %[temp3] \n\t" + "balign %[temp0], %[temp1], 1 \n\t" + "wsbh %[temp2], %[temp2] \n\t" + "wsbh %[temp0], %[temp0] \n\t" + "usw %[temp3], 8(%[dst]) \n\t" + "rotr %[temp0], %[temp0], 16 \n\t" + "usw %[temp2], 4(%[dst]) \n\t" + "addiu %[src], %[src], 16 \n\t" + "usw %[temp0], 0(%[dst]) \n\t" + "bne %[src], %[p_loop1_end], 0b \n\t" + " addiu %[dst], %[dst], 12 \n\t" + "3: \n\t" + "beq %[src], %[p_loop2_end], 2f \n\t" + " nop \n\t" + "1: \n\t" + "lw %[temp0], 0(%[src]) \n\t" + "addiu %[src], %[src], 4 \n\t" + "wsbh %[temp1], %[temp0] \n\t" + "addiu %[dst], %[dst], 3 \n\t" + "ush %[temp1], -2(%[dst]) \n\t" + "sra %[temp0], %[temp0], 16 \n\t" + "bne %[src], %[p_loop2_end], 1b \n\t" + " sb %[temp0], -3(%[dst]) \n\t" + "2: \n\t" + ".set pop \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [dst] "+&r"(dst), [src] "+&r"(src) + : [p_loop1_end] "r"(p_loop1_end), [p_loop2_end] "r"(p_loop2_end) + : "memory"); } -static void ConvertBGRAToRGBA_MIPSdspR2(const uint32_t* src, - int num_pixels, uint8_t* dst) { +static void ConvertBGRAToRGBA_MIPSdspR2(const uint32_t* src, int num_pixels, + uint8_t* dst) { int temp0, temp1, temp2, temp3; const uint32_t* const p_loop1_end = src + (num_pixels & ~3); const uint32_t* const p_loop2_end = src + num_pixels; - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "beq %[src], %[p_loop1_end], 3f \n\t" - " nop \n\t" - "0: \n\t" - "lw %[temp0], 0(%[src]) \n\t" - "lw %[temp1], 4(%[src]) \n\t" - "lw %[temp2], 8(%[src]) \n\t" - "lw %[temp3], 12(%[src]) \n\t" - "wsbh %[temp0], %[temp0] \n\t" - "wsbh %[temp1], %[temp1] \n\t" - "wsbh %[temp2], %[temp2] \n\t" - "wsbh %[temp3], %[temp3] \n\t" - "addiu %[src], %[src], 16 \n\t" - "balign %[temp0], %[temp0], 1 \n\t" - "balign %[temp1], %[temp1], 1 \n\t" - "balign %[temp2], %[temp2], 1 \n\t" - "balign %[temp3], %[temp3], 1 \n\t" - "usw %[temp0], 0(%[dst]) \n\t" - "usw %[temp1], 4(%[dst]) \n\t" - "usw %[temp2], 8(%[dst]) \n\t" - "usw %[temp3], 12(%[dst]) \n\t" - "bne %[src], %[p_loop1_end], 0b \n\t" - " addiu %[dst], %[dst], 16 \n\t" - "3: \n\t" - "beq %[src], %[p_loop2_end], 2f \n\t" - " nop \n\t" - "1: \n\t" - "lw %[temp0], 0(%[src]) \n\t" - "wsbh %[temp0], %[temp0] \n\t" - "addiu %[src], %[src], 4 \n\t" - "balign %[temp0], %[temp0], 1 \n\t" - "usw %[temp0], 0(%[dst]) \n\t" - "bne %[src], %[p_loop2_end], 1b \n\t" - " addiu %[dst], %[dst], 4 \n\t" - "2: \n\t" - ".set pop \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [dst]"+&r"(dst), [src]"+&r"(src) - : [p_loop1_end]"r"(p_loop1_end), [p_loop2_end]"r"(p_loop2_end) - : "memory" - ); + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "beq %[src], %[p_loop1_end], 3f \n\t" + " nop \n\t" + "0: \n\t" + "lw %[temp0], 0(%[src]) \n\t" + "lw %[temp1], 4(%[src]) \n\t" + "lw %[temp2], 8(%[src]) \n\t" + "lw %[temp3], 12(%[src]) \n\t" + "wsbh %[temp0], %[temp0] \n\t" + "wsbh %[temp1], %[temp1] \n\t" + "wsbh %[temp2], %[temp2] \n\t" + "wsbh %[temp3], %[temp3] \n\t" + "addiu %[src], %[src], 16 \n\t" + "balign %[temp0], %[temp0], 1 \n\t" + "balign %[temp1], %[temp1], 1 \n\t" + "balign %[temp2], %[temp2], 1 \n\t" + "balign %[temp3], %[temp3], 1 \n\t" + "usw %[temp0], 0(%[dst]) \n\t" + "usw %[temp1], 4(%[dst]) \n\t" + "usw %[temp2], 8(%[dst]) \n\t" + "usw %[temp3], 12(%[dst]) \n\t" + "bne %[src], %[p_loop1_end], 0b \n\t" + " addiu %[dst], %[dst], 16 \n\t" + "3: \n\t" + "beq %[src], %[p_loop2_end], 2f \n\t" + " nop \n\t" + "1: \n\t" + "lw %[temp0], 0(%[src]) \n\t" + "wsbh %[temp0], %[temp0] \n\t" + "addiu %[src], %[src], 4 \n\t" + "balign %[temp0], %[temp0], 1 \n\t" + "usw %[temp0], 0(%[dst]) \n\t" + "bne %[src], %[p_loop2_end], 1b \n\t" + " addiu %[dst], %[dst], 4 \n\t" + "2: \n\t" + ".set pop \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [dst] "+&r"(dst), [src] "+&r"(src) + : [p_loop1_end] "r"(p_loop1_end), [p_loop2_end] "r"(p_loop2_end) + : "memory"); } -static void ConvertBGRAToRGBA4444_MIPSdspR2(const uint32_t* src, - int num_pixels, uint8_t* dst) { +static void ConvertBGRAToRGBA4444_MIPSdspR2(const uint32_t* src, int num_pixels, + uint8_t* dst) { int temp0, temp1, temp2, temp3, temp4, temp5; const uint32_t* const p_loop1_end = src + (num_pixels & ~3); const uint32_t* const p_loop2_end = src + num_pixels; - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "beq %[src], %[p_loop1_end], 3f \n\t" - " nop \n\t" - "0: \n\t" - "lw %[temp0], 0(%[src]) \n\t" - "lw %[temp1], 4(%[src]) \n\t" - "lw %[temp2], 8(%[src]) \n\t" - "lw %[temp3], 12(%[src]) \n\t" - "ext %[temp4], %[temp0], 28, 4 \n\t" - "ext %[temp5], %[temp0], 12, 4 \n\t" - "ins %[temp0], %[temp4], 0, 4 \n\t" - "ext %[temp4], %[temp1], 28, 4 \n\t" - "ins %[temp0], %[temp5], 16, 4 \n\t" - "ext %[temp5], %[temp1], 12, 4 \n\t" - "ins %[temp1], %[temp4], 0, 4 \n\t" - "ext %[temp4], %[temp2], 28, 4 \n\t" - "ins %[temp1], %[temp5], 16, 4 \n\t" - "ext %[temp5], %[temp2], 12, 4 \n\t" - "ins %[temp2], %[temp4], 0, 4 \n\t" - "ext %[temp4], %[temp3], 28, 4 \n\t" - "ins %[temp2], %[temp5], 16, 4 \n\t" - "ext %[temp5], %[temp3], 12, 4 \n\t" - "ins %[temp3], %[temp4], 0, 4 \n\t" - "precr.qb.ph %[temp1], %[temp1], %[temp0] \n\t" - "ins %[temp3], %[temp5], 16, 4 \n\t" - "addiu %[src], %[src], 16 \n\t" - "precr.qb.ph %[temp3], %[temp3], %[temp2] \n\t" + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "beq %[src], %[p_loop1_end], 3f \n\t" + " nop \n\t" + "0: \n\t" + "lw %[temp0], 0(%[src]) \n\t" + "lw %[temp1], 4(%[src]) \n\t" + "lw %[temp2], 8(%[src]) \n\t" + "lw %[temp3], 12(%[src]) \n\t" + "ext %[temp4], %[temp0], 28, 4 \n\t" + "ext %[temp5], %[temp0], 12, 4 \n\t" + "ins %[temp0], %[temp4], 0, 4 \n\t" + "ext %[temp4], %[temp1], 28, 4 \n\t" + "ins %[temp0], %[temp5], 16, 4 \n\t" + "ext %[temp5], %[temp1], 12, 4 \n\t" + "ins %[temp1], %[temp4], 0, 4 \n\t" + "ext %[temp4], %[temp2], 28, 4 \n\t" + "ins %[temp1], %[temp5], 16, 4 \n\t" + "ext %[temp5], %[temp2], 12, 4 \n\t" + "ins %[temp2], %[temp4], 0, 4 \n\t" + "ext %[temp4], %[temp3], 28, 4 \n\t" + "ins %[temp2], %[temp5], 16, 4 \n\t" + "ext %[temp5], %[temp3], 12, 4 \n\t" + "ins %[temp3], %[temp4], 0, 4 \n\t" + "precr.qb.ph %[temp1], %[temp1], %[temp0] \n\t" + "ins %[temp3], %[temp5], 16, 4 \n\t" + "addiu %[src], %[src], 16 \n\t" + "precr.qb.ph %[temp3], %[temp3], %[temp2] \n\t" #if (WEBP_SWAP_16BIT_CSP == 1) - "usw %[temp1], 0(%[dst]) \n\t" - "usw %[temp3], 4(%[dst]) \n\t" + "usw %[temp1], 0(%[dst]) \n\t" + "usw %[temp3], 4(%[dst]) \n\t" #else - "wsbh %[temp1], %[temp1] \n\t" - "wsbh %[temp3], %[temp3] \n\t" - "usw %[temp1], 0(%[dst]) \n\t" - "usw %[temp3], 4(%[dst]) \n\t" + "wsbh %[temp1], %[temp1] \n\t" + "wsbh %[temp3], %[temp3] \n\t" + "usw %[temp1], 0(%[dst]) \n\t" + "usw %[temp3], 4(%[dst]) \n\t" #endif - "bne %[src], %[p_loop1_end], 0b \n\t" - " addiu %[dst], %[dst], 8 \n\t" - "3: \n\t" - "beq %[src], %[p_loop2_end], 2f \n\t" - " nop \n\t" - "1: \n\t" - "lw %[temp0], 0(%[src]) \n\t" - "ext %[temp4], %[temp0], 28, 4 \n\t" - "ext %[temp5], %[temp0], 12, 4 \n\t" - "ins %[temp0], %[temp4], 0, 4 \n\t" - "ins %[temp0], %[temp5], 16, 4 \n\t" - "addiu %[src], %[src], 4 \n\t" - "precr.qb.ph %[temp0], %[temp0], %[temp0] \n\t" + "bne %[src], %[p_loop1_end], 0b \n\t" + " addiu %[dst], %[dst], 8 \n\t" + "3: \n\t" + "beq %[src], %[p_loop2_end], 2f \n\t" + " nop \n\t" + "1: \n\t" + "lw %[temp0], 0(%[src]) \n\t" + "ext %[temp4], %[temp0], 28, 4 \n\t" + "ext %[temp5], %[temp0], 12, 4 \n\t" + "ins %[temp0], %[temp4], 0, 4 \n\t" + "ins %[temp0], %[temp5], 16, 4 \n\t" + "addiu %[src], %[src], 4 \n\t" + "precr.qb.ph %[temp0], %[temp0], %[temp0] \n\t" #if (WEBP_SWAP_16BIT_CSP == 1) - "ush %[temp0], 0(%[dst]) \n\t" + "ush %[temp0], 0(%[dst]) \n\t" #else - "wsbh %[temp0], %[temp0] \n\t" - "ush %[temp0], 0(%[dst]) \n\t" + "wsbh %[temp0], %[temp0] \n\t" + "ush %[temp0], 0(%[dst]) \n\t" #endif - "bne %[src], %[p_loop2_end], 1b \n\t" - " addiu %[dst], %[dst], 2 \n\t" - "2: \n\t" - ".set pop \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [dst]"+&r"(dst), [src]"+&r"(src) - : [p_loop1_end]"r"(p_loop1_end), [p_loop2_end]"r"(p_loop2_end) - : "memory" - ); + "bne %[src], %[p_loop2_end], 1b \n\t" + " addiu %[dst], %[dst], 2 \n\t" + "2: \n\t" + ".set pop \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [dst] "+&r"(dst), [src] "+&r"(src) + : [p_loop1_end] "r"(p_loop1_end), [p_loop2_end] "r"(p_loop2_end) + : "memory"); } -static void ConvertBGRAToRGB565_MIPSdspR2(const uint32_t* src, - int num_pixels, uint8_t* dst) { +static void ConvertBGRAToRGB565_MIPSdspR2(const uint32_t* src, int num_pixels, + uint8_t* dst) { int temp0, temp1, temp2, temp3, temp4, temp5; const uint32_t* const p_loop1_end = src + (num_pixels & ~3); const uint32_t* const p_loop2_end = src + num_pixels; - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "beq %[src], %[p_loop1_end], 3f \n\t" - " nop \n\t" - "0: \n\t" - "lw %[temp0], 0(%[src]) \n\t" - "lw %[temp1], 4(%[src]) \n\t" - "lw %[temp2], 8(%[src]) \n\t" - "lw %[temp3], 12(%[src]) \n\t" - "ext %[temp4], %[temp0], 8, 16 \n\t" - "ext %[temp5], %[temp0], 5, 11 \n\t" - "ext %[temp0], %[temp0], 3, 5 \n\t" - "ins %[temp4], %[temp5], 0, 11 \n\t" - "ext %[temp5], %[temp1], 5, 11 \n\t" - "ins %[temp4], %[temp0], 0, 5 \n\t" - "ext %[temp0], %[temp1], 8, 16 \n\t" - "ext %[temp1], %[temp1], 3, 5 \n\t" - "ins %[temp0], %[temp5], 0, 11 \n\t" - "ext %[temp5], %[temp2], 5, 11 \n\t" - "ins %[temp0], %[temp1], 0, 5 \n\t" - "ext %[temp1], %[temp2], 8, 16 \n\t" - "ext %[temp2], %[temp2], 3, 5 \n\t" - "ins %[temp1], %[temp5], 0, 11 \n\t" - "ext %[temp5], %[temp3], 5, 11 \n\t" - "ins %[temp1], %[temp2], 0, 5 \n\t" - "ext %[temp2], %[temp3], 8, 16 \n\t" - "ext %[temp3], %[temp3], 3, 5 \n\t" - "ins %[temp2], %[temp5], 0, 11 \n\t" - "append %[temp0], %[temp4], 16 \n\t" - "ins %[temp2], %[temp3], 0, 5 \n\t" - "addiu %[src], %[src], 16 \n\t" - "append %[temp2], %[temp1], 16 \n\t" + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "beq %[src], %[p_loop1_end], 3f \n\t" + " nop \n\t" + "0: \n\t" + "lw %[temp0], 0(%[src]) \n\t" + "lw %[temp1], 4(%[src]) \n\t" + "lw %[temp2], 8(%[src]) \n\t" + "lw %[temp3], 12(%[src]) \n\t" + "ext %[temp4], %[temp0], 8, 16 \n\t" + "ext %[temp5], %[temp0], 5, 11 \n\t" + "ext %[temp0], %[temp0], 3, 5 \n\t" + "ins %[temp4], %[temp5], 0, 11 \n\t" + "ext %[temp5], %[temp1], 5, 11 \n\t" + "ins %[temp4], %[temp0], 0, 5 \n\t" + "ext %[temp0], %[temp1], 8, 16 \n\t" + "ext %[temp1], %[temp1], 3, 5 \n\t" + "ins %[temp0], %[temp5], 0, 11 \n\t" + "ext %[temp5], %[temp2], 5, 11 \n\t" + "ins %[temp0], %[temp1], 0, 5 \n\t" + "ext %[temp1], %[temp2], 8, 16 \n\t" + "ext %[temp2], %[temp2], 3, 5 \n\t" + "ins %[temp1], %[temp5], 0, 11 \n\t" + "ext %[temp5], %[temp3], 5, 11 \n\t" + "ins %[temp1], %[temp2], 0, 5 \n\t" + "ext %[temp2], %[temp3], 8, 16 \n\t" + "ext %[temp3], %[temp3], 3, 5 \n\t" + "ins %[temp2], %[temp5], 0, 11 \n\t" + "append %[temp0], %[temp4], 16 \n\t" + "ins %[temp2], %[temp3], 0, 5 \n\t" + "addiu %[src], %[src], 16 \n\t" + "append %[temp2], %[temp1], 16 \n\t" #if (WEBP_SWAP_16BIT_CSP == 1) - "usw %[temp0], 0(%[dst]) \n\t" - "usw %[temp2], 4(%[dst]) \n\t" + "usw %[temp0], 0(%[dst]) \n\t" + "usw %[temp2], 4(%[dst]) \n\t" #else - "wsbh %[temp0], %[temp0] \n\t" - "wsbh %[temp2], %[temp2] \n\t" - "usw %[temp0], 0(%[dst]) \n\t" - "usw %[temp2], 4(%[dst]) \n\t" + "wsbh %[temp0], %[temp0] \n\t" + "wsbh %[temp2], %[temp2] \n\t" + "usw %[temp0], 0(%[dst]) \n\t" + "usw %[temp2], 4(%[dst]) \n\t" #endif - "bne %[src], %[p_loop1_end], 0b \n\t" - " addiu %[dst], %[dst], 8 \n\t" - "3: \n\t" - "beq %[src], %[p_loop2_end], 2f \n\t" - " nop \n\t" - "1: \n\t" - "lw %[temp0], 0(%[src]) \n\t" - "ext %[temp4], %[temp0], 8, 16 \n\t" - "ext %[temp5], %[temp0], 5, 11 \n\t" - "ext %[temp0], %[temp0], 3, 5 \n\t" - "ins %[temp4], %[temp5], 0, 11 \n\t" - "addiu %[src], %[src], 4 \n\t" - "ins %[temp4], %[temp0], 0, 5 \n\t" + "bne %[src], %[p_loop1_end], 0b \n\t" + " addiu %[dst], %[dst], 8 \n\t" + "3: \n\t" + "beq %[src], %[p_loop2_end], 2f \n\t" + " nop \n\t" + "1: \n\t" + "lw %[temp0], 0(%[src]) \n\t" + "ext %[temp4], %[temp0], 8, 16 \n\t" + "ext %[temp5], %[temp0], 5, 11 \n\t" + "ext %[temp0], %[temp0], 3, 5 \n\t" + "ins %[temp4], %[temp5], 0, 11 \n\t" + "addiu %[src], %[src], 4 \n\t" + "ins %[temp4], %[temp0], 0, 5 \n\t" #if (WEBP_SWAP_16BIT_CSP == 1) - "ush %[temp4], 0(%[dst]) \n\t" + "ush %[temp4], 0(%[dst]) \n\t" #else - "wsbh %[temp4], %[temp4] \n\t" - "ush %[temp4], 0(%[dst]) \n\t" + "wsbh %[temp4], %[temp4] \n\t" + "ush %[temp4], 0(%[dst]) \n\t" #endif - "bne %[src], %[p_loop2_end], 1b \n\t" - " addiu %[dst], %[dst], 2 \n\t" - "2: \n\t" - ".set pop \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), - [dst]"+&r"(dst), [src]"+&r"(src) - : [p_loop1_end]"r"(p_loop1_end), [p_loop2_end]"r"(p_loop2_end) - : "memory" - ); + "bne %[src], %[p_loop2_end], 1b \n\t" + " addiu %[dst], %[dst], 2 \n\t" + "2: \n\t" + ".set pop \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), + [dst] "+&r"(dst), [src] "+&r"(src) + : [p_loop1_end] "r"(p_loop1_end), [p_loop2_end] "r"(p_loop2_end) + : "memory"); } -static void ConvertBGRAToBGR_MIPSdspR2(const uint32_t* src, - int num_pixels, uint8_t* dst) { +static void ConvertBGRAToBGR_MIPSdspR2(const uint32_t* src, int num_pixels, + uint8_t* dst) { int temp0, temp1, temp2, temp3; const uint32_t* const p_loop1_end = src + (num_pixels & ~3); const uint32_t* const p_loop2_end = src + num_pixels; - __asm__ volatile ( - ".set push \n\t" - ".set noreorder \n\t" - "beq %[src], %[p_loop1_end], 3f \n\t" - " nop \n\t" - "0: \n\t" - "lw %[temp0], 0(%[src]) \n\t" - "lw %[temp1], 4(%[src]) \n\t" - "lw %[temp2], 8(%[src]) \n\t" - "lw %[temp3], 12(%[src]) \n\t" - "ins %[temp0], %[temp1], 24, 8 \n\t" - "sra %[temp1], %[temp1], 8 \n\t" - "ins %[temp1], %[temp2], 16, 16 \n\t" - "sll %[temp2], %[temp2], 8 \n\t" - "balign %[temp3], %[temp2], 1 \n\t" - "addiu %[src], %[src], 16 \n\t" - "usw %[temp0], 0(%[dst]) \n\t" - "usw %[temp1], 4(%[dst]) \n\t" - "usw %[temp3], 8(%[dst]) \n\t" - "bne %[src], %[p_loop1_end], 0b \n\t" - " addiu %[dst], %[dst], 12 \n\t" - "3: \n\t" - "beq %[src], %[p_loop2_end], 2f \n\t" - " nop \n\t" - "1: \n\t" - "lw %[temp0], 0(%[src]) \n\t" - "addiu %[src], %[src], 4 \n\t" - "addiu %[dst], %[dst], 3 \n\t" - "ush %[temp0], -3(%[dst]) \n\t" - "sra %[temp0], %[temp0], 16 \n\t" - "bne %[src], %[p_loop2_end], 1b \n\t" - " sb %[temp0], -1(%[dst]) \n\t" - "2: \n\t" - ".set pop \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), - [temp3]"=&r"(temp3), [dst]"+&r"(dst), [src]"+&r"(src) - : [p_loop1_end]"r"(p_loop1_end), [p_loop2_end]"r"(p_loop2_end) - : "memory" - ); + __asm__ volatile( + ".set push \n\t" + ".set noreorder \n\t" + "beq %[src], %[p_loop1_end], 3f \n\t" + " nop \n\t" + "0: \n\t" + "lw %[temp0], 0(%[src]) \n\t" + "lw %[temp1], 4(%[src]) \n\t" + "lw %[temp2], 8(%[src]) \n\t" + "lw %[temp3], 12(%[src]) \n\t" + "ins %[temp0], %[temp1], 24, 8 \n\t" + "sra %[temp1], %[temp1], 8 \n\t" + "ins %[temp1], %[temp2], 16, 16 \n\t" + "sll %[temp2], %[temp2], 8 \n\t" + "balign %[temp3], %[temp2], 1 \n\t" + "addiu %[src], %[src], 16 \n\t" + "usw %[temp0], 0(%[dst]) \n\t" + "usw %[temp1], 4(%[dst]) \n\t" + "usw %[temp3], 8(%[dst]) \n\t" + "bne %[src], %[p_loop1_end], 0b \n\t" + " addiu %[dst], %[dst], 12 \n\t" + "3: \n\t" + "beq %[src], %[p_loop2_end], 2f \n\t" + " nop \n\t" + "1: \n\t" + "lw %[temp0], 0(%[src]) \n\t" + "addiu %[src], %[src], 4 \n\t" + "addiu %[dst], %[dst], 3 \n\t" + "ush %[temp0], -3(%[dst]) \n\t" + "sra %[temp0], %[temp0], 16 \n\t" + "bne %[src], %[p_loop2_end], 1b \n\t" + " sb %[temp0], -1(%[dst]) \n\t" + "2: \n\t" + ".set pop \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2), + [temp3] "=&r"(temp3), [dst] "+&r"(dst), [src] "+&r"(src) + : [p_loop1_end] "r"(p_loop1_end), [p_loop2_end] "r"(p_loop2_end) + : "memory"); } //------------------------------------------------------------------------------ diff --git a/src/dsp/lossless_msa.c b/src/dsp/lossless_msa.c index 0f8ef410..a0370d1e 100644 --- a/src/dsp/lossless_msa.c +++ b/src/dsp/lossless_msa.c @@ -21,101 +21,109 @@ //------------------------------------------------------------------------------ // Colorspace conversion functions -#define CONVERT16_BGRA_XXX(psrc, pdst, m0, m1, m2) do { \ - v16u8 src0, src1, src2, src3, dst0, dst1, dst2; \ - LD_UB4(psrc, 16, src0, src1, src2, src3); \ - VSHF_B2_UB(src0, src1, src1, src2, m0, m1, dst0, dst1); \ - dst2 = VSHF_UB(src2, src3, m2); \ - ST_UB2(dst0, dst1, pdst, 16); \ - ST_UB(dst2, pdst + 32); \ -} while (0) +#define CONVERT16_BGRA_XXX(psrc, pdst, m0, m1, m2) \ + do { \ + v16u8 src0, src1, src2, src3, dst0, dst1, dst2; \ + LD_UB4(psrc, 16, src0, src1, src2, src3); \ + VSHF_B2_UB(src0, src1, src1, src2, m0, m1, dst0, dst1); \ + dst2 = VSHF_UB(src2, src3, m2); \ + ST_UB2(dst0, dst1, pdst, 16); \ + ST_UB(dst2, pdst + 32); \ + } while (0) -#define CONVERT12_BGRA_XXX(psrc, pdst, m0, m1, m2) do { \ - uint32_t pix_w; \ - v16u8 src0, src1, src2, dst0, dst1, dst2; \ - LD_UB3(psrc, 16, src0, src1, src2); \ - VSHF_B2_UB(src0, src1, src1, src2, m0, m1, dst0, dst1); \ - dst2 = VSHF_UB(src2, src2, m2); \ - ST_UB2(dst0, dst1, pdst, 16); \ - pix_w = __msa_copy_s_w((v4i32)dst2, 0); \ - SW(pix_w, pdst + 32); \ -} while (0) +#define CONVERT12_BGRA_XXX(psrc, pdst, m0, m1, m2) \ + do { \ + uint32_t pix_w; \ + v16u8 src0, src1, src2, dst0, dst1, dst2; \ + LD_UB3(psrc, 16, src0, src1, src2); \ + VSHF_B2_UB(src0, src1, src1, src2, m0, m1, dst0, dst1); \ + dst2 = VSHF_UB(src2, src2, m2); \ + ST_UB2(dst0, dst1, pdst, 16); \ + pix_w = __msa_copy_s_w((v4i32)dst2, 0); \ + SW(pix_w, pdst + 32); \ + } while (0) -#define CONVERT8_BGRA_XXX(psrc, pdst, m0, m1) do { \ - uint64_t pix_d; \ - v16u8 src0, src1, src2 = { 0 }, dst0, dst1; \ - LD_UB2(psrc, 16, src0, src1); \ - VSHF_B2_UB(src0, src1, src1, src2, m0, m1, dst0, dst1); \ - ST_UB(dst0, pdst); \ - pix_d = __msa_copy_s_d((v2i64)dst1, 0); \ - SD(pix_d, pdst + 16); \ -} while (0) +#define CONVERT8_BGRA_XXX(psrc, pdst, m0, m1) \ + do { \ + uint64_t pix_d; \ + v16u8 src0, src1, src2 = {0}, dst0, dst1; \ + LD_UB2(psrc, 16, src0, src1); \ + VSHF_B2_UB(src0, src1, src1, src2, m0, m1, dst0, dst1); \ + ST_UB(dst0, pdst); \ + pix_d = __msa_copy_s_d((v2i64)dst1, 0); \ + SD(pix_d, pdst + 16); \ + } while (0) -#define CONVERT4_BGRA_XXX(psrc, pdst, m) do { \ - const v16u8 src0 = LD_UB(psrc); \ - const v16u8 dst0 = VSHF_UB(src0, src0, m); \ - uint64_t pix_d = __msa_copy_s_d((v2i64)dst0, 0); \ - uint32_t pix_w = __msa_copy_s_w((v4i32)dst0, 2); \ - SD(pix_d, pdst + 0); \ - SW(pix_w, pdst + 8); \ -} while (0) +#define CONVERT4_BGRA_XXX(psrc, pdst, m) \ + do { \ + const v16u8 src0 = LD_UB(psrc); \ + const v16u8 dst0 = VSHF_UB(src0, src0, m); \ + uint64_t pix_d = __msa_copy_s_d((v2i64)dst0, 0); \ + uint32_t pix_w = __msa_copy_s_w((v4i32)dst0, 2); \ + SD(pix_d, pdst + 0); \ + SW(pix_w, pdst + 8); \ + } while (0) -#define CONVERT1_BGRA_BGR(psrc, pdst) do { \ - const int32_t b = (psrc)[0]; \ - const int32_t g = (psrc)[1]; \ - const int32_t r = (psrc)[2]; \ - (pdst)[0] = b; \ - (pdst)[1] = g; \ - (pdst)[2] = r; \ -} while (0) +#define CONVERT1_BGRA_BGR(psrc, pdst) \ + do { \ + const int32_t b = (psrc)[0]; \ + const int32_t g = (psrc)[1]; \ + const int32_t r = (psrc)[2]; \ + (pdst)[0] = b; \ + (pdst)[1] = g; \ + (pdst)[2] = r; \ + } while (0) -#define CONVERT1_BGRA_RGB(psrc, pdst) do { \ - const int32_t b = (psrc)[0]; \ - const int32_t g = (psrc)[1]; \ - const int32_t r = (psrc)[2]; \ - (pdst)[0] = r; \ - (pdst)[1] = g; \ - (pdst)[2] = b; \ -} while (0) +#define CONVERT1_BGRA_RGB(psrc, pdst) \ + do { \ + const int32_t b = (psrc)[0]; \ + const int32_t g = (psrc)[1]; \ + const int32_t r = (psrc)[2]; \ + (pdst)[0] = r; \ + (pdst)[1] = g; \ + (pdst)[2] = b; \ + } while (0) -#define TRANSFORM_COLOR_INVERSE_8(src0, src1, dst0, dst1, \ - c0, c1, mask0, mask1) do { \ - v8i16 g0, g1, t0, t1, t2, t3; \ - v4i32 t4, t5; \ - VSHF_B2_SH(src0, src0, src1, src1, mask0, mask0, g0, g1); \ - DOTP_SB2_SH(g0, g1, c0, c0, t0, t1); \ - SRAI_H2_SH(t0, t1, 5); \ - t0 = __msa_addv_h(t0, (v8i16)src0); \ - t1 = __msa_addv_h(t1, (v8i16)src1); \ - t4 = __msa_srli_w((v4i32)t0, 16); \ - t5 = __msa_srli_w((v4i32)t1, 16); \ - DOTP_SB2_SH(t4, t5, c1, c1, t2, t3); \ - SRAI_H2_SH(t2, t3, 5); \ - ADD2(t0, t2, t1, t3, t0, t1); \ - VSHF_B2_UB(src0, t0, src1, t1, mask1, mask1, dst0, dst1); \ -} while (0) +#define TRANSFORM_COLOR_INVERSE_8(src0, src1, dst0, dst1, c0, c1, mask0, \ + mask1) \ + do { \ + v8i16 g0, g1, t0, t1, t2, t3; \ + v4i32 t4, t5; \ + VSHF_B2_SH(src0, src0, src1, src1, mask0, mask0, g0, g1); \ + DOTP_SB2_SH(g0, g1, c0, c0, t0, t1); \ + SRAI_H2_SH(t0, t1, 5); \ + t0 = __msa_addv_h(t0, (v8i16)src0); \ + t1 = __msa_addv_h(t1, (v8i16)src1); \ + t4 = __msa_srli_w((v4i32)t0, 16); \ + t5 = __msa_srli_w((v4i32)t1, 16); \ + DOTP_SB2_SH(t4, t5, c1, c1, t2, t3); \ + SRAI_H2_SH(t2, t3, 5); \ + ADD2(t0, t2, t1, t3, t0, t1); \ + VSHF_B2_UB(src0, t0, src1, t1, mask1, mask1, dst0, dst1); \ + } while (0) -#define TRANSFORM_COLOR_INVERSE_4(src, dst, c0, c1, mask0, mask1) do { \ - const v16i8 g0 = VSHF_SB(src, src, mask0); \ - v8i16 t0 = __msa_dotp_s_h(c0, g0); \ - v8i16 t1; \ - v4i32 t2; \ - t0 = SRAI_H(t0, 5); \ - t0 = __msa_addv_h(t0, (v8i16)src); \ - t2 = __msa_srli_w((v4i32)t0, 16); \ - t1 = __msa_dotp_s_h(c1, (v16i8)t2); \ - t1 = SRAI_H(t1, 5); \ - t0 = t0 + t1; \ - dst = VSHF_UB(src, t0, mask1); \ -} while (0) +#define TRANSFORM_COLOR_INVERSE_4(src, dst, c0, c1, mask0, mask1) \ + do { \ + const v16i8 g0 = VSHF_SB(src, src, mask0); \ + v8i16 t0 = __msa_dotp_s_h(c0, g0); \ + v8i16 t1; \ + v4i32 t2; \ + t0 = SRAI_H(t0, 5); \ + t0 = __msa_addv_h(t0, (v8i16)src); \ + t2 = __msa_srli_w((v4i32)t0, 16); \ + t1 = __msa_dotp_s_h(c1, (v16i8)t2); \ + t1 = SRAI_H(t1, 5); \ + t0 = t0 + t1; \ + dst = VSHF_UB(src, t0, mask1); \ + } while (0) -static void ConvertBGRAToRGBA_MSA(const uint32_t* src, - int num_pixels, uint8_t* dst) { +static void ConvertBGRAToRGBA_MSA(const uint32_t* src, int num_pixels, + uint8_t* dst) { int i; const uint8_t* ptemp_src = (const uint8_t*)src; uint8_t* ptemp_dst = (uint8_t*)dst; v16u8 src0, dst0; - const v16u8 mask = { 2, 1, 0, 3, 6, 5, 4, 7, 10, 9, 8, 11, 14, 13, 12, 15 }; + const v16u8 mask = {2, 1, 0, 3, 6, 5, 4, 7, 10, 9, 8, 11, 14, 13, 12, 15}; while (num_pixels >= 8) { v16u8 src1, dst1; @@ -150,16 +158,15 @@ static void ConvertBGRAToRGBA_MSA(const uint32_t* src, } } -static void ConvertBGRAToBGR_MSA(const uint32_t* src, - int num_pixels, uint8_t* dst) { +static void ConvertBGRAToBGR_MSA(const uint32_t* src, int num_pixels, + uint8_t* dst) { const uint8_t* ptemp_src = (const uint8_t*)src; uint8_t* ptemp_dst = (uint8_t*)dst; - const v16u8 mask0 = { 0, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 14, - 16, 17, 18, 20 }; - const v16u8 mask1 = { 5, 6, 8, 9, 10, 12, 13, 14, 16, 17, 18, 20, - 21, 22, 24, 25 }; - const v16u8 mask2 = { 10, 12, 13, 14, 16, 17, 18, 20, 21, 22, 24, 25, - 26, 28, 29, 30 }; + const v16u8 mask0 = {0, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 14, 16, 17, 18, 20}; + const v16u8 mask1 = {5, 6, 8, 9, 10, 12, 13, 14, + 16, 17, 18, 20, 21, 22, 24, 25}; + const v16u8 mask2 = {10, 12, 13, 14, 16, 17, 18, 20, + 21, 22, 24, 25, 26, 28, 29, 30}; while (num_pixels >= 16) { CONVERT16_BGRA_XXX(ptemp_src, ptemp_dst, mask0, mask1, mask2); @@ -197,16 +204,15 @@ static void ConvertBGRAToBGR_MSA(const uint32_t* src, } } -static void ConvertBGRAToRGB_MSA(const uint32_t* src, - int num_pixels, uint8_t* dst) { +static void ConvertBGRAToRGB_MSA(const uint32_t* src, int num_pixels, + uint8_t* dst) { const uint8_t* ptemp_src = (const uint8_t*)src; uint8_t* ptemp_dst = (uint8_t*)dst; - const v16u8 mask0 = { 2, 1, 0, 6, 5, 4, 10, 9, 8, 14, 13, 12, - 18, 17, 16, 22 }; - const v16u8 mask1 = { 5, 4, 10, 9, 8, 14, 13, 12, 18, 17, 16, 22, - 21, 20, 26, 25 }; - const v16u8 mask2 = { 8, 14, 13, 12, 18, 17, 16, 22, 21, 20, 26, 25, - 24, 30, 29, 28 }; + const v16u8 mask0 = {2, 1, 0, 6, 5, 4, 10, 9, 8, 14, 13, 12, 18, 17, 16, 22}; + const v16u8 mask1 = {5, 4, 10, 9, 8, 14, 13, 12, + 18, 17, 16, 22, 21, 20, 26, 25}; + const v16u8 mask2 = {8, 14, 13, 12, 18, 17, 16, 22, + 21, 20, 26, 25, 24, 30, 29, 28}; while (num_pixels >= 16) { CONVERT16_BGRA_XXX(ptemp_src, ptemp_dst, mask0, mask1, mask2); @@ -250,8 +256,8 @@ static void AddGreenToBlueAndRed_MSA(const uint32_t* const src, int num_pixels, const uint8_t* in = (const uint8_t*)src; uint8_t* out = (uint8_t*)dst; v16u8 src0, dst0, tmp0; - const v16u8 mask = { 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255, - 13, 255, 13, 255 }; + const v16u8 mask = {1, 255, 1, 255, 5, 255, 5, 255, + 9, 255, 9, 255, 13, 255, 13, 255}; while (num_pixels >= 8) { v16u8 src1, dst1, tmp1; @@ -290,13 +296,13 @@ static void TransformColorInverse_MSA(const VP8LMultipliers* const m, const uint32_t* src, int num_pixels, uint32_t* dst) { v16u8 src0, dst0; - const v16i8 g2br = (v16i8)__msa_fill_w(m->green_to_blue | - (m->green_to_red << 16)); + const v16i8 g2br = + (v16i8)__msa_fill_w(m->green_to_blue | (m->green_to_red << 16)); const v16i8 r2b = (v16i8)__msa_fill_w(m->red_to_blue); - const v16u8 mask0 = { 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255, - 13, 255, 13, 255 }; - const v16u8 mask1 = { 16, 1, 18, 3, 20, 5, 22, 7, 24, 9, 26, 11, - 28, 13, 30, 15 }; + const v16u8 mask0 = {1, 255, 1, 255, 5, 255, 5, 255, + 9, 255, 9, 255, 13, 255, 13, 255}; + const v16u8 mask1 = {16, 1, 18, 3, 20, 5, 22, 7, + 24, 9, 26, 11, 28, 13, 30, 15}; while (num_pixels >= 8) { v16u8 src1, dst1; diff --git a/src/dsp/lossless_neon.c b/src/dsp/lossless_neon.c index 0a85edd4..8364c442 100644 --- a/src/dsp/lossless_neon.c +++ b/src/dsp/lossless_neon.c @@ -47,7 +47,7 @@ static void ConvertBGRAToBGR_NEON(const uint32_t* WEBP_RESTRICT src, const uint32_t* const end = src + (num_pixels & ~15); for (; src < end; src += 16) { const uint8x16x4_t pixel = vld4q_u8((uint8_t*)src); - const uint8x16x3_t tmp = { { pixel.val[0], pixel.val[1], pixel.val[2] } }; + const uint8x16x3_t tmp = {{pixel.val[0], pixel.val[1], pixel.val[2]}}; vst3q_u8(dst, tmp); dst += 48; } @@ -59,7 +59,7 @@ static void ConvertBGRAToRGB_NEON(const uint32_t* WEBP_RESTRICT src, const uint32_t* const end = src + (num_pixels & ~15); for (; src < end; src += 16) { const uint8x16x4_t pixel = vld4q_u8((uint8_t*)src); - const uint8x16x3_t tmp = { { pixel.val[2], pixel.val[1], pixel.val[0] } }; + const uint8x16x3_t tmp = {{pixel.val[2], pixel.val[1], pixel.val[0]}}; vst3q_u8(dst, tmp); dst += 48; } @@ -70,7 +70,7 @@ static void ConvertBGRAToRGB_NEON(const uint32_t* WEBP_RESTRICT src, // gcc-4.6.0 fallback -static const uint8_t kRGBAShuffle[8] = { 2, 1, 0, 3, 6, 5, 4, 7 }; +static const uint8_t kRGBAShuffle[8] = {2, 1, 0, 3, 6, 5, 4, 7}; static void ConvertBGRAToRGBA_NEON(const uint32_t* WEBP_RESTRICT src, int num_pixels, uint8_t* WEBP_RESTRICT dst) { @@ -84,11 +84,9 @@ static void ConvertBGRAToRGBA_NEON(const uint32_t* WEBP_RESTRICT src, VP8LConvertBGRAToRGBA_C(src, num_pixels & 1, dst); // left-overs } -static const uint8_t kBGRShuffle[3][8] = { - { 0, 1, 2, 4, 5, 6, 8, 9 }, - { 10, 12, 13, 14, 16, 17, 18, 20 }, - { 21, 22, 24, 25, 26, 28, 29, 30 } -}; +static const uint8_t kBGRShuffle[3][8] = {{0, 1, 2, 4, 5, 6, 8, 9}, + {10, 12, 13, 14, 16, 17, 18, 20}, + {21, 22, 24, 25, 26, 28, 29, 30}}; static void ConvertBGRAToBGR_NEON(const uint32_t* WEBP_RESTRICT src, int num_pixels, uint8_t* WEBP_RESTRICT dst) { @@ -98,24 +96,21 @@ static void ConvertBGRAToBGR_NEON(const uint32_t* WEBP_RESTRICT src, const uint8x8_t shuffle2 = vld1_u8(kBGRShuffle[2]); for (; src < end; src += 8) { uint8x8x4_t pixels; - INIT_VECTOR4(pixels, - vld1_u8((const uint8_t*)(src + 0)), + INIT_VECTOR4(pixels, vld1_u8((const uint8_t*)(src + 0)), vld1_u8((const uint8_t*)(src + 2)), vld1_u8((const uint8_t*)(src + 4)), vld1_u8((const uint8_t*)(src + 6))); - vst1_u8(dst + 0, vtbl4_u8(pixels, shuffle0)); - vst1_u8(dst + 8, vtbl4_u8(pixels, shuffle1)); + vst1_u8(dst + 0, vtbl4_u8(pixels, shuffle0)); + vst1_u8(dst + 8, vtbl4_u8(pixels, shuffle1)); vst1_u8(dst + 16, vtbl4_u8(pixels, shuffle2)); dst += 8 * 3; } VP8LConvertBGRAToBGR_C(src, num_pixels & 7, dst); // left-overs } -static const uint8_t kRGBShuffle[3][8] = { - { 2, 1, 0, 6, 5, 4, 10, 9 }, - { 8, 14, 13, 12, 18, 17, 16, 22 }, - { 21, 20, 26, 25, 24, 30, 29, 28 } -}; +static const uint8_t kRGBShuffle[3][8] = {{2, 1, 0, 6, 5, 4, 10, 9}, + {8, 14, 13, 12, 18, 17, 16, 22}, + {21, 20, 26, 25, 24, 30, 29, 28}}; static void ConvertBGRAToRGB_NEON(const uint32_t* WEBP_RESTRICT src, int num_pixels, uint8_t* WEBP_RESTRICT dst) { @@ -125,20 +120,19 @@ static void ConvertBGRAToRGB_NEON(const uint32_t* WEBP_RESTRICT src, const uint8x8_t shuffle2 = vld1_u8(kRGBShuffle[2]); for (; src < end; src += 8) { uint8x8x4_t pixels; - INIT_VECTOR4(pixels, - vld1_u8((const uint8_t*)(src + 0)), + INIT_VECTOR4(pixels, vld1_u8((const uint8_t*)(src + 0)), vld1_u8((const uint8_t*)(src + 2)), vld1_u8((const uint8_t*)(src + 4)), vld1_u8((const uint8_t*)(src + 6))); - vst1_u8(dst + 0, vtbl4_u8(pixels, shuffle0)); - vst1_u8(dst + 8, vtbl4_u8(pixels, shuffle1)); + vst1_u8(dst + 0, vtbl4_u8(pixels, shuffle0)); + vst1_u8(dst + 8, vtbl4_u8(pixels, shuffle1)); vst1_u8(dst + 16, vtbl4_u8(pixels, shuffle2)); dst += 8 * 3; } VP8LConvertBGRAToRGB_C(src, num_pixels & 7, dst); // left-overs } -#endif // !WORK_AROUND_GCC +#endif // !WORK_AROUND_GCC //------------------------------------------------------------------------------ // Predictor Transform @@ -150,7 +144,7 @@ static void ConvertBGRAToRGB_NEON(const uint32_t* WEBP_RESTRICT src, #define GET_U8_AS_U32(IN) vget_lane_u32(vreinterpret_u32_u8((IN)), 0) #define GETQ_U8_AS_U32(IN) vgetq_lane_u32(vreinterpretq_u32_u8((IN)), 0) #define STOREQ_U8_AS_U32P(OUT, IN) vst1q_u32((OUT), vreinterpretq_u32_u8((IN))) -#define ROTATE32_LEFT(L) vextq_u8((L), (L), 12) // D|C|B|A -> C|B|A|D +#define ROTATE32_LEFT(L) vextq_u8((L), (L), 12) // D|C|B|A -> C|B|A|D static WEBP_INLINE uint8x8_t Average2_u8_NEON(uint32_t a0, uint32_t a1) { const uint8x8_t A0 = LOAD_U32_AS_U8(a0); @@ -246,19 +240,19 @@ static void PredictorAdd1_NEON(const uint32_t* in, const uint32_t* upper, // Macro that adds 32-bit integers from IN using mod 256 arithmetic // per 8 bit channel. -#define GENERATE_PREDICTOR_1(X, IN) \ -static void PredictorAdd##X##_NEON(const uint32_t* in, \ - const uint32_t* upper, int num_pixels, \ - uint32_t* WEBP_RESTRICT out) { \ - int i; \ - for (i = 0; i + 4 <= num_pixels; i += 4) { \ - const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); \ - const uint8x16_t other = LOADQ_U32P_AS_U8(&(IN)); \ - const uint8x16_t res = vaddq_u8(src, other); \ - STOREQ_U8_AS_U32P(&out[i], res); \ - } \ - VP8LPredictorsAdd_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ -} +#define GENERATE_PREDICTOR_1(X, IN) \ + static void PredictorAdd##X##_NEON(const uint32_t* in, \ + const uint32_t* upper, int num_pixels, \ + uint32_t* WEBP_RESTRICT out) { \ + int i; \ + for (i = 0; i + 4 <= num_pixels; i += 4) { \ + const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); \ + const uint8x16_t other = LOADQ_U32P_AS_U8(&(IN)); \ + const uint8x16_t res = vaddq_u8(src, other); \ + STOREQ_U8_AS_U32P(&out[i], res); \ + } \ + VP8LPredictorsAdd_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ + } // Predictor2: Top. GENERATE_PREDICTOR_1(2, upper[i]) // Predictor3: Top-right. @@ -268,13 +262,14 @@ GENERATE_PREDICTOR_1(4, upper[i - 1]) #undef GENERATE_PREDICTOR_1 // Predictor5: average(average(left, TR), T) -#define DO_PRED5(LANE) do { \ - const uint8x16_t avgLTR = vhaddq_u8(L, TR); \ - const uint8x16_t avg = vhaddq_u8(avgLTR, T); \ - const uint8x16_t res = vaddq_u8(avg, src); \ - vst1q_lane_u32(&out[i + (LANE)], vreinterpretq_u32_u8(res), (LANE)); \ - L = ROTATE32_LEFT(res); \ -} while (0) +#define DO_PRED5(LANE) \ + do { \ + const uint8x16_t avgLTR = vhaddq_u8(L, TR); \ + const uint8x16_t avg = vhaddq_u8(avgLTR, T); \ + const uint8x16_t res = vaddq_u8(avg, src); \ + vst1q_lane_u32(&out[i + (LANE)], vreinterpretq_u32_u8(res), (LANE)); \ + L = ROTATE32_LEFT(res); \ + } while (0) static void PredictorAdd5_NEON(const uint32_t* in, const uint32_t* upper, int num_pixels, uint32_t* WEBP_RESTRICT out) { @@ -293,12 +288,13 @@ static void PredictorAdd5_NEON(const uint32_t* in, const uint32_t* upper, } #undef DO_PRED5 -#define DO_PRED67(LANE) do { \ - const uint8x16_t avg = vhaddq_u8(L, top); \ - const uint8x16_t res = vaddq_u8(avg, src); \ - vst1q_lane_u32(&out[i + (LANE)], vreinterpretq_u32_u8(res), (LANE)); \ - L = ROTATE32_LEFT(res); \ -} while (0) +#define DO_PRED67(LANE) \ + do { \ + const uint8x16_t avg = vhaddq_u8(L, top); \ + const uint8x16_t res = vaddq_u8(avg, src); \ + vst1q_lane_u32(&out[i + (LANE)], vreinterpretq_u32_u8(res), (LANE)); \ + L = ROTATE32_LEFT(res); \ + } while (0) // Predictor6: average(left, TL) static void PredictorAdd6_NEON(const uint32_t* in, const uint32_t* upper, @@ -333,21 +329,21 @@ static void PredictorAdd7_NEON(const uint32_t* in, const uint32_t* upper, } #undef DO_PRED67 -#define GENERATE_PREDICTOR_2(X, IN) \ -static void PredictorAdd##X##_NEON(const uint32_t* in, \ - const uint32_t* upper, int num_pixels, \ - uint32_t* WEBP_RESTRICT out) { \ - int i; \ - for (i = 0; i + 4 <= num_pixels; i += 4) { \ - const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); \ - const uint8x16_t Tother = LOADQ_U32P_AS_U8(&(IN)); \ - const uint8x16_t T = LOADQ_U32P_AS_U8(&upper[i]); \ - const uint8x16_t avg = vhaddq_u8(T, Tother); \ - const uint8x16_t res = vaddq_u8(avg, src); \ - STOREQ_U8_AS_U32P(&out[i], res); \ - } \ - VP8LPredictorsAdd_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ -} +#define GENERATE_PREDICTOR_2(X, IN) \ + static void PredictorAdd##X##_NEON(const uint32_t* in, \ + const uint32_t* upper, int num_pixels, \ + uint32_t* WEBP_RESTRICT out) { \ + int i; \ + for (i = 0; i + 4 <= num_pixels; i += 4) { \ + const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); \ + const uint8x16_t Tother = LOADQ_U32P_AS_U8(&(IN)); \ + const uint8x16_t T = LOADQ_U32P_AS_U8(&upper[i]); \ + const uint8x16_t avg = vhaddq_u8(T, Tother); \ + const uint8x16_t res = vaddq_u8(avg, src); \ + STOREQ_U8_AS_U32P(&out[i], res); \ + } \ + VP8LPredictorsAdd_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ + } // Predictor8: average TL T. GENERATE_PREDICTOR_2(8, upper[i - 1]) // Predictor9: average T TR. @@ -355,13 +351,14 @@ GENERATE_PREDICTOR_2(9, upper[i + 1]) #undef GENERATE_PREDICTOR_2 // Predictor10: average of (average of (L,TL), average of (T, TR)). -#define DO_PRED10(LANE) do { \ - const uint8x16_t avgLTL = vhaddq_u8(L, TL); \ - const uint8x16_t avg = vhaddq_u8(avgTTR, avgLTL); \ - const uint8x16_t res = vaddq_u8(avg, src); \ - vst1q_lane_u32(&out[i + (LANE)], vreinterpretq_u32_u8(res), (LANE)); \ - L = ROTATE32_LEFT(res); \ -} while (0) +#define DO_PRED10(LANE) \ + do { \ + const uint8x16_t avgLTL = vhaddq_u8(L, TL); \ + const uint8x16_t avg = vhaddq_u8(avgTTR, avgLTL); \ + const uint8x16_t res = vaddq_u8(avg, src); \ + vst1q_lane_u32(&out[i + (LANE)], vreinterpretq_u32_u8(res), (LANE)); \ + L = ROTATE32_LEFT(res); \ + } while (0) static void PredictorAdd10_NEON(const uint32_t* in, const uint32_t* upper, int num_pixels, uint32_t* WEBP_RESTRICT out) { @@ -383,16 +380,18 @@ static void PredictorAdd10_NEON(const uint32_t* in, const uint32_t* upper, #undef DO_PRED10 // Predictor11: select. -#define DO_PRED11(LANE) do { \ - const uint8x16_t sumLin = vaddq_u8(L, src); /* in + L */ \ - const uint8x16_t pLTL = vabdq_u8(L, TL); /* |L - TL| */ \ - const uint16x8_t sum_LTL = vpaddlq_u8(pLTL); \ - const uint32x4_t pa = vpaddlq_u16(sum_LTL); \ - const uint32x4_t mask = vcleq_u32(pa, pb); \ - const uint8x16_t res = vbslq_u8(vreinterpretq_u8_u32(mask), sumTin, sumLin); \ - vst1q_lane_u32(&out[i + (LANE)], vreinterpretq_u32_u8(res), (LANE)); \ - L = ROTATE32_LEFT(res); \ -} while (0) +#define DO_PRED11(LANE) \ + do { \ + const uint8x16_t sumLin = vaddq_u8(L, src); /* in + L */ \ + const uint8x16_t pLTL = vabdq_u8(L, TL); /* |L - TL| */ \ + const uint16x8_t sum_LTL = vpaddlq_u8(pLTL); \ + const uint32x4_t pa = vpaddlq_u16(sum_LTL); \ + const uint32x4_t mask = vcleq_u32(pa, pb); \ + const uint8x16_t res = \ + vbslq_u8(vreinterpretq_u8_u32(mask), sumTin, sumLin); \ + vst1q_lane_u32(&out[i + (LANE)], vreinterpretq_u32_u8(res), (LANE)); \ + L = ROTATE32_LEFT(res); \ + } while (0) static void PredictorAdd11_NEON(const uint32_t* in, const uint32_t* upper, int num_pixels, uint32_t* WEBP_RESTRICT out) { @@ -401,11 +400,11 @@ static void PredictorAdd11_NEON(const uint32_t* in, const uint32_t* upper, for (i = 0; i + 4 <= num_pixels; i += 4) { const uint8x16_t T = LOADQ_U32P_AS_U8(&upper[i]); const uint8x16_t TL = LOADQ_U32P_AS_U8(&upper[i - 1]); - const uint8x16_t pTTL = vabdq_u8(T, TL); // |T - TL| + const uint8x16_t pTTL = vabdq_u8(T, TL); // |T - TL| const uint16x8_t sum_TTL = vpaddlq_u8(pTTL); const uint32x4_t pb = vpaddlq_u16(sum_TTL); const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); - const uint8x16_t sumTin = vaddq_u8(T, src); // in + T + const uint8x16_t sumTin = vaddq_u8(T, src); // in + T DO_PRED11(0); DO_PRED11(1); DO_PRED11(2); @@ -416,16 +415,17 @@ static void PredictorAdd11_NEON(const uint32_t* in, const uint32_t* upper, #undef DO_PRED11 // Predictor12: ClampedAddSubtractFull. -#define DO_PRED12(DIFF, LANE) do { \ - const uint8x8_t pred = \ - vqmovun_s16(vaddq_s16(vreinterpretq_s16_u16(L), (DIFF))); \ - const uint8x8_t res = \ - vadd_u8(pred, (LANE <= 1) ? vget_low_u8(src) : vget_high_u8(src)); \ - const uint16x8_t res16 = vmovl_u8(res); \ - vst1_lane_u32(&out[i + (LANE)], vreinterpret_u32_u8(res), (LANE) & 1); \ - /* rotate in the left predictor for next iteration */ \ - L = vextq_u16(res16, res16, 4); \ -} while (0) +#define DO_PRED12(DIFF, LANE) \ + do { \ + const uint8x8_t pred = \ + vqmovun_s16(vaddq_s16(vreinterpretq_s16_u16(L), (DIFF))); \ + const uint8x8_t res = \ + vadd_u8(pred, (LANE <= 1) ? vget_low_u8(src) : vget_high_u8(src)); \ + const uint16x8_t res16 = vmovl_u8(res); \ + vst1_lane_u32(&out[i + (LANE)], vreinterpret_u32_u8(res), (LANE) & 1); \ + /* rotate in the left predictor for next iteration */ \ + L = vextq_u16(res16, res16, 4); \ + } while (0) static void PredictorAdd12_NEON(const uint32_t* in, const uint32_t* upper, int num_pixels, uint32_t* WEBP_RESTRICT out) { @@ -452,21 +452,22 @@ static void PredictorAdd12_NEON(const uint32_t* in, const uint32_t* upper, #undef DO_PRED12 // Predictor13: ClampedAddSubtractHalf -#define DO_PRED13(LANE, LOW_OR_HI) do { \ - const uint8x16_t avg = vhaddq_u8(L, T); \ - const uint8x16_t cmp = vcgtq_u8(TL, avg); \ - const uint8x16_t TL_1 = vaddq_u8(TL, cmp); \ - /* Compute half of the difference between avg and TL'. */ \ - const int8x8_t diff_avg = \ - vreinterpret_s8_u8(LOW_OR_HI(vhsubq_u8(avg, TL_1))); \ - /* Compute the sum with avg and saturate. */ \ - const int16x8_t avg_16 = vreinterpretq_s16_u16(vmovl_u8(LOW_OR_HI(avg))); \ - const uint8x8_t delta = vqmovun_s16(vaddw_s8(avg_16, diff_avg)); \ - const uint8x8_t res = vadd_u8(LOW_OR_HI(src), delta); \ - const uint8x16_t res2 = vcombine_u8(res, res); \ - vst1_lane_u32(&out[i + (LANE)], vreinterpret_u32_u8(res), (LANE) & 1); \ - L = ROTATE32_LEFT(res2); \ -} while (0) +#define DO_PRED13(LANE, LOW_OR_HI) \ + do { \ + const uint8x16_t avg = vhaddq_u8(L, T); \ + const uint8x16_t cmp = vcgtq_u8(TL, avg); \ + const uint8x16_t TL_1 = vaddq_u8(TL, cmp); \ + /* Compute half of the difference between avg and TL'. */ \ + const int8x8_t diff_avg = \ + vreinterpret_s8_u8(LOW_OR_HI(vhsubq_u8(avg, TL_1))); \ + /* Compute the sum with avg and saturate. */ \ + const int16x8_t avg_16 = vreinterpretq_s16_u16(vmovl_u8(LOW_OR_HI(avg))); \ + const uint8x8_t delta = vqmovun_s16(vaddw_s8(avg_16, diff_avg)); \ + const uint8x8_t res = vadd_u8(LOW_OR_HI(src), delta); \ + const uint8x16_t res2 = vcombine_u8(res, res); \ + vst1_lane_u32(&out[i + (LANE)], vreinterpret_u32_u8(res), (LANE) & 1); \ + L = ROTATE32_LEFT(res2); \ + } while (0) static void PredictorAdd13_NEON(const uint32_t* in, const uint32_t* upper, int num_pixels, uint32_t* WEBP_RESTRICT out) { @@ -499,25 +500,24 @@ static void PredictorAdd13_NEON(const uint32_t* in, const uint32_t* upper, // vtbl?_u8 are marked unavailable for iOS arm64 with Xcode < 6.3, use // non-standard versions there. -#if defined(__APPLE__) && WEBP_AARCH64 && \ - defined(__apple_build_version__) && (__apple_build_version__< 6020037) +#if defined(__APPLE__) && WEBP_AARCH64 && defined(__apple_build_version__) && \ + (__apple_build_version__ < 6020037) #define USE_VTBLQ #endif #ifdef USE_VTBLQ // 255 = byte will be zeroed -static const uint8_t kGreenShuffle[16] = { - 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255, 13, 255, 13, 255 -}; +static const uint8_t kGreenShuffle[16] = {1, 255, 1, 255, 5, 255, 5, 255, + 9, 255, 9, 255, 13, 255, 13, 255}; static WEBP_INLINE uint8x16_t DoGreenShuffle_NEON(const uint8x16_t argb, const uint8x16_t shuffle) { return vcombine_u8(vtbl1q_u8(argb, vget_low_u8(shuffle)), vtbl1q_u8(argb, vget_high_u8(shuffle))); } -#else // !USE_VTBLQ +#else // !USE_VTBLQ // 255 = byte will be zeroed -static const uint8_t kGreenShuffle[8] = { 1, 255, 1, 255, 5, 255, 5, 255 }; +static const uint8_t kGreenShuffle[8] = {1, 255, 1, 255, 5, 255, 5, 255}; static WEBP_INLINE uint8x16_t DoGreenShuffle_NEON(const uint8x16_t argb, const uint8x8_t shuffle) { @@ -550,27 +550,24 @@ static void TransformColorInverse_NEON(const VP8LMultipliers* const m, const uint32_t* const src, int num_pixels, uint32_t* dst) { // sign-extended multiplying constants, pre-shifted by 6. -#define CST(X) (((int16_t)(m->X << 8)) >> 6) - const int16_t rb[8] = { - CST(green_to_blue), CST(green_to_red), - CST(green_to_blue), CST(green_to_red), - CST(green_to_blue), CST(green_to_red), - CST(green_to_blue), CST(green_to_red) - }; +#define CST(X) (((int16_t)(m->X << 8)) >> 6) + const int16_t rb[8] = {CST(green_to_blue), CST(green_to_red), + CST(green_to_blue), CST(green_to_red), + CST(green_to_blue), CST(green_to_red), + CST(green_to_blue), CST(green_to_red)}; const int16x8_t mults_rb = vld1q_s16(rb); const int16_t b2[8] = { - 0, CST(red_to_blue), 0, CST(red_to_blue), - 0, CST(red_to_blue), 0, CST(red_to_blue), + 0, CST(red_to_blue), 0, CST(red_to_blue), + 0, CST(red_to_blue), 0, CST(red_to_blue), }; const int16x8_t mults_b2 = vld1q_s16(b2); #undef CST #ifdef USE_VTBLQ - static const uint8_t kg0g0[16] = { - 255, 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255, 13, 255, 13 - }; + static const uint8_t kg0g0[16] = {255, 1, 255, 1, 255, 5, 255, 5, + 255, 9, 255, 9, 255, 13, 255, 13}; const uint8x16_t shuffle = vld1q_u8(kg0g0); #else - static const uint8_t k0g0g[8] = { 255, 1, 255, 1, 255, 5, 255, 5 }; + static const uint8_t k0g0g[8] = {255, 1, 255, 1, 255, 5, 255, 5}; const uint8x8_t shuffle = vld1_u8(k0g0g); #endif const uint32x4_t mask_ag = vdupq_n_u32(0xff00ff00u); @@ -583,8 +580,8 @@ static void TransformColorInverse_NEON(const VP8LMultipliers* const m, // x dr x db1 const int16x8_t A = vqdmulhq_s16(vreinterpretq_s16_u8(greens), mults_rb); // x r' x b' - const int8x16_t B = vaddq_s8(vreinterpretq_s8_u8(in), - vreinterpretq_s8_s16(A)); + const int8x16_t B = + vaddq_s8(vreinterpretq_s8_u8(in), vreinterpretq_s8_s16(A)); // r' 0 b' 0 const int16x8_t C = vshlq_n_s16(vreinterpretq_s16_s8(B), 8); // x db2 0 0 @@ -592,8 +589,8 @@ static void TransformColorInverse_NEON(const VP8LMultipliers* const m, // 0 x db2 0 const uint32x4_t E = vshrq_n_u32(vreinterpretq_u32_s16(D), 8); // r' x b'' 0 - const int8x16_t F = vaddq_s8(vreinterpretq_s8_u32(E), - vreinterpretq_s8_s16(C)); + const int8x16_t F = + vaddq_s8(vreinterpretq_s8_u32(E), vreinterpretq_s8_s16(C)); // 0 r' 0 b'' const uint16x8_t G = vshrq_n_u16(vreinterpretq_u16_s8(F), 8); const uint32x4_t out = vorrq_u32(vreinterpretq_u32_u16(G), a0g0); diff --git a/src/dsp/lossless_sse2.c b/src/dsp/lossless_sse2.c index 3c6608be..ab17346c 100644 --- a/src/dsp/lossless_sse2.c +++ b/src/dsp/lossless_sse2.c @@ -129,8 +129,8 @@ static WEBP_INLINE uint32_t Average3_SSE2(uint32_t a0, uint32_t a1, return (uint32_t)_mm_cvtsi128_si32(A2); } -static WEBP_INLINE uint32_t Average4_SSE2(uint32_t a0, uint32_t a1, - uint32_t a2, uint32_t a3) { +static WEBP_INLINE uint32_t Average4_SSE2(uint32_t a0, uint32_t a1, uint32_t a2, + uint32_t a3) { const __m128i avg1 = Average2_uint32_16_SSE2(a0, a1); const __m128i avg2 = Average2_uint32_16_SSE2(a2, a3); const __m128i sum = _mm_add_epi16(avg2, avg1); @@ -233,21 +233,21 @@ static void PredictorAdd1_SSE2(const uint32_t* in, const uint32_t* upper, // Macro that adds 32-bit integers from IN using mod 256 arithmetic // per 8 bit channel. -#define GENERATE_PREDICTOR_1(X, IN) \ -static void PredictorAdd##X##_SSE2(const uint32_t* in, const uint32_t* upper, \ - int num_pixels, \ - uint32_t* WEBP_RESTRICT out) { \ - int i; \ - for (i = 0; i + 4 <= num_pixels; i += 4) { \ - const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); \ - const __m128i other = _mm_loadu_si128((const __m128i*)&(IN)); \ - const __m128i res = _mm_add_epi8(src, other); \ - _mm_storeu_si128((__m128i*)&out[i], res); \ - } \ - if (i != num_pixels) { \ - VP8LPredictorsAdd_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ - } \ -} +#define GENERATE_PREDICTOR_1(X, IN) \ + static void PredictorAdd##X##_SSE2(const uint32_t* in, \ + const uint32_t* upper, int num_pixels, \ + uint32_t* WEBP_RESTRICT out) { \ + int i; \ + for (i = 0; i + 4 <= num_pixels; i += 4) { \ + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); \ + const __m128i other = _mm_loadu_si128((const __m128i*)&(IN)); \ + const __m128i res = _mm_add_epi8(src, other); \ + _mm_storeu_si128((__m128i*)&out[i], res); \ + } \ + if (i != num_pixels) { \ + VP8LPredictorsAdd_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ + } \ + } // Predictor2: Top. GENERATE_PREDICTOR_1(2, upper[i]) @@ -263,24 +263,24 @@ GENERATE_PREDICTOR_ADD(Predictor5_SSE2, PredictorAdd5_SSE2) GENERATE_PREDICTOR_ADD(Predictor6_SSE2, PredictorAdd6_SSE2) GENERATE_PREDICTOR_ADD(Predictor7_SSE2, PredictorAdd7_SSE2) -#define GENERATE_PREDICTOR_2(X, IN) \ -static void PredictorAdd##X##_SSE2(const uint32_t* in, const uint32_t* upper, \ - int num_pixels, \ - uint32_t* WEBP_RESTRICT out) { \ - int i; \ - for (i = 0; i + 4 <= num_pixels; i += 4) { \ - const __m128i Tother = _mm_loadu_si128((const __m128i*)&(IN)); \ - const __m128i T = _mm_loadu_si128((const __m128i*)&upper[i]); \ - const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); \ - __m128i avg, res; \ - Average2_m128i(&T, &Tother, &avg); \ - res = _mm_add_epi8(avg, src); \ - _mm_storeu_si128((__m128i*)&out[i], res); \ - } \ - if (i != num_pixels) { \ - VP8LPredictorsAdd_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ - } \ -} +#define GENERATE_PREDICTOR_2(X, IN) \ + static void PredictorAdd##X##_SSE2(const uint32_t* in, \ + const uint32_t* upper, int num_pixels, \ + uint32_t* WEBP_RESTRICT out) { \ + int i; \ + for (i = 0; i + 4 <= num_pixels; i += 4) { \ + const __m128i Tother = _mm_loadu_si128((const __m128i*)&(IN)); \ + const __m128i T = _mm_loadu_si128((const __m128i*)&upper[i]); \ + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); \ + __m128i avg, res; \ + Average2_m128i(&T, &Tother, &avg); \ + res = _mm_add_epi8(avg, src); \ + _mm_storeu_si128((__m128i*)&out[i], res); \ + } \ + if (i != num_pixels) { \ + VP8LPredictorsAdd_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ + } \ + } // Predictor8: average TL T. GENERATE_PREDICTOR_2(8, upper[i - 1]) // Predictor9: average T TR. @@ -288,20 +288,22 @@ GENERATE_PREDICTOR_2(9, upper[i + 1]) #undef GENERATE_PREDICTOR_2 // Predictor10: average of (average of (L,TL), average of (T, TR)). -#define DO_PRED10(OUT) do { \ - __m128i avgLTL, avg; \ - Average2_m128i(&L, &TL, &avgLTL); \ - Average2_m128i(&avgTTR, &avgLTL, &avg); \ - L = _mm_add_epi8(avg, src); \ - out[i + (OUT)] = (uint32_t)_mm_cvtsi128_si32(L); \ -} while (0) +#define DO_PRED10(OUT) \ + do { \ + __m128i avgLTL, avg; \ + Average2_m128i(&L, &TL, &avgLTL); \ + Average2_m128i(&avgTTR, &avgLTL, &avg); \ + L = _mm_add_epi8(avg, src); \ + out[i + (OUT)] = (uint32_t)_mm_cvtsi128_si32(L); \ + } while (0) -#define DO_PRED10_SHIFT do { \ - /* Rotate the pre-computed values for the next iteration.*/ \ - avgTTR = _mm_srli_si128(avgTTR, 4); \ - TL = _mm_srli_si128(TL, 4); \ - src = _mm_srli_si128(src, 4); \ -} while (0) +#define DO_PRED10_SHIFT \ + do { \ + /* Rotate the pre-computed values for the next iteration.*/ \ + avgTTR = _mm_srli_si128(avgTTR, 4); \ + TL = _mm_srli_si128(TL, 4); \ + src = _mm_srli_si128(src, 4); \ + } while (0) static void PredictorAdd10_SSE2(const uint32_t* in, const uint32_t* upper, int num_pixels, uint32_t* WEBP_RESTRICT out) { @@ -330,25 +332,27 @@ static void PredictorAdd10_SSE2(const uint32_t* in, const uint32_t* upper, #undef DO_PRED10_SHIFT // Predictor11: select. -#define DO_PRED11(OUT) do { \ - const __m128i L_lo = _mm_unpacklo_epi32(L, T); \ - const __m128i TL_lo = _mm_unpacklo_epi32(TL, T); \ - const __m128i pb = _mm_sad_epu8(L_lo, TL_lo); /* pb = sum |L-TL|*/ \ - const __m128i mask = _mm_cmpgt_epi32(pb, pa); \ - const __m128i A = _mm_and_si128(mask, L); \ - const __m128i B = _mm_andnot_si128(mask, T); \ - const __m128i pred = _mm_or_si128(A, B); /* pred = (pa > b)? L : T*/ \ - L = _mm_add_epi8(src, pred); \ - out[i + (OUT)] = (uint32_t)_mm_cvtsi128_si32(L); \ -} while (0) +#define DO_PRED11(OUT) \ + do { \ + const __m128i L_lo = _mm_unpacklo_epi32(L, T); \ + const __m128i TL_lo = _mm_unpacklo_epi32(TL, T); \ + const __m128i pb = _mm_sad_epu8(L_lo, TL_lo); /* pb = sum |L-TL|*/ \ + const __m128i mask = _mm_cmpgt_epi32(pb, pa); \ + const __m128i A = _mm_and_si128(mask, L); \ + const __m128i B = _mm_andnot_si128(mask, T); \ + const __m128i pred = _mm_or_si128(A, B); /* pred = (pa > b)? L : T*/ \ + L = _mm_add_epi8(src, pred); \ + out[i + (OUT)] = (uint32_t)_mm_cvtsi128_si32(L); \ + } while (0) -#define DO_PRED11_SHIFT do { \ - /* Shift the pre-computed value for the next iteration.*/ \ - T = _mm_srli_si128(T, 4); \ - TL = _mm_srli_si128(TL, 4); \ - src = _mm_srli_si128(src, 4); \ - pa = _mm_srli_si128(pa, 4); \ -} while (0) +#define DO_PRED11_SHIFT \ + do { \ + /* Shift the pre-computed value for the next iteration.*/ \ + T = _mm_srli_si128(T, 4); \ + TL = _mm_srli_si128(TL, 4); \ + src = _mm_srli_si128(src, 4); \ + pa = _mm_srli_si128(pa, 4); \ + } while (0) static void PredictorAdd11_SSE2(const uint32_t* in, const uint32_t* upper, int num_pixels, uint32_t* WEBP_RESTRICT out) { @@ -387,19 +391,21 @@ static void PredictorAdd11_SSE2(const uint32_t* in, const uint32_t* upper, #undef DO_PRED11_SHIFT // Predictor12: ClampedAddSubtractFull. -#define DO_PRED12(DIFF, LANE, OUT) do { \ - const __m128i all = _mm_add_epi16(L, (DIFF)); \ - const __m128i alls = _mm_packus_epi16(all, all); \ - const __m128i res = _mm_add_epi8(src, alls); \ - out[i + (OUT)] = (uint32_t)_mm_cvtsi128_si32(res); \ - L = _mm_unpacklo_epi8(res, zero); \ -} while (0) +#define DO_PRED12(DIFF, LANE, OUT) \ + do { \ + const __m128i all = _mm_add_epi16(L, (DIFF)); \ + const __m128i alls = _mm_packus_epi16(all, all); \ + const __m128i res = _mm_add_epi8(src, alls); \ + out[i + (OUT)] = (uint32_t)_mm_cvtsi128_si32(res); \ + L = _mm_unpacklo_epi8(res, zero); \ + } while (0) -#define DO_PRED12_SHIFT(DIFF, LANE) do { \ - /* Shift the pre-computed value for the next iteration.*/ \ - if ((LANE) == 0) (DIFF) = _mm_srli_si128((DIFF), 8); \ - src = _mm_srli_si128(src, 4); \ -} while (0) +#define DO_PRED12_SHIFT(DIFF, LANE) \ + do { \ + /* Shift the pre-computed value for the next iteration.*/ \ + if ((LANE) == 0) (DIFF) = _mm_srli_si128((DIFF), 8); \ + src = _mm_srli_si128(src, 4); \ + } while (0) static void PredictorAdd12_SSE2(const uint32_t* in, const uint32_t* upper, int num_pixels, uint32_t* WEBP_RESTRICT out) { @@ -444,8 +450,8 @@ static void AddGreenToBlueAndRed_SSE2(const uint32_t* const src, int num_pixels, uint32_t* dst) { int i; for (i = 0; i + 4 <= num_pixels; i += 4) { - const __m128i in = _mm_loadu_si128((const __m128i*)&src[i]); // argb - const __m128i A = _mm_srli_epi16(in, 8); // 0 a 0 g + const __m128i in = _mm_loadu_si128((const __m128i*)&src[i]); // argb + const __m128i A = _mm_srli_epi16(in, 8); // 0 a 0 g const __m128i B = _mm_shufflelo_epi16(A, _MM_SHUFFLE(2, 2, 0, 0)); const __m128i C = _mm_shufflehi_epi16(B, _MM_SHUFFLE(2, 2, 0, 0)); // 0g0g const __m128i out = _mm_add_epi8(in, C); @@ -464,7 +470,7 @@ static void TransformColorInverse_SSE2(const VP8LMultipliers* const m, const uint32_t* const src, int num_pixels, uint32_t* dst) { // sign-extended multiplying constants, pre-shifted by 5. -#define CST(X) (((int16_t)(m->X << 8)) >> 5) // sign-extend +#define CST(X) (((int16_t)(m->X << 8)) >> 5) // sign-extend #define MK_CST_16(HI, LO) \ _mm_set1_epi32((int)(((uint32_t)(HI) << 16) | ((LO) & 0xffff))) const __m128i mults_rb = MK_CST_16(CST(green_to_red), CST(green_to_blue)); @@ -474,17 +480,17 @@ static void TransformColorInverse_SSE2(const VP8LMultipliers* const m, const __m128i mask_ag = _mm_set1_epi32((int)0xff00ff00); // alpha-green masks int i; for (i = 0; i + 4 <= num_pixels; i += 4) { - const __m128i in = _mm_loadu_si128((const __m128i*)&src[i]); // argb - const __m128i A = _mm_and_si128(in, mask_ag); // a 0 g 0 + const __m128i in = _mm_loadu_si128((const __m128i*)&src[i]); // argb + const __m128i A = _mm_and_si128(in, mask_ag); // a 0 g 0 const __m128i B = _mm_shufflelo_epi16(A, _MM_SHUFFLE(2, 2, 0, 0)); const __m128i C = _mm_shufflehi_epi16(B, _MM_SHUFFLE(2, 2, 0, 0)); // g0g0 - const __m128i D = _mm_mulhi_epi16(C, mults_rb); // x dr x db1 - const __m128i E = _mm_add_epi8(in, D); // x r' x b' - const __m128i F = _mm_slli_epi16(E, 8); // r' 0 b' 0 - const __m128i G = _mm_mulhi_epi16(F, mults_b2); // x db2 0 0 - const __m128i H = _mm_srli_epi32(G, 8); // 0 x db2 0 - const __m128i I = _mm_add_epi8(H, F); // r' x b'' 0 - const __m128i J = _mm_srli_epi16(I, 8); // 0 r' 0 b'' + const __m128i D = _mm_mulhi_epi16(C, mults_rb); // x dr x db1 + const __m128i E = _mm_add_epi8(in, D); // x r' x b' + const __m128i F = _mm_slli_epi16(E, 8); // r' 0 b' 0 + const __m128i G = _mm_mulhi_epi16(F, mults_b2); // x db2 0 0 + const __m128i H = _mm_srli_epi32(G, 8); // 0 x db2 0 + const __m128i I = _mm_add_epi8(H, F); // r' x b'' 0 + const __m128i J = _mm_srli_epi16(I, 8); // 0 r' 0 b'' const __m128i out = _mm_or_si128(J, A); _mm_storeu_si128((__m128i*)&dst[i], out); } @@ -569,21 +575,21 @@ static void ConvertBGRAToRGBA4444_SSE2(const uint32_t* WEBP_RESTRICT src, const __m128i* in = (const __m128i*)src; __m128i* out = (__m128i*)dst; while (num_pixels >= 8) { - const __m128i bgra0 = _mm_loadu_si128(in++); // bgra0|bgra1|bgra2|bgra3 - const __m128i bgra4 = _mm_loadu_si128(in++); // bgra4|bgra5|bgra6|bgra7 + const __m128i bgra0 = _mm_loadu_si128(in++); // bgra0|bgra1|bgra2|bgra3 + const __m128i bgra4 = _mm_loadu_si128(in++); // bgra4|bgra5|bgra6|bgra7 const __m128i v0l = _mm_unpacklo_epi8(bgra0, bgra4); // b0b4g0g4r0r4a0a4... const __m128i v0h = _mm_unpackhi_epi8(bgra0, bgra4); // b2b6g2g6r2r6a2a6... - const __m128i v1l = _mm_unpacklo_epi8(v0l, v0h); // b0b2b4b6g0g2g4g6... - const __m128i v1h = _mm_unpackhi_epi8(v0l, v0h); // b1b3b5b7g1g3g5g7... - const __m128i v2l = _mm_unpacklo_epi8(v1l, v1h); // b0...b7 | g0...g7 - const __m128i v2h = _mm_unpackhi_epi8(v1l, v1h); // r0...r7 | a0...a7 - const __m128i ga0 = _mm_unpackhi_epi64(v2l, v2h); // g0...g7 | a0...a7 - const __m128i rb0 = _mm_unpacklo_epi64(v2h, v2l); // r0...r7 | b0...b7 - const __m128i ga1 = _mm_srli_epi16(ga0, 4); // g0-|g1-|...|a6-|a7- - const __m128i rb1 = _mm_and_si128(rb0, mask_0xf0); // -r0|-r1|...|-b6|-a7 - const __m128i ga2 = _mm_and_si128(ga1, mask_0x0f); // g0-|g1-|...|a6-|a7- - const __m128i rgba0 = _mm_or_si128(ga2, rb1); // rg0..rg7 | ba0..ba7 - const __m128i rgba1 = _mm_srli_si128(rgba0, 8); // ba0..ba7 | 0 + const __m128i v1l = _mm_unpacklo_epi8(v0l, v0h); // b0b2b4b6g0g2g4g6... + const __m128i v1h = _mm_unpackhi_epi8(v0l, v0h); // b1b3b5b7g1g3g5g7... + const __m128i v2l = _mm_unpacklo_epi8(v1l, v1h); // b0...b7 | g0...g7 + const __m128i v2h = _mm_unpackhi_epi8(v1l, v1h); // r0...r7 | a0...a7 + const __m128i ga0 = _mm_unpackhi_epi64(v2l, v2h); // g0...g7 | a0...a7 + const __m128i rb0 = _mm_unpacklo_epi64(v2h, v2l); // r0...r7 | b0...b7 + const __m128i ga1 = _mm_srli_epi16(ga0, 4); // g0-|g1-|...|a6-|a7- + const __m128i rb1 = _mm_and_si128(rb0, mask_0xf0); // -r0|-r1|...|-b6|-a7 + const __m128i ga2 = _mm_and_si128(ga1, mask_0x0f); // g0-|g1-|...|a6-|a7- + const __m128i rgba0 = _mm_or_si128(ga2, rb1); // rg0..rg7 | ba0..ba7 + const __m128i rgba1 = _mm_srli_si128(rgba0, 8); // ba0..ba7 | 0 #if (WEBP_SWAP_16BIT_CSP == 1) const __m128i rgba = _mm_unpacklo_epi8(rgba1, rgba0); // barg0...barg7 #else @@ -607,8 +613,8 @@ static void ConvertBGRAToRGB565_SSE2(const uint32_t* WEBP_RESTRICT src, const __m128i* in = (const __m128i*)src; __m128i* out = (__m128i*)dst; while (num_pixels >= 8) { - const __m128i bgra0 = _mm_loadu_si128(in++); // bgra0|bgra1|bgra2|bgra3 - const __m128i bgra4 = _mm_loadu_si128(in++); // bgra4|bgra5|bgra6|bgra7 + const __m128i bgra0 = _mm_loadu_si128(in++); // bgra0|bgra1|bgra2|bgra3 + const __m128i bgra4 = _mm_loadu_si128(in++); // bgra4|bgra5|bgra6|bgra7 const __m128i v0l = _mm_unpacklo_epi8(bgra0, bgra4); // b0b4g0g4r0r4a0a4... const __m128i v0h = _mm_unpackhi_epi8(bgra0, bgra4); // b2b6g2g6r2r6a2a6... const __m128i v1l = _mm_unpacklo_epi8(v0l, v0h); // b0b2b4b6g0g2g4g6... @@ -625,11 +631,11 @@ static void ConvertBGRAToRGB565_SSE2(const uint32_t* WEBP_RESTRICT src, const __m128i b0 = _mm_srli_si128(rb1, 8); // -b0...-b7|0 const __m128i rg1 = _mm_or_si128(rb1, g_lo2); // gr0...gr7|xx const __m128i b1 = _mm_srli_epi16(b0, 3); - const __m128i gb1 = _mm_or_si128(b1, g_hi2); // bg0...bg7|xx + const __m128i gb1 = _mm_or_si128(b1, g_hi2); // bg0...bg7|xx #if (WEBP_SWAP_16BIT_CSP == 1) - const __m128i rgba = _mm_unpacklo_epi8(gb1, rg1); // rggb0...rggb7 + const __m128i rgba = _mm_unpacklo_epi8(gb1, rg1); // rggb0...rggb7 #else - const __m128i rgba = _mm_unpacklo_epi8(rg1, gb1); // bgrb0...bgrb7 + const __m128i rgba = _mm_unpacklo_epi8(rg1, gb1); // bgrb0...bgrb7 #endif _mm_storeu_si128(out++, rgba); num_pixels -= 8; @@ -648,22 +654,22 @@ static void ConvertBGRAToBGR_SSE2(const uint32_t* WEBP_RESTRICT src, const uint8_t* const end = dst + num_pixels * 3; // the last storel_epi64 below writes 8 bytes starting at offset 18 while (dst + 26 <= end) { - const __m128i bgra0 = _mm_loadu_si128(in++); // bgra0|bgra1|bgra2|bgra3 - const __m128i bgra4 = _mm_loadu_si128(in++); // bgra4|bgra5|bgra6|bgra7 - const __m128i a0l = _mm_and_si128(bgra0, mask_l); // bgr0|0|bgr0|0 - const __m128i a4l = _mm_and_si128(bgra4, mask_l); // bgr0|0|bgr0|0 - const __m128i a0h = _mm_and_si128(bgra0, mask_h); // 0|bgr0|0|bgr0 - const __m128i a4h = _mm_and_si128(bgra4, mask_h); // 0|bgr0|0|bgr0 - const __m128i b0h = _mm_srli_epi64(a0h, 8); // 000b|gr00|000b|gr00 - const __m128i b4h = _mm_srli_epi64(a4h, 8); // 000b|gr00|000b|gr00 - const __m128i c0 = _mm_or_si128(a0l, b0h); // rgbrgb00|rgbrgb00 - const __m128i c4 = _mm_or_si128(a4l, b4h); // rgbrgb00|rgbrgb00 + const __m128i bgra0 = _mm_loadu_si128(in++); // bgra0|bgra1|bgra2|bgra3 + const __m128i bgra4 = _mm_loadu_si128(in++); // bgra4|bgra5|bgra6|bgra7 + const __m128i a0l = _mm_and_si128(bgra0, mask_l); // bgr0|0|bgr0|0 + const __m128i a4l = _mm_and_si128(bgra4, mask_l); // bgr0|0|bgr0|0 + const __m128i a0h = _mm_and_si128(bgra0, mask_h); // 0|bgr0|0|bgr0 + const __m128i a4h = _mm_and_si128(bgra4, mask_h); // 0|bgr0|0|bgr0 + const __m128i b0h = _mm_srli_epi64(a0h, 8); // 000b|gr00|000b|gr00 + const __m128i b4h = _mm_srli_epi64(a4h, 8); // 000b|gr00|000b|gr00 + const __m128i c0 = _mm_or_si128(a0l, b0h); // rgbrgb00|rgbrgb00 + const __m128i c4 = _mm_or_si128(a4l, b4h); // rgbrgb00|rgbrgb00 const __m128i c2 = _mm_srli_si128(c0, 8); const __m128i c6 = _mm_srli_si128(c4, 8); - _mm_storel_epi64((__m128i*)(dst + 0), c0); - _mm_storel_epi64((__m128i*)(dst + 6), c2); - _mm_storel_epi64((__m128i*)(dst + 12), c4); - _mm_storel_epi64((__m128i*)(dst + 18), c6); + _mm_storel_epi64((__m128i*)(dst + 0), c0); + _mm_storel_epi64((__m128i*)(dst + 6), c2); + _mm_storel_epi64((__m128i*)(dst + 12), c4); + _mm_storel_epi64((__m128i*)(dst + 18), c6); dst += 24; num_pixels -= 8; } diff --git a/src/dsp/lossless_sse41.c b/src/dsp/lossless_sse41.c index 598e6794..960dcc88 100644 --- a/src/dsp/lossless_sse41.c +++ b/src/dsp/lossless_sse41.c @@ -15,9 +15,9 @@ #include #include -#include "src/webp/types.h" #include "src/dsp/cpu.h" #include "src/dsp/lossless.h" +#include "src/webp/types.h" //------------------------------------------------------------------------------ // Color-space conversion functions @@ -26,21 +26,20 @@ static void TransformColorInverse_SSE41(const VP8LMultipliers* const m, const uint32_t* const src, int num_pixels, uint32_t* dst) { // sign-extended multiplying constants, pre-shifted by 5. -#define CST(X) (((int16_t)(m->X << 8)) >> 5) // sign-extend - const __m128i mults_rb = - _mm_set1_epi32((int)((uint32_t)CST(green_to_red) << 16 | - (CST(green_to_blue) & 0xffff))); +#define CST(X) (((int16_t)(m->X << 8)) >> 5) // sign-extend + const __m128i mults_rb = _mm_set1_epi32( + (int)((uint32_t)CST(green_to_red) << 16 | (CST(green_to_blue) & 0xffff))); const __m128i mults_b2 = _mm_set1_epi32(CST(red_to_blue)); #undef CST const __m128i mask_ag = _mm_set1_epi32((int)0xff00ff00); - const __m128i perm1 = _mm_setr_epi8(-1, 1, -1, 1, -1, 5, -1, 5, - -1, 9, -1, 9, -1, 13, -1, 13); - const __m128i perm2 = _mm_setr_epi8(-1, 2, -1, -1, -1, 6, -1, -1, - -1, 10, -1, -1, -1, 14, -1, -1); + const __m128i perm1 = + _mm_setr_epi8(-1, 1, -1, 1, -1, 5, -1, 5, -1, 9, -1, 9, -1, 13, -1, 13); + const __m128i perm2 = _mm_setr_epi8(-1, 2, -1, -1, -1, 6, -1, -1, -1, 10, -1, + -1, -1, 14, -1, -1); int i; for (i = 0; i + 4 <= num_pixels; i += 4) { const __m128i A = _mm_loadu_si128((const __m128i*)(src + i)); - const __m128i B = _mm_shuffle_epi8(A, perm1); // argb -> g0g0 + const __m128i B = _mm_shuffle_epi8(A, perm1); // argb -> g0g0 const __m128i C = _mm_mulhi_epi16(B, mults_rb); const __m128i D = _mm_add_epi8(A, C); const __m128i E = _mm_shuffle_epi8(D, perm2); @@ -57,34 +56,35 @@ static void TransformColorInverse_SSE41(const VP8LMultipliers* const m, //------------------------------------------------------------------------------ -#define ARGB_TO_RGB_SSE41 do { \ - while (num_pixels >= 16) { \ - const __m128i in0 = _mm_loadu_si128(in + 0); \ - const __m128i in1 = _mm_loadu_si128(in + 1); \ - const __m128i in2 = _mm_loadu_si128(in + 2); \ - const __m128i in3 = _mm_loadu_si128(in + 3); \ - const __m128i a0 = _mm_shuffle_epi8(in0, perm0); \ - const __m128i a1 = _mm_shuffle_epi8(in1, perm1); \ - const __m128i a2 = _mm_shuffle_epi8(in2, perm2); \ - const __m128i a3 = _mm_shuffle_epi8(in3, perm3); \ - const __m128i b0 = _mm_blend_epi16(a0, a1, 0xc0); \ - const __m128i b1 = _mm_blend_epi16(a1, a2, 0xf0); \ - const __m128i b2 = _mm_blend_epi16(a2, a3, 0xfc); \ - _mm_storeu_si128(out + 0, b0); \ - _mm_storeu_si128(out + 1, b1); \ - _mm_storeu_si128(out + 2, b2); \ - in += 4; \ - out += 3; \ - num_pixels -= 16; \ - } \ -} while (0) +#define ARGB_TO_RGB_SSE41 \ + do { \ + while (num_pixels >= 16) { \ + const __m128i in0 = _mm_loadu_si128(in + 0); \ + const __m128i in1 = _mm_loadu_si128(in + 1); \ + const __m128i in2 = _mm_loadu_si128(in + 2); \ + const __m128i in3 = _mm_loadu_si128(in + 3); \ + const __m128i a0 = _mm_shuffle_epi8(in0, perm0); \ + const __m128i a1 = _mm_shuffle_epi8(in1, perm1); \ + const __m128i a2 = _mm_shuffle_epi8(in2, perm2); \ + const __m128i a3 = _mm_shuffle_epi8(in3, perm3); \ + const __m128i b0 = _mm_blend_epi16(a0, a1, 0xc0); \ + const __m128i b1 = _mm_blend_epi16(a1, a2, 0xf0); \ + const __m128i b2 = _mm_blend_epi16(a2, a3, 0xfc); \ + _mm_storeu_si128(out + 0, b0); \ + _mm_storeu_si128(out + 1, b1); \ + _mm_storeu_si128(out + 2, b2); \ + in += 4; \ + out += 3; \ + num_pixels -= 16; \ + } \ + } while (0) static void ConvertBGRAToRGB_SSE41(const uint32_t* WEBP_RESTRICT src, int num_pixels, uint8_t* WEBP_RESTRICT dst) { const __m128i* in = (const __m128i*)src; __m128i* out = (__m128i*)dst; - const __m128i perm0 = _mm_setr_epi8(2, 1, 0, 6, 5, 4, 10, 9, - 8, 14, 13, 12, -1, -1, -1, -1); + const __m128i perm0 = + _mm_setr_epi8(2, 1, 0, 6, 5, 4, 10, 9, 8, 14, 13, 12, -1, -1, -1, -1); const __m128i perm1 = _mm_shuffle_epi32(perm0, 0x39); const __m128i perm2 = _mm_shuffle_epi32(perm0, 0x4e); const __m128i perm3 = _mm_shuffle_epi32(perm0, 0x93); @@ -101,8 +101,8 @@ static void ConvertBGRAToBGR_SSE41(const uint32_t* WEBP_RESTRICT src, int num_pixels, uint8_t* WEBP_RESTRICT dst) { const __m128i* in = (const __m128i*)src; __m128i* out = (__m128i*)dst; - const __m128i perm0 = _mm_setr_epi8(0, 1, 2, 4, 5, 6, 8, 9, 10, - 12, 13, 14, -1, -1, -1, -1); + const __m128i perm0 = + _mm_setr_epi8(0, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 14, -1, -1, -1, -1); const __m128i perm1 = _mm_shuffle_epi32(perm0, 0x39); const __m128i perm2 = _mm_shuffle_epi32(perm0, 0x4e); const __m128i perm3 = _mm_shuffle_epi32(perm0, 0x93); diff --git a/src/dsp/mips_macro.h b/src/dsp/mips_macro.h index e810d3d3..fba41e15 100644 --- a/src/dsp/mips_macro.h +++ b/src/dsp/mips_macro.h @@ -23,6 +23,7 @@ // O1[31..16 | 15..0] = I0[31..16 | 15..0] - I1[31..16 | 15..0] // O - output // I - input (macro doesn't change it) +// clang-format off #define ADD_SUB_HALVES(O0, O1, \ I0, I1) \ "addq.ph %[" #O0 "], %[" #I0 "], %[" #I1 "] \n\t" \ @@ -206,5 +207,6 @@ [temp11]"=&r"(temp11), [temp12]"=&r"(temp12), [temp13]"=&r"(temp13), \ [temp14]"=&r"(temp14), [temp15]"=&r"(temp15), [temp16]"=&r"(temp16), \ [temp17]"=&r"(temp17), [temp18]"=&r"(temp18) +// clang-format on #endif // WEBP_DSP_MIPS_MACRO_H_ diff --git a/src/dsp/msa_macro.h b/src/dsp/msa_macro.h index 90adbbc3..992fd017 100644 --- a/src/dsp/msa_macro.h +++ b/src/dsp/msa_macro.h @@ -18,35 +18,35 @@ #if defined(WEBP_USE_MSA) -#include #include +#include #if defined(__clang__) - #define CLANG_BUILD +#define CLANG_BUILD #endif #ifdef CLANG_BUILD - #define ALPHAVAL (-1) - #define ADDVI_H(a, b) __msa_addvi_h((v8i16)a, b) - #define ADDVI_W(a, b) __msa_addvi_w((v4i32)a, b) - #define SRAI_B(a, b) __msa_srai_b((v16i8)a, b) - #define SRAI_H(a, b) __msa_srai_h((v8i16)a, b) - #define SRAI_W(a, b) __msa_srai_w((v4i32)a, b) - #define SRLI_H(a, b) __msa_srli_h((v8i16)a, b) - #define SLLI_B(a, b) __msa_slli_b((v4i32)a, b) - #define ANDI_B(a, b) __msa_andi_b((v16u8)a, b) - #define ORI_B(a, b) __msa_ori_b((v16u8)a, b) +#define ALPHAVAL (-1) +#define ADDVI_H(a, b) __msa_addvi_h((v8i16)a, b) +#define ADDVI_W(a, b) __msa_addvi_w((v4i32)a, b) +#define SRAI_B(a, b) __msa_srai_b((v16i8)a, b) +#define SRAI_H(a, b) __msa_srai_h((v8i16)a, b) +#define SRAI_W(a, b) __msa_srai_w((v4i32)a, b) +#define SRLI_H(a, b) __msa_srli_h((v8i16)a, b) +#define SLLI_B(a, b) __msa_slli_b((v4i32)a, b) +#define ANDI_B(a, b) __msa_andi_b((v16u8)a, b) +#define ORI_B(a, b) __msa_ori_b((v16u8)a, b) #else - #define ALPHAVAL (0xff) - #define ADDVI_H(a, b) (a + b) - #define ADDVI_W(a, b) (a + b) - #define SRAI_B(a, b) (a >> b) - #define SRAI_H(a, b) (a >> b) - #define SRAI_W(a, b) (a >> b) - #define SRLI_H(a, b) (a << b) - #define SLLI_B(a, b) (a << b) - #define ANDI_B(a, b) (a & b) - #define ORI_B(a, b) (a | b) +#define ALPHAVAL (0xff) +#define ADDVI_H(a, b) (a + b) +#define ADDVI_W(a, b) (a + b) +#define SRAI_B(a, b) (a >> b) +#define SRAI_H(a, b) (a >> b) +#define SRAI_W(a, b) (a >> b) +#define SRLI_H(a, b) (a << b) +#define SLLI_B(a, b) (a << b) +#define ANDI_B(a, b) (a & b) +#define ORI_B(a, b) (a | b) #endif #define LD_B(RTYPE, psrc) *((RTYPE*)(psrc)) @@ -83,7 +83,7 @@ return val_m; \ } -#define MSA_LOAD(psrc, FUNC_NAME) FUNC_NAME(psrc) +#define MSA_LOAD(psrc, FUNC_NAME) FUNC_NAME(psrc) #define MSA_STORE_FUNC(TYPE, INSTR, FUNC_NAME) \ static inline void FUNC_NAME(TYPE val, void* const pdst) { \ @@ -94,50 +94,51 @@ : [val_m] "r"(val_m)); \ } -#define MSA_STORE(val, pdst, FUNC_NAME) FUNC_NAME(val, pdst) +#define MSA_STORE(val, pdst, FUNC_NAME) FUNC_NAME(val, pdst) #if (__mips_isa_rev >= 6) - MSA_LOAD_FUNC(uint16_t, lh, msa_lh); - #define LH(psrc) MSA_LOAD(psrc, msa_lh) - MSA_LOAD_FUNC(uint32_t, lw, msa_lw); - #define LW(psrc) MSA_LOAD(psrc, msa_lw) - #if (__mips == 64) - MSA_LOAD_FUNC(uint64_t, ld, msa_ld); - #define LD(psrc) MSA_LOAD(psrc, msa_ld) - #else // !(__mips == 64) - #define LD(psrc) ((((uint64_t)MSA_LOAD(psrc + 4, msa_lw)) << 32) | \ - MSA_LOAD(psrc, msa_lw)) - #endif // (__mips == 64) +MSA_LOAD_FUNC(uint16_t, lh, msa_lh); +#define LH(psrc) MSA_LOAD(psrc, msa_lh) +MSA_LOAD_FUNC(uint32_t, lw, msa_lw); +#define LW(psrc) MSA_LOAD(psrc, msa_lw) +#if (__mips == 64) +MSA_LOAD_FUNC(uint64_t, ld, msa_ld); +#define LD(psrc) MSA_LOAD(psrc, msa_ld) +#else // !(__mips == 64) +#define LD(psrc) \ + ((((uint64_t)MSA_LOAD(psrc + 4, msa_lw)) << 32) | MSA_LOAD(psrc, msa_lw)) +#endif // (__mips == 64) - MSA_STORE_FUNC(uint16_t, sh, msa_sh); - #define SH(val, pdst) MSA_STORE(val, pdst, msa_sh) - MSA_STORE_FUNC(uint32_t, sw, msa_sw); - #define SW(val, pdst) MSA_STORE(val, pdst, msa_sw) - MSA_STORE_FUNC(uint64_t, sd, msa_sd); - #define SD(val, pdst) MSA_STORE(val, pdst, msa_sd) +MSA_STORE_FUNC(uint16_t, sh, msa_sh); +#define SH(val, pdst) MSA_STORE(val, pdst, msa_sh) +MSA_STORE_FUNC(uint32_t, sw, msa_sw); +#define SW(val, pdst) MSA_STORE(val, pdst, msa_sw) +MSA_STORE_FUNC(uint64_t, sd, msa_sd); +#define SD(val, pdst) MSA_STORE(val, pdst, msa_sd) #else // !(__mips_isa_rev >= 6) - MSA_LOAD_FUNC(uint16_t, ulh, msa_ulh); - #define LH(psrc) MSA_LOAD(psrc, msa_ulh) - MSA_LOAD_FUNC(uint32_t, ulw, msa_ulw); - #define LW(psrc) MSA_LOAD(psrc, msa_ulw) - #if (__mips == 64) - MSA_LOAD_FUNC(uint64_t, uld, msa_uld); - #define LD(psrc) MSA_LOAD(psrc, msa_uld) - #else // !(__mips == 64) - #define LD(psrc) ((((uint64_t)MSA_LOAD(psrc + 4, msa_ulw)) << 32) | \ - MSA_LOAD(psrc, msa_ulw)) - #endif // (__mips == 64) +MSA_LOAD_FUNC(uint16_t, ulh, msa_ulh); +#define LH(psrc) MSA_LOAD(psrc, msa_ulh) +MSA_LOAD_FUNC(uint32_t, ulw, msa_ulw); +#define LW(psrc) MSA_LOAD(psrc, msa_ulw) +#if (__mips == 64) +MSA_LOAD_FUNC(uint64_t, uld, msa_uld); +#define LD(psrc) MSA_LOAD(psrc, msa_uld) +#else // !(__mips == 64) +#define LD(psrc) \ + ((((uint64_t)MSA_LOAD(psrc + 4, msa_ulw)) << 32) | MSA_LOAD(psrc, msa_ulw)) +#endif // (__mips == 64) - MSA_STORE_FUNC(uint16_t, ush, msa_ush); - #define SH(val, pdst) MSA_STORE(val, pdst, msa_ush) - MSA_STORE_FUNC(uint32_t, usw, msa_usw); - #define SW(val, pdst) MSA_STORE(val, pdst, msa_usw) - #define SD(val, pdst) do { \ - uint8_t* const pdst_sd_m = (uint8_t*)(pdst); \ - const uint32_t val0_m = (uint32_t)(val & 0x00000000FFFFFFFF); \ - const uint32_t val1_m = (uint32_t)((val >> 32) & 0x00000000FFFFFFFF); \ - SW(val0_m, pdst_sd_m); \ - SW(val1_m, pdst_sd_m + 4); \ +MSA_STORE_FUNC(uint16_t, ush, msa_ush); +#define SH(val, pdst) MSA_STORE(val, pdst, msa_ush) +MSA_STORE_FUNC(uint32_t, usw, msa_usw); +#define SW(val, pdst) MSA_STORE(val, pdst, msa_usw) +#define SD(val, pdst) \ + do { \ + uint8_t* const pdst_sd_m = (uint8_t*)(pdst); \ + const uint32_t val0_m = (uint32_t)(val & 0x00000000FFFFFFFF); \ + const uint32_t val1_m = (uint32_t)((val >> 32) & 0x00000000FFFFFFFF); \ + SW(val0_m, pdst_sd_m); \ + SW(val1_m, pdst_sd_m + 4); \ } while (0) #endif // (__mips_isa_rev >= 6) @@ -149,16 +150,17 @@ * Load word in 'out2' from (psrc + 2 * stride) * Load word in 'out3' from (psrc + 3 * stride) */ -#define LW4(psrc, stride, out0, out1, out2, out3) do { \ - const uint8_t* ptmp = (const uint8_t*)psrc; \ - out0 = LW(ptmp); \ - ptmp += stride; \ - out1 = LW(ptmp); \ - ptmp += stride; \ - out2 = LW(ptmp); \ - ptmp += stride; \ - out3 = LW(ptmp); \ -} while (0) +#define LW4(psrc, stride, out0, out1, out2, out3) \ + do { \ + const uint8_t* ptmp = (const uint8_t*)psrc; \ + out0 = LW(ptmp); \ + ptmp += stride; \ + out1 = LW(ptmp); \ + ptmp += stride; \ + out2 = LW(ptmp); \ + ptmp += stride; \ + out3 = LW(ptmp); \ + } while (0) /* Description : Store words with stride * Arguments : Inputs - in0, in1, in2, in3, pdst, stride @@ -167,32 +169,35 @@ * Store word from 'in2' to (pdst + 2 * stride) * Store word from 'in3' to (pdst + 3 * stride) */ -#define SW4(in0, in1, in2, in3, pdst, stride) do { \ - uint8_t* ptmp = (uint8_t*)pdst; \ - SW(in0, ptmp); \ - ptmp += stride; \ - SW(in1, ptmp); \ - ptmp += stride; \ - SW(in2, ptmp); \ - ptmp += stride; \ - SW(in3, ptmp); \ -} while (0) +#define SW4(in0, in1, in2, in3, pdst, stride) \ + do { \ + uint8_t* ptmp = (uint8_t*)pdst; \ + SW(in0, ptmp); \ + ptmp += stride; \ + SW(in1, ptmp); \ + ptmp += stride; \ + SW(in2, ptmp); \ + ptmp += stride; \ + SW(in3, ptmp); \ + } while (0) -#define SW3(in0, in1, in2, pdst, stride) do { \ - uint8_t* ptmp = (uint8_t*)pdst; \ - SW(in0, ptmp); \ - ptmp += stride; \ - SW(in1, ptmp); \ - ptmp += stride; \ - SW(in2, ptmp); \ -} while (0) +#define SW3(in0, in1, in2, pdst, stride) \ + do { \ + uint8_t* ptmp = (uint8_t*)pdst; \ + SW(in0, ptmp); \ + ptmp += stride; \ + SW(in1, ptmp); \ + ptmp += stride; \ + SW(in2, ptmp); \ + } while (0) -#define SW2(in0, in1, pdst, stride) do { \ - uint8_t* ptmp = (uint8_t*)pdst; \ - SW(in0, ptmp); \ - ptmp += stride; \ - SW(in1, ptmp); \ -} while (0) +#define SW2(in0, in1, pdst, stride) \ + do { \ + uint8_t* ptmp = (uint8_t*)pdst; \ + SW(in0, ptmp); \ + ptmp += stride; \ + SW(in1, ptmp); \ + } while (0) /* Description : Store 4 double words with stride * Arguments : Inputs - in0, in1, in2, in3, pdst, stride @@ -201,16 +206,17 @@ * Store double word from 'in2' to (pdst + 2 * stride) * Store double word from 'in3' to (pdst + 3 * stride) */ -#define SD4(in0, in1, in2, in3, pdst, stride) do { \ - uint8_t* ptmp = (uint8_t*)pdst; \ - SD(in0, ptmp); \ - ptmp += stride; \ - SD(in1, ptmp); \ - ptmp += stride; \ - SD(in2, ptmp); \ - ptmp += stride; \ - SD(in3, ptmp); \ -} while (0) +#define SD4(in0, in1, in2, in3, pdst, stride) \ + do { \ + uint8_t* ptmp = (uint8_t*)pdst; \ + SD(in0, ptmp); \ + ptmp += stride; \ + SD(in1, ptmp); \ + ptmp += stride; \ + SD(in2, ptmp); \ + ptmp += stride; \ + SD(in3, ptmp); \ + } while (0) /* Description : Load vectors with 16 byte elements with stride * Arguments : Inputs - psrc, stride @@ -219,32 +225,36 @@ * Details : Load 16 byte elements in 'out0' from (psrc) * Load 16 byte elements in 'out1' from (psrc + stride) */ -#define LD_B2(RTYPE, psrc, stride, out0, out1) do { \ - out0 = LD_B(RTYPE, psrc); \ - out1 = LD_B(RTYPE, psrc + stride); \ -} while (0) +#define LD_B2(RTYPE, psrc, stride, out0, out1) \ + do { \ + out0 = LD_B(RTYPE, psrc); \ + out1 = LD_B(RTYPE, psrc + stride); \ + } while (0) #define LD_UB2(...) LD_B2(v16u8, __VA_ARGS__) #define LD_SB2(...) LD_B2(v16i8, __VA_ARGS__) -#define LD_B3(RTYPE, psrc, stride, out0, out1, out2) do { \ - LD_B2(RTYPE, psrc, stride, out0, out1); \ - out2 = LD_B(RTYPE, psrc + 2 * stride); \ -} while (0) +#define LD_B3(RTYPE, psrc, stride, out0, out1, out2) \ + do { \ + LD_B2(RTYPE, psrc, stride, out0, out1); \ + out2 = LD_B(RTYPE, psrc + 2 * stride); \ + } while (0) #define LD_UB3(...) LD_B3(v16u8, __VA_ARGS__) #define LD_SB3(...) LD_B3(v16i8, __VA_ARGS__) -#define LD_B4(RTYPE, psrc, stride, out0, out1, out2, out3) do { \ - LD_B2(RTYPE, psrc, stride, out0, out1); \ - LD_B2(RTYPE, psrc + 2 * stride , stride, out2, out3); \ -} while (0) +#define LD_B4(RTYPE, psrc, stride, out0, out1, out2, out3) \ + do { \ + LD_B2(RTYPE, psrc, stride, out0, out1); \ + LD_B2(RTYPE, psrc + 2 * stride, stride, out2, out3); \ + } while (0) #define LD_UB4(...) LD_B4(v16u8, __VA_ARGS__) #define LD_SB4(...) LD_B4(v16i8, __VA_ARGS__) -#define LD_B8(RTYPE, psrc, stride, \ - out0, out1, out2, out3, out4, out5, out6, out7) do { \ - LD_B4(RTYPE, psrc, stride, out0, out1, out2, out3); \ - LD_B4(RTYPE, psrc + 4 * stride, stride, out4, out5, out6, out7); \ -} while (0) +#define LD_B8(RTYPE, psrc, stride, out0, out1, out2, out3, out4, out5, out6, \ + out7) \ + do { \ + LD_B4(RTYPE, psrc, stride, out0, out1, out2, out3); \ + LD_B4(RTYPE, psrc + 4 * stride, stride, out4, out5, out6, out7); \ + } while (0) #define LD_UB8(...) LD_B8(v16u8, __VA_ARGS__) #define LD_SB8(...) LD_B8(v16i8, __VA_ARGS__) @@ -254,10 +264,11 @@ * Details : Load 8 halfword elements in 'out0' from (psrc) * Load 8 halfword elements in 'out1' from (psrc + stride) */ -#define LD_H2(RTYPE, psrc, stride, out0, out1) do { \ - out0 = LD_H(RTYPE, psrc); \ - out1 = LD_H(RTYPE, psrc + stride); \ -} while (0) +#define LD_H2(RTYPE, psrc, stride, out0, out1) \ + do { \ + out0 = LD_H(RTYPE, psrc); \ + out1 = LD_H(RTYPE, psrc + stride); \ + } while (0) #define LD_UH2(...) LD_H2(v8u16, __VA_ARGS__) #define LD_SH2(...) LD_H2(v8i16, __VA_ARGS__) @@ -269,24 +280,27 @@ * Load 4 word elements in 'out2' from (psrc + 2 * stride) * Load 4 word elements in 'out3' from (psrc + 3 * stride) */ -#define LD_W2(RTYPE, psrc, stride, out0, out1) do { \ - out0 = LD_W(RTYPE, psrc); \ - out1 = LD_W(RTYPE, psrc + stride); \ -} while (0) +#define LD_W2(RTYPE, psrc, stride, out0, out1) \ + do { \ + out0 = LD_W(RTYPE, psrc); \ + out1 = LD_W(RTYPE, psrc + stride); \ + } while (0) #define LD_UW2(...) LD_W2(v4u32, __VA_ARGS__) #define LD_SW2(...) LD_W2(v4i32, __VA_ARGS__) -#define LD_W3(RTYPE, psrc, stride, out0, out1, out2) do { \ - LD_W2(RTYPE, psrc, stride, out0, out1); \ - out2 = LD_W(RTYPE, psrc + 2 * stride); \ -} while (0) +#define LD_W3(RTYPE, psrc, stride, out0, out1, out2) \ + do { \ + LD_W2(RTYPE, psrc, stride, out0, out1); \ + out2 = LD_W(RTYPE, psrc + 2 * stride); \ + } while (0) #define LD_UW3(...) LD_W3(v4u32, __VA_ARGS__) #define LD_SW3(...) LD_W3(v4i32, __VA_ARGS__) -#define LD_W4(RTYPE, psrc, stride, out0, out1, out2, out3) do { \ - LD_W2(RTYPE, psrc, stride, out0, out1); \ - LD_W2(RTYPE, psrc + 2 * stride, stride, out2, out3); \ -} while (0) +#define LD_W4(RTYPE, psrc, stride, out0, out1, out2, out3) \ + do { \ + LD_W2(RTYPE, psrc, stride, out0, out1); \ + LD_W2(RTYPE, psrc + 2 * stride, stride, out2, out3); \ + } while (0) #define LD_UW4(...) LD_W4(v4u32, __VA_ARGS__) #define LD_SW4(...) LD_W4(v4i32, __VA_ARGS__) @@ -295,25 +309,27 @@ * Details : Store 16 byte elements from 'in0' to (pdst) * Store 16 byte elements from 'in1' to (pdst + stride) */ -#define ST_B2(RTYPE, in0, in1, pdst, stride) do { \ - ST_B(RTYPE, in0, pdst); \ - ST_B(RTYPE, in1, pdst + stride); \ -} while (0) +#define ST_B2(RTYPE, in0, in1, pdst, stride) \ + do { \ + ST_B(RTYPE, in0, pdst); \ + ST_B(RTYPE, in1, pdst + stride); \ + } while (0) #define ST_UB2(...) ST_B2(v16u8, __VA_ARGS__) #define ST_SB2(...) ST_B2(v16i8, __VA_ARGS__) -#define ST_B4(RTYPE, in0, in1, in2, in3, pdst, stride) do { \ - ST_B2(RTYPE, in0, in1, pdst, stride); \ - ST_B2(RTYPE, in2, in3, pdst + 2 * stride, stride); \ -} while (0) +#define ST_B4(RTYPE, in0, in1, in2, in3, pdst, stride) \ + do { \ + ST_B2(RTYPE, in0, in1, pdst, stride); \ + ST_B2(RTYPE, in2, in3, pdst + 2 * stride, stride); \ + } while (0) #define ST_UB4(...) ST_B4(v16u8, __VA_ARGS__) #define ST_SB4(...) ST_B4(v16i8, __VA_ARGS__) -#define ST_B8(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \ - pdst, stride) do { \ - ST_B4(RTYPE, in0, in1, in2, in3, pdst, stride); \ - ST_B4(RTYPE, in4, in5, in6, in7, pdst + 4 * stride, stride); \ -} while (0) +#define ST_B8(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride) \ + do { \ + ST_B4(RTYPE, in0, in1, in2, in3, pdst, stride); \ + ST_B4(RTYPE, in4, in5, in6, in7, pdst + 4 * stride, stride); \ + } while (0) #define ST_UB8(...) ST_B8(v16u8, __VA_ARGS__) /* Description : Store vectors of 4 word elements with stride @@ -323,24 +339,27 @@ * Store 4 word elements from 'in2' to (pdst + 2 * stride) * Store 4 word elements from 'in3' to (pdst + 3 * stride) */ -#define ST_W2(RTYPE, in0, in1, pdst, stride) do { \ - ST_W(RTYPE, in0, pdst); \ - ST_W(RTYPE, in1, pdst + stride); \ -} while (0) +#define ST_W2(RTYPE, in0, in1, pdst, stride) \ + do { \ + ST_W(RTYPE, in0, pdst); \ + ST_W(RTYPE, in1, pdst + stride); \ + } while (0) #define ST_UW2(...) ST_W2(v4u32, __VA_ARGS__) #define ST_SW2(...) ST_W2(v4i32, __VA_ARGS__) -#define ST_W3(RTYPE, in0, in1, in2, pdst, stride) do { \ - ST_W2(RTYPE, in0, in1, pdst, stride); \ - ST_W(RTYPE, in2, pdst + 2 * stride); \ -} while (0) +#define ST_W3(RTYPE, in0, in1, in2, pdst, stride) \ + do { \ + ST_W2(RTYPE, in0, in1, pdst, stride); \ + ST_W(RTYPE, in2, pdst + 2 * stride); \ + } while (0) #define ST_UW3(...) ST_W3(v4u32, __VA_ARGS__) #define ST_SW3(...) ST_W3(v4i32, __VA_ARGS__) -#define ST_W4(RTYPE, in0, in1, in2, in3, pdst, stride) do { \ - ST_W2(RTYPE, in0, in1, pdst, stride); \ - ST_W2(RTYPE, in2, in3, pdst + 2 * stride, stride); \ -} while (0) +#define ST_W4(RTYPE, in0, in1, in2, in3, pdst, stride) \ + do { \ + ST_W2(RTYPE, in0, in1, pdst, stride); \ + ST_W2(RTYPE, in2, in3, pdst + 2 * stride, stride); \ + } while (0) #define ST_UW4(...) ST_W4(v4u32, __VA_ARGS__) #define ST_SW4(...) ST_W4(v4i32, __VA_ARGS__) @@ -349,10 +368,11 @@ * Details : Store 8 halfword elements from 'in0' to (pdst) * Store 8 halfword elements from 'in1' to (pdst + stride) */ -#define ST_H2(RTYPE, in0, in1, pdst, stride) do { \ - ST_H(RTYPE, in0, pdst); \ - ST_H(RTYPE, in1, pdst + stride); \ -} while (0) +#define ST_H2(RTYPE, in0, in1, pdst, stride) \ + do { \ + ST_H(RTYPE, in0, pdst); \ + ST_H(RTYPE, in1, pdst + stride); \ + } while (0) #define ST_UH2(...) ST_H2(v8u16, __VA_ARGS__) #define ST_SH2(...) ST_H2(v8i16, __VA_ARGS__) @@ -367,20 +387,21 @@ * Index 'stidx+3' halfword element from 'in' vector is copied to * the GP register and stored to (pdst + 3 * stride) */ -#define ST2x4_UB(in, stidx, pdst, stride) do { \ - uint8_t* pblk_2x4_m = (uint8_t*)pdst; \ - const uint16_t out0_m = __msa_copy_s_h((v8i16)in, stidx); \ - const uint16_t out1_m = __msa_copy_s_h((v8i16)in, stidx + 1); \ - const uint16_t out2_m = __msa_copy_s_h((v8i16)in, stidx + 2); \ - const uint16_t out3_m = __msa_copy_s_h((v8i16)in, stidx + 3); \ - SH(out0_m, pblk_2x4_m); \ - pblk_2x4_m += stride; \ - SH(out1_m, pblk_2x4_m); \ - pblk_2x4_m += stride; \ - SH(out2_m, pblk_2x4_m); \ - pblk_2x4_m += stride; \ - SH(out3_m, pblk_2x4_m); \ -} while (0) +#define ST2x4_UB(in, stidx, pdst, stride) \ + do { \ + uint8_t* pblk_2x4_m = (uint8_t*)pdst; \ + const uint16_t out0_m = __msa_copy_s_h((v8i16)in, stidx); \ + const uint16_t out1_m = __msa_copy_s_h((v8i16)in, stidx + 1); \ + const uint16_t out2_m = __msa_copy_s_h((v8i16)in, stidx + 2); \ + const uint16_t out3_m = __msa_copy_s_h((v8i16)in, stidx + 3); \ + SH(out0_m, pblk_2x4_m); \ + pblk_2x4_m += stride; \ + SH(out1_m, pblk_2x4_m); \ + pblk_2x4_m += stride; \ + SH(out2_m, pblk_2x4_m); \ + pblk_2x4_m += stride; \ + SH(out3_m, pblk_2x4_m); \ + } while (0) /* Description : Store 4x4 byte block to destination memory from input vector * Arguments : Inputs - in0, in1, pdst, stride @@ -393,20 +414,22 @@ * 'Idx3' word element from input vector 'in0' is copied to the * GP register and stored to (pdst + 3 * stride) */ -#define ST4x4_UB(in0, in1, idx0, idx1, idx2, idx3, pdst, stride) do { \ - uint8_t* const pblk_4x4_m = (uint8_t*)pdst; \ - const uint32_t out0_m = __msa_copy_s_w((v4i32)in0, idx0); \ - const uint32_t out1_m = __msa_copy_s_w((v4i32)in0, idx1); \ - const uint32_t out2_m = __msa_copy_s_w((v4i32)in1, idx2); \ - const uint32_t out3_m = __msa_copy_s_w((v4i32)in1, idx3); \ - SW4(out0_m, out1_m, out2_m, out3_m, pblk_4x4_m, stride); \ -} while (0) +#define ST4x4_UB(in0, in1, idx0, idx1, idx2, idx3, pdst, stride) \ + do { \ + uint8_t* const pblk_4x4_m = (uint8_t*)pdst; \ + const uint32_t out0_m = __msa_copy_s_w((v4i32)in0, idx0); \ + const uint32_t out1_m = __msa_copy_s_w((v4i32)in0, idx1); \ + const uint32_t out2_m = __msa_copy_s_w((v4i32)in1, idx2); \ + const uint32_t out3_m = __msa_copy_s_w((v4i32)in1, idx3); \ + SW4(out0_m, out1_m, out2_m, out3_m, pblk_4x4_m, stride); \ + } while (0) -#define ST4x8_UB(in0, in1, pdst, stride) do { \ - uint8_t* const pblk_4x8 = (uint8_t*)pdst; \ - ST4x4_UB(in0, in0, 0, 1, 2, 3, pblk_4x8, stride); \ - ST4x4_UB(in1, in1, 0, 1, 2, 3, pblk_4x8 + 4 * stride, stride); \ -} while (0) +#define ST4x8_UB(in0, in1, pdst, stride) \ + do { \ + uint8_t* const pblk_4x8 = (uint8_t*)pdst; \ + ST4x4_UB(in0, in0, 0, 1, 2, 3, pblk_4x8, stride); \ + ST4x4_UB(in1, in1, 0, 1, 2, 3, pblk_4x8 + 4 * stride, stride); \ + } while (0) /* Description : Immediate number of elements to slide * Arguments : Inputs - in0, in1, slide_val @@ -415,8 +438,8 @@ * Details : Byte elements from 'in1' vector are slid into 'in0' by * value specified in the 'slide_val' */ -#define SLDI_B(RTYPE, in0, in1, slide_val) \ - (RTYPE)__msa_sldi_b((v16i8)in0, (v16i8)in1, slide_val) \ +#define SLDI_B(RTYPE, in0, in1, slide_val) \ + (RTYPE) __msa_sldi_b((v16i8)in0, (v16i8)in1, slide_val) #define SLDI_UB(...) SLDI_B(v16u8, __VA_ARGS__) #define SLDI_SB(...) SLDI_B(v16i8, __VA_ARGS__) @@ -429,18 +452,19 @@ * Details : Byte elements from 'in0' & 'in1' are copied selectively to * 'out0' as per control vector 'mask0' */ -#define VSHF_B(RTYPE, in0, in1, mask) \ - (RTYPE)__msa_vshf_b((v16i8)mask, (v16i8)in1, (v16i8)in0) +#define VSHF_B(RTYPE, in0, in1, mask) \ + (RTYPE) __msa_vshf_b((v16i8)mask, (v16i8)in1, (v16i8)in0) #define VSHF_UB(...) VSHF_B(v16u8, __VA_ARGS__) #define VSHF_SB(...) VSHF_B(v16i8, __VA_ARGS__) #define VSHF_UH(...) VSHF_B(v8u16, __VA_ARGS__) #define VSHF_SH(...) VSHF_B(v8i16, __VA_ARGS__) -#define VSHF_B2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) do { \ - out0 = VSHF_B(RTYPE, in0, in1, mask0); \ - out1 = VSHF_B(RTYPE, in2, in3, mask1); \ -} while (0) +#define VSHF_B2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) \ + do { \ + out0 = VSHF_B(RTYPE, in0, in1, mask0); \ + out1 = VSHF_B(RTYPE, in2, in3, mask1); \ + } while (0) #define VSHF_B2_UB(...) VSHF_B2(v16u8, __VA_ARGS__) #define VSHF_B2_SB(...) VSHF_B2(v16i8, __VA_ARGS__) #define VSHF_B2_UH(...) VSHF_B2(v8u16, __VA_ARGS__) @@ -453,10 +477,11 @@ * Details : halfword elements from 'in0' & 'in1' are copied selectively to * 'out0' as per control vector 'mask0' */ -#define VSHF_H2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) do { \ - out0 = (RTYPE)__msa_vshf_h((v8i16)mask0, (v8i16)in1, (v8i16)in0); \ - out1 = (RTYPE)__msa_vshf_h((v8i16)mask1, (v8i16)in3, (v8i16)in2); \ -} while (0) +#define VSHF_H2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_vshf_h((v8i16)mask0, (v8i16)in1, (v8i16)in0); \ + out1 = (RTYPE)__msa_vshf_h((v8i16)mask1, (v8i16)in3, (v8i16)in2); \ + } while (0) #define VSHF_H2_UH(...) VSHF_H2(v8u16, __VA_ARGS__) #define VSHF_H2_SH(...) VSHF_H2(v8i16, __VA_ARGS__) @@ -469,11 +494,12 @@ * twice the size of input i.e. signed halfword. * The multiplication result of adjacent odd-even elements * are added together and written to the 'out0' vector -*/ -#define DOTP_SB2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) do { \ - out0 = (RTYPE)__msa_dotp_s_h((v16i8)mult0, (v16i8)cnst0); \ - out1 = (RTYPE)__msa_dotp_s_h((v16i8)mult1, (v16i8)cnst1); \ -} while (0) + */ +#define DOTP_SB2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_dotp_s_h((v16i8)mult0, (v16i8)cnst0); \ + out1 = (RTYPE)__msa_dotp_s_h((v16i8)mult1, (v16i8)cnst1); \ + } while (0) #define DOTP_SB2_SH(...) DOTP_SB2(v8i16, __VA_ARGS__) /* Description : Dot product of halfword vector elements @@ -486,10 +512,11 @@ * The multiplication result of adjacent odd-even elements * are added together and written to the 'out0' vector */ -#define DOTP_SH2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) do { \ - out0 = (RTYPE)__msa_dotp_s_w((v8i16)mult0, (v8i16)cnst0); \ - out1 = (RTYPE)__msa_dotp_s_w((v8i16)mult1, (v8i16)cnst1); \ -} while (0) +#define DOTP_SH2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_dotp_s_w((v8i16)mult0, (v8i16)cnst0); \ + out1 = (RTYPE)__msa_dotp_s_w((v8i16)mult1, (v8i16)cnst1); \ + } while (0) #define DOTP_SH2_SW(...) DOTP_SH2(v4i32, __VA_ARGS__) /* Description : Dot product of unsigned word vector elements @@ -502,10 +529,11 @@ * The multiplication result of adjacent odd-even elements * are added together and written to the 'out0' vector */ -#define DOTP_UW2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) do { \ - out0 = (RTYPE)__msa_dotp_u_d((v4u32)mult0, (v4u32)cnst0); \ - out1 = (RTYPE)__msa_dotp_u_d((v4u32)mult1, (v4u32)cnst1); \ -} while (0) +#define DOTP_UW2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_dotp_u_d((v4u32)mult0, (v4u32)cnst0); \ + out1 = (RTYPE)__msa_dotp_u_d((v4u32)mult1, (v4u32)cnst1); \ + } while (0) #define DOTP_UW2_UD(...) DOTP_UW2(v2u64, __VA_ARGS__) /* Description : Dot product & addition of halfword vector elements @@ -518,10 +546,11 @@ * The multiplication result of adjacent odd-even elements * are added to the 'out0' vector */ -#define DPADD_SH2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) do { \ - out0 = (RTYPE)__msa_dpadd_s_w((v4i32)out0, (v8i16)mult0, (v8i16)cnst0); \ - out1 = (RTYPE)__msa_dpadd_s_w((v4i32)out1, (v8i16)mult1, (v8i16)cnst1); \ -} while (0) +#define DPADD_SH2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_dpadd_s_w((v4i32)out0, (v8i16)mult0, (v8i16)cnst0); \ + out1 = (RTYPE)__msa_dpadd_s_w((v4i32)out1, (v8i16)mult1, (v8i16)cnst1); \ + } while (0) #define DPADD_SH2_SW(...) DPADD_SH2(v4i32, __VA_ARGS__) /* Description : Clips all signed halfword elements of input vector @@ -529,21 +558,24 @@ * Arguments : Input/output - val * Return Type - signed halfword */ -#define CLIP_SH_0_255(val) do { \ - const v8i16 max_m = __msa_ldi_h(255); \ - val = __msa_maxi_s_h((v8i16)val, 0); \ - val = __msa_min_s_h(max_m, (v8i16)val); \ -} while (0) +#define CLIP_SH_0_255(val) \ + do { \ + const v8i16 max_m = __msa_ldi_h(255); \ + val = __msa_maxi_s_h((v8i16)val, 0); \ + val = __msa_min_s_h(max_m, (v8i16)val); \ + } while (0) -#define CLIP_SH2_0_255(in0, in1) do { \ - CLIP_SH_0_255(in0); \ - CLIP_SH_0_255(in1); \ -} while (0) +#define CLIP_SH2_0_255(in0, in1) \ + do { \ + CLIP_SH_0_255(in0); \ + CLIP_SH_0_255(in1); \ + } while (0) -#define CLIP_SH4_0_255(in0, in1, in2, in3) do { \ - CLIP_SH2_0_255(in0, in1); \ - CLIP_SH2_0_255(in2, in3); \ -} while (0) +#define CLIP_SH4_0_255(in0, in1, in2, in3) \ + do { \ + CLIP_SH2_0_255(in0, in1); \ + CLIP_SH2_0_255(in2, in3); \ + } while (0) /* Description : Clips all unsigned halfword elements of input vector * between 0 & 255 @@ -551,34 +583,38 @@ * Output - out_m * Return Type - unsigned halfword */ -#define CLIP_UH_0_255(in) do { \ - const v8u16 max_m = (v8u16)__msa_ldi_h(255); \ - in = __msa_maxi_u_h((v8u16) in, 0); \ - in = __msa_min_u_h((v8u16) max_m, (v8u16) in); \ -} while (0) +#define CLIP_UH_0_255(in) \ + do { \ + const v8u16 max_m = (v8u16)__msa_ldi_h(255); \ + in = __msa_maxi_u_h((v8u16)in, 0); \ + in = __msa_min_u_h((v8u16)max_m, (v8u16)in); \ + } while (0) -#define CLIP_UH2_0_255(in0, in1) do { \ - CLIP_UH_0_255(in0); \ - CLIP_UH_0_255(in1); \ -} while (0) +#define CLIP_UH2_0_255(in0, in1) \ + do { \ + CLIP_UH_0_255(in0); \ + CLIP_UH_0_255(in1); \ + } while (0) /* Description : Clips all signed word elements of input vector * between 0 & 255 * Arguments : Input/output - val * Return Type - signed word */ -#define CLIP_SW_0_255(val) do { \ - const v4i32 max_m = __msa_ldi_w(255); \ - val = __msa_maxi_s_w((v4i32)val, 0); \ - val = __msa_min_s_w(max_m, (v4i32)val); \ -} while (0) +#define CLIP_SW_0_255(val) \ + do { \ + const v4i32 max_m = __msa_ldi_w(255); \ + val = __msa_maxi_s_w((v4i32)val, 0); \ + val = __msa_min_s_w(max_m, (v4i32)val); \ + } while (0) -#define CLIP_SW4_0_255(in0, in1, in2, in3) do { \ - CLIP_SW_0_255(in0); \ - CLIP_SW_0_255(in1); \ - CLIP_SW_0_255(in2); \ - CLIP_SW_0_255(in3); \ -} while (0) +#define CLIP_SW4_0_255(in0, in1, in2, in3) \ + do { \ + CLIP_SW_0_255(in0); \ + CLIP_SW_0_255(in1); \ + CLIP_SW_0_255(in2); \ + CLIP_SW_0_255(in3); \ + } while (0) /* Description : Horizontal addition of 4 signed word elements of input vector * Arguments : Input - in (signed word vector) @@ -639,16 +675,18 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { even signed half word element from 'in0' (pairwise) and the halfword result is written in 'out0' */ -#define HADD_SH2(RTYPE, in0, in1, out0, out1) do { \ - out0 = (RTYPE)__msa_hadd_s_w((v8i16)in0, (v8i16)in0); \ - out1 = (RTYPE)__msa_hadd_s_w((v8i16)in1, (v8i16)in1); \ -} while (0) +#define HADD_SH2(RTYPE, in0, in1, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_hadd_s_w((v8i16)in0, (v8i16)in0); \ + out1 = (RTYPE)__msa_hadd_s_w((v8i16)in1, (v8i16)in1); \ + } while (0) #define HADD_SH2_SW(...) HADD_SH2(v4i32, __VA_ARGS__) -#define HADD_SH4(RTYPE, in0, in1, in2, in3, out0, out1, out2, out3) do { \ - HADD_SH2(RTYPE, in0, in1, out0, out1); \ - HADD_SH2(RTYPE, in2, in3, out2, out3); \ -} while (0) +#define HADD_SH4(RTYPE, in0, in1, in2, in3, out0, out1, out2, out3) \ + do { \ + HADD_SH2(RTYPE, in0, in1, out0, out1); \ + HADD_SH2(RTYPE, in2, in3, out2, out3); \ + } while (0) #define HADD_SH4_SW(...) HADD_SH4(v4i32, __VA_ARGS__) /* Description : Horizontal subtraction of unsigned byte vector elements @@ -659,10 +697,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * even unsigned byte element from 'in0' (pairwise) and the * halfword result is written to 'out0' */ -#define HSUB_UB2(RTYPE, in0, in1, out0, out1) do { \ - out0 = (RTYPE)__msa_hsub_u_h((v16u8)in0, (v16u8)in0); \ - out1 = (RTYPE)__msa_hsub_u_h((v16u8)in1, (v16u8)in1); \ -} while (0) +#define HSUB_UB2(RTYPE, in0, in1, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_hsub_u_h((v16u8)in0, (v16u8)in0); \ + out1 = (RTYPE)__msa_hsub_u_h((v16u8)in1, (v16u8)in1); \ + } while (0) #define HSUB_UB2_UH(...) HSUB_UB2(v8u16, __VA_ARGS__) #define HSUB_UB2_SH(...) HSUB_UB2(v8i16, __VA_ARGS__) #define HSUB_UB2_SW(...) HSUB_UB2(v4i32, __VA_ARGS__) @@ -673,19 +712,21 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Return Type - as per RTYPE * Details : Set element 0 in vector 'out' to value specified in 'in0' */ -#define INSERT_W2(RTYPE, in0, in1, out) do { \ - out = (RTYPE)__msa_insert_w((v4i32)out, 0, in0); \ - out = (RTYPE)__msa_insert_w((v4i32)out, 1, in1); \ -} while (0) +#define INSERT_W2(RTYPE, in0, in1, out) \ + do { \ + out = (RTYPE)__msa_insert_w((v4i32)out, 0, in0); \ + out = (RTYPE)__msa_insert_w((v4i32)out, 1, in1); \ + } while (0) #define INSERT_W2_UB(...) INSERT_W2(v16u8, __VA_ARGS__) #define INSERT_W2_SB(...) INSERT_W2(v16i8, __VA_ARGS__) -#define INSERT_W4(RTYPE, in0, in1, in2, in3, out) do { \ - out = (RTYPE)__msa_insert_w((v4i32)out, 0, in0); \ - out = (RTYPE)__msa_insert_w((v4i32)out, 1, in1); \ - out = (RTYPE)__msa_insert_w((v4i32)out, 2, in2); \ - out = (RTYPE)__msa_insert_w((v4i32)out, 3, in3); \ -} while (0) +#define INSERT_W4(RTYPE, in0, in1, in2, in3, out) \ + do { \ + out = (RTYPE)__msa_insert_w((v4i32)out, 0, in0); \ + out = (RTYPE)__msa_insert_w((v4i32)out, 1, in1); \ + out = (RTYPE)__msa_insert_w((v4i32)out, 2, in2); \ + out = (RTYPE)__msa_insert_w((v4i32)out, 3, in3); \ + } while (0) #define INSERT_W4_UB(...) INSERT_W4(v16u8, __VA_ARGS__) #define INSERT_W4_SB(...) INSERT_W4(v16i8, __VA_ARGS__) #define INSERT_W4_SW(...) INSERT_W4(v4i32, __VA_ARGS__) @@ -697,10 +738,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Set element 0 in vector 'out' to GPR value specified in 'in0' * Set element 1 in vector 'out' to GPR value specified in 'in1' */ -#define INSERT_D2(RTYPE, in0, in1, out) do { \ - out = (RTYPE)__msa_insert_d((v2i64)out, 0, in0); \ - out = (RTYPE)__msa_insert_d((v2i64)out, 1, in1); \ -} while (0) +#define INSERT_D2(RTYPE, in0, in1, out) \ + do { \ + out = (RTYPE)__msa_insert_d((v2i64)out, 0, in0); \ + out = (RTYPE)__msa_insert_d((v2i64)out, 1, in1); \ + } while (0) #define INSERT_D2_UB(...) INSERT_D2(v16u8, __VA_ARGS__) #define INSERT_D2_SB(...) INSERT_D2(v16i8, __VA_ARGS__) @@ -711,10 +753,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Even byte elements of 'in0' and 'in1' are interleaved * and written to 'out0' */ -#define ILVEV_B2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvev_b((v16i8)in1, (v16i8)in0); \ - out1 = (RTYPE)__msa_ilvev_b((v16i8)in3, (v16i8)in2); \ -} while (0) +#define ILVEV_B2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvev_b((v16i8)in1, (v16i8)in0); \ + out1 = (RTYPE)__msa_ilvev_b((v16i8)in3, (v16i8)in2); \ + } while (0) #define ILVEV_B2_UB(...) ILVEV_B2(v16u8, __VA_ARGS__) #define ILVEV_B2_SB(...) ILVEV_B2(v16i8, __VA_ARGS__) #define ILVEV_B2_UH(...) ILVEV_B2(v8u16, __VA_ARGS__) @@ -728,10 +771,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Odd byte elements of 'in0' and 'in1' are interleaved * and written to 'out0' */ -#define ILVOD_B2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvod_b((v16i8)in1, (v16i8)in0); \ - out1 = (RTYPE)__msa_ilvod_b((v16i8)in3, (v16i8)in2); \ -} while (0) +#define ILVOD_B2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvod_b((v16i8)in1, (v16i8)in0); \ + out1 = (RTYPE)__msa_ilvod_b((v16i8)in3, (v16i8)in2); \ + } while (0) #define ILVOD_B2_UB(...) ILVOD_B2(v16u8, __VA_ARGS__) #define ILVOD_B2_SB(...) ILVOD_B2(v16i8, __VA_ARGS__) #define ILVOD_B2_UH(...) ILVOD_B2(v8u16, __VA_ARGS__) @@ -745,10 +789,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Even halfword elements of 'in0' and 'in1' are interleaved * and written to 'out0' */ -#define ILVEV_H2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvev_h((v8i16)in1, (v8i16)in0); \ - out1 = (RTYPE)__msa_ilvev_h((v8i16)in3, (v8i16)in2); \ -} while (0) +#define ILVEV_H2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvev_h((v8i16)in1, (v8i16)in0); \ + out1 = (RTYPE)__msa_ilvev_h((v8i16)in3, (v8i16)in2); \ + } while (0) #define ILVEV_H2_UB(...) ILVEV_H2(v16u8, __VA_ARGS__) #define ILVEV_H2_UH(...) ILVEV_H2(v8u16, __VA_ARGS__) #define ILVEV_H2_SH(...) ILVEV_H2(v8i16, __VA_ARGS__) @@ -761,10 +806,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Odd halfword elements of 'in0' and 'in1' are interleaved * and written to 'out0' */ -#define ILVOD_H2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvod_h((v8i16)in1, (v8i16)in0); \ - out1 = (RTYPE)__msa_ilvod_h((v8i16)in3, (v8i16)in2); \ -} while (0) +#define ILVOD_H2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvod_h((v8i16)in1, (v8i16)in0); \ + out1 = (RTYPE)__msa_ilvod_h((v8i16)in3, (v8i16)in2); \ + } while (0) #define ILVOD_H2_UB(...) ILVOD_H2(v16u8, __VA_ARGS__) #define ILVOD_H2_UH(...) ILVOD_H2(v8u16, __VA_ARGS__) #define ILVOD_H2_SH(...) ILVOD_H2(v8i16, __VA_ARGS__) @@ -777,10 +823,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Even word elements of 'in0' and 'in1' are interleaved * and written to 'out0' */ -#define ILVEV_W2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvev_w((v4i32)in1, (v4i32)in0); \ - out1 = (RTYPE)__msa_ilvev_w((v4i32)in3, (v4i32)in2); \ -} while (0) +#define ILVEV_W2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvev_w((v4i32)in1, (v4i32)in0); \ + out1 = (RTYPE)__msa_ilvev_w((v4i32)in3, (v4i32)in2); \ + } while (0) #define ILVEV_W2_UB(...) ILVEV_W2(v16u8, __VA_ARGS__) #define ILVEV_W2_SB(...) ILVEV_W2(v16i8, __VA_ARGS__) #define ILVEV_W2_UH(...) ILVEV_W2(v8u16, __VA_ARGS__) @@ -795,10 +842,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Odd word elements of 'in2' and 'in3' are interleaved * and written to 'out1' */ -#define ILVEVOD_W2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvev_w((v4i32)in1, (v4i32)in0); \ - out1 = (RTYPE)__msa_ilvod_w((v4i32)in3, (v4i32)in2); \ -} while (0) +#define ILVEVOD_W2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvev_w((v4i32)in1, (v4i32)in0); \ + out1 = (RTYPE)__msa_ilvod_w((v4i32)in3, (v4i32)in2); \ + } while (0) #define ILVEVOD_W2_UB(...) ILVEVOD_W2(v16u8, __VA_ARGS__) #define ILVEVOD_W2_UH(...) ILVEVOD_W2(v8u16, __VA_ARGS__) #define ILVEVOD_W2_SH(...) ILVEVOD_W2(v8i16, __VA_ARGS__) @@ -813,10 +861,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Odd half-word elements of 'in2' and 'in3' are interleaved * and written to 'out1' */ -#define ILVEVOD_H2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvev_h((v8i16)in1, (v8i16)in0); \ - out1 = (RTYPE)__msa_ilvod_h((v8i16)in3, (v8i16)in2); \ -} while (0) +#define ILVEVOD_H2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvev_h((v8i16)in1, (v8i16)in0); \ + out1 = (RTYPE)__msa_ilvod_h((v8i16)in3, (v8i16)in2); \ + } while (0) #define ILVEVOD_H2_UB(...) ILVEVOD_H2(v16u8, __VA_ARGS__) #define ILVEVOD_H2_UH(...) ILVEVOD_H2(v8u16, __VA_ARGS__) #define ILVEVOD_H2_SH(...) ILVEVOD_H2(v8i16, __VA_ARGS__) @@ -829,10 +878,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Even double word elements of 'in0' and 'in1' are interleaved * and written to 'out0' */ -#define ILVEV_D2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvev_d((v2i64)in1, (v2i64)in0); \ - out1 = (RTYPE)__msa_ilvev_d((v2i64)in3, (v2i64)in2); \ -} while (0) +#define ILVEV_D2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvev_d((v2i64)in1, (v2i64)in0); \ + out1 = (RTYPE)__msa_ilvev_d((v2i64)in3, (v2i64)in2); \ + } while (0) #define ILVEV_D2_UB(...) ILVEV_D2(v16u8, __VA_ARGS__) #define ILVEV_D2_SB(...) ILVEV_D2(v16i8, __VA_ARGS__) #define ILVEV_D2_SW(...) ILVEV_D2(v4i32, __VA_ARGS__) @@ -845,10 +895,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Left half of byte elements of 'in0' and 'in1' are interleaved * and written to 'out0'. */ -#define ILVL_B2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvl_b((v16i8)in0, (v16i8)in1); \ - out1 = (RTYPE)__msa_ilvl_b((v16i8)in2, (v16i8)in3); \ -} while (0) +#define ILVL_B2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvl_b((v16i8)in0, (v16i8)in1); \ + out1 = (RTYPE)__msa_ilvl_b((v16i8)in2, (v16i8)in3); \ + } while (0) #define ILVL_B2_UB(...) ILVL_B2(v16u8, __VA_ARGS__) #define ILVL_B2_SB(...) ILVL_B2(v16i8, __VA_ARGS__) #define ILVL_B2_UH(...) ILVL_B2(v8u16, __VA_ARGS__) @@ -862,21 +913,23 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Right half of byte elements of 'in0' and 'in1' are interleaved * and written to out0. */ -#define ILVR_B2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvr_b((v16i8)in0, (v16i8)in1); \ - out1 = (RTYPE)__msa_ilvr_b((v16i8)in2, (v16i8)in3); \ -} while (0) +#define ILVR_B2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvr_b((v16i8)in0, (v16i8)in1); \ + out1 = (RTYPE)__msa_ilvr_b((v16i8)in2, (v16i8)in3); \ + } while (0) #define ILVR_B2_UB(...) ILVR_B2(v16u8, __VA_ARGS__) #define ILVR_B2_SB(...) ILVR_B2(v16i8, __VA_ARGS__) #define ILVR_B2_UH(...) ILVR_B2(v8u16, __VA_ARGS__) #define ILVR_B2_SH(...) ILVR_B2(v8i16, __VA_ARGS__) #define ILVR_B2_SW(...) ILVR_B2(v4i32, __VA_ARGS__) -#define ILVR_B4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \ - out0, out1, out2, out3) do { \ - ILVR_B2(RTYPE, in0, in1, in2, in3, out0, out1); \ - ILVR_B2(RTYPE, in4, in5, in6, in7, out2, out3); \ -} while (0) +#define ILVR_B4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, \ + out2, out3) \ + do { \ + ILVR_B2(RTYPE, in0, in1, in2, in3, out0, out1); \ + ILVR_B2(RTYPE, in4, in5, in6, in7, out2, out3); \ + } while (0) #define ILVR_B4_UB(...) ILVR_B4(v16u8, __VA_ARGS__) #define ILVR_B4_SB(...) ILVR_B4(v16i8, __VA_ARGS__) #define ILVR_B4_UH(...) ILVR_B4(v8u16, __VA_ARGS__) @@ -890,19 +943,21 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Right half of halfword elements of 'in0' and 'in1' are * interleaved and written to 'out0'. */ -#define ILVR_H2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvr_h((v8i16)in0, (v8i16)in1); \ - out1 = (RTYPE)__msa_ilvr_h((v8i16)in2, (v8i16)in3); \ -} while (0) +#define ILVR_H2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvr_h((v8i16)in0, (v8i16)in1); \ + out1 = (RTYPE)__msa_ilvr_h((v8i16)in2, (v8i16)in3); \ + } while (0) #define ILVR_H2_UB(...) ILVR_H2(v16u8, __VA_ARGS__) #define ILVR_H2_SH(...) ILVR_H2(v8i16, __VA_ARGS__) #define ILVR_H2_SW(...) ILVR_H2(v4i32, __VA_ARGS__) -#define ILVR_H4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \ - out0, out1, out2, out3) do { \ - ILVR_H2(RTYPE, in0, in1, in2, in3, out0, out1); \ - ILVR_H2(RTYPE, in4, in5, in6, in7, out2, out3); \ -} while (0) +#define ILVR_H4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, \ + out2, out3) \ + do { \ + ILVR_H2(RTYPE, in0, in1, in2, in3, out0, out1); \ + ILVR_H2(RTYPE, in4, in5, in6, in7, out2, out3); \ + } while (0) #define ILVR_H4_UB(...) ILVR_H4(v16u8, __VA_ARGS__) #define ILVR_H4_SH(...) ILVR_H4(v8i16, __VA_ARGS__) #define ILVR_H4_SW(...) ILVR_H4(v4i32, __VA_ARGS__) @@ -914,19 +969,21 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Right half of double word elements of 'in0' and 'in1' are * interleaved and written to 'out0'. */ -#define ILVR_D2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvr_d((v2i64)in0, (v2i64)in1); \ - out1 = (RTYPE)__msa_ilvr_d((v2i64)in2, (v2i64)in3); \ -} while (0) +#define ILVR_D2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvr_d((v2i64)in0, (v2i64)in1); \ + out1 = (RTYPE)__msa_ilvr_d((v2i64)in2, (v2i64)in3); \ + } while (0) #define ILVR_D2_UB(...) ILVR_D2(v16u8, __VA_ARGS__) #define ILVR_D2_SB(...) ILVR_D2(v16i8, __VA_ARGS__) #define ILVR_D2_SH(...) ILVR_D2(v8i16, __VA_ARGS__) -#define ILVR_D4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \ - out0, out1, out2, out3) do { \ - ILVR_D2(RTYPE, in0, in1, in2, in3, out0, out1); \ - ILVR_D2(RTYPE, in4, in5, in6, in7, out2, out3); \ -} while (0) +#define ILVR_D4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, \ + out2, out3) \ + do { \ + ILVR_D2(RTYPE, in0, in1, in2, in3, out0, out1); \ + ILVR_D2(RTYPE, in4, in5, in6, in7, out2, out3); \ + } while (0) #define ILVR_D4_SB(...) ILVR_D4(v16i8, __VA_ARGS__) #define ILVR_D4_UB(...) ILVR_D4(v16u8, __VA_ARGS__) @@ -937,30 +994,33 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Right half of byte elements from 'in0' and 'in1' are * interleaved and written to 'out0' */ -#define ILVRL_B2(RTYPE, in0, in1, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvr_b((v16i8)in0, (v16i8)in1); \ - out1 = (RTYPE)__msa_ilvl_b((v16i8)in0, (v16i8)in1); \ -} while (0) +#define ILVRL_B2(RTYPE, in0, in1, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvr_b((v16i8)in0, (v16i8)in1); \ + out1 = (RTYPE)__msa_ilvl_b((v16i8)in0, (v16i8)in1); \ + } while (0) #define ILVRL_B2_UB(...) ILVRL_B2(v16u8, __VA_ARGS__) #define ILVRL_B2_SB(...) ILVRL_B2(v16i8, __VA_ARGS__) #define ILVRL_B2_UH(...) ILVRL_B2(v8u16, __VA_ARGS__) #define ILVRL_B2_SH(...) ILVRL_B2(v8i16, __VA_ARGS__) #define ILVRL_B2_SW(...) ILVRL_B2(v4i32, __VA_ARGS__) -#define ILVRL_H2(RTYPE, in0, in1, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvr_h((v8i16)in0, (v8i16)in1); \ - out1 = (RTYPE)__msa_ilvl_h((v8i16)in0, (v8i16)in1); \ -} while (0) +#define ILVRL_H2(RTYPE, in0, in1, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvr_h((v8i16)in0, (v8i16)in1); \ + out1 = (RTYPE)__msa_ilvl_h((v8i16)in0, (v8i16)in1); \ + } while (0) #define ILVRL_H2_UB(...) ILVRL_H2(v16u8, __VA_ARGS__) #define ILVRL_H2_SB(...) ILVRL_H2(v16i8, __VA_ARGS__) #define ILVRL_H2_SH(...) ILVRL_H2(v8i16, __VA_ARGS__) #define ILVRL_H2_SW(...) ILVRL_H2(v4i32, __VA_ARGS__) #define ILVRL_H2_UW(...) ILVRL_H2(v4u32, __VA_ARGS__) -#define ILVRL_W2(RTYPE, in0, in1, out0, out1) do { \ - out0 = (RTYPE)__msa_ilvr_w((v4i32)in0, (v4i32)in1); \ - out1 = (RTYPE)__msa_ilvl_w((v4i32)in0, (v4i32)in1); \ -} while (0) +#define ILVRL_W2(RTYPE, in0, in1, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_ilvr_w((v4i32)in0, (v4i32)in1); \ + out1 = (RTYPE)__msa_ilvl_w((v4i32)in0, (v4i32)in1); \ + } while (0) #define ILVRL_W2_UB(...) ILVRL_W2(v16u8, __VA_ARGS__) #define ILVRL_W2_SH(...) ILVRL_W2(v8i16, __VA_ARGS__) #define ILVRL_W2_SW(...) ILVRL_W2(v4i32, __VA_ARGS__) @@ -974,20 +1034,22 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * 'out0' & even byte elements of 'in1' are copied to the right * half of 'out0'. */ -#define PCKEV_B2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_pckev_b((v16i8)in0, (v16i8)in1); \ - out1 = (RTYPE)__msa_pckev_b((v16i8)in2, (v16i8)in3); \ -} while (0) +#define PCKEV_B2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_pckev_b((v16i8)in0, (v16i8)in1); \ + out1 = (RTYPE)__msa_pckev_b((v16i8)in2, (v16i8)in3); \ + } while (0) #define PCKEV_B2_SB(...) PCKEV_B2(v16i8, __VA_ARGS__) #define PCKEV_B2_UB(...) PCKEV_B2(v16u8, __VA_ARGS__) #define PCKEV_B2_SH(...) PCKEV_B2(v8i16, __VA_ARGS__) #define PCKEV_B2_SW(...) PCKEV_B2(v4i32, __VA_ARGS__) -#define PCKEV_B4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \ - out0, out1, out2, out3) do { \ - PCKEV_B2(RTYPE, in0, in1, in2, in3, out0, out1); \ - PCKEV_B2(RTYPE, in4, in5, in6, in7, out2, out3); \ -} while (0) +#define PCKEV_B4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, \ + out2, out3) \ + do { \ + PCKEV_B2(RTYPE, in0, in1, in2, in3, out0, out1); \ + PCKEV_B2(RTYPE, in4, in5, in6, in7, out2, out3); \ + } while (0) #define PCKEV_B4_SB(...) PCKEV_B4(v16i8, __VA_ARGS__) #define PCKEV_B4_UB(...) PCKEV_B4(v16u8, __VA_ARGS__) #define PCKEV_B4_SH(...) PCKEV_B4(v8i16, __VA_ARGS__) @@ -1001,10 +1063,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * 'out0' & even halfword elements of 'in1' are copied to the * right half of 'out0'. */ -#define PCKEV_H2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_pckev_h((v8i16)in0, (v8i16)in1); \ - out1 = (RTYPE)__msa_pckev_h((v8i16)in2, (v8i16)in3); \ -} while (0) +#define PCKEV_H2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_pckev_h((v8i16)in0, (v8i16)in1); \ + out1 = (RTYPE)__msa_pckev_h((v8i16)in2, (v8i16)in3); \ + } while (0) #define PCKEV_H2_UH(...) PCKEV_H2(v8u16, __VA_ARGS__) #define PCKEV_H2_SH(...) PCKEV_H2(v8i16, __VA_ARGS__) #define PCKEV_H2_SW(...) PCKEV_H2(v4i32, __VA_ARGS__) @@ -1018,10 +1081,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * 'out0' & even word elements of 'in1' are copied to the * right half of 'out0'. */ -#define PCKEV_W2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_pckev_w((v4i32)in0, (v4i32)in1); \ - out1 = (RTYPE)__msa_pckev_w((v4i32)in2, (v4i32)in3); \ -} while (0) +#define PCKEV_W2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_pckev_w((v4i32)in0, (v4i32)in1); \ + out1 = (RTYPE)__msa_pckev_w((v4i32)in2, (v4i32)in3); \ + } while (0) #define PCKEV_W2_UH(...) PCKEV_W2(v8u16, __VA_ARGS__) #define PCKEV_W2_SH(...) PCKEV_W2(v8i16, __VA_ARGS__) #define PCKEV_W2_SW(...) PCKEV_W2(v4i32, __VA_ARGS__) @@ -1035,10 +1099,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * 'out0' & odd halfword elements of 'in1' are copied to the * right half of 'out0'. */ -#define PCKOD_H2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_pckod_h((v8i16)in0, (v8i16)in1); \ - out1 = (RTYPE)__msa_pckod_h((v8i16)in2, (v8i16)in3); \ -} while (0) +#define PCKOD_H2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_pckod_h((v8i16)in0, (v8i16)in1); \ + out1 = (RTYPE)__msa_pckod_h((v8i16)in2, (v8i16)in3); \ + } while (0) #define PCKOD_H2_UH(...) PCKOD_H2(v8u16, __VA_ARGS__) #define PCKOD_H2_SH(...) PCKOD_H2(v8i16, __VA_ARGS__) #define PCKOD_H2_SW(...) PCKOD_H2(v4i32, __VA_ARGS__) @@ -1051,17 +1116,19 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Each element of vector 'in0' is right shifted by 'shift' and * the result is written in-place. 'shift' is a GP variable. */ -#define SRAI_W2(RTYPE, in0, in1, shift_val) do { \ - in0 = (RTYPE)SRAI_W(in0, shift_val); \ - in1 = (RTYPE)SRAI_W(in1, shift_val); \ -} while (0) +#define SRAI_W2(RTYPE, in0, in1, shift_val) \ + do { \ + in0 = (RTYPE)SRAI_W(in0, shift_val); \ + in1 = (RTYPE)SRAI_W(in1, shift_val); \ + } while (0) #define SRAI_W2_SW(...) SRAI_W2(v4i32, __VA_ARGS__) #define SRAI_W2_UW(...) SRAI_W2(v4u32, __VA_ARGS__) -#define SRAI_W4(RTYPE, in0, in1, in2, in3, shift_val) do { \ - SRAI_W2(RTYPE, in0, in1, shift_val); \ - SRAI_W2(RTYPE, in2, in3, shift_val); \ -} while (0) +#define SRAI_W4(RTYPE, in0, in1, in2, in3, shift_val) \ + do { \ + SRAI_W2(RTYPE, in0, in1, shift_val); \ + SRAI_W2(RTYPE, in2, in3, shift_val); \ + } while (0) #define SRAI_W4_SW(...) SRAI_W4(v4i32, __VA_ARGS__) #define SRAI_W4_UW(...) SRAI_W4(v4u32, __VA_ARGS__) @@ -1072,10 +1139,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Each element of vector 'in0' is right shifted by 'shift' and * the result is written in-place. 'shift' is a GP variable. */ -#define SRAI_H2(RTYPE, in0, in1, shift_val) do { \ - in0 = (RTYPE)SRAI_H(in0, shift_val); \ - in1 = (RTYPE)SRAI_H(in1, shift_val); \ -} while (0) +#define SRAI_H2(RTYPE, in0, in1, shift_val) \ + do { \ + in0 = (RTYPE)SRAI_H(in0, shift_val); \ + in1 = (RTYPE)SRAI_H(in1, shift_val); \ + } while (0) #define SRAI_H2_SH(...) SRAI_H2(v8i16, __VA_ARGS__) #define SRAI_H2_UH(...) SRAI_H2(v8u16, __VA_ARGS__) @@ -1086,16 +1154,18 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Each element of vector 'in0' is right shifted by 'shift' and * the result is written in-place. 'shift' is a GP variable. */ -#define SRARI_W2(RTYPE, in0, in1, shift) do { \ - in0 = (RTYPE)__msa_srari_w((v4i32)in0, shift); \ - in1 = (RTYPE)__msa_srari_w((v4i32)in1, shift); \ -} while (0) +#define SRARI_W2(RTYPE, in0, in1, shift) \ + do { \ + in0 = (RTYPE)__msa_srari_w((v4i32)in0, shift); \ + in1 = (RTYPE)__msa_srari_w((v4i32)in1, shift); \ + } while (0) #define SRARI_W2_SW(...) SRARI_W2(v4i32, __VA_ARGS__) -#define SRARI_W4(RTYPE, in0, in1, in2, in3, shift) do { \ - SRARI_W2(RTYPE, in0, in1, shift); \ - SRARI_W2(RTYPE, in2, in3, shift); \ -} while (0) +#define SRARI_W4(RTYPE, in0, in1, in2, in3, shift) \ + do { \ + SRARI_W2(RTYPE, in0, in1, shift); \ + SRARI_W2(RTYPE, in2, in3, shift); \ + } while (0) #define SRARI_W4_SH(...) SRARI_W4(v8i16, __VA_ARGS__) #define SRARI_W4_UW(...) SRARI_W4(v4u32, __VA_ARGS__) #define SRARI_W4_SW(...) SRARI_W4(v4i32, __VA_ARGS__) @@ -1110,18 +1180,20 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * rounding and the result is written in-place. * 'shift' is a vector. */ -#define SRAR_D2(RTYPE, in0, in1, shift) do { \ - in0 = (RTYPE)__msa_srar_d((v2i64)in0, (v2i64)shift); \ - in1 = (RTYPE)__msa_srar_d((v2i64)in1, (v2i64)shift); \ -} while (0) +#define SRAR_D2(RTYPE, in0, in1, shift) \ + do { \ + in0 = (RTYPE)__msa_srar_d((v2i64)in0, (v2i64)shift); \ + in1 = (RTYPE)__msa_srar_d((v2i64)in1, (v2i64)shift); \ + } while (0) #define SRAR_D2_SW(...) SRAR_D2(v4i32, __VA_ARGS__) #define SRAR_D2_SD(...) SRAR_D2(v2i64, __VA_ARGS__) #define SRAR_D2_UD(...) SRAR_D2(v2u64, __VA_ARGS__) -#define SRAR_D4(RTYPE, in0, in1, in2, in3, shift) do { \ - SRAR_D2(RTYPE, in0, in1, shift); \ - SRAR_D2(RTYPE, in2, in3, shift); \ -} while (0) +#define SRAR_D4(RTYPE, in0, in1, in2, in3, shift) \ + do { \ + SRAR_D2(RTYPE, in0, in1, shift); \ + SRAR_D2(RTYPE, in2, in3, shift); \ + } while (0) #define SRAR_D4_SD(...) SRAR_D4(v2i64, __VA_ARGS__) #define SRAR_D4_UD(...) SRAR_D4(v2u64, __VA_ARGS__) @@ -1131,10 +1203,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Each element in 'in0' is added to 'in1' and result is written * to 'out0'. */ -#define ADDVI_H2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)ADDVI_H(in0, in1); \ - out1 = (RTYPE)ADDVI_H(in2, in3); \ -} while (0) +#define ADDVI_H2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)ADDVI_H(in0, in1); \ + out1 = (RTYPE)ADDVI_H(in2, in3); \ + } while (0) #define ADDVI_H2_SH(...) ADDVI_H2(v8i16, __VA_ARGS__) #define ADDVI_H2_UH(...) ADDVI_H2(v8u16, __VA_ARGS__) @@ -1144,10 +1217,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Each element in 'in0' is added to 'in1' and result is written * to 'out0'. */ -#define ADDVI_W2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)ADDVI_W(in0, in1); \ - out1 = (RTYPE)ADDVI_W(in2, in3); \ -} while (0) +#define ADDVI_W2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)ADDVI_W(in0, in1); \ + out1 = (RTYPE)ADDVI_W(in2, in3); \ + } while (0) #define ADDVI_W2_SW(...) ADDVI_W2(v4i32, __VA_ARGS__) /* Description : Fill 2 pairs of word vectors with GP registers @@ -1156,10 +1230,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : GP register in0 is replicated in each word element of out0 * GP register in1 is replicated in each word element of out1 */ -#define FILL_W2(RTYPE, in0, in1, out0, out1) do { \ - out0 = (RTYPE)__msa_fill_w(in0); \ - out1 = (RTYPE)__msa_fill_w(in1); \ -} while (0) +#define FILL_W2(RTYPE, in0, in1, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_fill_w(in0); \ + out1 = (RTYPE)__msa_fill_w(in1); \ + } while (0) #define FILL_W2_SW(...) FILL_W2(v4i32, __VA_ARGS__) /* Description : Addition of 2 pairs of vectors @@ -1168,16 +1243,17 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Each element in 'in0' is added to 'in1' and result is written * to 'out0'. */ -#define ADD2(in0, in1, in2, in3, out0, out1) do { \ - out0 = in0 + in1; \ - out1 = in2 + in3; \ -} while (0) +#define ADD2(in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = in0 + in1; \ + out1 = in2 + in3; \ + } while (0) -#define ADD4(in0, in1, in2, in3, in4, in5, in6, in7, \ - out0, out1, out2, out3) do { \ - ADD2(in0, in1, in2, in3, out0, out1); \ - ADD2(in4, in5, in6, in7, out2, out3); \ -} while (0) +#define ADD4(in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, out2, out3) \ + do { \ + ADD2(in0, in1, in2, in3, out0, out1); \ + ADD2(in4, in5, in6, in7, out2, out3); \ + } while (0) /* Description : Subtraction of 2 pairs of vectors * Arguments : Inputs - in0, in1, in2, in3 @@ -1185,24 +1261,26 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Each element in 'in1' is subtracted from 'in0' and result is * written to 'out0'. */ -#define SUB2(in0, in1, in2, in3, out0, out1) do { \ - out0 = in0 - in1; \ - out1 = in2 - in3; \ -} while (0) +#define SUB2(in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = in0 - in1; \ + out1 = in2 - in3; \ + } while (0) -#define SUB3(in0, in1, in2, in3, in4, in5, out0, out1, out2) do { \ - out0 = in0 - in1; \ - out1 = in2 - in3; \ - out2 = in4 - in5; \ -} while (0) +#define SUB3(in0, in1, in2, in3, in4, in5, out0, out1, out2) \ + do { \ + out0 = in0 - in1; \ + out1 = in2 - in3; \ + out2 = in4 - in5; \ + } while (0) -#define SUB4(in0, in1, in2, in3, in4, in5, in6, in7, \ - out0, out1, out2, out3) do { \ - out0 = in0 - in1; \ - out1 = in2 - in3; \ - out2 = in4 - in5; \ - out3 = in6 - in7; \ -} while (0) +#define SUB4(in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, out2, out3) \ + do { \ + out0 = in0 - in1; \ + out1 = in2 - in3; \ + out2 = in4 - in5; \ + out3 = in6 - in7; \ + } while (0) /* Description : Addition - Subtraction of input vectors * Arguments : Inputs - in0, in1 @@ -1212,10 +1290,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Each element in 'in1' is subtracted from 'in0' and result is * written to 'out1'. */ -#define ADDSUB2(in0, in1, out0, out1) do { \ - out0 = in0 + in1; \ - out1 = in0 - in1; \ -} while (0) +#define ADDSUB2(in0, in1, out0, out1) \ + do { \ + out0 = in0 + in1; \ + out1 = in0 - in1; \ + } while (0) /* Description : Multiplication of pairs of vectors * Arguments : Inputs - in0, in1, in2, in3 @@ -1223,16 +1302,17 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Each element from 'in0' is multiplied with elements from 'in1' * and the result is written to 'out0' */ -#define MUL2(in0, in1, in2, in3, out0, out1) do { \ - out0 = in0 * in1; \ - out1 = in2 * in3; \ -} while (0) +#define MUL2(in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = in0 * in1; \ + out1 = in2 * in3; \ + } while (0) -#define MUL4(in0, in1, in2, in3, in4, in5, in6, in7, \ - out0, out1, out2, out3) do { \ - MUL2(in0, in1, in2, in3, out0, out1); \ - MUL2(in4, in5, in6, in7, out2, out3); \ -} while (0) +#define MUL4(in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, out2, out3) \ + do { \ + MUL2(in0, in1, in2, in3, out0, out1); \ + MUL2(in4, in5, in6, in7, out2, out3); \ + } while (0) /* Description : Sign extend halfword elements from right half of the vector * Arguments : Input - in (halfword vector) @@ -1242,10 +1322,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * extracted and interleaved with same vector 'in0' to generate * 4 word elements keeping sign intact */ -#define UNPCK_R_SH_SW(in, out) do { \ - const v8i16 sign_m = __msa_clti_s_h((v8i16)in, 0); \ - out = (v4i32)__msa_ilvr_h(sign_m, (v8i16)in); \ -} while (0) +#define UNPCK_R_SH_SW(in, out) \ + do { \ + const v8i16 sign_m = __msa_clti_s_h((v8i16)in, 0); \ + out = (v4i32)__msa_ilvr_h(sign_m, (v8i16)in); \ + } while (0) /* Description : Sign extend halfword elements from input vector and return * the result in pair of vectors @@ -1258,22 +1339,24 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Then interleaved left with same vector 'in0' to * generate 4 signed word elements in 'out1' */ -#define UNPCK_SH_SW(in, out0, out1) do { \ - const v8i16 tmp_m = __msa_clti_s_h((v8i16)in, 0); \ - ILVRL_H2_SW(tmp_m, in, out0, out1); \ -} while (0) +#define UNPCK_SH_SW(in, out0, out1) \ + do { \ + const v8i16 tmp_m = __msa_clti_s_h((v8i16)in, 0); \ + ILVRL_H2_SW(tmp_m, in, out0, out1); \ + } while (0) /* Description : Butterfly of 4 input vectors * Arguments : Inputs - in0, in1, in2, in3 * Outputs - out0, out1, out2, out3 * Details : Butterfly operation */ -#define BUTTERFLY_4(in0, in1, in2, in3, out0, out1, out2, out3) do { \ - out0 = in0 + in3; \ - out1 = in1 + in2; \ - out2 = in1 - in2; \ - out3 = in0 - in3; \ -} while (0) +#define BUTTERFLY_4(in0, in1, in2, in3, out0, out1, out2, out3) \ + do { \ + out0 = in0 + in3; \ + out1 = in1 + in2; \ + out2 = in1 - in2; \ + out3 = in0 - in3; \ + } while (0) /* Description : Transpose 16x4 block into 4x16 with byte elements in vectors * Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, @@ -1281,21 +1364,22 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Outputs - out0, out1, out2, out3 * Return Type - unsigned byte */ -#define TRANSPOSE16x4_UB_UB(in0, in1, in2, in3, in4, in5, in6, in7, \ - in8, in9, in10, in11, in12, in13, in14, in15, \ - out0, out1, out2, out3) do { \ - v2i64 tmp0_m, tmp1_m, tmp2_m, tmp3_m, tmp4_m, tmp5_m; \ - ILVEV_W2_SD(in0, in4, in8, in12, tmp2_m, tmp3_m); \ - ILVEV_W2_SD(in1, in5, in9, in13, tmp0_m, tmp1_m); \ - ILVEV_D2_UB(tmp2_m, tmp3_m, tmp0_m, tmp1_m, out1, out3); \ - ILVEV_W2_SD(in2, in6, in10, in14, tmp4_m, tmp5_m); \ - ILVEV_W2_SD(in3, in7, in11, in15, tmp0_m, tmp1_m); \ - ILVEV_D2_SD(tmp4_m, tmp5_m, tmp0_m, tmp1_m, tmp2_m, tmp3_m); \ - ILVEV_B2_SD(out1, out3, tmp2_m, tmp3_m, tmp0_m, tmp1_m); \ - ILVEVOD_H2_UB(tmp0_m, tmp1_m, tmp0_m, tmp1_m, out0, out2); \ - ILVOD_B2_SD(out1, out3, tmp2_m, tmp3_m, tmp0_m, tmp1_m); \ - ILVEVOD_H2_UB(tmp0_m, tmp1_m, tmp0_m, tmp1_m, out1, out3); \ -} while (0) +#define TRANSPOSE16x4_UB_UB(in0, in1, in2, in3, in4, in5, in6, in7, in8, in9, \ + in10, in11, in12, in13, in14, in15, out0, out1, \ + out2, out3) \ + do { \ + v2i64 tmp0_m, tmp1_m, tmp2_m, tmp3_m, tmp4_m, tmp5_m; \ + ILVEV_W2_SD(in0, in4, in8, in12, tmp2_m, tmp3_m); \ + ILVEV_W2_SD(in1, in5, in9, in13, tmp0_m, tmp1_m); \ + ILVEV_D2_UB(tmp2_m, tmp3_m, tmp0_m, tmp1_m, out1, out3); \ + ILVEV_W2_SD(in2, in6, in10, in14, tmp4_m, tmp5_m); \ + ILVEV_W2_SD(in3, in7, in11, in15, tmp0_m, tmp1_m); \ + ILVEV_D2_SD(tmp4_m, tmp5_m, tmp0_m, tmp1_m, tmp2_m, tmp3_m); \ + ILVEV_B2_SD(out1, out3, tmp2_m, tmp3_m, tmp0_m, tmp1_m); \ + ILVEVOD_H2_UB(tmp0_m, tmp1_m, tmp0_m, tmp1_m, out0, out2); \ + ILVOD_B2_SD(out1, out3, tmp2_m, tmp3_m, tmp0_m, tmp1_m); \ + ILVEVOD_H2_UB(tmp0_m, tmp1_m, tmp0_m, tmp1_m, out1, out3); \ + } while (0) /* Description : Transpose 16x8 block into 8x16 with byte elements in vectors * Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, @@ -1303,45 +1387,45 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Outputs - out0, out1, out2, out3, out4, out5, out6, out7 * Return Type - unsigned byte */ -#define TRANSPOSE16x8_UB_UB(in0, in1, in2, in3, in4, in5, in6, in7, \ - in8, in9, in10, in11, in12, in13, in14, in15, \ - out0, out1, out2, out3, out4, out5, \ - out6, out7) do { \ - v8i16 tmp0_m, tmp1_m, tmp4_m, tmp5_m, tmp6_m, tmp7_m; \ - v4i32 tmp2_m, tmp3_m; \ - ILVEV_D2_UB(in0, in8, in1, in9, out7, out6); \ - ILVEV_D2_UB(in2, in10, in3, in11, out5, out4); \ - ILVEV_D2_UB(in4, in12, in5, in13, out3, out2); \ - ILVEV_D2_UB(in6, in14, in7, in15, out1, out0); \ - ILVEV_B2_SH(out7, out6, out5, out4, tmp0_m, tmp1_m); \ - ILVOD_B2_SH(out7, out6, out5, out4, tmp4_m, tmp5_m); \ - ILVEV_B2_UB(out3, out2, out1, out0, out5, out7); \ - ILVOD_B2_SH(out3, out2, out1, out0, tmp6_m, tmp7_m); \ - ILVEV_H2_SW(tmp0_m, tmp1_m, out5, out7, tmp2_m, tmp3_m); \ - ILVEVOD_W2_UB(tmp2_m, tmp3_m, tmp2_m, tmp3_m, out0, out4); \ - ILVOD_H2_SW(tmp0_m, tmp1_m, out5, out7, tmp2_m, tmp3_m); \ - ILVEVOD_W2_UB(tmp2_m, tmp3_m, tmp2_m, tmp3_m, out2, out6); \ - ILVEV_H2_SW(tmp4_m, tmp5_m, tmp6_m, tmp7_m, tmp2_m, tmp3_m); \ - ILVEVOD_W2_UB(tmp2_m, tmp3_m, tmp2_m, tmp3_m, out1, out5); \ - ILVOD_H2_SW(tmp4_m, tmp5_m, tmp6_m, tmp7_m, tmp2_m, tmp3_m); \ - ILVEVOD_W2_UB(tmp2_m, tmp3_m, tmp2_m, tmp3_m, out3, out7); \ -} while (0) +#define TRANSPOSE16x8_UB_UB(in0, in1, in2, in3, in4, in5, in6, in7, in8, in9, \ + in10, in11, in12, in13, in14, in15, out0, out1, \ + out2, out3, out4, out5, out6, out7) \ + do { \ + v8i16 tmp0_m, tmp1_m, tmp4_m, tmp5_m, tmp6_m, tmp7_m; \ + v4i32 tmp2_m, tmp3_m; \ + ILVEV_D2_UB(in0, in8, in1, in9, out7, out6); \ + ILVEV_D2_UB(in2, in10, in3, in11, out5, out4); \ + ILVEV_D2_UB(in4, in12, in5, in13, out3, out2); \ + ILVEV_D2_UB(in6, in14, in7, in15, out1, out0); \ + ILVEV_B2_SH(out7, out6, out5, out4, tmp0_m, tmp1_m); \ + ILVOD_B2_SH(out7, out6, out5, out4, tmp4_m, tmp5_m); \ + ILVEV_B2_UB(out3, out2, out1, out0, out5, out7); \ + ILVOD_B2_SH(out3, out2, out1, out0, tmp6_m, tmp7_m); \ + ILVEV_H2_SW(tmp0_m, tmp1_m, out5, out7, tmp2_m, tmp3_m); \ + ILVEVOD_W2_UB(tmp2_m, tmp3_m, tmp2_m, tmp3_m, out0, out4); \ + ILVOD_H2_SW(tmp0_m, tmp1_m, out5, out7, tmp2_m, tmp3_m); \ + ILVEVOD_W2_UB(tmp2_m, tmp3_m, tmp2_m, tmp3_m, out2, out6); \ + ILVEV_H2_SW(tmp4_m, tmp5_m, tmp6_m, tmp7_m, tmp2_m, tmp3_m); \ + ILVEVOD_W2_UB(tmp2_m, tmp3_m, tmp2_m, tmp3_m, out1, out5); \ + ILVOD_H2_SW(tmp4_m, tmp5_m, tmp6_m, tmp7_m, tmp2_m, tmp3_m); \ + ILVEVOD_W2_UB(tmp2_m, tmp3_m, tmp2_m, tmp3_m, out3, out7); \ + } while (0) /* Description : Transpose 4x4 block with word elements in vectors * Arguments : Inputs - in0, in1, in2, in3 * Outputs - out0, out1, out2, out3 * Return Type - as per RTYPE */ -#define TRANSPOSE4x4_W(RTYPE, in0, in1, in2, in3, \ - out0, out1, out2, out3) do { \ - v4i32 s0_m, s1_m, s2_m, s3_m; \ - ILVRL_W2_SW(in1, in0, s0_m, s1_m); \ - ILVRL_W2_SW(in3, in2, s2_m, s3_m); \ - out0 = (RTYPE)__msa_ilvr_d((v2i64)s2_m, (v2i64)s0_m); \ - out1 = (RTYPE)__msa_ilvl_d((v2i64)s2_m, (v2i64)s0_m); \ - out2 = (RTYPE)__msa_ilvr_d((v2i64)s3_m, (v2i64)s1_m); \ - out3 = (RTYPE)__msa_ilvl_d((v2i64)s3_m, (v2i64)s1_m); \ -} while (0) +#define TRANSPOSE4x4_W(RTYPE, in0, in1, in2, in3, out0, out1, out2, out3) \ + do { \ + v4i32 s0_m, s1_m, s2_m, s3_m; \ + ILVRL_W2_SW(in1, in0, s0_m, s1_m); \ + ILVRL_W2_SW(in3, in2, s2_m, s3_m); \ + out0 = (RTYPE)__msa_ilvr_d((v2i64)s2_m, (v2i64)s0_m); \ + out1 = (RTYPE)__msa_ilvl_d((v2i64)s2_m, (v2i64)s0_m); \ + out2 = (RTYPE)__msa_ilvr_d((v2i64)s3_m, (v2i64)s1_m); \ + out3 = (RTYPE)__msa_ilvl_d((v2i64)s3_m, (v2i64)s1_m); \ + } while (0) #define TRANSPOSE4x4_SW_SW(...) TRANSPOSE4x4_W(v4i32, __VA_ARGS__) /* Description : Add block 4x4 @@ -1349,33 +1433,35 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * Details : Least significant 4 bytes from each input vector are added to * the destination bytes, clipped between 0-255 and stored. */ -#define ADDBLK_ST4x4_UB(in0, in1, in2, in3, pdst, stride) do { \ - uint32_t src0_m, src1_m, src2_m, src3_m; \ - v8i16 inp0_m, inp1_m, res0_m, res1_m; \ - v16i8 dst0_m = { 0 }; \ - v16i8 dst1_m = { 0 }; \ - const v16i8 zero_m = { 0 }; \ - ILVR_D2_SH(in1, in0, in3, in2, inp0_m, inp1_m); \ - LW4(pdst, stride, src0_m, src1_m, src2_m, src3_m); \ - INSERT_W2_SB(src0_m, src1_m, dst0_m); \ - INSERT_W2_SB(src2_m, src3_m, dst1_m); \ - ILVR_B2_SH(zero_m, dst0_m, zero_m, dst1_m, res0_m, res1_m); \ - ADD2(res0_m, inp0_m, res1_m, inp1_m, res0_m, res1_m); \ - CLIP_SH2_0_255(res0_m, res1_m); \ - PCKEV_B2_SB(res0_m, res0_m, res1_m, res1_m, dst0_m, dst1_m); \ - ST4x4_UB(dst0_m, dst1_m, 0, 1, 0, 1, pdst, stride); \ -} while (0) +#define ADDBLK_ST4x4_UB(in0, in1, in2, in3, pdst, stride) \ + do { \ + uint32_t src0_m, src1_m, src2_m, src3_m; \ + v8i16 inp0_m, inp1_m, res0_m, res1_m; \ + v16i8 dst0_m = {0}; \ + v16i8 dst1_m = {0}; \ + const v16i8 zero_m = {0}; \ + ILVR_D2_SH(in1, in0, in3, in2, inp0_m, inp1_m); \ + LW4(pdst, stride, src0_m, src1_m, src2_m, src3_m); \ + INSERT_W2_SB(src0_m, src1_m, dst0_m); \ + INSERT_W2_SB(src2_m, src3_m, dst1_m); \ + ILVR_B2_SH(zero_m, dst0_m, zero_m, dst1_m, res0_m, res1_m); \ + ADD2(res0_m, inp0_m, res1_m, inp1_m, res0_m, res1_m); \ + CLIP_SH2_0_255(res0_m, res1_m); \ + PCKEV_B2_SB(res0_m, res0_m, res1_m, res1_m, dst0_m, dst1_m); \ + ST4x4_UB(dst0_m, dst1_m, 0, 1, 0, 1, pdst, stride); \ + } while (0) /* Description : Pack even byte elements, extract 0 & 2 index words from pair * of results and store 4 words in destination memory as per * stride * Arguments : Inputs - in0, in1, in2, in3, pdst, stride */ -#define PCKEV_ST4x4_UB(in0, in1, in2, in3, pdst, stride) do { \ - v16i8 tmp0_m, tmp1_m; \ - PCKEV_B2_SB(in1, in0, in3, in2, tmp0_m, tmp1_m); \ - ST4x4_UB(tmp0_m, tmp1_m, 0, 2, 0, 2, pdst, stride); \ -} while (0) +#define PCKEV_ST4x4_UB(in0, in1, in2, in3, pdst, stride) \ + do { \ + v16i8 tmp0_m, tmp1_m; \ + PCKEV_B2_SB(in1, in0, in3, in2, tmp0_m, tmp1_m); \ + ST4x4_UB(tmp0_m, tmp1_m, 0, 2, 0, 2, pdst, stride); \ + } while (0) /* Description : average with rounding (in0 + in1 + 1) / 2. * Arguments : Inputs - in0, in1, in2, in3, @@ -1385,10 +1471,11 @@ static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { * each unsigned byte element from 'in1' vector. Then the average * with rounding is calculated and written to 'out0' */ -#define AVER_UB2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ - out0 = (RTYPE)__msa_aver_u_b((v16u8)in0, (v16u8)in1); \ - out1 = (RTYPE)__msa_aver_u_b((v16u8)in2, (v16u8)in3); \ -} while (0) +#define AVER_UB2(RTYPE, in0, in1, in2, in3, out0, out1) \ + do { \ + out0 = (RTYPE)__msa_aver_u_b((v16u8)in0, (v16u8)in1); \ + out1 = (RTYPE)__msa_aver_u_b((v16u8)in2, (v16u8)in3); \ + } while (0) #define AVER_UB2_UB(...) AVER_UB2(v16u8, __VA_ARGS__) #endif // WEBP_USE_MSA diff --git a/src/dsp/neon.h b/src/dsp/neon.h index 14acb404..324e0156 100644 --- a/src/dsp/neon.h +++ b/src/dsp/neon.h @@ -22,26 +22,29 @@ // everywhere except newer clang/gcc or aarch64 where the inline assembly is // incompatible. #if LOCAL_CLANG_PREREQ(3, 8) || LOCAL_GCC_PREREQ(4, 9) || WEBP_AARCH64 -#define WEBP_USE_INTRINSICS // use intrinsics when possible +#define WEBP_USE_INTRINSICS // use intrinsics when possible #endif -#define INIT_VECTOR2(v, a, b) do { \ - v.val[0] = a; \ - v.val[1] = b; \ -} while (0) +#define INIT_VECTOR2(v, a, b) \ + do { \ + v.val[0] = a; \ + v.val[1] = b; \ + } while (0) -#define INIT_VECTOR3(v, a, b, c) do { \ - v.val[0] = a; \ - v.val[1] = b; \ - v.val[2] = c; \ -} while (0) +#define INIT_VECTOR3(v, a, b, c) \ + do { \ + v.val[0] = a; \ + v.val[1] = b; \ + v.val[2] = c; \ + } while (0) -#define INIT_VECTOR4(v, a, b, c, d) do { \ - v.val[0] = a; \ - v.val[1] = b; \ - v.val[2] = c; \ - v.val[3] = d; \ -} while (0) +#define INIT_VECTOR4(v, a, b, c, d) \ + do { \ + v.val[0] = a; \ + v.val[1] = b; \ + v.val[2] = c; \ + v.val[3] = d; \ + } while (0) // if using intrinsics, this flag avoids some functions that make gcc-4.6.3 // crash ("internal compiler error: in immed_double_const, at emit-rtl."). @@ -82,22 +85,23 @@ static WEBP_INLINE int32x4x4_t Transpose4x4_NEON(const int32x4x4_t rows) { } } -#if 0 // Useful debug macro. +#if 0 // Useful debug macro. #include -#define PRINT_REG(REG, SIZE) do { \ - int i; \ - printf("%s \t[%d]: 0x", #REG, SIZE); \ - if (SIZE == 8) { \ - uint8_t _tmp[8]; \ - vst1_u8(_tmp, (REG)); \ - for (i = 0; i < 8; ++i) printf("%.2x ", _tmp[i]); \ - } else if (SIZE == 16) { \ - uint16_t _tmp[4]; \ - vst1_u16(_tmp, (REG)); \ - for (i = 0; i < 4; ++i) printf("%.4x ", _tmp[i]); \ - } \ - printf("\n"); \ -} while (0) +#define PRINT_REG(REG, SIZE) \ + do { \ + int i; \ + printf("%s \t[%d]: 0x", #REG, SIZE); \ + if (SIZE == 8) { \ + uint8_t _tmp[8]; \ + vst1_u8(_tmp, (REG)); \ + for (i = 0; i < 8; ++i) printf("%.2x ", _tmp[i]); \ + } else if (SIZE == 16) { \ + uint16_t _tmp[4]; \ + vst1_u16(_tmp, (REG)); \ + for (i = 0; i < 4; ++i) printf("%.4x ", _tmp[i]); \ + } \ + printf("\n"); \ + } while (0) #endif #endif // WEBP_USE_NEON diff --git a/src/dsp/quant.h b/src/dsp/quant.h index dcbc11c7..0a3e1527 100644 --- a/src/dsp/quant.h +++ b/src/dsp/quant.h @@ -61,9 +61,9 @@ static WEBP_INLINE int IsFlat(const int16_t* levels, int num_blocks, static WEBP_INLINE int IsFlat(const int16_t* levels, int num_blocks, int thresh) { int score = 0; - while (num_blocks-- > 0) { // TODO(skal): refine positional scoring? + while (num_blocks-- > 0) { // TODO(skal): refine positional scoring? int i; - for (i = 1; i < 16; ++i) { // omit DC, we're only interested in AC + for (i = 1; i < 16; ++i) { // omit DC, we're only interested in AC score += (levels[i] != 0); if (score > thresh) return 0; } @@ -79,7 +79,7 @@ static WEBP_INLINE int IsFlatSource16(const uint8_t* src) { const uint32_t v = src[0] * 0x01010101u; int i; for (i = 0; i < 16; ++i) { - if (memcmp(src + 0, &v, 4) || memcmp(src + 4, &v, 4) || + if (memcmp(src + 0, &v, 4) || memcmp(src + 4, &v, 4) || memcmp(src + 8, &v, 4) || memcmp(src + 12, &v, 4)) { return 0; } diff --git a/src/dsp/rescaler.c b/src/dsp/rescaler.c index eafccd44..5e2fa653 100644 --- a/src/dsp/rescaler.c +++ b/src/dsp/rescaler.c @@ -15,9 +15,9 @@ #include #include "src/dsp/cpu.h" -#include "src/webp/types.h" #include "src/dsp/dsp.h" #include "src/utils/rescaler_utils.h" +#include "src/webp/types.h" //------------------------------------------------------------------------------ // Implementations of critical functions ImportRow / ExportRow @@ -84,7 +84,7 @@ void WebPRescalerImportRowShrink_C(WebPRescaler* WEBP_RESTRICT const wrk, sum += base; x_in += x_stride; } - { // Emit next horizontal pixel. + { // Emit next horizontal pixel. const rescaler_t frac = base * (-accum); wrk->frow[x_out] = sum * wrk->x_sub - frac; // fresh fractional start for next pixel @@ -119,8 +119,7 @@ void WebPRescalerExportRowExpand_C(WebPRescaler* const wrk) { const uint32_t B = WEBP_RESCALER_FRAC(-wrk->y_accum, wrk->y_sub); const uint32_t A = (uint32_t)(WEBP_RESCALER_ONE - B); for (x_out = 0; x_out < x_out_max; ++x_out) { - const uint64_t I = (uint64_t)A * frow[x_out] - + (uint64_t)B * irow[x_out]; + const uint64_t I = (uint64_t)A * frow[x_out] + (uint64_t)B * irow[x_out]; const uint32_t J = (uint32_t)((I + ROUNDER) >> WEBP_RESCALER_RFIX); const int v = (int)MULT_FIX(J, wrk->fy_scale); dst[x_out] = (v > 255) ? 255u : (uint8_t)v; @@ -143,7 +142,7 @@ void WebPRescalerExportRowShrink_C(WebPRescaler* const wrk) { const uint32_t frac = (uint32_t)MULT_FIX_FLOOR(frow[x_out], yscale); const int v = (int)MULT_FIX(irow[x_out] - frac, wrk->fxy_scale); dst[x_out] = (v > 255) ? 255u : (uint8_t)v; - irow[x_out] = frac; // new fractional start + irow[x_out] = frac; // new fractional start } } else { for (x_out = 0; x_out < x_out_max; ++x_out) { @@ -252,5 +251,5 @@ WEBP_DSP_INIT_FUNC(WebPRescalerDspInit) { assert(WebPRescalerExportRowShrink != NULL); assert(WebPRescalerImportRowExpand != NULL); assert(WebPRescalerImportRowShrink != NULL); -#endif // WEBP_REDUCE_SIZE +#endif // WEBP_REDUCE_SIZE } diff --git a/src/dsp/rescaler_mips32.c b/src/dsp/rescaler_mips32.c index b5168caa..43a83dcf 100644 --- a/src/dsp/rescaler_mips32.c +++ b/src/dsp/rescaler_mips32.c @@ -16,6 +16,7 @@ #if defined(WEBP_USE_MIPS32) && !defined(WEBP_REDUCE_SIZE) #include + #include "src/utils/rescaler_utils.h" //------------------------------------------------------------------------------ @@ -41,42 +42,41 @@ static void ImportRowShrink_MIPS32(WebPRescaler* WEBP_RESTRICT const wrk, int accum, accum1; int loop_c = x_out_max - channel; - __asm__ volatile ( - "li %[temp1], 0x8000 \n\t" - "li %[temp2], 0x10000 \n\t" - "li %[sum], 0 \n\t" - "li %[accum], 0 \n\t" - "1: \n\t" - "addu %[accum], %[accum], %[x_add] \n\t" - "li %[base], 0 \n\t" - "blez %[accum], 3f \n\t" - "2: \n\t" - "lbu %[base], 0(%[src1]) \n\t" - "subu %[accum], %[accum], %[x_sub] \n\t" - "addu %[src1], %[src1], %[x_stride] \n\t" - "addu %[sum], %[sum], %[base] \n\t" - "bgtz %[accum], 2b \n\t" - "3: \n\t" - "negu %[accum1], %[accum] \n\t" - "mul %[frac], %[base], %[accum1] \n\t" - "mul %[temp3], %[sum], %[x_sub] \n\t" - "subu %[loop_c], %[loop_c], %[x_stride] \n\t" - "mult %[temp1], %[temp2] \n\t" - "maddu %[frac], %[fx_scale] \n\t" - "mfhi %[sum] \n\t" - "subu %[temp3], %[temp3], %[frac] \n\t" - "sw %[temp3], 0(%[frow]) \n\t" - "addu %[frow], %[frow], %[x_stride1] \n\t" - "bgtz %[loop_c], 1b \n\t" - : [accum]"=&r"(accum), [src1]"+r"(src1), [temp3]"=&r"(temp3), - [sum]"=&r"(sum), [base]"=&r"(base), [frac]"=&r"(frac), - [frow]"+r"(frow), [accum1]"=&r"(accum1), - [temp2]"=&r"(temp2), [temp1]"=&r"(temp1) - : [x_stride]"r"(x_stride), [fx_scale]"r"(fx_scale), - [x_sub]"r"(x_sub), [x_add]"r"(x_add), - [loop_c]"r"(loop_c), [x_stride1]"r"(x_stride1) - : "memory", "hi", "lo" - ); + __asm__ volatile( + "li %[temp1], 0x8000 \n\t" + "li %[temp2], 0x10000 \n\t" + "li %[sum], 0 \n\t" + "li %[accum], 0 \n\t" + "1: \n\t" + "addu %[accum], %[accum], %[x_add] \n\t" + "li %[base], 0 \n\t" + "blez %[accum], 3f \n\t" + "2: \n\t" + "lbu %[base], 0(%[src1]) \n\t" + "subu %[accum], %[accum], %[x_sub] \n\t" + "addu %[src1], %[src1], %[x_stride] \n\t" + "addu %[sum], %[sum], %[base] \n\t" + "bgtz %[accum], 2b \n\t" + "3: \n\t" + "negu %[accum1], %[accum] \n\t" + "mul %[frac], %[base], %[accum1] \n\t" + "mul %[temp3], %[sum], %[x_sub] \n\t" + "subu %[loop_c], %[loop_c], %[x_stride] \n\t" + "mult %[temp1], %[temp2] \n\t" + "maddu %[frac], %[fx_scale] \n\t" + "mfhi %[sum] \n\t" + "subu %[temp3], %[temp3], %[frac] \n\t" + "sw %[temp3], 0(%[frow]) \n\t" + "addu %[frow], %[frow], %[x_stride1] \n\t" + "bgtz %[loop_c], 1b \n\t" + : [accum] "=&r"(accum), [src1] "+r"(src1), [temp3] "=&r"(temp3), + [sum] "=&r"(sum), [base] "=&r"(base), [frac] "=&r"(frac), + [frow] "+r"(frow), [accum1] "=&r"(accum1), [temp2] "=&r"(temp2), + [temp1] "=&r"(temp1) + : [x_stride] "r"(x_stride), [fx_scale] "r"(fx_scale), + [x_sub] "r"(x_sub), [x_add] "r"(x_add), [loop_c] "r"(loop_c), + [x_stride1] "r"(x_stride1) + : "memory", "hi", "lo"); assert(accum == 0); } } @@ -101,44 +101,43 @@ static void ImportRowExpand_MIPS32(WebPRescaler* WEBP_RESTRICT const wrk, int accum; int x_out = channel; - __asm__ volatile ( - "addiu %[temp3], %[src_width], -1 \n\t" - "lbu %[temp2], 0(%[src1]) \n\t" - "addu %[src1], %[src1], %[x_stride] \n\t" - "bgtz %[temp3], 0f \n\t" - "addiu %[temp1], %[temp2], 0 \n\t" - "b 3f \n\t" - "0: \n\t" - "lbu %[temp1], 0(%[src1]) \n\t" - "3: \n\t" - "addiu %[accum], %[x_add], 0 \n\t" - "1: \n\t" - "subu %[temp3], %[temp2], %[temp1] \n\t" - "mul %[temp3], %[temp3], %[accum] \n\t" - "mul %[temp4], %[temp1], %[x_add] \n\t" - "addu %[temp3], %[temp4], %[temp3] \n\t" - "sw %[temp3], 0(%[frow]) \n\t" - "addu %[frow], %[frow], %[x_stride1] \n\t" - "addu %[x_out], %[x_out], %[x_stride] \n\t" - "subu %[temp3], %[x_out], %[x_out_max] \n\t" - "bgez %[temp3], 2f \n\t" - "subu %[accum], %[accum], %[x_sub] \n\t" - "bgez %[accum], 4f \n\t" - "addiu %[temp2], %[temp1], 0 \n\t" - "addu %[src1], %[src1], %[x_stride] \n\t" - "lbu %[temp1], 0(%[src1]) \n\t" - "addu %[accum], %[accum], %[x_add] \n\t" - "4: \n\t" - "b 1b \n\t" - "2: \n\t" - : [src1]"+r"(src1), [accum]"=&r"(accum), [temp1]"=&r"(temp1), - [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), - [x_out]"+r"(x_out), [frac]"=&r"(frac), [frow]"+r"(frow) - : [x_stride]"r"(x_stride), [x_add]"r"(x_add), [x_sub]"r"(x_sub), - [x_stride1]"r"(x_stride1), [src_width]"r"(src_width), - [x_out_max]"r"(x_out_max) - : "memory", "hi", "lo" - ); + __asm__ volatile( + "addiu %[temp3], %[src_width], -1 \n\t" + "lbu %[temp2], 0(%[src1]) \n\t" + "addu %[src1], %[src1], %[x_stride] \n\t" + "bgtz %[temp3], 0f \n\t" + "addiu %[temp1], %[temp2], 0 \n\t" + "b 3f \n\t" + "0: \n\t" + "lbu %[temp1], 0(%[src1]) \n\t" + "3: \n\t" + "addiu %[accum], %[x_add], 0 \n\t" + "1: \n\t" + "subu %[temp3], %[temp2], %[temp1] \n\t" + "mul %[temp3], %[temp3], %[accum] \n\t" + "mul %[temp4], %[temp1], %[x_add] \n\t" + "addu %[temp3], %[temp4], %[temp3] \n\t" + "sw %[temp3], 0(%[frow]) \n\t" + "addu %[frow], %[frow], %[x_stride1] \n\t" + "addu %[x_out], %[x_out], %[x_stride] \n\t" + "subu %[temp3], %[x_out], %[x_out_max] \n\t" + "bgez %[temp3], 2f \n\t" + "subu %[accum], %[accum], %[x_sub] \n\t" + "bgez %[accum], 4f \n\t" + "addiu %[temp2], %[temp1], 0 \n\t" + "addu %[src1], %[src1], %[x_stride] \n\t" + "lbu %[temp1], 0(%[src1]) \n\t" + "addu %[accum], %[accum], %[x_add] \n\t" + "4: \n\t" + "b 1b \n\t" + "2: \n\t" + : [src1] "+r"(src1), [accum] "=&r"(accum), [temp1] "=&r"(temp1), + [temp2] "=&r"(temp2), [temp3] "=&r"(temp3), [temp4] "=&r"(temp4), + [x_out] "+r"(x_out), [frac] "=&r"(frac), [frow] "+r"(frow) + : [x_stride] "r"(x_stride), [x_add] "r"(x_add), [x_sub] "r"(x_sub), + [x_stride1] "r"(x_stride1), [src_width] "r"(src_width), + [x_out_max] "r"(x_out_max) + : "memory", "hi", "lo"); assert(wrk->x_sub == 0 /* <- special case for src_width=1 */ || accum == 0); } } @@ -159,57 +158,55 @@ static void ExportRowExpand_MIPS32(WebPRescaler* const wrk) { assert(wrk->y_expand); assert(wrk->y_sub != 0); if (wrk->y_accum == 0) { - __asm__ volatile ( - "li %[temp3], 0x10000 \n\t" - "li %[temp4], 0x8000 \n\t" - "addu %[loop_end], %[frow], %[temp6] \n\t" - "1: \n\t" - "lw %[temp0], 0(%[frow]) \n\t" - "addiu %[dst], %[dst], 1 \n\t" - "addiu %[frow], %[frow], 4 \n\t" - "mult %[temp3], %[temp4] \n\t" - "maddu %[temp0], %[temp2] \n\t" - "mfhi %[temp5] \n\t" - "sb %[temp5], -1(%[dst]) \n\t" - "bne %[frow], %[loop_end], 1b \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp3]"=&r"(temp3), - [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), [frow]"+r"(frow), - [dst]"+r"(dst), [loop_end]"=&r"(loop_end) - : [temp2]"r"(temp2), [temp6]"r"(temp6) - : "memory", "hi", "lo" - ); + __asm__ volatile( + "li %[temp3], 0x10000 \n\t" + "li %[temp4], 0x8000 \n\t" + "addu %[loop_end], %[frow], %[temp6] \n\t" + "1: \n\t" + "lw %[temp0], 0(%[frow]) \n\t" + "addiu %[dst], %[dst], 1 \n\t" + "addiu %[frow], %[frow], 4 \n\t" + "mult %[temp3], %[temp4] \n\t" + "maddu %[temp0], %[temp2] \n\t" + "mfhi %[temp5] \n\t" + "sb %[temp5], -1(%[dst]) \n\t" + "bne %[frow], %[loop_end], 1b \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp3] "=&r"(temp3), + [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), [frow] "+r"(frow), + [dst] "+r"(dst), [loop_end] "=&r"(loop_end) + : [temp2] "r"(temp2), [temp6] "r"(temp6) + : "memory", "hi", "lo"); } else { const uint32_t B = WEBP_RESCALER_FRAC(-wrk->y_accum, wrk->y_sub); const uint32_t A = (uint32_t)(WEBP_RESCALER_ONE - B); - __asm__ volatile ( - "li %[temp3], 0x10000 \n\t" - "li %[temp4], 0x8000 \n\t" - "addu %[loop_end], %[frow], %[temp6] \n\t" - "1: \n\t" - "lw %[temp0], 0(%[frow]) \n\t" - "lw %[temp1], 0(%[irow]) \n\t" - "addiu %[dst], %[dst], 1 \n\t" - "mult %[temp3], %[temp4] \n\t" - "maddu %[A], %[temp0] \n\t" - "maddu %[B], %[temp1] \n\t" - "addiu %[frow], %[frow], 4 \n\t" - "addiu %[irow], %[irow], 4 \n\t" - "mfhi %[temp5] \n\t" - "mult %[temp3], %[temp4] \n\t" - "maddu %[temp5], %[temp2] \n\t" - "mfhi %[temp5] \n\t" - "sb %[temp5], -1(%[dst]) \n\t" - "bne %[frow], %[loop_end], 1b \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp3]"=&r"(temp3), - [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), [frow]"+r"(frow), - [irow]"+r"(irow), [dst]"+r"(dst), [loop_end]"=&r"(loop_end) - : [temp2]"r"(temp2), [temp6]"r"(temp6), [A]"r"(A), [B]"r"(B) - : "memory", "hi", "lo" - ); + __asm__ volatile( + "li %[temp3], 0x10000 \n\t" + "li %[temp4], 0x8000 \n\t" + "addu %[loop_end], %[frow], %[temp6] \n\t" + "1: \n\t" + "lw %[temp0], 0(%[frow]) \n\t" + "lw %[temp1], 0(%[irow]) \n\t" + "addiu %[dst], %[dst], 1 \n\t" + "mult %[temp3], %[temp4] \n\t" + "maddu %[A], %[temp0] \n\t" + "maddu %[B], %[temp1] \n\t" + "addiu %[frow], %[frow], 4 \n\t" + "addiu %[irow], %[irow], 4 \n\t" + "mfhi %[temp5] \n\t" + "mult %[temp3], %[temp4] \n\t" + "maddu %[temp5], %[temp2] \n\t" + "mfhi %[temp5] \n\t" + "sb %[temp5], -1(%[dst]) \n\t" + "bne %[frow], %[loop_end], 1b \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp3] "=&r"(temp3), + [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), [frow] "+r"(frow), + [irow] "+r"(irow), [dst] "+r"(dst), [loop_end] "=&r"(loop_end) + : [temp2] "r"(temp2), [temp6] "r"(temp6), [A] "r"(A), [B] "r"(B) + : "memory", "hi", "lo"); } } -#if 0 // disabled for now. TODO(skal): make match the C-code +#if 0 // disabled for now. TODO(skal): make match the C-code static void ExportRowShrink_MIPS32(WebPRescaler* const wrk) { const int x_out_max = wrk->dst_width * wrk->num_channels; uint8_t* dst = wrk->dst; @@ -225,7 +222,7 @@ static void ExportRowShrink_MIPS32(WebPRescaler* const wrk) { assert(!wrk->y_expand); assert(wrk->fxy_scale != 0); if (yscale) { - __asm__ volatile ( + __asm__ volatile( "li %[temp3], 0x10000 \n\t" "li %[temp4], 0x8000 \n\t" "addu %[loop_end], %[frow], %[temp6] \n\t" @@ -252,7 +249,7 @@ static void ExportRowShrink_MIPS32(WebPRescaler* const wrk) { : "memory", "hi", "lo" ); } else { - __asm__ volatile ( + __asm__ volatile( "li %[temp3], 0x10000 \n\t" "li %[temp4], 0x8000 \n\t" "addu %[loop_end], %[irow], %[temp6] \n\t" @@ -285,7 +282,7 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPRescalerDspInitMIPS32(void) { WebPRescalerImportRowExpand = ImportRowExpand_MIPS32; WebPRescalerImportRowShrink = ImportRowShrink_MIPS32; WebPRescalerExportRowExpand = ExportRowExpand_MIPS32; -// WebPRescalerExportRowShrink = ExportRowShrink_MIPS32; + // WebPRescalerExportRowShrink = ExportRowShrink_MIPS32; } #else // !WEBP_USE_MIPS32 diff --git a/src/dsp/rescaler_mips_dsp_r2.c b/src/dsp/rescaler_mips_dsp_r2.c index 419b741f..7df44385 100644 --- a/src/dsp/rescaler_mips_dsp_r2.c +++ b/src/dsp/rescaler_mips_dsp_r2.c @@ -16,6 +16,7 @@ #if defined(WEBP_USE_MIPS_DSP_R2) && !defined(WEBP_REDUCE_SIZE) #include + #include "src/utils/rescaler_utils.h" #define ROUNDER (WEBP_RESCALER_ONE >> 1) @@ -25,7 +26,7 @@ //------------------------------------------------------------------------------ // Row export -#if 0 // disabled for now. TODO(skal): make match the C-code +#if 0 // disabled for now. TODO(skal): make match the C-code static void ExportRowShrink_MIPSdspR2(WebPRescaler* const wrk) { int i; const int x_out_max = wrk->dst_width * wrk->num_channels; @@ -43,7 +44,7 @@ static void ExportRowShrink_MIPSdspR2(WebPRescaler* const wrk) { if (yscale) { if (x_out_max >= 4) { int temp8, temp9, temp10, temp11; - __asm__ volatile ( + __asm__ volatile( "li %[temp3], 0x10000 \n\t" "li %[temp4], 0x8000 \n\t" "addu %[loop_end], %[frow], %[temp6] \n\t" @@ -114,7 +115,7 @@ static void ExportRowShrink_MIPSdspR2(WebPRescaler* const wrk) { } } else { if (x_out_max >= 4) { - __asm__ volatile ( + __asm__ volatile( "li %[temp3], 0x10000 \n\t" "li %[temp4], 0x8000 \n\t" "addu %[loop_end], %[irow], %[temp6] \n\t" @@ -178,41 +179,40 @@ static void ExportRowExpand_MIPSdspR2(WebPRescaler* const wrk) { assert(wrk->y_sub != 0); if (wrk->y_accum == 0) { if (x_out_max >= 4) { - __asm__ volatile ( - "li %[temp4], 0x10000 \n\t" - "li %[temp5], 0x8000 \n\t" - "addu %[loop_end], %[frow], %[temp6] \n\t" - "1: \n\t" - "lw %[temp0], 0(%[frow]) \n\t" - "lw %[temp1], 4(%[frow]) \n\t" - "lw %[temp2], 8(%[frow]) \n\t" - "lw %[temp3], 12(%[frow]) \n\t" - "addiu %[dst], %[dst], 4 \n\t" - "addiu %[frow], %[frow], 16 \n\t" - "mult $ac0, %[temp4], %[temp5] \n\t" - "maddu $ac0, %[temp0], %[temp7] \n\t" - "mult $ac1, %[temp4], %[temp5] \n\t" - "maddu $ac1, %[temp1], %[temp7] \n\t" - "mult $ac2, %[temp4], %[temp5] \n\t" - "maddu $ac2, %[temp2], %[temp7] \n\t" - "mult $ac3, %[temp4], %[temp5] \n\t" - "maddu $ac3, %[temp3], %[temp7] \n\t" - "mfhi %[temp0], $ac0 \n\t" - "mfhi %[temp1], $ac1 \n\t" - "mfhi %[temp2], $ac2 \n\t" - "mfhi %[temp3], $ac3 \n\t" - "sb %[temp0], -4(%[dst]) \n\t" - "sb %[temp1], -3(%[dst]) \n\t" - "sb %[temp2], -2(%[dst]) \n\t" - "sb %[temp3], -1(%[dst]) \n\t" - "bne %[frow], %[loop_end], 1b \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp3]"=&r"(temp3), - [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), [frow]"+r"(frow), - [dst]"+r"(dst), [loop_end]"=&r"(loop_end), [temp2]"=&r"(temp2) - : [temp7]"r"(temp7), [temp6]"r"(temp6) - : "memory", "hi", "lo", "$ac1hi", "$ac1lo", - "$ac2hi", "$ac2lo", "$ac3hi", "$ac3lo" - ); + __asm__ volatile( + "li %[temp4], 0x10000 \n\t" + "li %[temp5], 0x8000 \n\t" + "addu %[loop_end], %[frow], %[temp6] \n\t" + "1: \n\t" + "lw %[temp0], 0(%[frow]) \n\t" + "lw %[temp1], 4(%[frow]) \n\t" + "lw %[temp2], 8(%[frow]) \n\t" + "lw %[temp3], 12(%[frow]) \n\t" + "addiu %[dst], %[dst], 4 \n\t" + "addiu %[frow], %[frow], 16 \n\t" + "mult $ac0, %[temp4], %[temp5] \n\t" + "maddu $ac0, %[temp0], %[temp7] \n\t" + "mult $ac1, %[temp4], %[temp5] \n\t" + "maddu $ac1, %[temp1], %[temp7] \n\t" + "mult $ac2, %[temp4], %[temp5] \n\t" + "maddu $ac2, %[temp2], %[temp7] \n\t" + "mult $ac3, %[temp4], %[temp5] \n\t" + "maddu $ac3, %[temp3], %[temp7] \n\t" + "mfhi %[temp0], $ac0 \n\t" + "mfhi %[temp1], $ac1 \n\t" + "mfhi %[temp2], $ac2 \n\t" + "mfhi %[temp3], $ac3 \n\t" + "sb %[temp0], -4(%[dst]) \n\t" + "sb %[temp1], -3(%[dst]) \n\t" + "sb %[temp2], -2(%[dst]) \n\t" + "sb %[temp3], -1(%[dst]) \n\t" + "bne %[frow], %[loop_end], 1b \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp3] "=&r"(temp3), + [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), [frow] "+r"(frow), + [dst] "+r"(dst), [loop_end] "=&r"(loop_end), [temp2] "=&r"(temp2) + : [temp7] "r"(temp7), [temp6] "r"(temp6) + : "memory", "hi", "lo", "$ac1hi", "$ac1lo", "$ac2hi", "$ac2lo", + "$ac3hi", "$ac3lo"); } for (i = 0; i < (x_out_max & 0x3); ++i) { const uint32_t J = *frow++; @@ -224,68 +224,66 @@ static void ExportRowExpand_MIPSdspR2(WebPRescaler* const wrk) { const uint32_t A = (uint32_t)(WEBP_RESCALER_ONE - B); if (x_out_max >= 4) { int temp8, temp9, temp10, temp11; - __asm__ volatile ( - "li %[temp8], 0x10000 \n\t" - "li %[temp9], 0x8000 \n\t" - "addu %[loop_end], %[frow], %[temp6] \n\t" - "1: \n\t" - "lw %[temp0], 0(%[frow]) \n\t" - "lw %[temp1], 4(%[frow]) \n\t" - "lw %[temp2], 8(%[frow]) \n\t" - "lw %[temp3], 12(%[frow]) \n\t" - "lw %[temp4], 0(%[irow]) \n\t" - "lw %[temp5], 4(%[irow]) \n\t" - "lw %[temp10], 8(%[irow]) \n\t" - "lw %[temp11], 12(%[irow]) \n\t" - "addiu %[dst], %[dst], 4 \n\t" - "mult $ac0, %[temp8], %[temp9] \n\t" - "maddu $ac0, %[A], %[temp0] \n\t" - "maddu $ac0, %[B], %[temp4] \n\t" - "mult $ac1, %[temp8], %[temp9] \n\t" - "maddu $ac1, %[A], %[temp1] \n\t" - "maddu $ac1, %[B], %[temp5] \n\t" - "mult $ac2, %[temp8], %[temp9] \n\t" - "maddu $ac2, %[A], %[temp2] \n\t" - "maddu $ac2, %[B], %[temp10] \n\t" - "mult $ac3, %[temp8], %[temp9] \n\t" - "maddu $ac3, %[A], %[temp3] \n\t" - "maddu $ac3, %[B], %[temp11] \n\t" - "addiu %[frow], %[frow], 16 \n\t" - "addiu %[irow], %[irow], 16 \n\t" - "mfhi %[temp0], $ac0 \n\t" - "mfhi %[temp1], $ac1 \n\t" - "mfhi %[temp2], $ac2 \n\t" - "mfhi %[temp3], $ac3 \n\t" - "mult $ac0, %[temp8], %[temp9] \n\t" - "maddu $ac0, %[temp0], %[temp7] \n\t" - "mult $ac1, %[temp8], %[temp9] \n\t" - "maddu $ac1, %[temp1], %[temp7] \n\t" - "mult $ac2, %[temp8], %[temp9] \n\t" - "maddu $ac2, %[temp2], %[temp7] \n\t" - "mult $ac3, %[temp8], %[temp9] \n\t" - "maddu $ac3, %[temp3], %[temp7] \n\t" - "mfhi %[temp0], $ac0 \n\t" - "mfhi %[temp1], $ac1 \n\t" - "mfhi %[temp2], $ac2 \n\t" - "mfhi %[temp3], $ac3 \n\t" - "sb %[temp0], -4(%[dst]) \n\t" - "sb %[temp1], -3(%[dst]) \n\t" - "sb %[temp2], -2(%[dst]) \n\t" - "sb %[temp3], -1(%[dst]) \n\t" - "bne %[frow], %[loop_end], 1b \n\t" - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp3]"=&r"(temp3), - [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), [frow]"+r"(frow), - [irow]"+r"(irow), [dst]"+r"(dst), [loop_end]"=&r"(loop_end), - [temp8]"=&r"(temp8), [temp9]"=&r"(temp9), [temp10]"=&r"(temp10), - [temp11]"=&r"(temp11), [temp2]"=&r"(temp2) - : [temp7]"r"(temp7), [temp6]"r"(temp6), [A]"r"(A), [B]"r"(B) - : "memory", "hi", "lo", "$ac1hi", "$ac1lo", - "$ac2hi", "$ac2lo", "$ac3hi", "$ac3lo" - ); + __asm__ volatile( + "li %[temp8], 0x10000 \n\t" + "li %[temp9], 0x8000 \n\t" + "addu %[loop_end], %[frow], %[temp6] \n\t" + "1: \n\t" + "lw %[temp0], 0(%[frow]) \n\t" + "lw %[temp1], 4(%[frow]) \n\t" + "lw %[temp2], 8(%[frow]) \n\t" + "lw %[temp3], 12(%[frow]) \n\t" + "lw %[temp4], 0(%[irow]) \n\t" + "lw %[temp5], 4(%[irow]) \n\t" + "lw %[temp10], 8(%[irow]) \n\t" + "lw %[temp11], 12(%[irow]) \n\t" + "addiu %[dst], %[dst], 4 \n\t" + "mult $ac0, %[temp8], %[temp9] \n\t" + "maddu $ac0, %[A], %[temp0] \n\t" + "maddu $ac0, %[B], %[temp4] \n\t" + "mult $ac1, %[temp8], %[temp9] \n\t" + "maddu $ac1, %[A], %[temp1] \n\t" + "maddu $ac1, %[B], %[temp5] \n\t" + "mult $ac2, %[temp8], %[temp9] \n\t" + "maddu $ac2, %[A], %[temp2] \n\t" + "maddu $ac2, %[B], %[temp10] \n\t" + "mult $ac3, %[temp8], %[temp9] \n\t" + "maddu $ac3, %[A], %[temp3] \n\t" + "maddu $ac3, %[B], %[temp11] \n\t" + "addiu %[frow], %[frow], 16 \n\t" + "addiu %[irow], %[irow], 16 \n\t" + "mfhi %[temp0], $ac0 \n\t" + "mfhi %[temp1], $ac1 \n\t" + "mfhi %[temp2], $ac2 \n\t" + "mfhi %[temp3], $ac3 \n\t" + "mult $ac0, %[temp8], %[temp9] \n\t" + "maddu $ac0, %[temp0], %[temp7] \n\t" + "mult $ac1, %[temp8], %[temp9] \n\t" + "maddu $ac1, %[temp1], %[temp7] \n\t" + "mult $ac2, %[temp8], %[temp9] \n\t" + "maddu $ac2, %[temp2], %[temp7] \n\t" + "mult $ac3, %[temp8], %[temp9] \n\t" + "maddu $ac3, %[temp3], %[temp7] \n\t" + "mfhi %[temp0], $ac0 \n\t" + "mfhi %[temp1], $ac1 \n\t" + "mfhi %[temp2], $ac2 \n\t" + "mfhi %[temp3], $ac3 \n\t" + "sb %[temp0], -4(%[dst]) \n\t" + "sb %[temp1], -3(%[dst]) \n\t" + "sb %[temp2], -2(%[dst]) \n\t" + "sb %[temp3], -1(%[dst]) \n\t" + "bne %[frow], %[loop_end], 1b \n\t" + : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp3] "=&r"(temp3), + [temp4] "=&r"(temp4), [temp5] "=&r"(temp5), [frow] "+r"(frow), + [irow] "+r"(irow), [dst] "+r"(dst), [loop_end] "=&r"(loop_end), + [temp8] "=&r"(temp8), [temp9] "=&r"(temp9), [temp10] "=&r"(temp10), + [temp11] "=&r"(temp11), [temp2] "=&r"(temp2) + : [temp7] "r"(temp7), [temp6] "r"(temp6), [A] "r"(A), [B] "r"(B) + : "memory", "hi", "lo", "$ac1hi", "$ac1lo", "$ac2hi", "$ac2lo", + "$ac3hi", "$ac3lo"); } for (i = 0; i < (x_out_max & 0x3); ++i) { - const uint64_t I = (uint64_t)A * *frow++ - + (uint64_t)B * *irow++; + const uint64_t I = (uint64_t)A * *frow++ + (uint64_t)B * *irow++; const uint32_t J = (uint32_t)((I + ROUNDER) >> WEBP_RESCALER_RFIX); const int v = (int)MULT_FIX(J, wrk->fy_scale); *dst++ = (v > 255) ? 255u : (uint8_t)v; @@ -304,7 +302,7 @@ extern void WebPRescalerDspInitMIPSdspR2(void); WEBP_TSAN_IGNORE_FUNCTION void WebPRescalerDspInitMIPSdspR2(void) { WebPRescalerExportRowExpand = ExportRowExpand_MIPSdspR2; -// WebPRescalerExportRowShrink = ExportRowShrink_MIPSdspR2; + // WebPRescalerExportRowShrink = ExportRowShrink_MIPSdspR2; } #else // !WEBP_USE_MIPS_DSP_R2 diff --git a/src/dsp/rescaler_msa.c b/src/dsp/rescaler_msa.c index 954d0fdf..dd2b7238 100644 --- a/src/dsp/rescaler_msa.c +++ b/src/dsp/rescaler_msa.c @@ -17,109 +17,114 @@ #include -#include "src/utils/rescaler_utils.h" #include "src/dsp/msa_macro.h" +#include "src/utils/rescaler_utils.h" #define ROUNDER (WEBP_RESCALER_ONE >> 1) #define MULT_FIX(x, y) (((uint64_t)(x) * (y) + ROUNDER) >> WEBP_RESCALER_RFIX) #define MULT_FIX_FLOOR(x, y) (((uint64_t)(x) * (y)) >> WEBP_RESCALER_RFIX) -#define CALC_MULT_FIX_16(in0, in1, in2, in3, scale, shift, dst) do { \ - v4u32 tmp0, tmp1, tmp2, tmp3; \ - v16u8 t0, t1, t2, t3, t4, t5; \ - v2u64 out0, out1, out2, out3; \ - ILVRL_W2_UW(zero, in0, tmp0, tmp1); \ - ILVRL_W2_UW(zero, in1, tmp2, tmp3); \ - DOTP_UW2_UD(tmp0, tmp1, scale, scale, out0, out1); \ - DOTP_UW2_UD(tmp2, tmp3, scale, scale, out2, out3); \ - SRAR_D4_UD(out0, out1, out2, out3, shift); \ - PCKEV_B2_UB(out1, out0, out3, out2, t0, t1); \ - ILVRL_W2_UW(zero, in2, tmp0, tmp1); \ - ILVRL_W2_UW(zero, in3, tmp2, tmp3); \ - DOTP_UW2_UD(tmp0, tmp1, scale, scale, out0, out1); \ - DOTP_UW2_UD(tmp2, tmp3, scale, scale, out2, out3); \ - SRAR_D4_UD(out0, out1, out2, out3, shift); \ - PCKEV_B2_UB(out1, out0, out3, out2, t2, t3); \ - PCKEV_B2_UB(t1, t0, t3, t2, t4, t5); \ - dst = (v16u8)__msa_pckev_b((v16i8)t5, (v16i8)t4); \ -} while (0) +#define CALC_MULT_FIX_16(in0, in1, in2, in3, scale, shift, dst) \ + do { \ + v4u32 tmp0, tmp1, tmp2, tmp3; \ + v16u8 t0, t1, t2, t3, t4, t5; \ + v2u64 out0, out1, out2, out3; \ + ILVRL_W2_UW(zero, in0, tmp0, tmp1); \ + ILVRL_W2_UW(zero, in1, tmp2, tmp3); \ + DOTP_UW2_UD(tmp0, tmp1, scale, scale, out0, out1); \ + DOTP_UW2_UD(tmp2, tmp3, scale, scale, out2, out3); \ + SRAR_D4_UD(out0, out1, out2, out3, shift); \ + PCKEV_B2_UB(out1, out0, out3, out2, t0, t1); \ + ILVRL_W2_UW(zero, in2, tmp0, tmp1); \ + ILVRL_W2_UW(zero, in3, tmp2, tmp3); \ + DOTP_UW2_UD(tmp0, tmp1, scale, scale, out0, out1); \ + DOTP_UW2_UD(tmp2, tmp3, scale, scale, out2, out3); \ + SRAR_D4_UD(out0, out1, out2, out3, shift); \ + PCKEV_B2_UB(out1, out0, out3, out2, t2, t3); \ + PCKEV_B2_UB(t1, t0, t3, t2, t4, t5); \ + dst = (v16u8)__msa_pckev_b((v16i8)t5, (v16i8)t4); \ + } while (0) -#define CALC_MULT_FIX_4(in0, scale, shift, dst) do { \ - v4u32 tmp0, tmp1; \ - v16i8 t0, t1; \ - v2u64 out0, out1; \ - ILVRL_W2_UW(zero, in0, tmp0, tmp1); \ - DOTP_UW2_UD(tmp0, tmp1, scale, scale, out0, out1); \ - SRAR_D2_UD(out0, out1, shift); \ - t0 = __msa_pckev_b((v16i8)out1, (v16i8)out0); \ - t1 = __msa_pckev_b(t0, t0); \ - t0 = __msa_pckev_b(t1, t1); \ - dst = __msa_copy_s_w((v4i32)t0, 0); \ -} while (0) +#define CALC_MULT_FIX_4(in0, scale, shift, dst) \ + do { \ + v4u32 tmp0, tmp1; \ + v16i8 t0, t1; \ + v2u64 out0, out1; \ + ILVRL_W2_UW(zero, in0, tmp0, tmp1); \ + DOTP_UW2_UD(tmp0, tmp1, scale, scale, out0, out1); \ + SRAR_D2_UD(out0, out1, shift); \ + t0 = __msa_pckev_b((v16i8)out1, (v16i8)out0); \ + t1 = __msa_pckev_b(t0, t0); \ + t0 = __msa_pckev_b(t1, t1); \ + dst = __msa_copy_s_w((v4i32)t0, 0); \ + } while (0) -#define CALC_MULT_FIX1_16(in0, in1, in2, in3, fyscale, shift, \ - dst0, dst1, dst2, dst3) do { \ - v4u32 tmp0, tmp1, tmp2, tmp3; \ - v2u64 out0, out1, out2, out3; \ - ILVRL_W2_UW(zero, in0, tmp0, tmp1); \ - ILVRL_W2_UW(zero, in1, tmp2, tmp3); \ - DOTP_UW2_UD(tmp0, tmp1, fyscale, fyscale, out0, out1); \ - DOTP_UW2_UD(tmp2, tmp3, fyscale, fyscale, out2, out3); \ - SRAR_D4_UD(out0, out1, out2, out3, shift); \ - PCKEV_W2_UW(out1, out0, out3, out2, dst0, dst1); \ - ILVRL_W2_UW(zero, in2, tmp0, tmp1); \ - ILVRL_W2_UW(zero, in3, tmp2, tmp3); \ - DOTP_UW2_UD(tmp0, tmp1, fyscale, fyscale, out0, out1); \ - DOTP_UW2_UD(tmp2, tmp3, fyscale, fyscale, out2, out3); \ - SRAR_D4_UD(out0, out1, out2, out3, shift); \ - PCKEV_W2_UW(out1, out0, out3, out2, dst2, dst3); \ -} while (0) +#define CALC_MULT_FIX1_16(in0, in1, in2, in3, fyscale, shift, dst0, dst1, \ + dst2, dst3) \ + do { \ + v4u32 tmp0, tmp1, tmp2, tmp3; \ + v2u64 out0, out1, out2, out3; \ + ILVRL_W2_UW(zero, in0, tmp0, tmp1); \ + ILVRL_W2_UW(zero, in1, tmp2, tmp3); \ + DOTP_UW2_UD(tmp0, tmp1, fyscale, fyscale, out0, out1); \ + DOTP_UW2_UD(tmp2, tmp3, fyscale, fyscale, out2, out3); \ + SRAR_D4_UD(out0, out1, out2, out3, shift); \ + PCKEV_W2_UW(out1, out0, out3, out2, dst0, dst1); \ + ILVRL_W2_UW(zero, in2, tmp0, tmp1); \ + ILVRL_W2_UW(zero, in3, tmp2, tmp3); \ + DOTP_UW2_UD(tmp0, tmp1, fyscale, fyscale, out0, out1); \ + DOTP_UW2_UD(tmp2, tmp3, fyscale, fyscale, out2, out3); \ + SRAR_D4_UD(out0, out1, out2, out3, shift); \ + PCKEV_W2_UW(out1, out0, out3, out2, dst2, dst3); \ + } while (0) -#define CALC_MULT_FIX1_4(in0, scale, shift, dst) do { \ - v4u32 tmp0, tmp1; \ - v2u64 out0, out1; \ - ILVRL_W2_UW(zero, in0, tmp0, tmp1); \ - DOTP_UW2_UD(tmp0, tmp1, scale, scale, out0, out1); \ - SRAR_D2_UD(out0, out1, shift); \ - dst = (v4u32)__msa_pckev_w((v4i32)out1, (v4i32)out0); \ -} while (0) +#define CALC_MULT_FIX1_4(in0, scale, shift, dst) \ + do { \ + v4u32 tmp0, tmp1; \ + v2u64 out0, out1; \ + ILVRL_W2_UW(zero, in0, tmp0, tmp1); \ + DOTP_UW2_UD(tmp0, tmp1, scale, scale, out0, out1); \ + SRAR_D2_UD(out0, out1, shift); \ + dst = (v4u32)__msa_pckev_w((v4i32)out1, (v4i32)out0); \ + } while (0) -#define CALC_MULT_FIX2_16(in0, in1, in2, in3, mult, scale, shift, \ - dst0, dst1) do { \ - v4u32 tmp0, tmp1, tmp2, tmp3; \ - v2u64 out0, out1, out2, out3; \ - ILVRL_W2_UW(in0, in2, tmp0, tmp1); \ - ILVRL_W2_UW(in1, in3, tmp2, tmp3); \ - DOTP_UW2_UD(tmp0, tmp1, mult, mult, out0, out1); \ - DOTP_UW2_UD(tmp2, tmp3, mult, mult, out2, out3); \ - SRAR_D4_UD(out0, out1, out2, out3, shift); \ - DOTP_UW2_UD(out0, out1, scale, scale, out0, out1); \ - DOTP_UW2_UD(out2, out3, scale, scale, out2, out3); \ - SRAR_D4_UD(out0, out1, out2, out3, shift); \ - PCKEV_B2_UB(out1, out0, out3, out2, dst0, dst1); \ -} while (0) +#define CALC_MULT_FIX2_16(in0, in1, in2, in3, mult, scale, shift, dst0, dst1) \ + do { \ + v4u32 tmp0, tmp1, tmp2, tmp3; \ + v2u64 out0, out1, out2, out3; \ + ILVRL_W2_UW(in0, in2, tmp0, tmp1); \ + ILVRL_W2_UW(in1, in3, tmp2, tmp3); \ + DOTP_UW2_UD(tmp0, tmp1, mult, mult, out0, out1); \ + DOTP_UW2_UD(tmp2, tmp3, mult, mult, out2, out3); \ + SRAR_D4_UD(out0, out1, out2, out3, shift); \ + DOTP_UW2_UD(out0, out1, scale, scale, out0, out1); \ + DOTP_UW2_UD(out2, out3, scale, scale, out2, out3); \ + SRAR_D4_UD(out0, out1, out2, out3, shift); \ + PCKEV_B2_UB(out1, out0, out3, out2, dst0, dst1); \ + } while (0) -#define CALC_MULT_FIX2_4(in0, in1, mult, scale, shift, dst) do { \ - v4u32 tmp0, tmp1; \ - v2u64 out0, out1; \ - v16i8 t0, t1; \ - ILVRL_W2_UW(in0, in1, tmp0, tmp1); \ - DOTP_UW2_UD(tmp0, tmp1, mult, mult, out0, out1); \ - SRAR_D2_UD(out0, out1, shift); \ - DOTP_UW2_UD(out0, out1, scale, scale, out0, out1); \ - SRAR_D2_UD(out0, out1, shift); \ - t0 = __msa_pckev_b((v16i8)out1, (v16i8)out0); \ - t1 = __msa_pckev_b(t0, t0); \ - t0 = __msa_pckev_b(t1, t1); \ - dst = __msa_copy_s_w((v4i32)t0, 0); \ -} while (0) +#define CALC_MULT_FIX2_4(in0, in1, mult, scale, shift, dst) \ + do { \ + v4u32 tmp0, tmp1; \ + v2u64 out0, out1; \ + v16i8 t0, t1; \ + ILVRL_W2_UW(in0, in1, tmp0, tmp1); \ + DOTP_UW2_UD(tmp0, tmp1, mult, mult, out0, out1); \ + SRAR_D2_UD(out0, out1, shift); \ + DOTP_UW2_UD(out0, out1, scale, scale, out0, out1); \ + SRAR_D2_UD(out0, out1, shift); \ + t0 = __msa_pckev_b((v16i8)out1, (v16i8)out0); \ + t1 = __msa_pckev_b(t0, t0); \ + t0 = __msa_pckev_b(t1, t1); \ + dst = __msa_copy_s_w((v4i32)t0, 0); \ + } while (0) static WEBP_INLINE void ExportRowExpand_0( const uint32_t* WEBP_RESTRICT frow, uint8_t* WEBP_RESTRICT dst, int length, WebPRescaler* WEBP_RESTRICT const wrk) { const v4u32 scale = (v4u32)__msa_fill_w(wrk->fy_scale); const v4u32 shift = (v4u32)__msa_fill_w(WEBP_RESCALER_RFIX); - const v4i32 zero = { 0 }; + const v4i32 zero = {0}; while (length >= 16) { v4u32 src0, src1, src2, src3; @@ -128,8 +133,8 @@ static WEBP_INLINE void ExportRowExpand_0( CALC_MULT_FIX_16(src0, src1, src2, src3, scale, shift, out); ST_UB(out, dst); length -= 16; - frow += 16; - dst += 16; + frow += 16; + dst += 16; } if (length > 0) { int x_out; @@ -142,8 +147,8 @@ static WEBP_INLINE void ExportRowExpand_0( CALC_MULT_FIX_4(src2, scale, shift, val2_m); SW3(val0_m, val1_m, val2_m, dst, 4); length -= 12; - frow += 12; - dst += 12; + frow += 12; + dst += 12; } else if (length >= 8) { uint32_t val0_m, val1_m; v4u32 src0, src1; @@ -152,16 +157,16 @@ static WEBP_INLINE void ExportRowExpand_0( CALC_MULT_FIX_4(src1, scale, shift, val1_m); SW2(val0_m, val1_m, dst, 4); length -= 8; - frow += 8; - dst += 8; + frow += 8; + dst += 8; } else if (length >= 4) { uint32_t val0_m; const v4u32 src0 = LD_UW(frow); CALC_MULT_FIX_4(src0, scale, shift, val0_m); SW(val0_m, dst); length -= 4; - frow += 4; - dst += 4; + frow += 4; + dst += 4; } for (x_out = 0; x_out < length; ++x_out) { const uint32_t J = frow[x_out]; @@ -193,9 +198,9 @@ static WEBP_INLINE void ExportRowExpand_1( PCKEV_B2_UB(t1, t0, t3, t2, t4, t5); t0 = (v16u8)__msa_pckev_b((v16i8)t5, (v16i8)t4); ST_UB(t0, dst); - frow += 16; - irow += 16; - dst += 16; + frow += 16; + irow += 16; + dst += 16; length -= 16; } if (length > 0) { @@ -209,9 +214,9 @@ static WEBP_INLINE void ExportRowExpand_1( CALC_MULT_FIX2_4(frow1, irow1, AB, scale, shift, val1_m); CALC_MULT_FIX2_4(frow2, irow2, AB, scale, shift, val2_m); SW3(val0_m, val1_m, val2_m, dst, 4); - frow += 12; - irow += 12; - dst += 12; + frow += 12; + irow += 12; + dst += 12; length -= 12; } else if (length >= 8) { uint32_t val0_m, val1_m; @@ -221,9 +226,9 @@ static WEBP_INLINE void ExportRowExpand_1( CALC_MULT_FIX2_4(frow0, irow0, AB, scale, shift, val0_m); CALC_MULT_FIX2_4(frow1, irow1, AB, scale, shift, val1_m); SW2(val0_m, val1_m, dst, 4); - frow += 4; - irow += 4; - dst += 4; + frow += 4; + irow += 4; + dst += 4; length -= 4; } else if (length >= 4) { uint32_t val0_m; @@ -231,14 +236,13 @@ static WEBP_INLINE void ExportRowExpand_1( const v4u32 irow0 = LD_UW(irow + 0); CALC_MULT_FIX2_4(frow0, irow0, AB, scale, shift, val0_m); SW(val0_m, dst); - frow += 4; - irow += 4; - dst += 4; + frow += 4; + irow += 4; + dst += 4; length -= 4; } for (x_out = 0; x_out < length; ++x_out) { - const uint64_t I = (uint64_t)A * frow[x_out] - + (uint64_t)B * irow[x_out]; + const uint64_t I = (uint64_t)A * frow[x_out] + (uint64_t)B * irow[x_out]; const uint32_t J = (uint32_t)((I + ROUNDER) >> WEBP_RESCALER_RFIX); const int v = (int)MULT_FIX(J, wrk->fy_scale); dst[x_out] = (v > 255) ? 255u : (uint8_t)v; @@ -262,7 +266,7 @@ static void RescalerExportRowExpand_MIPSdspR2(WebPRescaler* const wrk) { } } -#if 0 // disabled for now. TODO(skal): make match the C-code +#if 0 // disabled for now. TODO(skal): make match the C-code static WEBP_INLINE void ExportRowShrink_0( const uint32_t* WEBP_RESTRICT frow, uint32_t* WEBP_RESTRICT irow, uint8_t* WEBP_RESTRICT dst, int length, const uint32_t yscale, @@ -434,11 +438,11 @@ extern void WebPRescalerDspInitMSA(void); WEBP_TSAN_IGNORE_FUNCTION void WebPRescalerDspInitMSA(void) { WebPRescalerExportRowExpand = RescalerExportRowExpand_MIPSdspR2; -// WebPRescalerExportRowShrink = RescalerExportRowShrink_MIPSdspR2; + // WebPRescalerExportRowShrink = RescalerExportRowShrink_MIPSdspR2; } -#else // !WEBP_USE_MSA +#else // !WEBP_USE_MSA WEBP_DSP_INIT_STUB(WebPRescalerDspInitMSA) -#endif // WEBP_USE_MSA +#endif // WEBP_USE_MSA diff --git a/src/dsp/rescaler_neon.c b/src/dsp/rescaler_neon.c index ab4ddc00..aea1eef7 100644 --- a/src/dsp/rescaler_neon.c +++ b/src/dsp/rescaler_neon.c @@ -17,6 +17,7 @@ #include #include + #include "src/dsp/neon.h" #include "src/utils/rescaler_utils.h" @@ -25,22 +26,23 @@ #define MULT_FIX_FLOOR_C(x, y) (((uint64_t)(x) * (y)) >> WEBP_RESCALER_RFIX) #define LOAD_32x4(SRC, DST) const uint32x4_t DST = vld1q_u32((SRC)) -#define LOAD_32x8(SRC, DST0, DST1) \ - LOAD_32x4(SRC + 0, DST0); \ - LOAD_32x4(SRC + 4, DST1) +#define LOAD_32x8(SRC, DST0, DST1) \ + LOAD_32x4(SRC + 0, DST0); \ + LOAD_32x4(SRC + 4, DST1) -#define STORE_32x8(SRC0, SRC1, DST) do { \ - vst1q_u32((DST) + 0, SRC0); \ - vst1q_u32((DST) + 4, SRC1); \ -} while (0) +#define STORE_32x8(SRC0, SRC1, DST) \ + do { \ + vst1q_u32((DST) + 0, SRC0); \ + vst1q_u32((DST) + 4, SRC1); \ + } while (0) #if (WEBP_RESCALER_RFIX == 32) #define MAKE_HALF_CST(C) vdupq_n_s32((int32_t)((C) >> 1)) // note: B is actualy scale>>1. See MAKE_HALF_CST #define MULT_FIX(A, B) \ - vreinterpretq_u32_s32(vqrdmulhq_s32(vreinterpretq_s32_u32((A)), (B))) + vreinterpretq_u32_s32(vqrdmulhq_s32(vreinterpretq_s32_u32((A)), (B))) #define MULT_FIX_FLOOR(A, B) \ - vreinterpretq_u32_s32(vqdmulhq_s32(vreinterpretq_s32_u32((A)), (B))) + vreinterpretq_u32_s32(vqdmulhq_s32(vreinterpretq_s32_u32((A)), (B))) #else #error "MULT_FIX/WEBP_RESCALER_RFIX need some more work" #endif @@ -54,9 +56,8 @@ static uint32x4_t Interpolate_NEON(const rescaler_t* WEBP_RESTRICT const frow, const uint64x2_t C1 = vmull_n_u32(vget_high_u32(A0), A); const uint64x2_t D0 = vmlal_n_u32(C0, vget_low_u32(B0), B); const uint64x2_t D1 = vmlal_n_u32(C1, vget_high_u32(B0), B); - const uint32x4_t E = vcombine_u32( - vrshrn_n_u64(D0, WEBP_RESCALER_RFIX), - vrshrn_n_u64(D1, WEBP_RESCALER_RFIX)); + const uint32x4_t E = vcombine_u32(vrshrn_n_u64(D0, WEBP_RESCALER_RFIX), + vrshrn_n_u64(D1, WEBP_RESCALER_RFIX)); return E; } @@ -105,8 +106,7 @@ static void RescalerExportRowExpand_NEON(WebPRescaler* const wrk) { vst1_u8(dst + x_out, F); } for (; x_out < x_out_max; ++x_out) { - const uint64_t I = (uint64_t)A * frow[x_out] - + (uint64_t)B * irow[x_out]; + const uint64_t I = (uint64_t)A * frow[x_out] + (uint64_t)B * irow[x_out]; const uint32_t J = (uint32_t)((I + ROUNDER) >> WEBP_RESCALER_RFIX); const int v = (int)MULT_FIX_C(J, fy_scale); dst[x_out] = (v > 255) ? 255u : (uint8_t)v; @@ -149,7 +149,7 @@ static void RescalerExportRowShrink_NEON(WebPRescaler* const wrk) { const uint32_t frac = (uint32_t)MULT_FIX_FLOOR_C(frow[x_out], yscale); const int v = (int)MULT_FIX_C(irow[x_out] - frac, fxy_scale); dst[x_out] = (v > 255) ? 255u : (uint8_t)v; - irow[x_out] = frac; // new fractional start + irow[x_out] = frac; // new fractional start } } else { for (x_out = 0; x_out < max_span; x_out += 8) { @@ -185,8 +185,8 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPRescalerDspInitNEON(void) { WebPRescalerExportRowShrink = RescalerExportRowShrink_NEON; } -#else // !WEBP_USE_NEON +#else // !WEBP_USE_NEON WEBP_DSP_INIT_STUB(WebPRescalerDspInitNEON) -#endif // WEBP_USE_NEON +#endif // WEBP_USE_NEON diff --git a/src/dsp/rescaler_sse2.c b/src/dsp/rescaler_sse2.c index be5508ca..cfcfd17d 100644 --- a/src/dsp/rescaler_sse2.c +++ b/src/dsp/rescaler_sse2.c @@ -14,9 +14,8 @@ #include "src/dsp/dsp.h" #if defined(WEBP_USE_SSE2) && !defined(WEBP_REDUCE_SIZE) -#include - #include +#include #include #include "src/dsp/cpu.h" @@ -100,7 +99,7 @@ static void RescalerImportRowExpand_SSE2(WebPRescaler* WEBP_RESTRICT const wrk, LoadEightPixels_SSE2(src, &cur_pixels); src += 7; left = 7; - } else { // tail + } else { // tail cur_pixels = _mm_srli_si128(cur_pixels, 2); cur_pixels = _mm_insert_epi16(cur_pixels, src[1], 1); src += 1; @@ -144,17 +143,17 @@ static void RescalerImportRowShrink_SSE2(WebPRescaler* WEBP_RESTRICT const wrk, sum = _mm_add_epi16(sum, base); accum -= x_sub; } - { // Emit next horizontal pixel. + { // Emit next horizontal pixel. const __m128i mult = _mm_set1_epi16(-accum); const __m128i frac0 = _mm_mullo_epi16(base, mult); // 16b x 16b -> 32b const __m128i frac1 = _mm_mulhi_epu16(base, mult); const __m128i frac = _mm_unpacklo_epi16(frac0, frac1); // frac is 32b const __m128i A0 = _mm_mullo_epi16(sum, mult0); const __m128i A1 = _mm_mulhi_epu16(sum, mult0); - const __m128i B0 = _mm_unpacklo_epi16(A0, A1); // sum * x_sub - const __m128i frow_out = _mm_sub_epi32(B0, frac); // sum * x_sub - frac + const __m128i B0 = _mm_unpacklo_epi16(A0, A1); // sum * x_sub + const __m128i frow_out = _mm_sub_epi32(B0, frac); // sum * x_sub - frac const __m128i D0 = _mm_srli_epi64(frac, 32); - const __m128i D1 = _mm_mul_epu32(frac, mult1); // 32b x 16b -> 64b + const __m128i D1 = _mm_mul_epu32(frac, mult1); // 32b x 16b -> 64b const __m128i D2 = _mm_mul_epu32(D0, mult1); const __m128i E1 = _mm_add_epi64(D1, rounder); const __m128i E2 = _mm_add_epi64(D2, rounder); @@ -193,12 +192,9 @@ static WEBP_INLINE void LoadDispatchAndMult_SSE2( } } -static WEBP_INLINE void ProcessRow_SSE2(const __m128i* const A0, - const __m128i* const A1, - const __m128i* const A2, - const __m128i* const A3, - const __m128i* const mult, - uint8_t* const dst) { +static WEBP_INLINE void ProcessRow_SSE2( + const __m128i* const A0, const __m128i* const A1, const __m128i* const A2, + const __m128i* const A3, const __m128i* const mult, uint8_t* const dst) { const __m128i rounder = _mm_set_epi32(0, ROUNDER, 0, ROUNDER); const __m128i mask = _mm_set_epi32(~0, 0, ~0, 0); const __m128i B0 = _mm_mul_epu32(*A0, *mult); @@ -276,8 +272,7 @@ static void RescalerExportRowExpand_SSE2(WebPRescaler* const wrk) { } } for (; x_out < x_out_max; ++x_out) { - const uint64_t I = (uint64_t)A * frow[x_out] - + (uint64_t)B * irow[x_out]; + const uint64_t I = (uint64_t)A * frow[x_out] + (uint64_t)B * irow[x_out]; const uint32_t J = (uint32_t)((I + ROUNDER) >> WEBP_RESCALER_RFIX); const int v = (int)MULT_FIX(J, wrk->fy_scale); dst[x_out] = (v > 255) ? 255u : (uint8_t)v; @@ -304,11 +299,11 @@ static void RescalerExportRowShrink_SSE2(WebPRescaler* const wrk) { LoadDispatchAndMult_SSE2(irow + x_out, NULL, &A0, &A1, &A2, &A3); LoadDispatchAndMult_SSE2(frow + x_out, &mult_y, &B0, &B1, &B2, &B3); { - const __m128i D0 = _mm_srli_epi64(B0, WEBP_RESCALER_RFIX); // = frac + const __m128i D0 = _mm_srli_epi64(B0, WEBP_RESCALER_RFIX); // = frac const __m128i D1 = _mm_srli_epi64(B1, WEBP_RESCALER_RFIX); const __m128i D2 = _mm_srli_epi64(B2, WEBP_RESCALER_RFIX); const __m128i D3 = _mm_srli_epi64(B3, WEBP_RESCALER_RFIX); - const __m128i E0 = _mm_sub_epi64(A0, D0); // irow[x] - frac + const __m128i E0 = _mm_sub_epi64(A0, D0); // irow[x] - frac const __m128i E1 = _mm_sub_epi64(A1, D1); const __m128i E2 = _mm_sub_epi64(A2, D2); const __m128i E3 = _mm_sub_epi64(A3, D3); @@ -325,7 +320,7 @@ static void RescalerExportRowShrink_SSE2(WebPRescaler* const wrk) { const uint32_t frac = (int)MULT_FIX_FLOOR(frow[x_out], yscale); const int v = (int)MULT_FIX(irow[x_out] - frac, wrk->fxy_scale); dst[x_out] = (v > 255) ? 255u : (uint8_t)v; - irow[x_out] = frac; // new fractional start + irow[x_out] = frac; // new fractional start } } else { const uint32_t scale = wrk->fxy_scale; diff --git a/src/dsp/ssim.c b/src/dsp/ssim.c index 3002d626..ef63ee1c 100644 --- a/src/dsp/ssim.c +++ b/src/dsp/ssim.c @@ -24,22 +24,20 @@ // SSIM / PSNR // hat-shaped filter. Sum of coefficients is equal to 16. -static const uint32_t kWeight[2 * VP8_SSIM_KERNEL + 1] = { - 1, 2, 3, 4, 3, 2, 1 -}; -static const uint32_t kWeightSum = 16 * 16; // sum{kWeight}^2 +static const uint32_t kWeight[2 * VP8_SSIM_KERNEL + 1] = {1, 2, 3, 4, 3, 2, 1}; +static const uint32_t kWeightSum = 16 * 16; // sum{kWeight}^2 -static WEBP_INLINE double SSIMCalculation( - const VP8DistoStats* const stats, uint32_t N /*num samples*/) { - const uint32_t w2 = N * N; +static WEBP_INLINE double SSIMCalculation(const VP8DistoStats* const stats, + uint32_t N /*num samples*/) { + const uint32_t w2 = N * N; const uint32_t C1 = 20 * w2; const uint32_t C2 = 60 * w2; - const uint32_t C3 = 8 * 8 * w2; // 'dark' limit ~= 6 + const uint32_t C3 = 8 * 8 * w2; // 'dark' limit ~= 6 const uint64_t xmxm = (uint64_t)stats->xm * stats->xm; const uint64_t ymym = (uint64_t)stats->ym * stats->ym; if (xmxm + ymym >= C3) { const int64_t xmym = (int64_t)stats->xm * stats->ym; - const int64_t sxy = (int64_t)stats->xym * N - xmym; // can be negative + const int64_t sxy = (int64_t)stats->xym * N - xmym; // can be negative const uint64_t sxx = (uint64_t)stats->xxm * N - xmxm; const uint64_t syy = (uint64_t)stats->yym * N - ymym; // we descale by 8 to prevent overflow during the fnum/fden multiply. @@ -51,7 +49,7 @@ static WEBP_INLINE double SSIMCalculation( assert(r >= 0. && r <= 1.0); return r; } - return 1.; // area is too dark to contribute meaningfully + return 1.; // area is too dark to contribute meaningfully } double VP8SSIMFromStats(const VP8DistoStats* const stats) { @@ -63,27 +61,27 @@ double VP8SSIMFromStatsClipped(const VP8DistoStats* const stats) { } static double SSIMGetClipped_C(const uint8_t* src1, int stride1, - const uint8_t* src2, int stride2, - int xo, int yo, int W, int H) { - VP8DistoStats stats = { 0, 0, 0, 0, 0, 0 }; + const uint8_t* src2, int stride2, int xo, int yo, + int W, int H) { + VP8DistoStats stats = {0, 0, 0, 0, 0, 0}; const int ymin = (yo - VP8_SSIM_KERNEL < 0) ? 0 : yo - VP8_SSIM_KERNEL; - const int ymax = (yo + VP8_SSIM_KERNEL > H - 1) ? H - 1 - : yo + VP8_SSIM_KERNEL; + const int ymax = + (yo + VP8_SSIM_KERNEL > H - 1) ? H - 1 : yo + VP8_SSIM_KERNEL; const int xmin = (xo - VP8_SSIM_KERNEL < 0) ? 0 : xo - VP8_SSIM_KERNEL; - const int xmax = (xo + VP8_SSIM_KERNEL > W - 1) ? W - 1 - : xo + VP8_SSIM_KERNEL; + const int xmax = + (xo + VP8_SSIM_KERNEL > W - 1) ? W - 1 : xo + VP8_SSIM_KERNEL; int x, y; src1 += ymin * stride1; src2 += ymin * stride2; for (y = ymin; y <= ymax; ++y, src1 += stride1, src2 += stride2) { for (x = xmin; x <= xmax; ++x) { - const uint32_t w = kWeight[VP8_SSIM_KERNEL + x - xo] - * kWeight[VP8_SSIM_KERNEL + y - yo]; + const uint32_t w = + kWeight[VP8_SSIM_KERNEL + x - xo] * kWeight[VP8_SSIM_KERNEL + y - yo]; const uint32_t s1 = src1[x]; const uint32_t s2 = src2[x]; - stats.w += w; - stats.xm += w * s1; - stats.ym += w * s2; + stats.w += w; + stats.xm += w * s1; + stats.ym += w * s2; stats.xxm += w * s1 * s1; stats.xym += w * s1 * s2; stats.yym += w * s2 * s2; @@ -92,17 +90,17 @@ static double SSIMGetClipped_C(const uint8_t* src1, int stride1, return VP8SSIMFromStatsClipped(&stats); } -static double SSIMGet_C(const uint8_t* src1, int stride1, - const uint8_t* src2, int stride2) { - VP8DistoStats stats = { 0, 0, 0, 0, 0, 0 }; +static double SSIMGet_C(const uint8_t* src1, int stride1, const uint8_t* src2, + int stride2) { + VP8DistoStats stats = {0, 0, 0, 0, 0, 0}; int x, y; for (y = 0; y <= 2 * VP8_SSIM_KERNEL; ++y, src1 += stride1, src2 += stride2) { for (x = 0; x <= 2 * VP8_SSIM_KERNEL; ++x) { const uint32_t w = kWeight[x] * kWeight[y]; const uint32_t s1 = src1[x]; const uint32_t s2 = src2[x]; - stats.xm += w * s1; - stats.ym += w * s2; + stats.xm += w * s1; + stats.ym += w * s2; stats.xxm += w * s1 * s1; stats.xym += w * s1 * s2; stats.yym += w * s2 * s2; @@ -116,8 +114,8 @@ static double SSIMGet_C(const uint8_t* src1, int stride1, //------------------------------------------------------------------------------ #if !defined(WEBP_DISABLE_STATS) -static uint32_t AccumulateSSE_C(const uint8_t* src1, - const uint8_t* src2, int len) { +static uint32_t AccumulateSSE_C(const uint8_t* src1, const uint8_t* src2, + int len) { int i; uint32_t sse2 = 0; assert(len <= 65535); // to ensure that accumulation fits within uint32_t diff --git a/src/dsp/ssim_sse2.c b/src/dsp/ssim_sse2.c index 3ca3de4e..bc26e49d 100644 --- a/src/dsp/ssim_sse2.c +++ b/src/dsp/ssim_sse2.c @@ -14,9 +14,8 @@ #include "src/dsp/dsp.h" #if defined(WEBP_USE_SSE2) -#include - #include +#include #include "src/dsp/common_sse2.h" #include "src/dsp/cpu.h" @@ -44,8 +43,8 @@ static WEBP_INLINE void SubtractAndSquare_SSE2(const __m128i a, const __m128i b, //------------------------------------------------------------------------------ // SSIM / PSNR entry point -static uint32_t AccumulateSSE_SSE2(const uint8_t* src1, - const uint8_t* src2, int len) { +static uint32_t AccumulateSSE_SSE2(const uint8_t* src1, const uint8_t* src2, + int len) { int i = 0; uint32_t sse2 = 0; if (len >= 16) { @@ -100,29 +99,30 @@ static uint32_t HorizontalAdd32b_SSE2(const __m128i* const m) { return (uint32_t)_mm_cvtsi128_si32(c); } -static const uint16_t kWeight[] = { 1, 2, 3, 4, 3, 2, 1, 0 }; +static const uint16_t kWeight[] = {1, 2, 3, 4, 3, 2, 1, 0}; -#define ACCUMULATE_ROW(WEIGHT) do { \ - /* compute row weight (Wx * Wy) */ \ - const __m128i Wy = _mm_set1_epi16((WEIGHT)); \ - const __m128i W = _mm_mullo_epi16(Wx, Wy); \ - /* process 8 bytes at a time (7 bytes, actually) */ \ - const __m128i a0 = _mm_loadl_epi64((const __m128i*)src1); \ - const __m128i b0 = _mm_loadl_epi64((const __m128i*)src2); \ - /* convert to 16b and multiply by weight */ \ - const __m128i a1 = _mm_unpacklo_epi8(a0, zero); \ - const __m128i b1 = _mm_unpacklo_epi8(b0, zero); \ - const __m128i wa1 = _mm_mullo_epi16(a1, W); \ - const __m128i wb1 = _mm_mullo_epi16(b1, W); \ - /* accumulate */ \ - xm = _mm_add_epi16(xm, wa1); \ - ym = _mm_add_epi16(ym, wb1); \ - xxm = _mm_add_epi32(xxm, _mm_madd_epi16(a1, wa1)); \ - xym = _mm_add_epi32(xym, _mm_madd_epi16(a1, wb1)); \ - yym = _mm_add_epi32(yym, _mm_madd_epi16(b1, wb1)); \ - src1 += stride1; \ - src2 += stride2; \ -} while (0) +#define ACCUMULATE_ROW(WEIGHT) \ + do { \ + /* compute row weight (Wx * Wy) */ \ + const __m128i Wy = _mm_set1_epi16((WEIGHT)); \ + const __m128i W = _mm_mullo_epi16(Wx, Wy); \ + /* process 8 bytes at a time (7 bytes, actually) */ \ + const __m128i a0 = _mm_loadl_epi64((const __m128i*)src1); \ + const __m128i b0 = _mm_loadl_epi64((const __m128i*)src2); \ + /* convert to 16b and multiply by weight */ \ + const __m128i a1 = _mm_unpacklo_epi8(a0, zero); \ + const __m128i b1 = _mm_unpacklo_epi8(b0, zero); \ + const __m128i wa1 = _mm_mullo_epi16(a1, W); \ + const __m128i wb1 = _mm_mullo_epi16(b1, W); \ + /* accumulate */ \ + xm = _mm_add_epi16(xm, wa1); \ + ym = _mm_add_epi16(ym, wb1); \ + xxm = _mm_add_epi32(xxm, _mm_madd_epi16(a1, wa1)); \ + xym = _mm_add_epi32(xym, _mm_madd_epi16(a1, wb1)); \ + yym = _mm_add_epi32(yym, _mm_madd_epi16(b1, wb1)); \ + src1 += stride1; \ + src2 += stride2; \ + } while (0) static double SSIMGet_SSE2(const uint8_t* src1, int stride1, const uint8_t* src2, int stride2) { @@ -139,8 +139,8 @@ static double SSIMGet_SSE2(const uint8_t* src1, int stride1, ACCUMULATE_ROW(3); ACCUMULATE_ROW(2); ACCUMULATE_ROW(1); - stats.xm = HorizontalAdd16b_SSE2(&xm); - stats.ym = HorizontalAdd16b_SSE2(&ym); + stats.xm = HorizontalAdd16b_SSE2(&xm); + stats.ym = HorizontalAdd16b_SSE2(&ym); stats.xxm = HorizontalAdd32b_SSE2(&xxm); stats.xym = HorizontalAdd32b_SSE2(&xym); stats.yym = HorizontalAdd32b_SSE2(&yym); diff --git a/src/dsp/upsampling.c b/src/dsp/upsampling.c index c57f66c3..a38be6a6 100644 --- a/src/dsp/upsampling.c +++ b/src/dsp/upsampling.c @@ -15,10 +15,10 @@ #include #include "src/dsp/cpu.h" -#include "src/webp/types.h" #include "src/dsp/dsp.h" #include "src/dsp/yuv.h" #include "src/webp/decode.h" +#include "src/webp/types.h" //------------------------------------------------------------------------------ // Fancy upsampler @@ -38,67 +38,67 @@ WebPUpsampleLinePairFunc WebPUpsamplers[MODE_LAST]; // We process u and v together stashed into 32bit (16bit each). #define LOAD_UV(u, v) ((u) | ((v) << 16)) -#define UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP) \ -static void FUNC_NAME(const uint8_t* WEBP_RESTRICT top_y, \ - const uint8_t* WEBP_RESTRICT bottom_y, \ - const uint8_t* WEBP_RESTRICT top_u, \ - const uint8_t* WEBP_RESTRICT top_v, \ - const uint8_t* WEBP_RESTRICT cur_u, \ - const uint8_t* WEBP_RESTRICT cur_v, \ - uint8_t* WEBP_RESTRICT top_dst, \ - uint8_t* WEBP_RESTRICT bottom_dst, int len) { \ - int x; \ - const int last_pixel_pair = (len - 1) >> 1; \ - uint32_t tl_uv = LOAD_UV(top_u[0], top_v[0]); /* top-left sample */ \ - uint32_t l_uv = LOAD_UV(cur_u[0], cur_v[0]); /* left-sample */ \ - assert(top_y != NULL); \ - { \ - const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2; \ - FUNC(top_y[0], uv0 & 0xff, (uv0 >> 16), top_dst); \ - } \ - if (bottom_y != NULL) { \ - const uint32_t uv0 = (3 * l_uv + tl_uv + 0x00020002u) >> 2; \ - FUNC(bottom_y[0], uv0 & 0xff, (uv0 >> 16), bottom_dst); \ - } \ - for (x = 1; x <= last_pixel_pair; ++x) { \ - const uint32_t t_uv = LOAD_UV(top_u[x], top_v[x]); /* top sample */ \ - const uint32_t uv = LOAD_UV(cur_u[x], cur_v[x]); /* sample */ \ - /* precompute invariant values associated with first and second diagonals*/\ - const uint32_t avg = tl_uv + t_uv + l_uv + uv + 0x00080008u; \ - const uint32_t diag_12 = (avg + 2 * (t_uv + l_uv)) >> 3; \ - const uint32_t diag_03 = (avg + 2 * (tl_uv + uv)) >> 3; \ - { \ - const uint32_t uv0 = (diag_12 + tl_uv) >> 1; \ - const uint32_t uv1 = (diag_03 + t_uv) >> 1; \ - FUNC(top_y[2 * x - 1], uv0 & 0xff, (uv0 >> 16), \ - top_dst + (2 * x - 1) * (XSTEP)); \ - FUNC(top_y[2 * x - 0], uv1 & 0xff, (uv1 >> 16), \ - top_dst + (2 * x - 0) * (XSTEP)); \ - } \ - if (bottom_y != NULL) { \ - const uint32_t uv0 = (diag_03 + l_uv) >> 1; \ - const uint32_t uv1 = (diag_12 + uv) >> 1; \ - FUNC(bottom_y[2 * x - 1], uv0 & 0xff, (uv0 >> 16), \ - bottom_dst + (2 * x - 1) * (XSTEP)); \ - FUNC(bottom_y[2 * x + 0], uv1 & 0xff, (uv1 >> 16), \ - bottom_dst + (2 * x + 0) * (XSTEP)); \ - } \ - tl_uv = t_uv; \ - l_uv = uv; \ - } \ - if (!(len & 1)) { \ - { \ - const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2; \ - FUNC(top_y[len - 1], uv0 & 0xff, (uv0 >> 16), \ - top_dst + (len - 1) * (XSTEP)); \ - } \ - if (bottom_y != NULL) { \ - const uint32_t uv0 = (3 * l_uv + tl_uv + 0x00020002u) >> 2; \ - FUNC(bottom_y[len - 1], uv0 & 0xff, (uv0 >> 16), \ - bottom_dst + (len - 1) * (XSTEP)); \ - } \ - } \ -} +#define UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP) \ + static void FUNC_NAME( \ + const uint8_t* WEBP_RESTRICT top_y, \ + const uint8_t* WEBP_RESTRICT bottom_y, \ + const uint8_t* WEBP_RESTRICT top_u, const uint8_t* WEBP_RESTRICT top_v, \ + const uint8_t* WEBP_RESTRICT cur_u, const uint8_t* WEBP_RESTRICT cur_v, \ + uint8_t* WEBP_RESTRICT top_dst, uint8_t* WEBP_RESTRICT bottom_dst, \ + int len) { \ + int x; \ + const int last_pixel_pair = (len - 1) >> 1; \ + uint32_t tl_uv = LOAD_UV(top_u[0], top_v[0]); /* top-left sample */ \ + uint32_t l_uv = LOAD_UV(cur_u[0], cur_v[0]); /* left-sample */ \ + assert(top_y != NULL); \ + { \ + const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2; \ + FUNC(top_y[0], uv0 & 0xff, (uv0 >> 16), top_dst); \ + } \ + if (bottom_y != NULL) { \ + const uint32_t uv0 = (3 * l_uv + tl_uv + 0x00020002u) >> 2; \ + FUNC(bottom_y[0], uv0 & 0xff, (uv0 >> 16), bottom_dst); \ + } \ + for (x = 1; x <= last_pixel_pair; ++x) { \ + const uint32_t t_uv = LOAD_UV(top_u[x], top_v[x]); /* top sample */ \ + const uint32_t uv = LOAD_UV(cur_u[x], cur_v[x]); /* sample */ \ + /* precompute invariant values associated with first and second \ + * diagonals*/ \ + const uint32_t avg = tl_uv + t_uv + l_uv + uv + 0x00080008u; \ + const uint32_t diag_12 = (avg + 2 * (t_uv + l_uv)) >> 3; \ + const uint32_t diag_03 = (avg + 2 * (tl_uv + uv)) >> 3; \ + { \ + const uint32_t uv0 = (diag_12 + tl_uv) >> 1; \ + const uint32_t uv1 = (diag_03 + t_uv) >> 1; \ + FUNC(top_y[2 * x - 1], uv0 & 0xff, (uv0 >> 16), \ + top_dst + (2 * x - 1) * (XSTEP)); \ + FUNC(top_y[2 * x - 0], uv1 & 0xff, (uv1 >> 16), \ + top_dst + (2 * x - 0) * (XSTEP)); \ + } \ + if (bottom_y != NULL) { \ + const uint32_t uv0 = (diag_03 + l_uv) >> 1; \ + const uint32_t uv1 = (diag_12 + uv) >> 1; \ + FUNC(bottom_y[2 * x - 1], uv0 & 0xff, (uv0 >> 16), \ + bottom_dst + (2 * x - 1) * (XSTEP)); \ + FUNC(bottom_y[2 * x + 0], uv1 & 0xff, (uv1 >> 16), \ + bottom_dst + (2 * x + 0) * (XSTEP)); \ + } \ + tl_uv = t_uv; \ + l_uv = uv; \ + } \ + if (!(len & 1)) { \ + { \ + const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2; \ + FUNC(top_y[len - 1], uv0 & 0xff, (uv0 >> 16), \ + top_dst + (len - 1) * (XSTEP)); \ + } \ + if (bottom_y != NULL) { \ + const uint32_t uv0 = (3 * l_uv + tl_uv + 0x00020002u) >> 2; \ + FUNC(bottom_y[len - 1], uv0 & 0xff, (uv0 >> 16), \ + bottom_dst + (len - 1) * (XSTEP)); \ + } \ + } \ + } // All variants implemented. #if !WEBP_NEON_OMIT_C_CODE @@ -106,10 +106,10 @@ UPSAMPLE_FUNC(UpsampleRgbaLinePair_C, VP8YuvToRgba, 4) UPSAMPLE_FUNC(UpsampleBgraLinePair_C, VP8YuvToBgra, 4) #if !defined(WEBP_REDUCE_CSP) UPSAMPLE_FUNC(UpsampleArgbLinePair_C, VP8YuvToArgb, 4) -UPSAMPLE_FUNC(UpsampleRgbLinePair_C, VP8YuvToRgb, 3) -UPSAMPLE_FUNC(UpsampleBgrLinePair_C, VP8YuvToBgr, 3) +UPSAMPLE_FUNC(UpsampleRgbLinePair_C, VP8YuvToRgb, 3) +UPSAMPLE_FUNC(UpsampleBgrLinePair_C, VP8YuvToBgr, 3) UPSAMPLE_FUNC(UpsampleRgba4444LinePair_C, VP8YuvToRgba4444, 2) -UPSAMPLE_FUNC(UpsampleRgb565LinePair_C, VP8YuvToRgb565, 2) +UPSAMPLE_FUNC(UpsampleRgb565LinePair_C, VP8YuvToRgb565, 2) #else static void EmptyUpsampleFunc(const uint8_t* top_y, const uint8_t* bottom_y, const uint8_t* top_u, const uint8_t* top_v, @@ -124,14 +124,14 @@ static void EmptyUpsampleFunc(const uint8_t* top_y, const uint8_t* bottom_y, (void)top_dst; (void)bottom_dst; (void)len; - assert(0); // COLORSPACE SUPPORT NOT COMPILED + assert(0); // COLORSPACE SUPPORT NOT COMPILED } #define UpsampleArgbLinePair_C EmptyUpsampleFunc #define UpsampleRgbLinePair_C EmptyUpsampleFunc #define UpsampleBgrLinePair_C EmptyUpsampleFunc #define UpsampleRgba4444LinePair_C EmptyUpsampleFunc #define UpsampleRgb565LinePair_C EmptyUpsampleFunc -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP #endif @@ -143,33 +143,33 @@ static void EmptyUpsampleFunc(const uint8_t* top_y, const uint8_t* bottom_y, //------------------------------------------------------------------------------ #if !defined(FANCY_UPSAMPLING) -#define DUAL_SAMPLE_FUNC(FUNC_NAME, FUNC) \ -static void FUNC_NAME(const uint8_t* WEBP_RESTRICT top_y, \ - const uint8_t* WEBP_RESTRICT bot_y, \ - const uint8_t* WEBP_RESTRICT top_u, \ - const uint8_t* WEBP_RESTRICT top_v, \ - const uint8_t* WEBP_RESTRICT bot_u, \ - const uint8_t* WEBP_RESTRICT bot_v, \ - uint8_t* WEBP_RESTRICT top_dst, \ - uint8_t* WEBP_RESTRICT bot_dst, int len) { \ - const int half_len = len >> 1; \ - int x; \ - assert(top_dst != NULL); \ - { \ - for (x = 0; x < half_len; ++x) { \ - FUNC(top_y[2 * x + 0], top_u[x], top_v[x], top_dst + 8 * x + 0); \ - FUNC(top_y[2 * x + 1], top_u[x], top_v[x], top_dst + 8 * x + 4); \ - } \ - if (len & 1) FUNC(top_y[2 * x + 0], top_u[x], top_v[x], top_dst + 8 * x); \ - } \ - if (bot_dst != NULL) { \ - for (x = 0; x < half_len; ++x) { \ - FUNC(bot_y[2 * x + 0], bot_u[x], bot_v[x], bot_dst + 8 * x + 0); \ - FUNC(bot_y[2 * x + 1], bot_u[x], bot_v[x], bot_dst + 8 * x + 4); \ - } \ - if (len & 1) FUNC(bot_y[2 * x + 0], bot_u[x], bot_v[x], bot_dst + 8 * x); \ - } \ -} +#define DUAL_SAMPLE_FUNC(FUNC_NAME, FUNC) \ + static void FUNC_NAME( \ + const uint8_t* WEBP_RESTRICT top_y, const uint8_t* WEBP_RESTRICT bot_y, \ + const uint8_t* WEBP_RESTRICT top_u, const uint8_t* WEBP_RESTRICT top_v, \ + const uint8_t* WEBP_RESTRICT bot_u, const uint8_t* WEBP_RESTRICT bot_v, \ + uint8_t* WEBP_RESTRICT top_dst, uint8_t* WEBP_RESTRICT bot_dst, \ + int len) { \ + const int half_len = len >> 1; \ + int x; \ + assert(top_dst != NULL); \ + { \ + for (x = 0; x < half_len; ++x) { \ + FUNC(top_y[2 * x + 0], top_u[x], top_v[x], top_dst + 8 * x + 0); \ + FUNC(top_y[2 * x + 1], top_u[x], top_v[x], top_dst + 8 * x + 4); \ + } \ + if (len & 1) \ + FUNC(top_y[2 * x + 0], top_u[x], top_v[x], top_dst + 8 * x); \ + } \ + if (bot_dst != NULL) { \ + for (x = 0; x < half_len; ++x) { \ + FUNC(bot_y[2 * x + 0], bot_u[x], bot_v[x], bot_dst + 8 * x + 0); \ + FUNC(bot_y[2 * x + 1], bot_u[x], bot_v[x], bot_dst + 8 * x + 4); \ + } \ + if (len & 1) \ + FUNC(bot_y[2 * x + 0], bot_u[x], bot_v[x], bot_dst + 8 * x); \ + } \ + } DUAL_SAMPLE_FUNC(DualLineSamplerBGRA, VP8YuvToBgra) DUAL_SAMPLE_FUNC(DualLineSamplerARGB, VP8YuvToArgb) @@ -189,31 +189,28 @@ WebPUpsampleLinePairFunc WebPGetLinePairConverter(int alpha_is_last) { //------------------------------------------------------------------------------ // YUV444 converter -#define YUV444_FUNC(FUNC_NAME, FUNC, XSTEP) \ -extern void FUNC_NAME(const uint8_t* WEBP_RESTRICT y, \ - const uint8_t* WEBP_RESTRICT u, \ - const uint8_t* WEBP_RESTRICT v, \ - uint8_t* WEBP_RESTRICT dst, int len); \ -void FUNC_NAME(const uint8_t* WEBP_RESTRICT y, \ - const uint8_t* WEBP_RESTRICT u, \ - const uint8_t* WEBP_RESTRICT v, \ - uint8_t* WEBP_RESTRICT dst, int len) { \ - int i; \ - for (i = 0; i < len; ++i) FUNC(y[i], u[i], v[i], &dst[i * (XSTEP)]); \ -} +#define YUV444_FUNC(FUNC_NAME, FUNC, XSTEP) \ + extern void FUNC_NAME( \ + const uint8_t* WEBP_RESTRICT y, const uint8_t* WEBP_RESTRICT u, \ + const uint8_t* WEBP_RESTRICT v, uint8_t* WEBP_RESTRICT dst, int len); \ + void FUNC_NAME( \ + const uint8_t* WEBP_RESTRICT y, const uint8_t* WEBP_RESTRICT u, \ + const uint8_t* WEBP_RESTRICT v, uint8_t* WEBP_RESTRICT dst, int len) { \ + int i; \ + for (i = 0; i < len; ++i) FUNC(y[i], u[i], v[i], &dst[i * (XSTEP)]); \ + } -YUV444_FUNC(WebPYuv444ToRgba_C, VP8YuvToRgba, 4) -YUV444_FUNC(WebPYuv444ToBgra_C, VP8YuvToBgra, 4) +YUV444_FUNC(WebPYuv444ToRgba_C, VP8YuvToRgba, 4) +YUV444_FUNC(WebPYuv444ToBgra_C, VP8YuvToBgra, 4) #if !defined(WEBP_REDUCE_CSP) -YUV444_FUNC(WebPYuv444ToRgb_C, VP8YuvToRgb, 3) -YUV444_FUNC(WebPYuv444ToBgr_C, VP8YuvToBgr, 3) -YUV444_FUNC(WebPYuv444ToArgb_C, VP8YuvToArgb, 4) +YUV444_FUNC(WebPYuv444ToRgb_C, VP8YuvToRgb, 3) +YUV444_FUNC(WebPYuv444ToBgr_C, VP8YuvToBgr, 3) +YUV444_FUNC(WebPYuv444ToArgb_C, VP8YuvToArgb, 4) YUV444_FUNC(WebPYuv444ToRgba4444_C, VP8YuvToRgba4444, 2) -YUV444_FUNC(WebPYuv444ToRgb565_C, VP8YuvToRgb565, 2) +YUV444_FUNC(WebPYuv444ToRgb565_C, VP8YuvToRgb565, 2) #else -static void EmptyYuv444Func(const uint8_t* y, - const uint8_t* u, const uint8_t* v, - uint8_t* dst, int len) { +static void EmptyYuv444Func(const uint8_t* y, const uint8_t* u, + const uint8_t* v, uint8_t* dst, int len) { (void)y; (void)u; (void)v; @@ -225,7 +222,7 @@ static void EmptyYuv444Func(const uint8_t* y, #define WebPYuv444ToArgb_C EmptyYuv444Func #define WebPYuv444ToRgba4444_C EmptyYuv444Func #define WebPYuv444ToRgb565_C EmptyYuv444Func -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP #undef YUV444_FUNC @@ -237,16 +234,16 @@ extern void WebPInitYUV444ConvertersSSE2(void); extern void WebPInitYUV444ConvertersSSE41(void); WEBP_DSP_INIT_FUNC(WebPInitYUV444Converters) { - WebPYUV444Converters[MODE_RGBA] = WebPYuv444ToRgba_C; - WebPYUV444Converters[MODE_BGRA] = WebPYuv444ToBgra_C; - WebPYUV444Converters[MODE_RGB] = WebPYuv444ToRgb_C; - WebPYUV444Converters[MODE_BGR] = WebPYuv444ToBgr_C; - WebPYUV444Converters[MODE_ARGB] = WebPYuv444ToArgb_C; + WebPYUV444Converters[MODE_RGBA] = WebPYuv444ToRgba_C; + WebPYUV444Converters[MODE_BGRA] = WebPYuv444ToBgra_C; + WebPYUV444Converters[MODE_RGB] = WebPYuv444ToRgb_C; + WebPYUV444Converters[MODE_BGR] = WebPYuv444ToBgr_C; + WebPYUV444Converters[MODE_ARGB] = WebPYuv444ToArgb_C; WebPYUV444Converters[MODE_RGBA_4444] = WebPYuv444ToRgba4444_C; - WebPYUV444Converters[MODE_RGB_565] = WebPYuv444ToRgb565_C; - WebPYUV444Converters[MODE_rgbA] = WebPYuv444ToRgba_C; - WebPYUV444Converters[MODE_bgrA] = WebPYuv444ToBgra_C; - WebPYUV444Converters[MODE_Argb] = WebPYuv444ToArgb_C; + WebPYUV444Converters[MODE_RGB_565] = WebPYuv444ToRgb565_C; + WebPYUV444Converters[MODE_rgbA] = WebPYuv444ToRgba_C; + WebPYUV444Converters[MODE_bgrA] = WebPYuv444ToBgra_C; + WebPYUV444Converters[MODE_Argb] = WebPYuv444ToArgb_C; WebPYUV444Converters[MODE_rgbA_4444] = WebPYuv444ToRgba4444_C; if (VP8GetCPUInfo != NULL) { @@ -280,16 +277,16 @@ extern void WebPInitUpsamplersMSA(void); WEBP_DSP_INIT_FUNC(WebPInitUpsamplers) { #ifdef FANCY_UPSAMPLING #if !WEBP_NEON_OMIT_C_CODE - WebPUpsamplers[MODE_RGBA] = UpsampleRgbaLinePair_C; - WebPUpsamplers[MODE_BGRA] = UpsampleBgraLinePair_C; - WebPUpsamplers[MODE_rgbA] = UpsampleRgbaLinePair_C; - WebPUpsamplers[MODE_bgrA] = UpsampleBgraLinePair_C; - WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair_C; - WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePair_C; - WebPUpsamplers[MODE_ARGB] = UpsampleArgbLinePair_C; + WebPUpsamplers[MODE_RGBA] = UpsampleRgbaLinePair_C; + WebPUpsamplers[MODE_BGRA] = UpsampleBgraLinePair_C; + WebPUpsamplers[MODE_rgbA] = UpsampleRgbaLinePair_C; + WebPUpsamplers[MODE_bgrA] = UpsampleBgraLinePair_C; + WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair_C; + WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePair_C; + WebPUpsamplers[MODE_ARGB] = UpsampleArgbLinePair_C; WebPUpsamplers[MODE_RGBA_4444] = UpsampleRgba4444LinePair_C; - WebPUpsamplers[MODE_RGB_565] = UpsampleRgb565LinePair_C; - WebPUpsamplers[MODE_Argb] = UpsampleArgbLinePair_C; + WebPUpsamplers[MODE_RGB_565] = UpsampleRgb565LinePair_C; + WebPUpsamplers[MODE_Argb] = UpsampleArgbLinePair_C; WebPUpsamplers[MODE_rgbA_4444] = UpsampleRgba4444LinePair_C; #endif diff --git a/src/dsp/upsampling_mips_dsp_r2.c b/src/dsp/upsampling_mips_dsp_r2.c index cbe8e71d..7ddd1c0d 100644 --- a/src/dsp/upsampling_mips_dsp_r2.c +++ b/src/dsp/upsampling_mips_dsp_r2.c @@ -17,8 +17,10 @@ #if defined(WEBP_USE_MIPS_DSP_R2) #include + #include "src/dsp/yuv.h" +// clang-format off #define YUV_TO_RGB(Y, U, V, R, G, B) do { \ const int t1 = MultHi(Y, 19077); \ const int t2 = MultHi(V, 13320); \ @@ -31,7 +33,7 @@ R = R - 14234; \ G = G - t2 + 8708; \ B = B - 17685; \ - __asm__ volatile ( \ + __asm__ volatile( \ "shll_s.w %[" #R "], %[" #R "], 17 \n\t" \ "shll_s.w %[" #G "], %[" #G "], 17 \n\t" \ "shll_s.w %[" #B "], %[" #B "], 17 \n\t" \ @@ -45,6 +47,7 @@ : \ ); \ } while (0) +// clang-format on #if !defined(WEBP_REDUCE_CSP) static WEBP_INLINE void YuvToRgb(int y, int u, int v, uint8_t* const rgb) { @@ -82,7 +85,7 @@ static WEBP_INLINE void YuvToRgba4444(int y, int u, int v, YUV_TO_RGB(y, u, v, r, g, b); { const int rg = (r & 0xf0) | (g >> 4); - const int ba = (b & 0xf0) | 0x0f; // overwrite the lower 4 bits + const int ba = (b & 0xf0) | 0x0f; // overwrite the lower 4 bits #if (WEBP_SWAP_16BIT_CSP == 1) argb[0] = ba; argb[1] = rg; @@ -90,9 +93,9 @@ static WEBP_INLINE void YuvToRgba4444(int y, int u, int v, argb[0] = rg; argb[1] = ba; #endif - } + } } -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP //----------------------------------------------------------------------------- // Alpha handling variants @@ -107,7 +110,7 @@ static WEBP_INLINE void YuvToArgb(uint8_t y, uint8_t u, uint8_t v, argb[2] = g; argb[3] = b; } -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP static WEBP_INLINE void YuvToBgra(uint8_t y, uint8_t u, uint8_t v, uint8_t* const bgra) { int r, g, b; @@ -142,78 +145,78 @@ static WEBP_INLINE void YuvToRgba(uint8_t y, uint8_t u, uint8_t v, // We process u and v together stashed into 32bit (16bit each). #define LOAD_UV(u, v) ((u) | ((v) << 16)) -#define UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP) \ -static void FUNC_NAME(const uint8_t* WEBP_RESTRICT top_y, \ - const uint8_t* WEBP_RESTRICT bottom_y, \ - const uint8_t* WEBP_RESTRICT top_u, \ - const uint8_t* WEBP_RESTRICT top_v, \ - const uint8_t* WEBP_RESTRICT cur_u, \ - const uint8_t* WEBP_RESTRICT cur_v, \ - uint8_t* WEBP_RESTRICT top_dst, \ - uint8_t* WEBP_RESTRICT bottom_dst, int len) { \ - int x; \ - const int last_pixel_pair = (len - 1) >> 1; \ - uint32_t tl_uv = LOAD_UV(top_u[0], top_v[0]); /* top-left sample */ \ - uint32_t l_uv = LOAD_UV(cur_u[0], cur_v[0]); /* left-sample */ \ - assert(top_y != NULL); \ - { \ - const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2; \ - FUNC(top_y[0], uv0 & 0xff, (uv0 >> 16), top_dst); \ - } \ - if (bottom_y != NULL) { \ - const uint32_t uv0 = (3 * l_uv + tl_uv + 0x00020002u) >> 2; \ - FUNC(bottom_y[0], uv0 & 0xff, (uv0 >> 16), bottom_dst); \ - } \ - for (x = 1; x <= last_pixel_pair; ++x) { \ - const uint32_t t_uv = LOAD_UV(top_u[x], top_v[x]); /* top sample */ \ - const uint32_t uv = LOAD_UV(cur_u[x], cur_v[x]); /* sample */ \ - /* precompute invariant values associated with first and second diagonals*/\ - const uint32_t avg = tl_uv + t_uv + l_uv + uv + 0x00080008u; \ - const uint32_t diag_12 = (avg + 2 * (t_uv + l_uv)) >> 3; \ - const uint32_t diag_03 = (avg + 2 * (tl_uv + uv)) >> 3; \ - { \ - const uint32_t uv0 = (diag_12 + tl_uv) >> 1; \ - const uint32_t uv1 = (diag_03 + t_uv) >> 1; \ - FUNC(top_y[2 * x - 1], uv0 & 0xff, (uv0 >> 16), \ - top_dst + (2 * x - 1) * XSTEP); \ - FUNC(top_y[2 * x - 0], uv1 & 0xff, (uv1 >> 16), \ - top_dst + (2 * x - 0) * XSTEP); \ - } \ - if (bottom_y != NULL) { \ - const uint32_t uv0 = (diag_03 + l_uv) >> 1; \ - const uint32_t uv1 = (diag_12 + uv) >> 1; \ - FUNC(bottom_y[2 * x - 1], uv0 & 0xff, (uv0 >> 16), \ - bottom_dst + (2 * x - 1) * XSTEP); \ - FUNC(bottom_y[2 * x + 0], uv1 & 0xff, (uv1 >> 16), \ - bottom_dst + (2 * x + 0) * XSTEP); \ - } \ - tl_uv = t_uv; \ - l_uv = uv; \ - } \ - if (!(len & 1)) { \ - { \ - const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2; \ - FUNC(top_y[len - 1], uv0 & 0xff, (uv0 >> 16), \ - top_dst + (len - 1) * XSTEP); \ - } \ - if (bottom_y != NULL) { \ - const uint32_t uv0 = (3 * l_uv + tl_uv + 0x00020002u) >> 2; \ - FUNC(bottom_y[len - 1], uv0 & 0xff, (uv0 >> 16), \ - bottom_dst + (len - 1) * XSTEP); \ - } \ - } \ -} +#define UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP) \ + static void FUNC_NAME( \ + const uint8_t* WEBP_RESTRICT top_y, \ + const uint8_t* WEBP_RESTRICT bottom_y, \ + const uint8_t* WEBP_RESTRICT top_u, const uint8_t* WEBP_RESTRICT top_v, \ + const uint8_t* WEBP_RESTRICT cur_u, const uint8_t* WEBP_RESTRICT cur_v, \ + uint8_t* WEBP_RESTRICT top_dst, uint8_t* WEBP_RESTRICT bottom_dst, \ + int len) { \ + int x; \ + const int last_pixel_pair = (len - 1) >> 1; \ + uint32_t tl_uv = LOAD_UV(top_u[0], top_v[0]); /* top-left sample */ \ + uint32_t l_uv = LOAD_UV(cur_u[0], cur_v[0]); /* left-sample */ \ + assert(top_y != NULL); \ + { \ + const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2; \ + FUNC(top_y[0], uv0 & 0xff, (uv0 >> 16), top_dst); \ + } \ + if (bottom_y != NULL) { \ + const uint32_t uv0 = (3 * l_uv + tl_uv + 0x00020002u) >> 2; \ + FUNC(bottom_y[0], uv0 & 0xff, (uv0 >> 16), bottom_dst); \ + } \ + for (x = 1; x <= last_pixel_pair; ++x) { \ + const uint32_t t_uv = LOAD_UV(top_u[x], top_v[x]); /* top sample */ \ + const uint32_t uv = LOAD_UV(cur_u[x], cur_v[x]); /* sample */ \ + /* precompute invariant values associated with first and second \ + * diagonals*/ \ + const uint32_t avg = tl_uv + t_uv + l_uv + uv + 0x00080008u; \ + const uint32_t diag_12 = (avg + 2 * (t_uv + l_uv)) >> 3; \ + const uint32_t diag_03 = (avg + 2 * (tl_uv + uv)) >> 3; \ + { \ + const uint32_t uv0 = (diag_12 + tl_uv) >> 1; \ + const uint32_t uv1 = (diag_03 + t_uv) >> 1; \ + FUNC(top_y[2 * x - 1], uv0 & 0xff, (uv0 >> 16), \ + top_dst + (2 * x - 1) * XSTEP); \ + FUNC(top_y[2 * x - 0], uv1 & 0xff, (uv1 >> 16), \ + top_dst + (2 * x - 0) * XSTEP); \ + } \ + if (bottom_y != NULL) { \ + const uint32_t uv0 = (diag_03 + l_uv) >> 1; \ + const uint32_t uv1 = (diag_12 + uv) >> 1; \ + FUNC(bottom_y[2 * x - 1], uv0 & 0xff, (uv0 >> 16), \ + bottom_dst + (2 * x - 1) * XSTEP); \ + FUNC(bottom_y[2 * x + 0], uv1 & 0xff, (uv1 >> 16), \ + bottom_dst + (2 * x + 0) * XSTEP); \ + } \ + tl_uv = t_uv; \ + l_uv = uv; \ + } \ + if (!(len & 1)) { \ + { \ + const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2; \ + FUNC(top_y[len - 1], uv0 & 0xff, (uv0 >> 16), \ + top_dst + (len - 1) * XSTEP); \ + } \ + if (bottom_y != NULL) { \ + const uint32_t uv0 = (3 * l_uv + tl_uv + 0x00020002u) >> 2; \ + FUNC(bottom_y[len - 1], uv0 & 0xff, (uv0 >> 16), \ + bottom_dst + (len - 1) * XSTEP); \ + } \ + } \ + } // All variants implemented. -UPSAMPLE_FUNC(UpsampleRgbaLinePair, YuvToRgba, 4) -UPSAMPLE_FUNC(UpsampleBgraLinePair, YuvToBgra, 4) +UPSAMPLE_FUNC(UpsampleRgbaLinePair, YuvToRgba, 4) +UPSAMPLE_FUNC(UpsampleBgraLinePair, YuvToBgra, 4) #if !defined(WEBP_REDUCE_CSP) -UPSAMPLE_FUNC(UpsampleRgbLinePair, YuvToRgb, 3) -UPSAMPLE_FUNC(UpsampleBgrLinePair, YuvToBgr, 3) -UPSAMPLE_FUNC(UpsampleArgbLinePair, YuvToArgb, 4) +UPSAMPLE_FUNC(UpsampleRgbLinePair, YuvToRgb, 3) +UPSAMPLE_FUNC(UpsampleBgrLinePair, YuvToBgr, 3) +UPSAMPLE_FUNC(UpsampleArgbLinePair, YuvToArgb, 4) UPSAMPLE_FUNC(UpsampleRgba4444LinePair, YuvToRgba4444, 2) -UPSAMPLE_FUNC(UpsampleRgb565LinePair, YuvToRgb565, 2) -#endif // WEBP_REDUCE_CSP +UPSAMPLE_FUNC(UpsampleRgb565LinePair, YuvToRgb565, 2) +#endif // WEBP_REDUCE_CSP #undef LOAD_UV #undef UPSAMPLE_FUNC @@ -224,19 +227,19 @@ UPSAMPLE_FUNC(UpsampleRgb565LinePair, YuvToRgb565, 2) extern void WebPInitUpsamplersMIPSdspR2(void); WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplersMIPSdspR2(void) { - WebPUpsamplers[MODE_RGBA] = UpsampleRgbaLinePair; - WebPUpsamplers[MODE_BGRA] = UpsampleBgraLinePair; - WebPUpsamplers[MODE_rgbA] = UpsampleRgbaLinePair; - WebPUpsamplers[MODE_bgrA] = UpsampleBgraLinePair; + WebPUpsamplers[MODE_RGBA] = UpsampleRgbaLinePair; + WebPUpsamplers[MODE_BGRA] = UpsampleBgraLinePair; + WebPUpsamplers[MODE_rgbA] = UpsampleRgbaLinePair; + WebPUpsamplers[MODE_bgrA] = UpsampleBgraLinePair; #if !defined(WEBP_REDUCE_CSP) - WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair; - WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePair; - WebPUpsamplers[MODE_ARGB] = UpsampleArgbLinePair; + WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair; + WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePair; + WebPUpsamplers[MODE_ARGB] = UpsampleArgbLinePair; WebPUpsamplers[MODE_RGBA_4444] = UpsampleRgba4444LinePair; - WebPUpsamplers[MODE_RGB_565] = UpsampleRgb565LinePair; - WebPUpsamplers[MODE_Argb] = UpsampleArgbLinePair; + WebPUpsamplers[MODE_RGB_565] = UpsampleRgb565LinePair; + WebPUpsamplers[MODE_Argb] = UpsampleArgbLinePair; WebPUpsamplers[MODE_rgbA_4444] = UpsampleRgba4444LinePair; -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP } #endif // FANCY_UPSAMPLING @@ -244,24 +247,23 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplersMIPSdspR2(void) { //------------------------------------------------------------------------------ // YUV444 converter -#define YUV444_FUNC(FUNC_NAME, FUNC, XSTEP) \ -static void FUNC_NAME(const uint8_t* WEBP_RESTRICT y, \ - const uint8_t* WEBP_RESTRICT u, \ - const uint8_t* WEBP_RESTRICT v, \ - uint8_t* WEBP_RESTRICT dst, int len) { \ - int i; \ - for (i = 0; i < len; ++i) FUNC(y[i], u[i], v[i], &dst[i * XSTEP]); \ -} +#define YUV444_FUNC(FUNC_NAME, FUNC, XSTEP) \ + static void FUNC_NAME( \ + const uint8_t* WEBP_RESTRICT y, const uint8_t* WEBP_RESTRICT u, \ + const uint8_t* WEBP_RESTRICT v, uint8_t* WEBP_RESTRICT dst, int len) { \ + int i; \ + for (i = 0; i < len; ++i) FUNC(y[i], u[i], v[i], &dst[i * XSTEP]); \ + } -YUV444_FUNC(Yuv444ToRgba, YuvToRgba, 4) -YUV444_FUNC(Yuv444ToBgra, YuvToBgra, 4) +YUV444_FUNC(Yuv444ToRgba, YuvToRgba, 4) +YUV444_FUNC(Yuv444ToBgra, YuvToBgra, 4) #if !defined(WEBP_REDUCE_CSP) -YUV444_FUNC(Yuv444ToRgb, YuvToRgb, 3) -YUV444_FUNC(Yuv444ToBgr, YuvToBgr, 3) -YUV444_FUNC(Yuv444ToArgb, YuvToArgb, 4) +YUV444_FUNC(Yuv444ToRgb, YuvToRgb, 3) +YUV444_FUNC(Yuv444ToBgr, YuvToBgr, 3) +YUV444_FUNC(Yuv444ToArgb, YuvToArgb, 4) YUV444_FUNC(Yuv444ToRgba4444, YuvToRgba4444, 2) -YUV444_FUNC(Yuv444ToRgb565, YuvToRgb565, 2) -#endif // WEBP_REDUCE_CSP +YUV444_FUNC(Yuv444ToRgb565, YuvToRgb565, 2) +#endif // WEBP_REDUCE_CSP #undef YUV444_FUNC @@ -271,19 +273,19 @@ YUV444_FUNC(Yuv444ToRgb565, YuvToRgb565, 2) extern void WebPInitYUV444ConvertersMIPSdspR2(void); WEBP_TSAN_IGNORE_FUNCTION void WebPInitYUV444ConvertersMIPSdspR2(void) { - WebPYUV444Converters[MODE_RGBA] = Yuv444ToRgba; - WebPYUV444Converters[MODE_BGRA] = Yuv444ToBgra; - WebPYUV444Converters[MODE_rgbA] = Yuv444ToRgba; - WebPYUV444Converters[MODE_bgrA] = Yuv444ToBgra; + WebPYUV444Converters[MODE_RGBA] = Yuv444ToRgba; + WebPYUV444Converters[MODE_BGRA] = Yuv444ToBgra; + WebPYUV444Converters[MODE_rgbA] = Yuv444ToRgba; + WebPYUV444Converters[MODE_bgrA] = Yuv444ToBgra; #if !defined(WEBP_REDUCE_CSP) - WebPYUV444Converters[MODE_RGB] = Yuv444ToRgb; - WebPYUV444Converters[MODE_BGR] = Yuv444ToBgr; - WebPYUV444Converters[MODE_ARGB] = Yuv444ToArgb; + WebPYUV444Converters[MODE_RGB] = Yuv444ToRgb; + WebPYUV444Converters[MODE_BGR] = Yuv444ToBgr; + WebPYUV444Converters[MODE_ARGB] = Yuv444ToArgb; WebPYUV444Converters[MODE_RGBA_4444] = Yuv444ToRgba4444; - WebPYUV444Converters[MODE_RGB_565] = Yuv444ToRgb565; - WebPYUV444Converters[MODE_Argb] = Yuv444ToArgb; + WebPYUV444Converters[MODE_RGB_565] = Yuv444ToRgb565; + WebPYUV444Converters[MODE_Argb] = Yuv444ToArgb; WebPYUV444Converters[MODE_rgbA_4444] = Yuv444ToRgba4444; -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP } #else // !WEBP_USE_MIPS_DSP_R2 diff --git a/src/dsp/upsampling_msa.c b/src/dsp/upsampling_msa.c index 72a526bc..adcf81c6 100644 --- a/src/dsp/upsampling_msa.c +++ b/src/dsp/upsampling_msa.c @@ -12,6 +12,7 @@ // Author: Prashant Patil (prashant.patil@imgtec.com) #include + #include "src/dsp/dsp.h" #if defined(WEBP_USE_MSA) @@ -21,228 +22,246 @@ #ifdef FANCY_UPSAMPLING -#define ILVR_UW2(in, out0, out1) do { \ - const v8i16 t0 = (v8i16)__msa_ilvr_b((v16i8)zero, (v16i8)in); \ - out0 = (v4u32)__msa_ilvr_h((v8i16)zero, t0); \ - out1 = (v4u32)__msa_ilvl_h((v8i16)zero, t0); \ -} while (0) +#define ILVR_UW2(in, out0, out1) \ + do { \ + const v8i16 t0 = (v8i16)__msa_ilvr_b((v16i8)zero, (v16i8)in); \ + out0 = (v4u32)__msa_ilvr_h((v8i16)zero, t0); \ + out1 = (v4u32)__msa_ilvl_h((v8i16)zero, t0); \ + } while (0) -#define ILVRL_UW4(in, out0, out1, out2, out3) do { \ - v16u8 t0, t1; \ - ILVRL_B2_UB(zero, in, t0, t1); \ - ILVRL_H2_UW(zero, t0, out0, out1); \ - ILVRL_H2_UW(zero, t1, out2, out3); \ -} while (0) +#define ILVRL_UW4(in, out0, out1, out2, out3) \ + do { \ + v16u8 t0, t1; \ + ILVRL_B2_UB(zero, in, t0, t1); \ + ILVRL_H2_UW(zero, t0, out0, out1); \ + ILVRL_H2_UW(zero, t1, out2, out3); \ + } while (0) -#define MULTHI_16(in0, in1, in2, in3, cnst, out0, out1) do { \ - const v4i32 const0 = (v4i32)__msa_fill_w(cnst * 256); \ - v4u32 temp0, temp1, temp2, temp3; \ - MUL4(in0, const0, in1, const0, in2, const0, in3, const0, \ - temp0, temp1, temp2, temp3); \ - PCKOD_H2_UH(temp1, temp0, temp3, temp2, out0, out1); \ -} while (0) +#define MULTHI_16(in0, in1, in2, in3, cnst, out0, out1) \ + do { \ + const v4i32 const0 = (v4i32)__msa_fill_w(cnst * 256); \ + v4u32 temp0, temp1, temp2, temp3; \ + MUL4(in0, const0, in1, const0, in2, const0, in3, const0, temp0, temp1, \ + temp2, temp3); \ + PCKOD_H2_UH(temp1, temp0, temp3, temp2, out0, out1); \ + } while (0) -#define MULTHI_8(in0, in1, cnst, out0) do { \ - const v4i32 const0 = (v4i32)__msa_fill_w(cnst * 256); \ - v4u32 temp0, temp1; \ - MUL2(in0, const0, in1, const0, temp0, temp1); \ - out0 = (v8u16)__msa_pckod_h((v8i16)temp1, (v8i16)temp0); \ -} while (0) +#define MULTHI_8(in0, in1, cnst, out0) \ + do { \ + const v4i32 const0 = (v4i32)__msa_fill_w(cnst * 256); \ + v4u32 temp0, temp1; \ + MUL2(in0, const0, in1, const0, temp0, temp1); \ + out0 = (v8u16)__msa_pckod_h((v8i16)temp1, (v8i16)temp0); \ + } while (0) -#define CALC_R16(y0, y1, v0, v1, dst) do { \ - const v8i16 const_a = (v8i16)__msa_fill_h(14234); \ - const v8i16 a0 = __msa_adds_s_h((v8i16)y0, (v8i16)v0); \ - const v8i16 a1 = __msa_adds_s_h((v8i16)y1, (v8i16)v1); \ - v8i16 b0 = __msa_subs_s_h(a0, const_a); \ - v8i16 b1 = __msa_subs_s_h(a1, const_a); \ - SRAI_H2_SH(b0, b1, 6); \ - CLIP_SH2_0_255(b0, b1); \ - dst = (v16u8)__msa_pckev_b((v16i8)b1, (v16i8)b0); \ -} while (0) +#define CALC_R16(y0, y1, v0, v1, dst) \ + do { \ + const v8i16 const_a = (v8i16)__msa_fill_h(14234); \ + const v8i16 a0 = __msa_adds_s_h((v8i16)y0, (v8i16)v0); \ + const v8i16 a1 = __msa_adds_s_h((v8i16)y1, (v8i16)v1); \ + v8i16 b0 = __msa_subs_s_h(a0, const_a); \ + v8i16 b1 = __msa_subs_s_h(a1, const_a); \ + SRAI_H2_SH(b0, b1, 6); \ + CLIP_SH2_0_255(b0, b1); \ + dst = (v16u8)__msa_pckev_b((v16i8)b1, (v16i8)b0); \ + } while (0) -#define CALC_R8(y0, v0, dst) do { \ - const v8i16 const_a = (v8i16)__msa_fill_h(14234); \ - const v8i16 a0 = __msa_adds_s_h((v8i16)y0, (v8i16)v0); \ - v8i16 b0 = __msa_subs_s_h(a0, const_a); \ - b0 = SRAI_H(b0, 6); \ - CLIP_SH_0_255(b0); \ - dst = (v16u8)__msa_pckev_b((v16i8)b0, (v16i8)b0); \ -} while (0) +#define CALC_R8(y0, v0, dst) \ + do { \ + const v8i16 const_a = (v8i16)__msa_fill_h(14234); \ + const v8i16 a0 = __msa_adds_s_h((v8i16)y0, (v8i16)v0); \ + v8i16 b0 = __msa_subs_s_h(a0, const_a); \ + b0 = SRAI_H(b0, 6); \ + CLIP_SH_0_255(b0); \ + dst = (v16u8)__msa_pckev_b((v16i8)b0, (v16i8)b0); \ + } while (0) -#define CALC_G16(y0, y1, u0, u1, v0, v1, dst) do { \ - const v8i16 const_a = (v8i16)__msa_fill_h(8708); \ - v8i16 a0 = __msa_subs_s_h((v8i16)y0, (v8i16)u0); \ - v8i16 a1 = __msa_subs_s_h((v8i16)y1, (v8i16)u1); \ - const v8i16 b0 = __msa_subs_s_h(a0, (v8i16)v0); \ - const v8i16 b1 = __msa_subs_s_h(a1, (v8i16)v1); \ - a0 = __msa_adds_s_h(b0, const_a); \ - a1 = __msa_adds_s_h(b1, const_a); \ - SRAI_H2_SH(a0, a1, 6); \ - CLIP_SH2_0_255(a0, a1); \ - dst = (v16u8)__msa_pckev_b((v16i8)a1, (v16i8)a0); \ -} while (0) +#define CALC_G16(y0, y1, u0, u1, v0, v1, dst) \ + do { \ + const v8i16 const_a = (v8i16)__msa_fill_h(8708); \ + v8i16 a0 = __msa_subs_s_h((v8i16)y0, (v8i16)u0); \ + v8i16 a1 = __msa_subs_s_h((v8i16)y1, (v8i16)u1); \ + const v8i16 b0 = __msa_subs_s_h(a0, (v8i16)v0); \ + const v8i16 b1 = __msa_subs_s_h(a1, (v8i16)v1); \ + a0 = __msa_adds_s_h(b0, const_a); \ + a1 = __msa_adds_s_h(b1, const_a); \ + SRAI_H2_SH(a0, a1, 6); \ + CLIP_SH2_0_255(a0, a1); \ + dst = (v16u8)__msa_pckev_b((v16i8)a1, (v16i8)a0); \ + } while (0) -#define CALC_G8(y0, u0, v0, dst) do { \ - const v8i16 const_a = (v8i16)__msa_fill_h(8708); \ - v8i16 a0 = __msa_subs_s_h((v8i16)y0, (v8i16)u0); \ - const v8i16 b0 = __msa_subs_s_h(a0, (v8i16)v0); \ - a0 = __msa_adds_s_h(b0, const_a); \ - a0 = SRAI_H(a0, 6); \ - CLIP_SH_0_255(a0); \ - dst = (v16u8)__msa_pckev_b((v16i8)a0, (v16i8)a0); \ -} while (0) +#define CALC_G8(y0, u0, v0, dst) \ + do { \ + const v8i16 const_a = (v8i16)__msa_fill_h(8708); \ + v8i16 a0 = __msa_subs_s_h((v8i16)y0, (v8i16)u0); \ + const v8i16 b0 = __msa_subs_s_h(a0, (v8i16)v0); \ + a0 = __msa_adds_s_h(b0, const_a); \ + a0 = SRAI_H(a0, 6); \ + CLIP_SH_0_255(a0); \ + dst = (v16u8)__msa_pckev_b((v16i8)a0, (v16i8)a0); \ + } while (0) -#define CALC_B16(y0, y1, u0, u1, dst) do { \ - const v8u16 const_a = (v8u16)__msa_fill_h(17685); \ - const v8u16 a0 = __msa_adds_u_h((v8u16)y0, u0); \ - const v8u16 a1 = __msa_adds_u_h((v8u16)y1, u1); \ - v8u16 b0 = __msa_subs_u_h(a0, const_a); \ - v8u16 b1 = __msa_subs_u_h(a1, const_a); \ - SRAI_H2_UH(b0, b1, 6); \ - CLIP_UH2_0_255(b0, b1); \ - dst = (v16u8)__msa_pckev_b((v16i8)b1, (v16i8)b0); \ -} while (0) +#define CALC_B16(y0, y1, u0, u1, dst) \ + do { \ + const v8u16 const_a = (v8u16)__msa_fill_h(17685); \ + const v8u16 a0 = __msa_adds_u_h((v8u16)y0, u0); \ + const v8u16 a1 = __msa_adds_u_h((v8u16)y1, u1); \ + v8u16 b0 = __msa_subs_u_h(a0, const_a); \ + v8u16 b1 = __msa_subs_u_h(a1, const_a); \ + SRAI_H2_UH(b0, b1, 6); \ + CLIP_UH2_0_255(b0, b1); \ + dst = (v16u8)__msa_pckev_b((v16i8)b1, (v16i8)b0); \ + } while (0) -#define CALC_B8(y0, u0, dst) do { \ - const v8u16 const_a = (v8u16)__msa_fill_h(17685); \ - const v8u16 a0 = __msa_adds_u_h((v8u16)y0, u0); \ - v8u16 b0 = __msa_subs_u_h(a0, const_a); \ - b0 = SRAI_H(b0, 6); \ - CLIP_UH_0_255(b0); \ - dst = (v16u8)__msa_pckev_b((v16i8)b0, (v16i8)b0); \ -} while (0) +#define CALC_B8(y0, u0, dst) \ + do { \ + const v8u16 const_a = (v8u16)__msa_fill_h(17685); \ + const v8u16 a0 = __msa_adds_u_h((v8u16)y0, u0); \ + v8u16 b0 = __msa_subs_u_h(a0, const_a); \ + b0 = SRAI_H(b0, 6); \ + CLIP_UH_0_255(b0); \ + dst = (v16u8)__msa_pckev_b((v16i8)b0, (v16i8)b0); \ + } while (0) -#define CALC_RGB16(y, u, v, R, G, B) do { \ - const v16u8 zero = { 0 }; \ - v8u16 y0, y1, u0, u1, v0, v1; \ - v4u32 p0, p1, p2, p3; \ - const v16u8 in_y = LD_UB(y); \ - const v16u8 in_u = LD_UB(u); \ - const v16u8 in_v = LD_UB(v); \ - ILVRL_UW4(in_y, p0, p1, p2, p3); \ - MULTHI_16(p0, p1, p2, p3, 19077, y0, y1); \ - ILVRL_UW4(in_v, p0, p1, p2, p3); \ - MULTHI_16(p0, p1, p2, p3, 26149, v0, v1); \ - CALC_R16(y0, y1, v0, v1, R); \ - MULTHI_16(p0, p1, p2, p3, 13320, v0, v1); \ - ILVRL_UW4(in_u, p0, p1, p2, p3); \ - MULTHI_16(p0, p1, p2, p3, 6419, u0, u1); \ - CALC_G16(y0, y1, u0, u1, v0, v1, G); \ - MULTHI_16(p0, p1, p2, p3, 33050, u0, u1); \ - CALC_B16(y0, y1, u0, u1, B); \ -} while (0) +#define CALC_RGB16(y, u, v, R, G, B) \ + do { \ + const v16u8 zero = {0}; \ + v8u16 y0, y1, u0, u1, v0, v1; \ + v4u32 p0, p1, p2, p3; \ + const v16u8 in_y = LD_UB(y); \ + const v16u8 in_u = LD_UB(u); \ + const v16u8 in_v = LD_UB(v); \ + ILVRL_UW4(in_y, p0, p1, p2, p3); \ + MULTHI_16(p0, p1, p2, p3, 19077, y0, y1); \ + ILVRL_UW4(in_v, p0, p1, p2, p3); \ + MULTHI_16(p0, p1, p2, p3, 26149, v0, v1); \ + CALC_R16(y0, y1, v0, v1, R); \ + MULTHI_16(p0, p1, p2, p3, 13320, v0, v1); \ + ILVRL_UW4(in_u, p0, p1, p2, p3); \ + MULTHI_16(p0, p1, p2, p3, 6419, u0, u1); \ + CALC_G16(y0, y1, u0, u1, v0, v1, G); \ + MULTHI_16(p0, p1, p2, p3, 33050, u0, u1); \ + CALC_B16(y0, y1, u0, u1, B); \ + } while (0) -#define CALC_RGB8(y, u, v, R, G, B) do { \ - const v16u8 zero = { 0 }; \ - v8u16 y0, u0, v0; \ - v4u32 p0, p1; \ - const v16u8 in_y = LD_UB(y); \ - const v16u8 in_u = LD_UB(u); \ - const v16u8 in_v = LD_UB(v); \ - ILVR_UW2(in_y, p0, p1); \ - MULTHI_8(p0, p1, 19077, y0); \ - ILVR_UW2(in_v, p0, p1); \ - MULTHI_8(p0, p1, 26149, v0); \ - CALC_R8(y0, v0, R); \ - MULTHI_8(p0, p1, 13320, v0); \ - ILVR_UW2(in_u, p0, p1); \ - MULTHI_8(p0, p1, 6419, u0); \ - CALC_G8(y0, u0, v0, G); \ - MULTHI_8(p0, p1, 33050, u0); \ - CALC_B8(y0, u0, B); \ -} while (0) +#define CALC_RGB8(y, u, v, R, G, B) \ + do { \ + const v16u8 zero = {0}; \ + v8u16 y0, u0, v0; \ + v4u32 p0, p1; \ + const v16u8 in_y = LD_UB(y); \ + const v16u8 in_u = LD_UB(u); \ + const v16u8 in_v = LD_UB(v); \ + ILVR_UW2(in_y, p0, p1); \ + MULTHI_8(p0, p1, 19077, y0); \ + ILVR_UW2(in_v, p0, p1); \ + MULTHI_8(p0, p1, 26149, v0); \ + CALC_R8(y0, v0, R); \ + MULTHI_8(p0, p1, 13320, v0); \ + ILVR_UW2(in_u, p0, p1); \ + MULTHI_8(p0, p1, 6419, u0); \ + CALC_G8(y0, u0, v0, G); \ + MULTHI_8(p0, p1, 33050, u0); \ + CALC_B8(y0, u0, B); \ + } while (0) -#define STORE16_3(a0, a1, a2, dst) do { \ - const v16u8 mask0 = { 0, 1, 16, 2, 3, 17, 4, 5, 18, 6, 7, 19, \ - 8, 9, 20, 10 }; \ - const v16u8 mask1 = { 0, 21, 1, 2, 22, 3, 4, 23, 5, 6, 24, 7, \ - 8, 25, 9, 10 }; \ - const v16u8 mask2 = { 26, 0, 1, 27, 2, 3, 28, 4, 5, 29, 6, 7, \ - 30, 8, 9, 31 }; \ - v16u8 out0, out1, out2, tmp0, tmp1, tmp2; \ - ILVRL_B2_UB(a1, a0, tmp0, tmp1); \ - out0 = VSHF_UB(tmp0, a2, mask0); \ - tmp2 = SLDI_UB(tmp1, tmp0, 11); \ - out1 = VSHF_UB(tmp2, a2, mask1); \ - tmp2 = SLDI_UB(tmp1, tmp1, 6); \ - out2 = VSHF_UB(tmp2, a2, mask2); \ - ST_UB(out0, dst + 0); \ - ST_UB(out1, dst + 16); \ - ST_UB(out2, dst + 32); \ -} while (0) +#define STORE16_3(a0, a1, a2, dst) \ + do { \ + const v16u8 mask0 = { \ + 0, 1, 16, 2, 3, 17, 4, 5, 18, 6, 7, 19, 8, 9, 20, 10}; \ + const v16u8 mask1 = { \ + 0, 21, 1, 2, 22, 3, 4, 23, 5, 6, 24, 7, 8, 25, 9, 10}; \ + const v16u8 mask2 = { \ + 26, 0, 1, 27, 2, 3, 28, 4, 5, 29, 6, 7, 30, 8, 9, 31}; \ + v16u8 out0, out1, out2, tmp0, tmp1, tmp2; \ + ILVRL_B2_UB(a1, a0, tmp0, tmp1); \ + out0 = VSHF_UB(tmp0, a2, mask0); \ + tmp2 = SLDI_UB(tmp1, tmp0, 11); \ + out1 = VSHF_UB(tmp2, a2, mask1); \ + tmp2 = SLDI_UB(tmp1, tmp1, 6); \ + out2 = VSHF_UB(tmp2, a2, mask2); \ + ST_UB(out0, dst + 0); \ + ST_UB(out1, dst + 16); \ + ST_UB(out2, dst + 32); \ + } while (0) -#define STORE8_3(a0, a1, a2, dst) do { \ - int64_t out_m; \ - const v16u8 mask0 = { 0, 1, 16, 2, 3, 17, 4, 5, 18, 6, 7, 19, \ - 8, 9, 20, 10 }; \ - const v16u8 mask1 = { 11, 21, 12, 13, 22, 14, 15, 23, \ - 255, 255, 255, 255, 255, 255, 255, 255 }; \ - const v16u8 tmp0 = (v16u8)__msa_ilvr_b((v16i8)a1, (v16i8)a0); \ - v16u8 out0, out1; \ - VSHF_B2_UB(tmp0, a2, tmp0, a2, mask0, mask1, out0, out1); \ - ST_UB(out0, dst); \ - out_m = __msa_copy_s_d((v2i64)out1, 0); \ - SD(out_m, dst + 16); \ -} while (0) +#define STORE8_3(a0, a1, a2, dst) \ + do { \ + int64_t out_m; \ + const v16u8 mask0 = { \ + 0, 1, 16, 2, 3, 17, 4, 5, 18, 6, 7, 19, 8, 9, 20, 10}; \ + const v16u8 mask1 = {11, 21, 12, 13, 22, 14, 15, 23, \ + 255, 255, 255, 255, 255, 255, 255, 255}; \ + const v16u8 tmp0 = (v16u8)__msa_ilvr_b((v16i8)a1, (v16i8)a0); \ + v16u8 out0, out1; \ + VSHF_B2_UB(tmp0, a2, tmp0, a2, mask0, mask1, out0, out1); \ + ST_UB(out0, dst); \ + out_m = __msa_copy_s_d((v2i64)out1, 0); \ + SD(out_m, dst + 16); \ + } while (0) -#define STORE16_4(a0, a1, a2, a3, dst) do { \ - v16u8 tmp0, tmp1, tmp2, tmp3; \ - v16u8 out0, out1, out2, out3; \ - ILVRL_B2_UB(a1, a0, tmp0, tmp1); \ - ILVRL_B2_UB(a3, a2, tmp2, tmp3); \ - ILVRL_H2_UB(tmp2, tmp0, out0, out1); \ - ILVRL_H2_UB(tmp3, tmp1, out2, out3); \ - ST_UB(out0, dst + 0); \ - ST_UB(out1, dst + 16); \ - ST_UB(out2, dst + 32); \ - ST_UB(out3, dst + 48); \ -} while (0) +#define STORE16_4(a0, a1, a2, a3, dst) \ + do { \ + v16u8 tmp0, tmp1, tmp2, tmp3; \ + v16u8 out0, out1, out2, out3; \ + ILVRL_B2_UB(a1, a0, tmp0, tmp1); \ + ILVRL_B2_UB(a3, a2, tmp2, tmp3); \ + ILVRL_H2_UB(tmp2, tmp0, out0, out1); \ + ILVRL_H2_UB(tmp3, tmp1, out2, out3); \ + ST_UB(out0, dst + 0); \ + ST_UB(out1, dst + 16); \ + ST_UB(out2, dst + 32); \ + ST_UB(out3, dst + 48); \ + } while (0) -#define STORE8_4(a0, a1, a2, a3, dst) do { \ - v16u8 tmp0, tmp1, tmp2, tmp3; \ - ILVR_B2_UB(a1, a0, a3, a2, tmp0, tmp1); \ - ILVRL_H2_UB(tmp1, tmp0, tmp2, tmp3); \ - ST_UB(tmp2, dst + 0); \ - ST_UB(tmp3, dst + 16); \ -} while (0) +#define STORE8_4(a0, a1, a2, a3, dst) \ + do { \ + v16u8 tmp0, tmp1, tmp2, tmp3; \ + ILVR_B2_UB(a1, a0, a3, a2, tmp0, tmp1); \ + ILVRL_H2_UB(tmp1, tmp0, tmp2, tmp3); \ + ST_UB(tmp2, dst + 0); \ + ST_UB(tmp3, dst + 16); \ + } while (0) -#define STORE2_16(a0, a1, dst) do { \ - v16u8 out0, out1; \ - ILVRL_B2_UB(a1, a0, out0, out1); \ - ST_UB(out0, dst + 0); \ - ST_UB(out1, dst + 16); \ -} while (0) +#define STORE2_16(a0, a1, dst) \ + do { \ + v16u8 out0, out1; \ + ILVRL_B2_UB(a1, a0, out0, out1); \ + ST_UB(out0, dst + 0); \ + ST_UB(out1, dst + 16); \ + } while (0) -#define STORE2_8(a0, a1, dst) do { \ - const v16u8 out0 = (v16u8)__msa_ilvr_b((v16i8)a1, (v16i8)a0); \ - ST_UB(out0, dst); \ -} while (0) +#define STORE2_8(a0, a1, dst) \ + do { \ + const v16u8 out0 = (v16u8)__msa_ilvr_b((v16i8)a1, (v16i8)a0); \ + ST_UB(out0, dst); \ + } while (0) -#define CALC_RGBA4444(y, u, v, out0, out1, N, dst) do { \ - CALC_RGB##N(y, u, v, R, G, B); \ - tmp0 = ANDI_B(R, 0xf0); \ - tmp1 = SRAI_B(G, 4); \ - RG = tmp0 | tmp1; \ - tmp0 = ANDI_B(B, 0xf0); \ - BA = ORI_B(tmp0, 0x0f); \ - STORE2_##N(out0, out1, dst); \ -} while (0) +#define CALC_RGBA4444(y, u, v, out0, out1, N, dst) \ + do { \ + CALC_RGB##N(y, u, v, R, G, B); \ + tmp0 = ANDI_B(R, 0xf0); \ + tmp1 = SRAI_B(G, 4); \ + RG = tmp0 | tmp1; \ + tmp0 = ANDI_B(B, 0xf0); \ + BA = ORI_B(tmp0, 0x0f); \ + STORE2_##N(out0, out1, dst); \ + } while (0) -#define CALC_RGB565(y, u, v, out0, out1, N, dst) do { \ - CALC_RGB##N(y, u, v, R, G, B); \ - tmp0 = ANDI_B(R, 0xf8); \ - tmp1 = SRAI_B(G, 5); \ - RG = tmp0 | tmp1; \ - tmp0 = SLLI_B(G, 3); \ - tmp1 = ANDI_B(tmp0, 0xe0); \ - tmp0 = SRAI_B(B, 3); \ - GB = tmp0 | tmp1; \ - STORE2_##N(out0, out1, dst); \ -} while (0) +#define CALC_RGB565(y, u, v, out0, out1, N, dst) \ + do { \ + CALC_RGB##N(y, u, v, R, G, B); \ + tmp0 = ANDI_B(R, 0xf8); \ + tmp1 = SRAI_B(G, 5); \ + RG = tmp0 | tmp1; \ + tmp0 = SLLI_B(G, 3); \ + tmp1 = ANDI_B(tmp0, 0xe0); \ + tmp0 = SRAI_B(B, 3); \ + GB = tmp0 | tmp1; \ + STORE2_##N(out0, out1, dst); \ + } while (0) -static WEBP_INLINE int Clip8(int v) { - return v < 0 ? 0 : v > 255 ? 255 : v; -} +static WEBP_INLINE int Clip8(int v) { return v < 0 ? 0 : v > 255 ? 255 : v; } static void YuvToRgb(int y, int u, int v, uint8_t* const rgb) { const int y1 = MultHi(y, 19077); @@ -293,7 +312,7 @@ static void YuvToRgba4444(int y, int u, int v, uint8_t* const argb) { const int g = Clip8(g1 >> 6); const int b = Clip8(b1 >> 6); const int rg = (r & 0xf0) | (g >> 4); - const int ba = (b & 0xf0) | 0x0f; // overwrite the lower 4 bits + const int ba = (b & 0xf0) | 0x0f; // overwrite the lower 4 bits #if (WEBP_SWAP_16BIT_CSP == 1) argb[0] = ba; argb[1] = rg; @@ -328,20 +347,20 @@ static void YuvToRgbLine(const uint8_t* WEBP_RESTRICT y, while (length >= 16) { CALC_RGB16(y, u, v, R, G, B); STORE16_3(R, G, B, dst); - y += 16; - u += 16; - v += 16; - dst += 16 * 3; + y += 16; + u += 16; + v += 16; + dst += 16 * 3; length -= 16; } if (length > 8) { - uint8_t temp[3 * 16] = { 0 }; + uint8_t temp[3 * 16] = {0}; memcpy(temp, y, length * sizeof(*temp)); CALC_RGB16(temp, u, v, R, G, B); STORE16_3(R, G, B, temp); memcpy(dst, temp, length * 3 * sizeof(*dst)); } else if (length > 0) { - uint8_t temp[3 * 8] = { 0 }; + uint8_t temp[3 * 8] = {0}; memcpy(temp, y, length * sizeof(*temp)); CALC_RGB8(temp, u, v, R, G, B); STORE8_3(R, G, B, temp); @@ -357,20 +376,20 @@ static void YuvToBgrLine(const uint8_t* WEBP_RESTRICT y, while (length >= 16) { CALC_RGB16(y, u, v, R, G, B); STORE16_3(B, G, R, dst); - y += 16; - u += 16; - v += 16; - dst += 16 * 3; + y += 16; + u += 16; + v += 16; + dst += 16 * 3; length -= 16; } if (length > 8) { - uint8_t temp[3 * 16] = { 0 }; + uint8_t temp[3 * 16] = {0}; memcpy(temp, y, length * sizeof(*temp)); CALC_RGB16(temp, u, v, R, G, B); STORE16_3(B, G, R, temp); memcpy(dst, temp, length * 3 * sizeof(*dst)); } else if (length > 0) { - uint8_t temp[3 * 8] = { 0 }; + uint8_t temp[3 * 8] = {0}; memcpy(temp, y, length * sizeof(*temp)); CALC_RGB8(temp, u, v, R, G, B); STORE8_3(B, G, R, temp); @@ -388,20 +407,20 @@ static void YuvToRgbaLine(const uint8_t* WEBP_RESTRICT y, while (length >= 16) { CALC_RGB16(y, u, v, R, G, B); STORE16_4(R, G, B, A, dst); - y += 16; - u += 16; - v += 16; - dst += 16 * 4; + y += 16; + u += 16; + v += 16; + dst += 16 * 4; length -= 16; } if (length > 8) { - uint8_t temp[4 * 16] = { 0 }; + uint8_t temp[4 * 16] = {0}; memcpy(temp, y, length * sizeof(*temp)); CALC_RGB16(&temp[0], u, v, R, G, B); STORE16_4(R, G, B, A, temp); memcpy(dst, temp, length * 4 * sizeof(*dst)); } else if (length > 0) { - uint8_t temp[4 * 8] = { 0 }; + uint8_t temp[4 * 8] = {0}; memcpy(temp, y, length * sizeof(*temp)); CALC_RGB8(temp, u, v, R, G, B); STORE8_4(R, G, B, A, temp); @@ -418,20 +437,20 @@ static void YuvToBgraLine(const uint8_t* WEBP_RESTRICT y, while (length >= 16) { CALC_RGB16(y, u, v, R, G, B); STORE16_4(B, G, R, A, dst); - y += 16; - u += 16; - v += 16; - dst += 16 * 4; + y += 16; + u += 16; + v += 16; + dst += 16 * 4; length -= 16; } if (length > 8) { - uint8_t temp[4 * 16] = { 0 }; + uint8_t temp[4 * 16] = {0}; memcpy(temp, y, length * sizeof(*temp)); CALC_RGB16(temp, u, v, R, G, B); STORE16_4(B, G, R, A, temp); memcpy(dst, temp, length * 4 * sizeof(*dst)); } else if (length > 0) { - uint8_t temp[4 * 8] = { 0 }; + uint8_t temp[4 * 8] = {0}; memcpy(temp, y, length * sizeof(*temp)); CALC_RGB8(temp, u, v, R, G, B); STORE8_4(B, G, R, A, temp); @@ -449,20 +468,20 @@ static void YuvToArgbLine(const uint8_t* WEBP_RESTRICT y, while (length >= 16) { CALC_RGB16(y, u, v, R, G, B); STORE16_4(A, R, G, B, dst); - y += 16; - u += 16; - v += 16; - dst += 16 * 4; + y += 16; + u += 16; + v += 16; + dst += 16 * 4; length -= 16; } if (length > 8) { - uint8_t temp[4 * 16] = { 0 }; + uint8_t temp[4 * 16] = {0}; memcpy(temp, y, length * sizeof(*temp)); CALC_RGB16(temp, u, v, R, G, B); STORE16_4(A, R, G, B, temp); memcpy(dst, temp, length * 4 * sizeof(*dst)); } else if (length > 0) { - uint8_t temp[4 * 8] = { 0 }; + uint8_t temp[4 * 8] = {0}; memcpy(temp, y, length * sizeof(*temp)); CALC_RGB8(temp, u, v, R, G, B); STORE8_4(A, R, G, B, temp); @@ -481,14 +500,14 @@ static void YuvToRgba4444Line(const uint8_t* WEBP_RESTRICT y, #else CALC_RGBA4444(y, u, v, RG, BA, 16, dst); #endif - y += 16; - u += 16; - v += 16; - dst += 16 * 2; + y += 16; + u += 16; + v += 16; + dst += 16 * 2; length -= 16; } if (length > 8) { - uint8_t temp[2 * 16] = { 0 }; + uint8_t temp[2 * 16] = {0}; memcpy(temp, y, length * sizeof(*temp)); #if (WEBP_SWAP_16BIT_CSP == 1) CALC_RGBA4444(temp, u, v, BA, RG, 16, temp); @@ -497,7 +516,7 @@ static void YuvToRgba4444Line(const uint8_t* WEBP_RESTRICT y, #endif memcpy(dst, temp, length * 2 * sizeof(*dst)); } else if (length > 0) { - uint8_t temp[2 * 8] = { 0 }; + uint8_t temp[2 * 8] = {0}; memcpy(temp, y, length * sizeof(*temp)); #if (WEBP_SWAP_16BIT_CSP == 1) CALC_RGBA4444(temp, u, v, BA, RG, 8, temp); @@ -519,14 +538,14 @@ static void YuvToRgb565Line(const uint8_t* WEBP_RESTRICT y, #else CALC_RGB565(y, u, v, RG, GB, 16, dst); #endif - y += 16; - u += 16; - v += 16; - dst += 16 * 2; + y += 16; + u += 16; + v += 16; + dst += 16 * 2; length -= 16; } if (length > 8) { - uint8_t temp[2 * 16] = { 0 }; + uint8_t temp[2 * 16] = {0}; memcpy(temp, y, length * sizeof(*temp)); #if (WEBP_SWAP_16BIT_CSP == 1) CALC_RGB565(temp, u, v, GB, RG, 16, temp); @@ -535,7 +554,7 @@ static void YuvToRgb565Line(const uint8_t* WEBP_RESTRICT y, #endif memcpy(dst, temp, length * 2 * sizeof(*dst)); } else if (length > 0) { - uint8_t temp[2 * 8] = { 0 }; + uint8_t temp[2 * 8] = {0}; memcpy(temp, y, length * sizeof(*temp)); #if (WEBP_SWAP_16BIT_CSP == 1) CALC_RGB565(temp, u, v, GB, RG, 8, temp); @@ -547,131 +566,130 @@ static void YuvToRgb565Line(const uint8_t* WEBP_RESTRICT y, } #endif // WEBP_REDUCE_CSP -#define UPSAMPLE_32PIXELS(a, b, c, d) do { \ - v16u8 s = __msa_aver_u_b(a, d); \ - v16u8 t = __msa_aver_u_b(b, c); \ - const v16u8 st = s ^ t; \ - v16u8 ad = a ^ d; \ - v16u8 bc = b ^ c; \ - v16u8 t0 = ad | bc; \ - v16u8 t1 = t0 | st; \ - v16u8 t2 = ANDI_B(t1, 1); \ - v16u8 t3 = __msa_aver_u_b(s, t); \ - const v16u8 k = t3 - t2; \ - v16u8 diag1, diag2; \ - AVER_UB2_UB(t, k, s, k, t0, t1); \ - bc = bc & st; \ - ad = ad & st; \ - t = t ^ k; \ - s = s ^ k; \ - t2 = bc | t; \ - t3 = ad | s; \ - t2 = ANDI_B(t2, 1); \ - t3 = ANDI_B(t3, 1); \ - SUB2(t0, t2, t1, t3, diag1, diag2); \ - AVER_UB2_UB(a, diag1, b, diag2, t0, t1); \ - ILVRL_B2_UB(t1, t0, a, b); \ - if (pbot_y != NULL) { \ - AVER_UB2_UB(c, diag2, d, diag1, t0, t1); \ - ILVRL_B2_UB(t1, t0, c, d); \ - } \ -} while (0) +#define UPSAMPLE_32PIXELS(a, b, c, d) \ + do { \ + v16u8 s = __msa_aver_u_b(a, d); \ + v16u8 t = __msa_aver_u_b(b, c); \ + const v16u8 st = s ^ t; \ + v16u8 ad = a ^ d; \ + v16u8 bc = b ^ c; \ + v16u8 t0 = ad | bc; \ + v16u8 t1 = t0 | st; \ + v16u8 t2 = ANDI_B(t1, 1); \ + v16u8 t3 = __msa_aver_u_b(s, t); \ + const v16u8 k = t3 - t2; \ + v16u8 diag1, diag2; \ + AVER_UB2_UB(t, k, s, k, t0, t1); \ + bc = bc & st; \ + ad = ad & st; \ + t = t ^ k; \ + s = s ^ k; \ + t2 = bc | t; \ + t3 = ad | s; \ + t2 = ANDI_B(t2, 1); \ + t3 = ANDI_B(t3, 1); \ + SUB2(t0, t2, t1, t3, diag1, diag2); \ + AVER_UB2_UB(a, diag1, b, diag2, t0, t1); \ + ILVRL_B2_UB(t1, t0, a, b); \ + if (pbot_y != NULL) { \ + AVER_UB2_UB(c, diag2, d, diag1, t0, t1); \ + ILVRL_B2_UB(t1, t0, c, d); \ + } \ + } while (0) -#define UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP) \ -static void FUNC_NAME(const uint8_t* WEBP_RESTRICT top_y, \ - const uint8_t* WEBP_RESTRICT bot_y, \ - const uint8_t* WEBP_RESTRICT top_u, \ - const uint8_t* WEBP_RESTRICT top_v, \ - const uint8_t* WEBP_RESTRICT cur_u, \ - const uint8_t* WEBP_RESTRICT cur_v, \ - uint8_t* WEBP_RESTRICT top_dst, \ - uint8_t* WEBP_RESTRICT bot_dst, int len) { \ - int size = (len - 1) >> 1; \ - uint8_t temp_u[64]; \ - uint8_t temp_v[64]; \ - const uint32_t tl_uv = ((top_u[0]) | ((top_v[0]) << 16)); \ - const uint32_t l_uv = ((cur_u[0]) | ((cur_v[0]) << 16)); \ - const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2; \ - const uint8_t* ptop_y = &top_y[1]; \ - uint8_t* ptop_dst = top_dst + XSTEP; \ - const uint8_t* pbot_y = &bot_y[1]; \ - uint8_t* pbot_dst = bot_dst + XSTEP; \ - \ - FUNC(top_y[0], uv0 & 0xff, (uv0 >> 16), top_dst); \ - if (bot_y != NULL) { \ - const uint32_t uv1 = (3 * l_uv + tl_uv + 0x00020002u) >> 2; \ - FUNC(bot_y[0], uv1 & 0xff, (uv1 >> 16), bot_dst); \ - } \ - while (size >= 16) { \ - v16u8 tu0, tu1, tv0, tv1, cu0, cu1, cv0, cv1; \ - LD_UB2(top_u, 1, tu0, tu1); \ - LD_UB2(cur_u, 1, cu0, cu1); \ - LD_UB2(top_v, 1, tv0, tv1); \ - LD_UB2(cur_v, 1, cv0, cv1); \ - UPSAMPLE_32PIXELS(tu0, tu1, cu0, cu1); \ - UPSAMPLE_32PIXELS(tv0, tv1, cv0, cv1); \ - ST_UB4(tu0, tu1, cu0, cu1, &temp_u[0], 16); \ - ST_UB4(tv0, tv1, cv0, cv1, &temp_v[0], 16); \ - FUNC##Line(ptop_y, &temp_u[ 0], &temp_v[0], ptop_dst, 32); \ - if (bot_y != NULL) { \ - FUNC##Line(pbot_y, &temp_u[32], &temp_v[32], pbot_dst, 32); \ - } \ - ptop_y += 32; \ - pbot_y += 32; \ - ptop_dst += XSTEP * 32; \ - pbot_dst += XSTEP * 32; \ - top_u += 16; \ - top_v += 16; \ - cur_u += 16; \ - cur_v += 16; \ - size -= 16; \ - } \ - if (size > 0) { \ - v16u8 tu0, tu1, tv0, tv1, cu0, cu1, cv0, cv1; \ - memcpy(&temp_u[ 0], top_u, 17 * sizeof(uint8_t)); \ - memcpy(&temp_u[32], cur_u, 17 * sizeof(uint8_t)); \ - memcpy(&temp_v[ 0], top_v, 17 * sizeof(uint8_t)); \ - memcpy(&temp_v[32], cur_v, 17 * sizeof(uint8_t)); \ - LD_UB2(&temp_u[ 0], 1, tu0, tu1); \ - LD_UB2(&temp_u[32], 1, cu0, cu1); \ - LD_UB2(&temp_v[ 0], 1, tv0, tv1); \ - LD_UB2(&temp_v[32], 1, cv0, cv1); \ - UPSAMPLE_32PIXELS(tu0, tu1, cu0, cu1); \ - UPSAMPLE_32PIXELS(tv0, tv1, cv0, cv1); \ - ST_UB4(tu0, tu1, cu0, cu1, &temp_u[0], 16); \ - ST_UB4(tv0, tv1, cv0, cv1, &temp_v[0], 16); \ - FUNC##Line(ptop_y, &temp_u[ 0], &temp_v[0], ptop_dst, size * 2); \ - if (bot_y != NULL) { \ - FUNC##Line(pbot_y, &temp_u[32], &temp_v[32], pbot_dst, size * 2); \ - } \ - top_u += size; \ - top_v += size; \ - cur_u += size; \ - cur_v += size; \ - } \ - if (!(len & 1)) { \ - const uint32_t t0 = ((top_u[0]) | ((top_v[0]) << 16)); \ - const uint32_t c0 = ((cur_u[0]) | ((cur_v[0]) << 16)); \ - const uint32_t tmp0 = (3 * t0 + c0 + 0x00020002u) >> 2; \ - FUNC(top_y[len - 1], tmp0 & 0xff, (tmp0 >> 16), \ - top_dst + (len - 1) * XSTEP); \ - if (bot_y != NULL) { \ - const uint32_t tmp1 = (3 * c0 + t0 + 0x00020002u) >> 2; \ - FUNC(bot_y[len - 1], tmp1 & 0xff, (tmp1 >> 16), \ - bot_dst + (len - 1) * XSTEP); \ - } \ - } \ -} +#define UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP) \ + static void FUNC_NAME( \ + const uint8_t* WEBP_RESTRICT top_y, const uint8_t* WEBP_RESTRICT bot_y, \ + const uint8_t* WEBP_RESTRICT top_u, const uint8_t* WEBP_RESTRICT top_v, \ + const uint8_t* WEBP_RESTRICT cur_u, const uint8_t* WEBP_RESTRICT cur_v, \ + uint8_t* WEBP_RESTRICT top_dst, uint8_t* WEBP_RESTRICT bot_dst, \ + int len) { \ + int size = (len - 1) >> 1; \ + uint8_t temp_u[64]; \ + uint8_t temp_v[64]; \ + const uint32_t tl_uv = ((top_u[0]) | ((top_v[0]) << 16)); \ + const uint32_t l_uv = ((cur_u[0]) | ((cur_v[0]) << 16)); \ + const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2; \ + const uint8_t* ptop_y = &top_y[1]; \ + uint8_t* ptop_dst = top_dst + XSTEP; \ + const uint8_t* pbot_y = &bot_y[1]; \ + uint8_t* pbot_dst = bot_dst + XSTEP; \ + \ + FUNC(top_y[0], uv0 & 0xff, (uv0 >> 16), top_dst); \ + if (bot_y != NULL) { \ + const uint32_t uv1 = (3 * l_uv + tl_uv + 0x00020002u) >> 2; \ + FUNC(bot_y[0], uv1 & 0xff, (uv1 >> 16), bot_dst); \ + } \ + while (size >= 16) { \ + v16u8 tu0, tu1, tv0, tv1, cu0, cu1, cv0, cv1; \ + LD_UB2(top_u, 1, tu0, tu1); \ + LD_UB2(cur_u, 1, cu0, cu1); \ + LD_UB2(top_v, 1, tv0, tv1); \ + LD_UB2(cur_v, 1, cv0, cv1); \ + UPSAMPLE_32PIXELS(tu0, tu1, cu0, cu1); \ + UPSAMPLE_32PIXELS(tv0, tv1, cv0, cv1); \ + ST_UB4(tu0, tu1, cu0, cu1, &temp_u[0], 16); \ + ST_UB4(tv0, tv1, cv0, cv1, &temp_v[0], 16); \ + FUNC##Line(ptop_y, &temp_u[0], &temp_v[0], ptop_dst, 32); \ + if (bot_y != NULL) { \ + FUNC##Line(pbot_y, &temp_u[32], &temp_v[32], pbot_dst, 32); \ + } \ + ptop_y += 32; \ + pbot_y += 32; \ + ptop_dst += XSTEP * 32; \ + pbot_dst += XSTEP * 32; \ + top_u += 16; \ + top_v += 16; \ + cur_u += 16; \ + cur_v += 16; \ + size -= 16; \ + } \ + if (size > 0) { \ + v16u8 tu0, tu1, tv0, tv1, cu0, cu1, cv0, cv1; \ + memcpy(&temp_u[0], top_u, 17 * sizeof(uint8_t)); \ + memcpy(&temp_u[32], cur_u, 17 * sizeof(uint8_t)); \ + memcpy(&temp_v[0], top_v, 17 * sizeof(uint8_t)); \ + memcpy(&temp_v[32], cur_v, 17 * sizeof(uint8_t)); \ + LD_UB2(&temp_u[0], 1, tu0, tu1); \ + LD_UB2(&temp_u[32], 1, cu0, cu1); \ + LD_UB2(&temp_v[0], 1, tv0, tv1); \ + LD_UB2(&temp_v[32], 1, cv0, cv1); \ + UPSAMPLE_32PIXELS(tu0, tu1, cu0, cu1); \ + UPSAMPLE_32PIXELS(tv0, tv1, cv0, cv1); \ + ST_UB4(tu0, tu1, cu0, cu1, &temp_u[0], 16); \ + ST_UB4(tv0, tv1, cv0, cv1, &temp_v[0], 16); \ + FUNC##Line(ptop_y, &temp_u[0], &temp_v[0], ptop_dst, size * 2); \ + if (bot_y != NULL) { \ + FUNC##Line(pbot_y, &temp_u[32], &temp_v[32], pbot_dst, size * 2); \ + } \ + top_u += size; \ + top_v += size; \ + cur_u += size; \ + cur_v += size; \ + } \ + if (!(len & 1)) { \ + const uint32_t t0 = ((top_u[0]) | ((top_v[0]) << 16)); \ + const uint32_t c0 = ((cur_u[0]) | ((cur_v[0]) << 16)); \ + const uint32_t tmp0 = (3 * t0 + c0 + 0x00020002u) >> 2; \ + FUNC(top_y[len - 1], tmp0 & 0xff, (tmp0 >> 16), \ + top_dst + (len - 1) * XSTEP); \ + if (bot_y != NULL) { \ + const uint32_t tmp1 = (3 * c0 + t0 + 0x00020002u) >> 2; \ + FUNC(bot_y[len - 1], tmp1 & 0xff, (tmp1 >> 16), \ + bot_dst + (len - 1) * XSTEP); \ + } \ + } \ + } -UPSAMPLE_FUNC(UpsampleRgbaLinePair, YuvToRgba, 4) -UPSAMPLE_FUNC(UpsampleBgraLinePair, YuvToBgra, 4) +UPSAMPLE_FUNC(UpsampleRgbaLinePair, YuvToRgba, 4) +UPSAMPLE_FUNC(UpsampleBgraLinePair, YuvToBgra, 4) #if !defined(WEBP_REDUCE_CSP) -UPSAMPLE_FUNC(UpsampleRgbLinePair, YuvToRgb, 3) -UPSAMPLE_FUNC(UpsampleBgrLinePair, YuvToBgr, 3) -UPSAMPLE_FUNC(UpsampleArgbLinePair, YuvToArgb, 4) +UPSAMPLE_FUNC(UpsampleRgbLinePair, YuvToRgb, 3) +UPSAMPLE_FUNC(UpsampleBgrLinePair, YuvToBgr, 3) +UPSAMPLE_FUNC(UpsampleArgbLinePair, YuvToArgb, 4) UPSAMPLE_FUNC(UpsampleRgba4444LinePair, YuvToRgba4444, 2) -UPSAMPLE_FUNC(UpsampleRgb565LinePair, YuvToRgb565, 2) -#endif // WEBP_REDUCE_CSP +UPSAMPLE_FUNC(UpsampleRgb565LinePair, YuvToRgb565, 2) +#endif // WEBP_REDUCE_CSP //------------------------------------------------------------------------------ // Entry point @@ -681,19 +699,19 @@ extern WebPUpsampleLinePairFunc WebPUpsamplers[/* MODE_LAST */]; extern void WebPInitUpsamplersMSA(void); WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplersMSA(void) { - WebPUpsamplers[MODE_RGBA] = UpsampleRgbaLinePair; - WebPUpsamplers[MODE_BGRA] = UpsampleBgraLinePair; - WebPUpsamplers[MODE_rgbA] = UpsampleRgbaLinePair; - WebPUpsamplers[MODE_bgrA] = UpsampleBgraLinePair; + WebPUpsamplers[MODE_RGBA] = UpsampleRgbaLinePair; + WebPUpsamplers[MODE_BGRA] = UpsampleBgraLinePair; + WebPUpsamplers[MODE_rgbA] = UpsampleRgbaLinePair; + WebPUpsamplers[MODE_bgrA] = UpsampleBgraLinePair; #if !defined(WEBP_REDUCE_CSP) - WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair; - WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePair; - WebPUpsamplers[MODE_ARGB] = UpsampleArgbLinePair; - WebPUpsamplers[MODE_Argb] = UpsampleArgbLinePair; - WebPUpsamplers[MODE_RGB_565] = UpsampleRgb565LinePair; + WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair; + WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePair; + WebPUpsamplers[MODE_ARGB] = UpsampleArgbLinePair; + WebPUpsamplers[MODE_Argb] = UpsampleArgbLinePair; + WebPUpsamplers[MODE_RGB_565] = UpsampleRgb565LinePair; WebPUpsamplers[MODE_RGBA_4444] = UpsampleRgba4444LinePair; WebPUpsamplers[MODE_rgbA_4444] = UpsampleRgba4444LinePair; -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP } #endif // FANCY_UPSAMPLING diff --git a/src/dsp/upsampling_neon.c b/src/dsp/upsampling_neon.c index 2bd3e931..b2ce9f7d 100644 --- a/src/dsp/upsampling_neon.c +++ b/src/dsp/upsampling_neon.c @@ -16,9 +16,10 @@ #if defined(WEBP_USE_NEON) -#include #include +#include #include + #include "src/dsp/neon.h" #include "src/dsp/yuv.h" @@ -28,34 +29,35 @@ // U/V upsampling // Loads 9 pixels each from rows r1 and r2 and generates 16 pixels. -#define UPSAMPLE_16PIXELS(r1, r2, out) do { \ - const uint8x8_t a = vld1_u8(r1 + 0); \ - const uint8x8_t b = vld1_u8(r1 + 1); \ - const uint8x8_t c = vld1_u8(r2 + 0); \ - const uint8x8_t d = vld1_u8(r2 + 1); \ - /* a + b + c + d */ \ - const uint16x8_t ad = vaddl_u8(a, d); \ - const uint16x8_t bc = vaddl_u8(b, c); \ - const uint16x8_t abcd = vaddq_u16(ad, bc); \ - /* 3a + b + c + 3d */ \ - const uint16x8_t al = vaddq_u16(abcd, vshlq_n_u16(ad, 1)); \ - /* a + 3b + 3c + d */ \ - const uint16x8_t bl = vaddq_u16(abcd, vshlq_n_u16(bc, 1)); \ - \ - const uint8x8_t diag2 = vshrn_n_u16(al, 3); \ - const uint8x8_t diag1 = vshrn_n_u16(bl, 3); \ - \ - const uint8x8_t A = vrhadd_u8(a, diag1); \ - const uint8x8_t B = vrhadd_u8(b, diag2); \ - const uint8x8_t C = vrhadd_u8(c, diag2); \ - const uint8x8_t D = vrhadd_u8(d, diag1); \ - \ - uint8x8x2_t A_B, C_D; \ - INIT_VECTOR2(A_B, A, B); \ - INIT_VECTOR2(C_D, C, D); \ - vst2_u8(out + 0, A_B); \ - vst2_u8(out + 32, C_D); \ -} while (0) +#define UPSAMPLE_16PIXELS(r1, r2, out) \ + do { \ + const uint8x8_t a = vld1_u8(r1 + 0); \ + const uint8x8_t b = vld1_u8(r1 + 1); \ + const uint8x8_t c = vld1_u8(r2 + 0); \ + const uint8x8_t d = vld1_u8(r2 + 1); \ + /* a + b + c + d */ \ + const uint16x8_t ad = vaddl_u8(a, d); \ + const uint16x8_t bc = vaddl_u8(b, c); \ + const uint16x8_t abcd = vaddq_u16(ad, bc); \ + /* 3a + b + c + 3d */ \ + const uint16x8_t al = vaddq_u16(abcd, vshlq_n_u16(ad, 1)); \ + /* a + 3b + 3c + d */ \ + const uint16x8_t bl = vaddq_u16(abcd, vshlq_n_u16(bc, 1)); \ + \ + const uint8x8_t diag2 = vshrn_n_u16(al, 3); \ + const uint8x8_t diag1 = vshrn_n_u16(bl, 3); \ + \ + const uint8x8_t A = vrhadd_u8(a, diag1); \ + const uint8x8_t B = vrhadd_u8(b, diag2); \ + const uint8x8_t C = vrhadd_u8(c, diag2); \ + const uint8x8_t D = vrhadd_u8(d, diag1); \ + \ + uint8x8x2_t A_B, C_D; \ + INIT_VECTOR2(A_B, A, B); \ + INIT_VECTOR2(C_D, C, D); \ + vst2_u8(out + 0, A_B); \ + vst2_u8(out + 32, C_D); \ + } while (0) // Turn the macro into a function for reducing code-size when non-critical static void Upsample16Pixels_NEON(const uint8_t* WEBP_RESTRICT const r1, @@ -64,53 +66,59 @@ static void Upsample16Pixels_NEON(const uint8_t* WEBP_RESTRICT const r1, UPSAMPLE_16PIXELS(r1, r2, out); } -#define UPSAMPLE_LAST_BLOCK(tb, bb, num_pixels, out) { \ - uint8_t r1[9], r2[9]; \ - memcpy(r1, (tb), (num_pixels)); \ - memcpy(r2, (bb), (num_pixels)); \ - /* replicate last byte */ \ - memset(r1 + (num_pixels), r1[(num_pixels) - 1], 9 - (num_pixels)); \ - memset(r2 + (num_pixels), r2[(num_pixels) - 1], 9 - (num_pixels)); \ - Upsample16Pixels_NEON(r1, r2, out); \ -} +#define UPSAMPLE_LAST_BLOCK(tb, bb, num_pixels, out) \ + { \ + uint8_t r1[9], r2[9]; \ + memcpy(r1, (tb), (num_pixels)); \ + memcpy(r2, (bb), (num_pixels)); \ + /* replicate last byte */ \ + memset(r1 + (num_pixels), r1[(num_pixels) - 1], 9 - (num_pixels)); \ + memset(r2 + (num_pixels), r2[(num_pixels) - 1], 9 - (num_pixels)); \ + Upsample16Pixels_NEON(r1, r2, out); \ + } //----------------------------------------------------------------------------- // YUV->RGB conversion // note: we represent the 33050 large constant as 32768 + 282 -static const int16_t kCoeffs1[4] = { 19077, 26149, 6419, 13320 }; +static const int16_t kCoeffs1[4] = {19077, 26149, 6419, 13320}; #define v255 vdup_n_u8(255) -#define STORE_Rgb(out, r, g, b) do { \ - uint8x8x3_t r_g_b; \ - INIT_VECTOR3(r_g_b, r, g, b); \ - vst3_u8(out, r_g_b); \ -} while (0) +#define STORE_Rgb(out, r, g, b) \ + do { \ + uint8x8x3_t r_g_b; \ + INIT_VECTOR3(r_g_b, r, g, b); \ + vst3_u8(out, r_g_b); \ + } while (0) -#define STORE_Bgr(out, r, g, b) do { \ - uint8x8x3_t b_g_r; \ - INIT_VECTOR3(b_g_r, b, g, r); \ - vst3_u8(out, b_g_r); \ -} while (0) +#define STORE_Bgr(out, r, g, b) \ + do { \ + uint8x8x3_t b_g_r; \ + INIT_VECTOR3(b_g_r, b, g, r); \ + vst3_u8(out, b_g_r); \ + } while (0) -#define STORE_Rgba(out, r, g, b) do { \ - uint8x8x4_t r_g_b_v255; \ - INIT_VECTOR4(r_g_b_v255, r, g, b, v255); \ - vst4_u8(out, r_g_b_v255); \ -} while (0) +#define STORE_Rgba(out, r, g, b) \ + do { \ + uint8x8x4_t r_g_b_v255; \ + INIT_VECTOR4(r_g_b_v255, r, g, b, v255); \ + vst4_u8(out, r_g_b_v255); \ + } while (0) -#define STORE_Bgra(out, r, g, b) do { \ - uint8x8x4_t b_g_r_v255; \ - INIT_VECTOR4(b_g_r_v255, b, g, r, v255); \ - vst4_u8(out, b_g_r_v255); \ -} while (0) +#define STORE_Bgra(out, r, g, b) \ + do { \ + uint8x8x4_t b_g_r_v255; \ + INIT_VECTOR4(b_g_r_v255, b, g, r, v255); \ + vst4_u8(out, b_g_r_v255); \ + } while (0) -#define STORE_Argb(out, r, g, b) do { \ - uint8x8x4_t v255_r_g_b; \ - INIT_VECTOR4(v255_r_g_b, v255, r, g, b); \ - vst4_u8(out, v255_r_g_b); \ -} while (0) +#define STORE_Argb(out, r, g, b) \ + do { \ + uint8x8x4_t v255_r_g_b; \ + INIT_VECTOR4(v255_r_g_b, v255, r, g, b); \ + vst4_u8(out, v255_r_g_b); \ + } while (0) #if (WEBP_SWAP_16BIT_CSP == 0) #define ZIP_U8(lo, hi) vzip_u8((lo), (hi)) @@ -118,145 +126,151 @@ static const int16_t kCoeffs1[4] = { 19077, 26149, 6419, 13320 }; #define ZIP_U8(lo, hi) vzip_u8((hi), (lo)) #endif -#define STORE_Rgba4444(out, r, g, b) do { \ - const uint8x8_t rg = vsri_n_u8(r, g, 4); /* shift g, insert r */ \ - const uint8x8_t ba = vsri_n_u8(b, v255, 4); /* shift a, insert b */ \ - const uint8x8x2_t rgba4444 = ZIP_U8(rg, ba); \ - vst1q_u8(out, vcombine_u8(rgba4444.val[0], rgba4444.val[1])); \ -} while (0) +#define STORE_Rgba4444(out, r, g, b) \ + do { \ + const uint8x8_t rg = vsri_n_u8(r, g, 4); /* shift g, insert r */ \ + const uint8x8_t ba = vsri_n_u8(b, v255, 4); /* shift a, insert b */ \ + const uint8x8x2_t rgba4444 = ZIP_U8(rg, ba); \ + vst1q_u8(out, vcombine_u8(rgba4444.val[0], rgba4444.val[1])); \ + } while (0) -#define STORE_Rgb565(out, r, g, b) do { \ - const uint8x8_t rg = vsri_n_u8(r, g, 5); /* shift g and insert r */ \ - const uint8x8_t g1 = vshl_n_u8(g, 3); /* pre-shift g: 3bits */ \ - const uint8x8_t gb = vsri_n_u8(g1, b, 3); /* shift b and insert g */ \ - const uint8x8x2_t rgb565 = ZIP_U8(rg, gb); \ - vst1q_u8(out, vcombine_u8(rgb565.val[0], rgb565.val[1])); \ -} while (0) +#define STORE_Rgb565(out, r, g, b) \ + do { \ + const uint8x8_t rg = vsri_n_u8(r, g, 5); /* shift g and insert r */ \ + const uint8x8_t g1 = vshl_n_u8(g, 3); /* pre-shift g: 3bits */ \ + const uint8x8_t gb = vsri_n_u8(g1, b, 3); /* shift b and insert g */ \ + const uint8x8x2_t rgb565 = ZIP_U8(rg, gb); \ + vst1q_u8(out, vcombine_u8(rgb565.val[0], rgb565.val[1])); \ + } while (0) -#define CONVERT8(FMT, XSTEP, N, src_y, src_uv, out, cur_x) do { \ - int i; \ - for (i = 0; i < N; i += 8) { \ - const int off = ((cur_x) + i) * XSTEP; \ - const uint8x8_t y = vld1_u8((src_y) + (cur_x) + i); \ - const uint8x8_t u = vld1_u8((src_uv) + i + 0); \ - const uint8x8_t v = vld1_u8((src_uv) + i + 16); \ - const int16x8_t Y0 = vreinterpretq_s16_u16(vshll_n_u8(y, 7)); \ - const int16x8_t U0 = vreinterpretq_s16_u16(vshll_n_u8(u, 7)); \ - const int16x8_t V0 = vreinterpretq_s16_u16(vshll_n_u8(v, 7)); \ - const int16x8_t Y1 = vqdmulhq_lane_s16(Y0, coeff1, 0); \ - const int16x8_t R0 = vqdmulhq_lane_s16(V0, coeff1, 1); \ - const int16x8_t G0 = vqdmulhq_lane_s16(U0, coeff1, 2); \ - const int16x8_t G1 = vqdmulhq_lane_s16(V0, coeff1, 3); \ - const int16x8_t B0 = vqdmulhq_n_s16(U0, 282); \ - const int16x8_t R1 = vqaddq_s16(Y1, R_Rounder); \ - const int16x8_t G2 = vqaddq_s16(Y1, G_Rounder); \ - const int16x8_t B1 = vqaddq_s16(Y1, B_Rounder); \ - const int16x8_t R2 = vqaddq_s16(R0, R1); \ - const int16x8_t G3 = vqaddq_s16(G0, G1); \ - const int16x8_t B2 = vqaddq_s16(B0, B1); \ - const int16x8_t G4 = vqsubq_s16(G2, G3); \ - const int16x8_t B3 = vqaddq_s16(B2, U0); \ - const uint8x8_t R = vqshrun_n_s16(R2, YUV_FIX2); \ - const uint8x8_t G = vqshrun_n_s16(G4, YUV_FIX2); \ - const uint8x8_t B = vqshrun_n_s16(B3, YUV_FIX2); \ - STORE_ ## FMT(out + off, R, G, B); \ - } \ -} while (0) +#define CONVERT8(FMT, XSTEP, N, src_y, src_uv, out, cur_x) \ + do { \ + int i; \ + for (i = 0; i < N; i += 8) { \ + const int off = ((cur_x) + i) * XSTEP; \ + const uint8x8_t y = vld1_u8((src_y) + (cur_x) + i); \ + const uint8x8_t u = vld1_u8((src_uv) + i + 0); \ + const uint8x8_t v = vld1_u8((src_uv) + i + 16); \ + const int16x8_t Y0 = vreinterpretq_s16_u16(vshll_n_u8(y, 7)); \ + const int16x8_t U0 = vreinterpretq_s16_u16(vshll_n_u8(u, 7)); \ + const int16x8_t V0 = vreinterpretq_s16_u16(vshll_n_u8(v, 7)); \ + const int16x8_t Y1 = vqdmulhq_lane_s16(Y0, coeff1, 0); \ + const int16x8_t R0 = vqdmulhq_lane_s16(V0, coeff1, 1); \ + const int16x8_t G0 = vqdmulhq_lane_s16(U0, coeff1, 2); \ + const int16x8_t G1 = vqdmulhq_lane_s16(V0, coeff1, 3); \ + const int16x8_t B0 = vqdmulhq_n_s16(U0, 282); \ + const int16x8_t R1 = vqaddq_s16(Y1, R_Rounder); \ + const int16x8_t G2 = vqaddq_s16(Y1, G_Rounder); \ + const int16x8_t B1 = vqaddq_s16(Y1, B_Rounder); \ + const int16x8_t R2 = vqaddq_s16(R0, R1); \ + const int16x8_t G3 = vqaddq_s16(G0, G1); \ + const int16x8_t B2 = vqaddq_s16(B0, B1); \ + const int16x8_t G4 = vqsubq_s16(G2, G3); \ + const int16x8_t B3 = vqaddq_s16(B2, U0); \ + const uint8x8_t R = vqshrun_n_s16(R2, YUV_FIX2); \ + const uint8x8_t G = vqshrun_n_s16(G4, YUV_FIX2); \ + const uint8x8_t B = vqshrun_n_s16(B3, YUV_FIX2); \ + STORE_##FMT(out + off, R, G, B); \ + } \ + } while (0) -#define CONVERT1(FUNC, XSTEP, N, src_y, src_uv, rgb, cur_x) { \ - int i; \ - for (i = 0; i < N; i++) { \ - const int off = ((cur_x) + i) * XSTEP; \ - const int y = src_y[(cur_x) + i]; \ - const int u = (src_uv)[i]; \ - const int v = (src_uv)[i + 16]; \ - FUNC(y, u, v, rgb + off); \ - } \ -} +#define CONVERT1(FUNC, XSTEP, N, src_y, src_uv, rgb, cur_x) \ + { \ + int i; \ + for (i = 0; i < N; i++) { \ + const int off = ((cur_x) + i) * XSTEP; \ + const int y = src_y[(cur_x) + i]; \ + const int u = (src_uv)[i]; \ + const int v = (src_uv)[i + 16]; \ + FUNC(y, u, v, rgb + off); \ + } \ + } -#define CONVERT2RGB_8(FMT, XSTEP, top_y, bottom_y, uv, \ - top_dst, bottom_dst, cur_x, len) { \ - CONVERT8(FMT, XSTEP, len, top_y, uv, top_dst, cur_x); \ - if (bottom_y != NULL) { \ - CONVERT8(FMT, XSTEP, len, bottom_y, (uv) + 32, bottom_dst, cur_x); \ - } \ -} +#define CONVERT2RGB_8(FMT, XSTEP, top_y, bottom_y, uv, top_dst, bottom_dst, \ + cur_x, len) \ + { \ + CONVERT8(FMT, XSTEP, len, top_y, uv, top_dst, cur_x); \ + if (bottom_y != NULL) { \ + CONVERT8(FMT, XSTEP, len, bottom_y, (uv) + 32, bottom_dst, cur_x); \ + } \ + } -#define CONVERT2RGB_1(FUNC, XSTEP, top_y, bottom_y, uv, \ - top_dst, bottom_dst, cur_x, len) { \ - CONVERT1(FUNC, XSTEP, len, top_y, uv, top_dst, cur_x); \ - if (bottom_y != NULL) { \ - CONVERT1(FUNC, XSTEP, len, bottom_y, (uv) + 32, bottom_dst, cur_x); \ - } \ -} +#define CONVERT2RGB_1(FUNC, XSTEP, top_y, bottom_y, uv, top_dst, bottom_dst, \ + cur_x, len) \ + { \ + CONVERT1(FUNC, XSTEP, len, top_y, uv, top_dst, cur_x); \ + if (bottom_y != NULL) { \ + CONVERT1(FUNC, XSTEP, len, bottom_y, (uv) + 32, bottom_dst, cur_x); \ + } \ + } -#define NEON_UPSAMPLE_FUNC(FUNC_NAME, FMT, XSTEP) \ -static void FUNC_NAME(const uint8_t* WEBP_RESTRICT top_y, \ - const uint8_t* WEBP_RESTRICT bottom_y, \ - const uint8_t* WEBP_RESTRICT top_u, \ - const uint8_t* WEBP_RESTRICT top_v, \ - const uint8_t* WEBP_RESTRICT cur_u, \ - const uint8_t* WEBP_RESTRICT cur_v, \ - uint8_t* WEBP_RESTRICT top_dst, \ - uint8_t* WEBP_RESTRICT bottom_dst, int len) { \ - int block; \ - /* 16 byte aligned array to cache reconstructed u and v */ \ - uint8_t uv_buf[2 * 32 + 15]; \ - uint8_t* const r_uv = (uint8_t*)((uintptr_t)(uv_buf + 15) & ~(uintptr_t)15); \ - const int uv_len = (len + 1) >> 1; \ - /* 9 pixels must be read-able for each block */ \ - const int num_blocks = (uv_len - 1) >> 3; \ - const int leftover = uv_len - num_blocks * 8; \ - const int last_pos = 1 + 16 * num_blocks; \ - \ - const int u_diag = ((top_u[0] + cur_u[0]) >> 1) + 1; \ - const int v_diag = ((top_v[0] + cur_v[0]) >> 1) + 1; \ - \ - const int16x4_t coeff1 = vld1_s16(kCoeffs1); \ - const int16x8_t R_Rounder = vdupq_n_s16(-14234); \ - const int16x8_t G_Rounder = vdupq_n_s16(8708); \ - const int16x8_t B_Rounder = vdupq_n_s16(-17685); \ - \ - /* Treat the first pixel in regular way */ \ - assert(top_y != NULL); \ - { \ - const int u0 = (top_u[0] + u_diag) >> 1; \ - const int v0 = (top_v[0] + v_diag) >> 1; \ - VP8YuvTo ## FMT(top_y[0], u0, v0, top_dst); \ - } \ - if (bottom_y != NULL) { \ - const int u0 = (cur_u[0] + u_diag) >> 1; \ - const int v0 = (cur_v[0] + v_diag) >> 1; \ - VP8YuvTo ## FMT(bottom_y[0], u0, v0, bottom_dst); \ - } \ - \ - for (block = 0; block < num_blocks; ++block) { \ - UPSAMPLE_16PIXELS(top_u, cur_u, r_uv); \ - UPSAMPLE_16PIXELS(top_v, cur_v, r_uv + 16); \ - CONVERT2RGB_8(FMT, XSTEP, top_y, bottom_y, r_uv, \ - top_dst, bottom_dst, 16 * block + 1, 16); \ - top_u += 8; \ - cur_u += 8; \ - top_v += 8; \ - cur_v += 8; \ - } \ - \ - UPSAMPLE_LAST_BLOCK(top_u, cur_u, leftover, r_uv); \ - UPSAMPLE_LAST_BLOCK(top_v, cur_v, leftover, r_uv + 16); \ - CONVERT2RGB_1(VP8YuvTo ## FMT, XSTEP, top_y, bottom_y, r_uv, \ - top_dst, bottom_dst, last_pos, len - last_pos); \ -} +#define NEON_UPSAMPLE_FUNC(FUNC_NAME, FMT, XSTEP) \ + static void FUNC_NAME( \ + const uint8_t* WEBP_RESTRICT top_y, \ + const uint8_t* WEBP_RESTRICT bottom_y, \ + const uint8_t* WEBP_RESTRICT top_u, const uint8_t* WEBP_RESTRICT top_v, \ + const uint8_t* WEBP_RESTRICT cur_u, const uint8_t* WEBP_RESTRICT cur_v, \ + uint8_t* WEBP_RESTRICT top_dst, uint8_t* WEBP_RESTRICT bottom_dst, \ + int len) { \ + int block; \ + /* 16 byte aligned array to cache reconstructed u and v */ \ + uint8_t uv_buf[2 * 32 + 15]; \ + uint8_t* const r_uv = \ + (uint8_t*)((uintptr_t)(uv_buf + 15) & ~(uintptr_t)15); \ + const int uv_len = (len + 1) >> 1; \ + /* 9 pixels must be read-able for each block */ \ + const int num_blocks = (uv_len - 1) >> 3; \ + const int leftover = uv_len - num_blocks * 8; \ + const int last_pos = 1 + 16 * num_blocks; \ + \ + const int u_diag = ((top_u[0] + cur_u[0]) >> 1) + 1; \ + const int v_diag = ((top_v[0] + cur_v[0]) >> 1) + 1; \ + \ + const int16x4_t coeff1 = vld1_s16(kCoeffs1); \ + const int16x8_t R_Rounder = vdupq_n_s16(-14234); \ + const int16x8_t G_Rounder = vdupq_n_s16(8708); \ + const int16x8_t B_Rounder = vdupq_n_s16(-17685); \ + \ + /* Treat the first pixel in regular way */ \ + assert(top_y != NULL); \ + { \ + const int u0 = (top_u[0] + u_diag) >> 1; \ + const int v0 = (top_v[0] + v_diag) >> 1; \ + VP8YuvTo##FMT(top_y[0], u0, v0, top_dst); \ + } \ + if (bottom_y != NULL) { \ + const int u0 = (cur_u[0] + u_diag) >> 1; \ + const int v0 = (cur_v[0] + v_diag) >> 1; \ + VP8YuvTo##FMT(bottom_y[0], u0, v0, bottom_dst); \ + } \ + \ + for (block = 0; block < num_blocks; ++block) { \ + UPSAMPLE_16PIXELS(top_u, cur_u, r_uv); \ + UPSAMPLE_16PIXELS(top_v, cur_v, r_uv + 16); \ + CONVERT2RGB_8(FMT, XSTEP, top_y, bottom_y, r_uv, top_dst, bottom_dst, \ + 16 * block + 1, 16); \ + top_u += 8; \ + cur_u += 8; \ + top_v += 8; \ + cur_v += 8; \ + } \ + \ + UPSAMPLE_LAST_BLOCK(top_u, cur_u, leftover, r_uv); \ + UPSAMPLE_LAST_BLOCK(top_v, cur_v, leftover, r_uv + 16); \ + CONVERT2RGB_1(VP8YuvTo##FMT, XSTEP, top_y, bottom_y, r_uv, top_dst, \ + bottom_dst, last_pos, len - last_pos); \ + } // NEON variants of the fancy upsampler. NEON_UPSAMPLE_FUNC(UpsampleRgbaLinePair_NEON, Rgba, 4) NEON_UPSAMPLE_FUNC(UpsampleBgraLinePair_NEON, Bgra, 4) #if !defined(WEBP_REDUCE_CSP) -NEON_UPSAMPLE_FUNC(UpsampleRgbLinePair_NEON, Rgb, 3) -NEON_UPSAMPLE_FUNC(UpsampleBgrLinePair_NEON, Bgr, 3) +NEON_UPSAMPLE_FUNC(UpsampleRgbLinePair_NEON, Rgb, 3) +NEON_UPSAMPLE_FUNC(UpsampleBgrLinePair_NEON, Bgr, 3) NEON_UPSAMPLE_FUNC(UpsampleArgbLinePair_NEON, Argb, 4) NEON_UPSAMPLE_FUNC(UpsampleRgba4444LinePair_NEON, Rgba4444, 2) NEON_UPSAMPLE_FUNC(UpsampleRgb565LinePair_NEON, Rgb565, 2) -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP //------------------------------------------------------------------------------ // Entry point @@ -271,14 +285,14 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplersNEON(void) { WebPUpsamplers[MODE_rgbA] = UpsampleRgbaLinePair_NEON; WebPUpsamplers[MODE_bgrA] = UpsampleBgraLinePair_NEON; #if !defined(WEBP_REDUCE_CSP) - WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair_NEON; - WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePair_NEON; + WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair_NEON; + WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePair_NEON; WebPUpsamplers[MODE_ARGB] = UpsampleArgbLinePair_NEON; WebPUpsamplers[MODE_Argb] = UpsampleArgbLinePair_NEON; WebPUpsamplers[MODE_RGB_565] = UpsampleRgb565LinePair_NEON; WebPUpsamplers[MODE_RGBA_4444] = UpsampleRgba4444LinePair_NEON; WebPUpsamplers[MODE_rgbA_4444] = UpsampleRgba4444LinePair_NEON; -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP } #endif // FANCY_UPSAMPLING diff --git a/src/dsp/upsampling_sse2.c b/src/dsp/upsampling_sse2.c index 0eecb11c..ddd82258 100644 --- a/src/dsp/upsampling_sse2.c +++ b/src/dsp/upsampling_sse2.c @@ -14,15 +14,14 @@ #include "src/dsp/dsp.h" #if defined(WEBP_USE_SSE2) -#include - #include +#include #include -#include "src/webp/types.h" #include "src/dsp/cpu.h" #include "src/dsp/yuv.h" #include "src/webp/decode.h" +#include "src/webp/types.h" #ifdef FANCY_UPSAMPLING @@ -42,54 +41,60 @@ // m = (k + t + 1) / 2 - (((b^c) & (s^t)) | (k^t)) & 1 // Computes out = (k + in + 1) / 2 - ((ij & (s^t)) | (k^in)) & 1 -#define GET_M(ij, in, out) do { \ - const __m128i tmp0 = _mm_avg_epu8(k, (in)); /* (k + in + 1) / 2 */ \ - const __m128i tmp1 = _mm_and_si128((ij), st); /* (ij) & (s^t) */ \ - const __m128i tmp2 = _mm_xor_si128(k, (in)); /* (k^in) */ \ - const __m128i tmp3 = _mm_or_si128(tmp1, tmp2); /* ((ij) & (s^t)) | (k^in) */\ - const __m128i tmp4 = _mm_and_si128(tmp3, one); /* & 1 -> lsb_correction */ \ - (out) = _mm_sub_epi8(tmp0, tmp4); /* (k + in + 1) / 2 - lsb_correction */ \ -} while (0) +#define GET_M(ij, in, out) \ + do { \ + const __m128i tmp0 = _mm_avg_epu8(k, (in)); /* (k + in + 1) / 2 */ \ + const __m128i tmp1 = _mm_and_si128((ij), st); /* (ij) & (s^t) */ \ + const __m128i tmp2 = _mm_xor_si128(k, (in)); /* (k^in) */ \ + const __m128i tmp3 = \ + _mm_or_si128(tmp1, tmp2); /* ((ij) & (s^t)) | (k^in) */ \ + const __m128i tmp4 = _mm_and_si128(tmp3, one); /* & 1 -> lsb_correction */ \ + (out) = _mm_sub_epi8(tmp0, tmp4); /* (k + in + 1) / 2 - lsb_correction */ \ + } while (0) // pack and store two alternating pixel rows -#define PACK_AND_STORE(a, b, da, db, out) do { \ - const __m128i t_a = _mm_avg_epu8(a, da); /* (9a + 3b + 3c + d + 8) / 16 */ \ - const __m128i t_b = _mm_avg_epu8(b, db); /* (3a + 9b + c + 3d + 8) / 16 */ \ - const __m128i t_1 = _mm_unpacklo_epi8(t_a, t_b); \ - const __m128i t_2 = _mm_unpackhi_epi8(t_a, t_b); \ - _mm_store_si128(((__m128i*)(out)) + 0, t_1); \ - _mm_store_si128(((__m128i*)(out)) + 1, t_2); \ -} while (0) +#define PACK_AND_STORE(a, b, da, db, out) \ + do { \ + const __m128i t_a = \ + _mm_avg_epu8(a, da); /* (9a + 3b + 3c + d + 8) / 16 */ \ + const __m128i t_b = \ + _mm_avg_epu8(b, db); /* (3a + 9b + c + 3d + 8) / 16 */ \ + const __m128i t_1 = _mm_unpacklo_epi8(t_a, t_b); \ + const __m128i t_2 = _mm_unpackhi_epi8(t_a, t_b); \ + _mm_store_si128(((__m128i*)(out)) + 0, t_1); \ + _mm_store_si128(((__m128i*)(out)) + 1, t_2); \ + } while (0) // Loads 17 pixels each from rows r1 and r2 and generates 32 pixels. -#define UPSAMPLE_32PIXELS(r1, r2, out) do { \ - const __m128i one = _mm_set1_epi8(1); \ - const __m128i a = _mm_loadu_si128((const __m128i*)&(r1)[0]); \ - const __m128i b = _mm_loadu_si128((const __m128i*)&(r1)[1]); \ - const __m128i c = _mm_loadu_si128((const __m128i*)&(r2)[0]); \ - const __m128i d = _mm_loadu_si128((const __m128i*)&(r2)[1]); \ +#define UPSAMPLE_32PIXELS(r1, r2, out) \ + do { \ + const __m128i one = _mm_set1_epi8(1); \ + const __m128i a = _mm_loadu_si128((const __m128i*)&(r1)[0]); \ + const __m128i b = _mm_loadu_si128((const __m128i*)&(r1)[1]); \ + const __m128i c = _mm_loadu_si128((const __m128i*)&(r2)[0]); \ + const __m128i d = _mm_loadu_si128((const __m128i*)&(r2)[1]); \ \ - const __m128i s = _mm_avg_epu8(a, d); /* s = (a + d + 1) / 2 */ \ - const __m128i t = _mm_avg_epu8(b, c); /* t = (b + c + 1) / 2 */ \ - const __m128i st = _mm_xor_si128(s, t); /* st = s^t */ \ + const __m128i s = _mm_avg_epu8(a, d); /* s = (a + d + 1) / 2 */ \ + const __m128i t = _mm_avg_epu8(b, c); /* t = (b + c + 1) / 2 */ \ + const __m128i st = _mm_xor_si128(s, t); /* st = s^t */ \ \ - const __m128i ad = _mm_xor_si128(a, d); /* ad = a^d */ \ - const __m128i bc = _mm_xor_si128(b, c); /* bc = b^c */ \ + const __m128i ad = _mm_xor_si128(a, d); /* ad = a^d */ \ + const __m128i bc = _mm_xor_si128(b, c); /* bc = b^c */ \ \ - const __m128i t1 = _mm_or_si128(ad, bc); /* (a^d) | (b^c) */ \ - const __m128i t2 = _mm_or_si128(t1, st); /* (a^d) | (b^c) | (s^t) */ \ - const __m128i t3 = _mm_and_si128(t2, one); /* (a^d) | (b^c) | (s^t) & 1 */ \ - const __m128i t4 = _mm_avg_epu8(s, t); \ - const __m128i k = _mm_sub_epi8(t4, t3); /* k = (a + b + c + d) / 4 */ \ - __m128i diag1, diag2; \ + const __m128i t1 = _mm_or_si128(ad, bc); /* (a^d) | (b^c) */ \ + const __m128i t2 = _mm_or_si128(t1, st); /* (a^d) | (b^c) | (s^t) */ \ + const __m128i t3 = _mm_and_si128(t2, one); /* (a^d) | (b^c) | (s^t) & 1 */ \ + const __m128i t4 = _mm_avg_epu8(s, t); \ + const __m128i k = _mm_sub_epi8(t4, t3); /* k = (a + b + c + d) / 4 */ \ + __m128i diag1, diag2; \ \ - GET_M(bc, t, diag1); /* diag1 = (a + 3b + 3c + d) / 8 */ \ - GET_M(ad, s, diag2); /* diag2 = (3a + b + c + 3d) / 8 */ \ + GET_M(bc, t, diag1); /* diag1 = (a + 3b + 3c + d) / 8 */ \ + GET_M(ad, s, diag2); /* diag2 = (3a + b + c + 3d) / 8 */ \ \ - /* pack the alternate pixels */ \ - PACK_AND_STORE(a, b, diag1, diag2, (out) + 0); /* store top */ \ - PACK_AND_STORE(c, d, diag2, diag1, (out) + 2 * 32); /* store bottom */ \ -} while (0) + /* pack the alternate pixels */ \ + PACK_AND_STORE(a, b, diag1, diag2, (out) + 0); /* store top */ \ + PACK_AND_STORE(c, d, diag2, diag1, (out) + 2 * 32); /* store bottom */ \ + } while (0) // Turn the macro into a function for reducing code-size when non-critical static void Upsample32Pixels_SSE2(const uint8_t* WEBP_RESTRICT const r1, @@ -98,92 +103,95 @@ static void Upsample32Pixels_SSE2(const uint8_t* WEBP_RESTRICT const r1, UPSAMPLE_32PIXELS(r1, r2, out); } -#define UPSAMPLE_LAST_BLOCK(tb, bb, num_pixels, out) { \ - uint8_t r1[17], r2[17]; \ - memcpy(r1, (tb), (num_pixels)); \ - memcpy(r2, (bb), (num_pixels)); \ - /* replicate last byte */ \ - memset(r1 + (num_pixels), r1[(num_pixels) - 1], 17 - (num_pixels)); \ - memset(r2 + (num_pixels), r2[(num_pixels) - 1], 17 - (num_pixels)); \ - /* using the shared function instead of the macro saves ~3k code size */ \ - Upsample32Pixels_SSE2(r1, r2, out); \ -} +#define UPSAMPLE_LAST_BLOCK(tb, bb, num_pixels, out) \ + { \ + uint8_t r1[17], r2[17]; \ + memcpy(r1, (tb), (num_pixels)); \ + memcpy(r2, (bb), (num_pixels)); \ + /* replicate last byte */ \ + memset(r1 + (num_pixels), r1[(num_pixels) - 1], 17 - (num_pixels)); \ + memset(r2 + (num_pixels), r2[(num_pixels) - 1], 17 - (num_pixels)); \ + /* using the shared function instead of the macro saves ~3k code size */ \ + Upsample32Pixels_SSE2(r1, r2, out); \ + } -#define CONVERT2RGB_32(FUNC, XSTEP, top_y, bottom_y, \ - top_dst, bottom_dst, cur_x) do { \ - FUNC##32_SSE2((top_y) + (cur_x), r_u, r_v, (top_dst) + (cur_x) * (XSTEP)); \ - if ((bottom_y) != NULL) { \ - FUNC##32_SSE2((bottom_y) + (cur_x), r_u + 64, r_v + 64, \ - (bottom_dst) + (cur_x) * (XSTEP)); \ - } \ -} while (0) +#define CONVERT2RGB_32(FUNC, XSTEP, top_y, bottom_y, top_dst, bottom_dst, \ + cur_x) \ + do { \ + FUNC##32_SSE2((top_y) + (cur_x), r_u, r_v, (top_dst) + (cur_x) * (XSTEP)); \ + if ((bottom_y) != NULL) { \ + FUNC##32_SSE2((bottom_y) + (cur_x), r_u + 64, r_v + 64, \ + (bottom_dst) + (cur_x) * (XSTEP)); \ + } \ + } while (0) -#define SSE2_UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP) \ -static void FUNC_NAME(const uint8_t* WEBP_RESTRICT top_y, \ - const uint8_t* WEBP_RESTRICT bottom_y, \ - const uint8_t* WEBP_RESTRICT top_u, \ - const uint8_t* WEBP_RESTRICT top_v, \ - const uint8_t* WEBP_RESTRICT cur_u, \ - const uint8_t* WEBP_RESTRICT cur_v, \ - uint8_t* WEBP_RESTRICT top_dst, \ - uint8_t* WEBP_RESTRICT bottom_dst, int len) { \ - int uv_pos, pos; \ - /* 16byte-aligned array to cache reconstructed u and v */ \ - uint8_t uv_buf[14 * 32 + 15] = { 0 }; \ - uint8_t* const r_u = (uint8_t*)((uintptr_t)(uv_buf + 15) & ~(uintptr_t)15); \ - uint8_t* const r_v = r_u + 32; \ - \ - assert(top_y != NULL); \ - { /* Treat the first pixel in regular way */ \ - const int u_diag = ((top_u[0] + cur_u[0]) >> 1) + 1; \ - const int v_diag = ((top_v[0] + cur_v[0]) >> 1) + 1; \ - const int u0_t = (top_u[0] + u_diag) >> 1; \ - const int v0_t = (top_v[0] + v_diag) >> 1; \ - FUNC(top_y[0], u0_t, v0_t, top_dst); \ - if (bottom_y != NULL) { \ - const int u0_b = (cur_u[0] + u_diag) >> 1; \ - const int v0_b = (cur_v[0] + v_diag) >> 1; \ - FUNC(bottom_y[0], u0_b, v0_b, bottom_dst); \ - } \ - } \ - /* For UPSAMPLE_32PIXELS, 17 u/v values must be read-able for each block */ \ - for (pos = 1, uv_pos = 0; pos + 32 + 1 <= len; pos += 32, uv_pos += 16) { \ - UPSAMPLE_32PIXELS(top_u + uv_pos, cur_u + uv_pos, r_u); \ - UPSAMPLE_32PIXELS(top_v + uv_pos, cur_v + uv_pos, r_v); \ - CONVERT2RGB_32(FUNC, XSTEP, top_y, bottom_y, top_dst, bottom_dst, pos); \ - } \ - if (len > 1) { \ - const int left_over = ((len + 1) >> 1) - (pos >> 1); \ - uint8_t* const tmp_top_dst = r_u + 4 * 32; \ - uint8_t* const tmp_bottom_dst = tmp_top_dst + 4 * 32; \ - uint8_t* const tmp_top = tmp_bottom_dst + 4 * 32; \ - uint8_t* const tmp_bottom = (bottom_y == NULL) ? NULL : tmp_top + 32; \ - assert(left_over > 0); \ - UPSAMPLE_LAST_BLOCK(top_u + uv_pos, cur_u + uv_pos, left_over, r_u); \ - UPSAMPLE_LAST_BLOCK(top_v + uv_pos, cur_v + uv_pos, left_over, r_v); \ - memcpy(tmp_top, top_y + pos, len - pos); \ - if (bottom_y != NULL) memcpy(tmp_bottom, bottom_y + pos, len - pos); \ - CONVERT2RGB_32(FUNC, XSTEP, tmp_top, tmp_bottom, tmp_top_dst, \ - tmp_bottom_dst, 0); \ - memcpy(top_dst + pos * (XSTEP), tmp_top_dst, (len - pos) * (XSTEP)); \ - if (bottom_y != NULL) { \ - memcpy(bottom_dst + pos * (XSTEP), tmp_bottom_dst, \ - (len - pos) * (XSTEP)); \ - } \ - } \ -} +#define SSE2_UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP) \ + static void FUNC_NAME( \ + const uint8_t* WEBP_RESTRICT top_y, \ + const uint8_t* WEBP_RESTRICT bottom_y, \ + const uint8_t* WEBP_RESTRICT top_u, const uint8_t* WEBP_RESTRICT top_v, \ + const uint8_t* WEBP_RESTRICT cur_u, const uint8_t* WEBP_RESTRICT cur_v, \ + uint8_t* WEBP_RESTRICT top_dst, uint8_t* WEBP_RESTRICT bottom_dst, \ + int len) { \ + int uv_pos, pos; \ + /* 16byte-aligned array to cache reconstructed u and v */ \ + uint8_t uv_buf[14 * 32 + 15] = {0}; \ + uint8_t* const r_u = \ + (uint8_t*)((uintptr_t)(uv_buf + 15) & ~(uintptr_t)15); \ + uint8_t* const r_v = r_u + 32; \ + \ + assert(top_y != NULL); \ + { /* Treat the first pixel in regular way */ \ + const int u_diag = ((top_u[0] + cur_u[0]) >> 1) + 1; \ + const int v_diag = ((top_v[0] + cur_v[0]) >> 1) + 1; \ + const int u0_t = (top_u[0] + u_diag) >> 1; \ + const int v0_t = (top_v[0] + v_diag) >> 1; \ + FUNC(top_y[0], u0_t, v0_t, top_dst); \ + if (bottom_y != NULL) { \ + const int u0_b = (cur_u[0] + u_diag) >> 1; \ + const int v0_b = (cur_v[0] + v_diag) >> 1; \ + FUNC(bottom_y[0], u0_b, v0_b, bottom_dst); \ + } \ + } \ + /* For UPSAMPLE_32PIXELS, 17 u/v values must be read-able for each block \ + */ \ + for (pos = 1, uv_pos = 0; pos + 32 + 1 <= len; pos += 32, uv_pos += 16) { \ + UPSAMPLE_32PIXELS(top_u + uv_pos, cur_u + uv_pos, r_u); \ + UPSAMPLE_32PIXELS(top_v + uv_pos, cur_v + uv_pos, r_v); \ + CONVERT2RGB_32(FUNC, XSTEP, top_y, bottom_y, top_dst, bottom_dst, pos); \ + } \ + if (len > 1) { \ + const int left_over = ((len + 1) >> 1) - (pos >> 1); \ + uint8_t* const tmp_top_dst = r_u + 4 * 32; \ + uint8_t* const tmp_bottom_dst = tmp_top_dst + 4 * 32; \ + uint8_t* const tmp_top = tmp_bottom_dst + 4 * 32; \ + uint8_t* const tmp_bottom = (bottom_y == NULL) ? NULL : tmp_top + 32; \ + assert(left_over > 0); \ + UPSAMPLE_LAST_BLOCK(top_u + uv_pos, cur_u + uv_pos, left_over, r_u); \ + UPSAMPLE_LAST_BLOCK(top_v + uv_pos, cur_v + uv_pos, left_over, r_v); \ + memcpy(tmp_top, top_y + pos, len - pos); \ + if (bottom_y != NULL) memcpy(tmp_bottom, bottom_y + pos, len - pos); \ + CONVERT2RGB_32(FUNC, XSTEP, tmp_top, tmp_bottom, tmp_top_dst, \ + tmp_bottom_dst, 0); \ + memcpy(top_dst + pos * (XSTEP), tmp_top_dst, (len - pos) * (XSTEP)); \ + if (bottom_y != NULL) { \ + memcpy(bottom_dst + pos * (XSTEP), tmp_bottom_dst, \ + (len - pos) * (XSTEP)); \ + } \ + } \ + } // SSE2 variants of the fancy upsampler. SSE2_UPSAMPLE_FUNC(UpsampleRgbaLinePair_SSE2, VP8YuvToRgba, 4) SSE2_UPSAMPLE_FUNC(UpsampleBgraLinePair_SSE2, VP8YuvToBgra, 4) #if !defined(WEBP_REDUCE_CSP) -SSE2_UPSAMPLE_FUNC(UpsampleRgbLinePair_SSE2, VP8YuvToRgb, 3) -SSE2_UPSAMPLE_FUNC(UpsampleBgrLinePair_SSE2, VP8YuvToBgr, 3) +SSE2_UPSAMPLE_FUNC(UpsampleRgbLinePair_SSE2, VP8YuvToRgb, 3) +SSE2_UPSAMPLE_FUNC(UpsampleBgrLinePair_SSE2, VP8YuvToBgr, 3) SSE2_UPSAMPLE_FUNC(UpsampleArgbLinePair_SSE2, VP8YuvToArgb, 4) SSE2_UPSAMPLE_FUNC(UpsampleRgba4444LinePair_SSE2, VP8YuvToRgba4444, 2) SSE2_UPSAMPLE_FUNC(UpsampleRgb565LinePair_SSE2, VP8YuvToRgb565, 2) -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP #undef GET_M #undef PACK_AND_STORE @@ -206,14 +214,14 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplersSSE2(void) { WebPUpsamplers[MODE_rgbA] = UpsampleRgbaLinePair_SSE2; WebPUpsamplers[MODE_bgrA] = UpsampleBgraLinePair_SSE2; #if !defined(WEBP_REDUCE_CSP) - WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair_SSE2; - WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePair_SSE2; + WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair_SSE2; + WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePair_SSE2; WebPUpsamplers[MODE_ARGB] = UpsampleArgbLinePair_SSE2; WebPUpsamplers[MODE_Argb] = UpsampleArgbLinePair_SSE2; WebPUpsamplers[MODE_RGB_565] = UpsampleRgb565LinePair_SSE2; WebPUpsamplers[MODE_RGBA_4444] = UpsampleRgba4444LinePair_SSE2; WebPUpsamplers[MODE_rgbA_4444] = UpsampleRgba4444LinePair_SSE2; -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP } #endif // FANCY_UPSAMPLING @@ -223,24 +231,22 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplersSSE2(void) { extern WebPYUV444Converter WebPYUV444Converters[/* MODE_LAST */]; extern void WebPInitYUV444ConvertersSSE2(void); -#define YUV444_FUNC(FUNC_NAME, CALL, CALL_C, XSTEP) \ -extern void CALL_C(const uint8_t* WEBP_RESTRICT y, \ - const uint8_t* WEBP_RESTRICT u, \ - const uint8_t* WEBP_RESTRICT v, \ - uint8_t* WEBP_RESTRICT dst, int len); \ -static void FUNC_NAME(const uint8_t* WEBP_RESTRICT y, \ - const uint8_t* WEBP_RESTRICT u, \ - const uint8_t* WEBP_RESTRICT v, \ - uint8_t* WEBP_RESTRICT dst, int len) { \ - int i; \ - const int max_len = len & ~31; \ - for (i = 0; i < max_len; i += 32) { \ - CALL(y + i, u + i, v + i, dst + i * (XSTEP)); \ - } \ - if (i < len) { /* C-fallback */ \ - CALL_C(y + i, u + i, v + i, dst + i * (XSTEP), len - i); \ - } \ -} +#define YUV444_FUNC(FUNC_NAME, CALL, CALL_C, XSTEP) \ + extern void CALL_C( \ + const uint8_t* WEBP_RESTRICT y, const uint8_t* WEBP_RESTRICT u, \ + const uint8_t* WEBP_RESTRICT v, uint8_t* WEBP_RESTRICT dst, int len); \ + static void FUNC_NAME( \ + const uint8_t* WEBP_RESTRICT y, const uint8_t* WEBP_RESTRICT u, \ + const uint8_t* WEBP_RESTRICT v, uint8_t* WEBP_RESTRICT dst, int len) { \ + int i; \ + const int max_len = len & ~31; \ + for (i = 0; i < max_len; i += 32) { \ + CALL(y + i, u + i, v + i, dst + i * (XSTEP)); \ + } \ + if (i < len) { /* C-fallback */ \ + CALL_C(y + i, u + i, v + i, dst + i * (XSTEP), len - i); \ + } \ + } YUV444_FUNC(Yuv444ToRgba_SSE2, VP8YuvToRgba32_SSE2, WebPYuv444ToRgba_C, 4) YUV444_FUNC(Yuv444ToBgra_SSE2, VP8YuvToBgra32_SSE2, WebPYuv444ToBgra_C, 4) @@ -248,25 +254,25 @@ YUV444_FUNC(Yuv444ToBgra_SSE2, VP8YuvToBgra32_SSE2, WebPYuv444ToBgra_C, 4) YUV444_FUNC(Yuv444ToRgb_SSE2, VP8YuvToRgb32_SSE2, WebPYuv444ToRgb_C, 3) YUV444_FUNC(Yuv444ToBgr_SSE2, VP8YuvToBgr32_SSE2, WebPYuv444ToBgr_C, 3) YUV444_FUNC(Yuv444ToArgb_SSE2, VP8YuvToArgb32_SSE2, WebPYuv444ToArgb_C, 4) -YUV444_FUNC(Yuv444ToRgba4444_SSE2, VP8YuvToRgba444432_SSE2, \ +YUV444_FUNC(Yuv444ToRgba4444_SSE2, VP8YuvToRgba444432_SSE2, WebPYuv444ToRgba4444_C, 2) YUV444_FUNC(Yuv444ToRgb565_SSE2, VP8YuvToRgb56532_SSE2, WebPYuv444ToRgb565_C, 2) -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP WEBP_TSAN_IGNORE_FUNCTION void WebPInitYUV444ConvertersSSE2(void) { - WebPYUV444Converters[MODE_RGBA] = Yuv444ToRgba_SSE2; - WebPYUV444Converters[MODE_BGRA] = Yuv444ToBgra_SSE2; - WebPYUV444Converters[MODE_rgbA] = Yuv444ToRgba_SSE2; - WebPYUV444Converters[MODE_bgrA] = Yuv444ToBgra_SSE2; + WebPYUV444Converters[MODE_RGBA] = Yuv444ToRgba_SSE2; + WebPYUV444Converters[MODE_BGRA] = Yuv444ToBgra_SSE2; + WebPYUV444Converters[MODE_rgbA] = Yuv444ToRgba_SSE2; + WebPYUV444Converters[MODE_bgrA] = Yuv444ToBgra_SSE2; #if !defined(WEBP_REDUCE_CSP) - WebPYUV444Converters[MODE_RGB] = Yuv444ToRgb_SSE2; - WebPYUV444Converters[MODE_BGR] = Yuv444ToBgr_SSE2; - WebPYUV444Converters[MODE_ARGB] = Yuv444ToArgb_SSE2; + WebPYUV444Converters[MODE_RGB] = Yuv444ToRgb_SSE2; + WebPYUV444Converters[MODE_BGR] = Yuv444ToBgr_SSE2; + WebPYUV444Converters[MODE_ARGB] = Yuv444ToArgb_SSE2; WebPYUV444Converters[MODE_RGBA_4444] = Yuv444ToRgba4444_SSE2; - WebPYUV444Converters[MODE_RGB_565] = Yuv444ToRgb565_SSE2; - WebPYUV444Converters[MODE_Argb] = Yuv444ToArgb_SSE2; + WebPYUV444Converters[MODE_RGB_565] = Yuv444ToRgb565_SSE2; + WebPYUV444Converters[MODE_Argb] = Yuv444ToArgb_SSE2; WebPYUV444Converters[MODE_rgbA_4444] = Yuv444ToRgba4444_SSE2; -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP } #else diff --git a/src/dsp/upsampling_sse41.c b/src/dsp/upsampling_sse41.c index cac9567a..a7535f45 100644 --- a/src/dsp/upsampling_sse41.c +++ b/src/dsp/upsampling_sse41.c @@ -14,15 +14,14 @@ #include "src/dsp/dsp.h" #if defined(WEBP_USE_SSE41) -#include - #include +#include #include -#include "src/webp/types.h" #include "src/dsp/cpu.h" #include "src/dsp/yuv.h" #include "src/webp/decode.h" +#include "src/webp/types.h" #ifdef FANCY_UPSAMPLING @@ -44,54 +43,60 @@ // m = (k + t + 1) / 2 - (((b^c) & (s^t)) | (k^t)) & 1 // Computes out = (k + in + 1) / 2 - ((ij & (s^t)) | (k^in)) & 1 -#define GET_M(ij, in, out) do { \ - const __m128i tmp0 = _mm_avg_epu8(k, (in)); /* (k + in + 1) / 2 */ \ - const __m128i tmp1 = _mm_and_si128((ij), st); /* (ij) & (s^t) */ \ - const __m128i tmp2 = _mm_xor_si128(k, (in)); /* (k^in) */ \ - const __m128i tmp3 = _mm_or_si128(tmp1, tmp2); /* ((ij) & (s^t)) | (k^in) */\ - const __m128i tmp4 = _mm_and_si128(tmp3, one); /* & 1 -> lsb_correction */ \ - (out) = _mm_sub_epi8(tmp0, tmp4); /* (k + in + 1) / 2 - lsb_correction */ \ -} while (0) +#define GET_M(ij, in, out) \ + do { \ + const __m128i tmp0 = _mm_avg_epu8(k, (in)); /* (k + in + 1) / 2 */ \ + const __m128i tmp1 = _mm_and_si128((ij), st); /* (ij) & (s^t) */ \ + const __m128i tmp2 = _mm_xor_si128(k, (in)); /* (k^in) */ \ + const __m128i tmp3 = \ + _mm_or_si128(tmp1, tmp2); /* ((ij) & (s^t)) | (k^in) */ \ + const __m128i tmp4 = _mm_and_si128(tmp3, one); /* & 1 -> lsb_correction */ \ + (out) = _mm_sub_epi8(tmp0, tmp4); /* (k + in + 1) / 2 - lsb_correction */ \ + } while (0) // pack and store two alternating pixel rows -#define PACK_AND_STORE(a, b, da, db, out) do { \ - const __m128i t_a = _mm_avg_epu8(a, da); /* (9a + 3b + 3c + d + 8) / 16 */ \ - const __m128i t_b = _mm_avg_epu8(b, db); /* (3a + 9b + c + 3d + 8) / 16 */ \ - const __m128i t_1 = _mm_unpacklo_epi8(t_a, t_b); \ - const __m128i t_2 = _mm_unpackhi_epi8(t_a, t_b); \ - _mm_store_si128(((__m128i*)(out)) + 0, t_1); \ - _mm_store_si128(((__m128i*)(out)) + 1, t_2); \ -} while (0) +#define PACK_AND_STORE(a, b, da, db, out) \ + do { \ + const __m128i t_a = \ + _mm_avg_epu8(a, da); /* (9a + 3b + 3c + d + 8) / 16 */ \ + const __m128i t_b = \ + _mm_avg_epu8(b, db); /* (3a + 9b + c + 3d + 8) / 16 */ \ + const __m128i t_1 = _mm_unpacklo_epi8(t_a, t_b); \ + const __m128i t_2 = _mm_unpackhi_epi8(t_a, t_b); \ + _mm_store_si128(((__m128i*)(out)) + 0, t_1); \ + _mm_store_si128(((__m128i*)(out)) + 1, t_2); \ + } while (0) // Loads 17 pixels each from rows r1 and r2 and generates 32 pixels. -#define UPSAMPLE_32PIXELS(r1, r2, out) do { \ - const __m128i one = _mm_set1_epi8(1); \ - const __m128i a = _mm_loadu_si128((const __m128i*)&(r1)[0]); \ - const __m128i b = _mm_loadu_si128((const __m128i*)&(r1)[1]); \ - const __m128i c = _mm_loadu_si128((const __m128i*)&(r2)[0]); \ - const __m128i d = _mm_loadu_si128((const __m128i*)&(r2)[1]); \ +#define UPSAMPLE_32PIXELS(r1, r2, out) \ + do { \ + const __m128i one = _mm_set1_epi8(1); \ + const __m128i a = _mm_loadu_si128((const __m128i*)&(r1)[0]); \ + const __m128i b = _mm_loadu_si128((const __m128i*)&(r1)[1]); \ + const __m128i c = _mm_loadu_si128((const __m128i*)&(r2)[0]); \ + const __m128i d = _mm_loadu_si128((const __m128i*)&(r2)[1]); \ \ - const __m128i s = _mm_avg_epu8(a, d); /* s = (a + d + 1) / 2 */ \ - const __m128i t = _mm_avg_epu8(b, c); /* t = (b + c + 1) / 2 */ \ - const __m128i st = _mm_xor_si128(s, t); /* st = s^t */ \ + const __m128i s = _mm_avg_epu8(a, d); /* s = (a + d + 1) / 2 */ \ + const __m128i t = _mm_avg_epu8(b, c); /* t = (b + c + 1) / 2 */ \ + const __m128i st = _mm_xor_si128(s, t); /* st = s^t */ \ \ - const __m128i ad = _mm_xor_si128(a, d); /* ad = a^d */ \ - const __m128i bc = _mm_xor_si128(b, c); /* bc = b^c */ \ + const __m128i ad = _mm_xor_si128(a, d); /* ad = a^d */ \ + const __m128i bc = _mm_xor_si128(b, c); /* bc = b^c */ \ \ - const __m128i t1 = _mm_or_si128(ad, bc); /* (a^d) | (b^c) */ \ - const __m128i t2 = _mm_or_si128(t1, st); /* (a^d) | (b^c) | (s^t) */ \ - const __m128i t3 = _mm_and_si128(t2, one); /* (a^d) | (b^c) | (s^t) & 1 */ \ - const __m128i t4 = _mm_avg_epu8(s, t); \ - const __m128i k = _mm_sub_epi8(t4, t3); /* k = (a + b + c + d) / 4 */ \ - __m128i diag1, diag2; \ + const __m128i t1 = _mm_or_si128(ad, bc); /* (a^d) | (b^c) */ \ + const __m128i t2 = _mm_or_si128(t1, st); /* (a^d) | (b^c) | (s^t) */ \ + const __m128i t3 = _mm_and_si128(t2, one); /* (a^d) | (b^c) | (s^t) & 1 */ \ + const __m128i t4 = _mm_avg_epu8(s, t); \ + const __m128i k = _mm_sub_epi8(t4, t3); /* k = (a + b + c + d) / 4 */ \ + __m128i diag1, diag2; \ \ - GET_M(bc, t, diag1); /* diag1 = (a + 3b + 3c + d) / 8 */ \ - GET_M(ad, s, diag2); /* diag2 = (3a + b + c + 3d) / 8 */ \ + GET_M(bc, t, diag1); /* diag1 = (a + 3b + 3c + d) / 8 */ \ + GET_M(ad, s, diag2); /* diag2 = (3a + b + c + 3d) / 8 */ \ \ - /* pack the alternate pixels */ \ - PACK_AND_STORE(a, b, diag1, diag2, (out) + 0); /* store top */ \ - PACK_AND_STORE(c, d, diag2, diag1, (out) + 2 * 32); /* store bottom */ \ -} while (0) + /* pack the alternate pixels */ \ + PACK_AND_STORE(a, b, diag1, diag2, (out) + 0); /* store top */ \ + PACK_AND_STORE(c, d, diag2, diag1, (out) + 2 * 32); /* store bottom */ \ + } while (0) // Turn the macro into a function for reducing code-size when non-critical static void Upsample32Pixels_SSE41(const uint8_t* WEBP_RESTRICT const r1, @@ -100,84 +105,88 @@ static void Upsample32Pixels_SSE41(const uint8_t* WEBP_RESTRICT const r1, UPSAMPLE_32PIXELS(r1, r2, out); } -#define UPSAMPLE_LAST_BLOCK(tb, bb, num_pixels, out) { \ - uint8_t r1[17], r2[17]; \ - memcpy(r1, (tb), (num_pixels)); \ - memcpy(r2, (bb), (num_pixels)); \ - /* replicate last byte */ \ - memset(r1 + (num_pixels), r1[(num_pixels) - 1], 17 - (num_pixels)); \ - memset(r2 + (num_pixels), r2[(num_pixels) - 1], 17 - (num_pixels)); \ - /* using the shared function instead of the macro saves ~3k code size */ \ - Upsample32Pixels_SSE41(r1, r2, out); \ -} +#define UPSAMPLE_LAST_BLOCK(tb, bb, num_pixels, out) \ + { \ + uint8_t r1[17], r2[17]; \ + memcpy(r1, (tb), (num_pixels)); \ + memcpy(r2, (bb), (num_pixels)); \ + /* replicate last byte */ \ + memset(r1 + (num_pixels), r1[(num_pixels) - 1], 17 - (num_pixels)); \ + memset(r2 + (num_pixels), r2[(num_pixels) - 1], 17 - (num_pixels)); \ + /* using the shared function instead of the macro saves ~3k code size */ \ + Upsample32Pixels_SSE41(r1, r2, out); \ + } -#define CONVERT2RGB_32(FUNC, XSTEP, top_y, bottom_y, \ - top_dst, bottom_dst, cur_x) do { \ - FUNC##32_SSE41((top_y) + (cur_x), r_u, r_v, (top_dst) + (cur_x) * (XSTEP)); \ - if ((bottom_y) != NULL) { \ - FUNC##32_SSE41((bottom_y) + (cur_x), r_u + 64, r_v + 64, \ - (bottom_dst) + (cur_x) * (XSTEP)); \ - } \ -} while (0) +#define CONVERT2RGB_32(FUNC, XSTEP, top_y, bottom_y, top_dst, bottom_dst, \ + cur_x) \ + do { \ + FUNC##32_SSE41((top_y) + (cur_x), r_u, r_v, \ + (top_dst) + (cur_x) * (XSTEP)); \ + if ((bottom_y) != NULL) { \ + FUNC##32_SSE41((bottom_y) + (cur_x), r_u + 64, r_v + 64, \ + (bottom_dst) + (cur_x) * (XSTEP)); \ + } \ + } while (0) -#define SSE4_UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP) \ -static void FUNC_NAME(const uint8_t* WEBP_RESTRICT top_y, \ - const uint8_t* WEBP_RESTRICT bottom_y, \ - const uint8_t* WEBP_RESTRICT top_u, \ - const uint8_t* WEBP_RESTRICT top_v, \ - const uint8_t* WEBP_RESTRICT cur_u, \ - const uint8_t* WEBP_RESTRICT cur_v, \ - uint8_t* WEBP_RESTRICT top_dst, \ - uint8_t* WEBP_RESTRICT bottom_dst, int len) { \ - int uv_pos, pos; \ - /* 16byte-aligned array to cache reconstructed u and v */ \ - uint8_t uv_buf[14 * 32 + 15] = { 0 }; \ - uint8_t* const r_u = (uint8_t*)((uintptr_t)(uv_buf + 15) & ~(uintptr_t)15); \ - uint8_t* const r_v = r_u + 32; \ - \ - assert(top_y != NULL); \ - { /* Treat the first pixel in regular way */ \ - const int u_diag = ((top_u[0] + cur_u[0]) >> 1) + 1; \ - const int v_diag = ((top_v[0] + cur_v[0]) >> 1) + 1; \ - const int u0_t = (top_u[0] + u_diag) >> 1; \ - const int v0_t = (top_v[0] + v_diag) >> 1; \ - FUNC(top_y[0], u0_t, v0_t, top_dst); \ - if (bottom_y != NULL) { \ - const int u0_b = (cur_u[0] + u_diag) >> 1; \ - const int v0_b = (cur_v[0] + v_diag) >> 1; \ - FUNC(bottom_y[0], u0_b, v0_b, bottom_dst); \ - } \ - } \ - /* For UPSAMPLE_32PIXELS, 17 u/v values must be read-able for each block */ \ - for (pos = 1, uv_pos = 0; pos + 32 + 1 <= len; pos += 32, uv_pos += 16) { \ - UPSAMPLE_32PIXELS(top_u + uv_pos, cur_u + uv_pos, r_u); \ - UPSAMPLE_32PIXELS(top_v + uv_pos, cur_v + uv_pos, r_v); \ - CONVERT2RGB_32(FUNC, XSTEP, top_y, bottom_y, top_dst, bottom_dst, pos); \ - } \ - if (len > 1) { \ - const int left_over = ((len + 1) >> 1) - (pos >> 1); \ - uint8_t* const tmp_top_dst = r_u + 4 * 32; \ - uint8_t* const tmp_bottom_dst = tmp_top_dst + 4 * 32; \ - uint8_t* const tmp_top = tmp_bottom_dst + 4 * 32; \ - uint8_t* const tmp_bottom = (bottom_y == NULL) ? NULL : tmp_top + 32; \ - assert(left_over > 0); \ - UPSAMPLE_LAST_BLOCK(top_u + uv_pos, cur_u + uv_pos, left_over, r_u); \ - UPSAMPLE_LAST_BLOCK(top_v + uv_pos, cur_v + uv_pos, left_over, r_v); \ - memcpy(tmp_top, top_y + pos, len - pos); \ - if (bottom_y != NULL) memcpy(tmp_bottom, bottom_y + pos, len - pos); \ - CONVERT2RGB_32(FUNC, XSTEP, tmp_top, tmp_bottom, tmp_top_dst, \ - tmp_bottom_dst, 0); \ - memcpy(top_dst + pos * (XSTEP), tmp_top_dst, (len - pos) * (XSTEP)); \ - if (bottom_y != NULL) { \ - memcpy(bottom_dst + pos * (XSTEP), tmp_bottom_dst, \ - (len - pos) * (XSTEP)); \ - } \ - } \ -} +#define SSE4_UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP) \ + static void FUNC_NAME( \ + const uint8_t* WEBP_RESTRICT top_y, \ + const uint8_t* WEBP_RESTRICT bottom_y, \ + const uint8_t* WEBP_RESTRICT top_u, const uint8_t* WEBP_RESTRICT top_v, \ + const uint8_t* WEBP_RESTRICT cur_u, const uint8_t* WEBP_RESTRICT cur_v, \ + uint8_t* WEBP_RESTRICT top_dst, uint8_t* WEBP_RESTRICT bottom_dst, \ + int len) { \ + int uv_pos, pos; \ + /* 16byte-aligned array to cache reconstructed u and v */ \ + uint8_t uv_buf[14 * 32 + 15] = {0}; \ + uint8_t* const r_u = \ + (uint8_t*)((uintptr_t)(uv_buf + 15) & ~(uintptr_t)15); \ + uint8_t* const r_v = r_u + 32; \ + \ + assert(top_y != NULL); \ + { /* Treat the first pixel in regular way */ \ + const int u_diag = ((top_u[0] + cur_u[0]) >> 1) + 1; \ + const int v_diag = ((top_v[0] + cur_v[0]) >> 1) + 1; \ + const int u0_t = (top_u[0] + u_diag) >> 1; \ + const int v0_t = (top_v[0] + v_diag) >> 1; \ + FUNC(top_y[0], u0_t, v0_t, top_dst); \ + if (bottom_y != NULL) { \ + const int u0_b = (cur_u[0] + u_diag) >> 1; \ + const int v0_b = (cur_v[0] + v_diag) >> 1; \ + FUNC(bottom_y[0], u0_b, v0_b, bottom_dst); \ + } \ + } \ + /* For UPSAMPLE_32PIXELS, 17 u/v values must be read-able for each block \ + */ \ + for (pos = 1, uv_pos = 0; pos + 32 + 1 <= len; pos += 32, uv_pos += 16) { \ + UPSAMPLE_32PIXELS(top_u + uv_pos, cur_u + uv_pos, r_u); \ + UPSAMPLE_32PIXELS(top_v + uv_pos, cur_v + uv_pos, r_v); \ + CONVERT2RGB_32(FUNC, XSTEP, top_y, bottom_y, top_dst, bottom_dst, pos); \ + } \ + if (len > 1) { \ + const int left_over = ((len + 1) >> 1) - (pos >> 1); \ + uint8_t* const tmp_top_dst = r_u + 4 * 32; \ + uint8_t* const tmp_bottom_dst = tmp_top_dst + 4 * 32; \ + uint8_t* const tmp_top = tmp_bottom_dst + 4 * 32; \ + uint8_t* const tmp_bottom = (bottom_y == NULL) ? NULL : tmp_top + 32; \ + assert(left_over > 0); \ + UPSAMPLE_LAST_BLOCK(top_u + uv_pos, cur_u + uv_pos, left_over, r_u); \ + UPSAMPLE_LAST_BLOCK(top_v + uv_pos, cur_v + uv_pos, left_over, r_v); \ + memcpy(tmp_top, top_y + pos, len - pos); \ + if (bottom_y != NULL) memcpy(tmp_bottom, bottom_y + pos, len - pos); \ + CONVERT2RGB_32(FUNC, XSTEP, tmp_top, tmp_bottom, tmp_top_dst, \ + tmp_bottom_dst, 0); \ + memcpy(top_dst + pos * (XSTEP), tmp_top_dst, (len - pos) * (XSTEP)); \ + if (bottom_y != NULL) { \ + memcpy(bottom_dst + pos * (XSTEP), tmp_bottom_dst, \ + (len - pos) * (XSTEP)); \ + } \ + } \ + } // SSE4 variants of the fancy upsampler. -SSE4_UPSAMPLE_FUNC(UpsampleRgbLinePair_SSE41, VP8YuvToRgb, 3) -SSE4_UPSAMPLE_FUNC(UpsampleBgrLinePair_SSE41, VP8YuvToBgr, 3) +SSE4_UPSAMPLE_FUNC(UpsampleRgbLinePair_SSE41, VP8YuvToRgb, 3) +SSE4_UPSAMPLE_FUNC(UpsampleBgrLinePair_SSE41, VP8YuvToBgr, 3) #undef GET_M #undef PACK_AND_STORE @@ -187,7 +196,7 @@ SSE4_UPSAMPLE_FUNC(UpsampleBgrLinePair_SSE41, VP8YuvToBgr, 3) #undef CONVERT2RGB_32 #undef SSE4_UPSAMPLE_FUNC -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP //------------------------------------------------------------------------------ // Entry point @@ -198,9 +207,9 @@ extern void WebPInitUpsamplersSSE41(void); WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplersSSE41(void) { #if !defined(WEBP_REDUCE_CSP) - WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair_SSE41; - WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePair_SSE41; -#endif // WEBP_REDUCE_CSP + WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair_SSE41; + WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePair_SSE41; +#endif // WEBP_REDUCE_CSP } #endif // FANCY_UPSAMPLING @@ -210,24 +219,22 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplersSSE41(void) { extern WebPYUV444Converter WebPYUV444Converters[/* MODE_LAST */]; extern void WebPInitYUV444ConvertersSSE41(void); -#define YUV444_FUNC(FUNC_NAME, CALL, CALL_C, XSTEP) \ -extern void CALL_C(const uint8_t* WEBP_RESTRICT y, \ - const uint8_t* WEBP_RESTRICT u, \ - const uint8_t* WEBP_RESTRICT v, \ - uint8_t* WEBP_RESTRICT dst, int len); \ -static void FUNC_NAME(const uint8_t* WEBP_RESTRICT y, \ - const uint8_t* WEBP_RESTRICT u, \ - const uint8_t* WEBP_RESTRICT v, \ - uint8_t* WEBP_RESTRICT dst, int len) { \ - int i; \ - const int max_len = len & ~31; \ - for (i = 0; i < max_len; i += 32) { \ - CALL(y + i, u + i, v + i, dst + i * (XSTEP)); \ - } \ - if (i < len) { /* C-fallback */ \ - CALL_C(y + i, u + i, v + i, dst + i * (XSTEP), len - i); \ - } \ -} +#define YUV444_FUNC(FUNC_NAME, CALL, CALL_C, XSTEP) \ + extern void CALL_C( \ + const uint8_t* WEBP_RESTRICT y, const uint8_t* WEBP_RESTRICT u, \ + const uint8_t* WEBP_RESTRICT v, uint8_t* WEBP_RESTRICT dst, int len); \ + static void FUNC_NAME( \ + const uint8_t* WEBP_RESTRICT y, const uint8_t* WEBP_RESTRICT u, \ + const uint8_t* WEBP_RESTRICT v, uint8_t* WEBP_RESTRICT dst, int len) { \ + int i; \ + const int max_len = len & ~31; \ + for (i = 0; i < max_len; i += 32) { \ + CALL(y + i, u + i, v + i, dst + i * (XSTEP)); \ + } \ + if (i < len) { /* C-fallback */ \ + CALL_C(y + i, u + i, v + i, dst + i * (XSTEP), len - i); \ + } \ + } #if !defined(WEBP_REDUCE_CSP) YUV444_FUNC(Yuv444ToRgb_SSE41, VP8YuvToRgb32_SSE41, WebPYuv444ToRgb_C, 3) @@ -236,9 +243,9 @@ YUV444_FUNC(Yuv444ToBgr_SSE41, VP8YuvToBgr32_SSE41, WebPYuv444ToBgr_C, 3) WEBP_TSAN_IGNORE_FUNCTION void WebPInitYUV444ConvertersSSE41(void) { #if !defined(WEBP_REDUCE_CSP) - WebPYUV444Converters[MODE_RGB] = Yuv444ToRgb_SSE41; - WebPYUV444Converters[MODE_BGR] = Yuv444ToBgr_SSE41; -#endif // WEBP_REDUCE_CSP + WebPYUV444Converters[MODE_RGB] = Yuv444ToRgb_SSE41; + WebPYUV444Converters[MODE_BGR] = Yuv444ToBgr_SSE41; +#endif // WEBP_REDUCE_CSP } #else diff --git a/src/dsp/yuv.c b/src/dsp/yuv.c index 7b0b6a91..ef32981a 100644 --- a/src/dsp/yuv.c +++ b/src/dsp/yuv.c @@ -11,45 +11,45 @@ // // Author: Skal (pascal.massimino@gmail.com) +#include "src/dsp/yuv.h" + #include #include #include "src/dsp/cpu.h" -#include "src/webp/types.h" #include "src/dsp/dsp.h" -#include "src/dsp/yuv.h" #include "src/webp/decode.h" +#include "src/webp/types.h" //----------------------------------------------------------------------------- // Plain-C version -#define ROW_FUNC(FUNC_NAME, FUNC, XSTEP) \ -static void FUNC_NAME(const uint8_t* WEBP_RESTRICT y, \ - const uint8_t* WEBP_RESTRICT u, \ - const uint8_t* WEBP_RESTRICT v, \ - uint8_t* WEBP_RESTRICT dst, int len) { \ - const uint8_t* const end = dst + (len & ~1) * (XSTEP); \ - while (dst != end) { \ - FUNC(y[0], u[0], v[0], dst); \ - FUNC(y[1], u[0], v[0], dst + (XSTEP)); \ - y += 2; \ - ++u; \ - ++v; \ - dst += 2 * (XSTEP); \ - } \ - if (len & 1) { \ - FUNC(y[0], u[0], v[0], dst); \ - } \ -} \ +#define ROW_FUNC(FUNC_NAME, FUNC, XSTEP) \ + static void FUNC_NAME( \ + const uint8_t* WEBP_RESTRICT y, const uint8_t* WEBP_RESTRICT u, \ + const uint8_t* WEBP_RESTRICT v, uint8_t* WEBP_RESTRICT dst, int len) { \ + const uint8_t* const end = dst + (len & ~1) * (XSTEP); \ + while (dst != end) { \ + FUNC(y[0], u[0], v[0], dst); \ + FUNC(y[1], u[0], v[0], dst + (XSTEP)); \ + y += 2; \ + ++u; \ + ++v; \ + dst += 2 * (XSTEP); \ + } \ + if (len & 1) { \ + FUNC(y[0], u[0], v[0], dst); \ + } \ + } // All variants implemented. -ROW_FUNC(YuvToRgbRow, VP8YuvToRgb, 3) -ROW_FUNC(YuvToBgrRow, VP8YuvToBgr, 3) -ROW_FUNC(YuvToRgbaRow, VP8YuvToRgba, 4) -ROW_FUNC(YuvToBgraRow, VP8YuvToBgra, 4) -ROW_FUNC(YuvToArgbRow, VP8YuvToArgb, 4) +ROW_FUNC(YuvToRgbRow, VP8YuvToRgb, 3) +ROW_FUNC(YuvToBgrRow, VP8YuvToBgr, 3) +ROW_FUNC(YuvToRgbaRow, VP8YuvToRgba, 4) +ROW_FUNC(YuvToBgraRow, VP8YuvToBgra, 4) +ROW_FUNC(YuvToArgbRow, VP8YuvToArgb, 4) ROW_FUNC(YuvToRgba4444Row, VP8YuvToRgba4444, 2) -ROW_FUNC(YuvToRgb565Row, VP8YuvToRgb565, 2) +ROW_FUNC(YuvToRgb565Row, VP8YuvToRgb565, 2) #undef ROW_FUNC @@ -83,16 +83,16 @@ extern void WebPInitSamplersMIPS32(void); extern void WebPInitSamplersMIPSdspR2(void); WEBP_DSP_INIT_FUNC(WebPInitSamplers) { - WebPSamplers[MODE_RGB] = YuvToRgbRow; - WebPSamplers[MODE_RGBA] = YuvToRgbaRow; - WebPSamplers[MODE_BGR] = YuvToBgrRow; - WebPSamplers[MODE_BGRA] = YuvToBgraRow; - WebPSamplers[MODE_ARGB] = YuvToArgbRow; + WebPSamplers[MODE_RGB] = YuvToRgbRow; + WebPSamplers[MODE_RGBA] = YuvToRgbaRow; + WebPSamplers[MODE_BGR] = YuvToBgrRow; + WebPSamplers[MODE_BGRA] = YuvToBgraRow; + WebPSamplers[MODE_ARGB] = YuvToArgbRow; WebPSamplers[MODE_RGBA_4444] = YuvToRgba4444Row; - WebPSamplers[MODE_RGB_565] = YuvToRgb565Row; - WebPSamplers[MODE_rgbA] = YuvToRgbaRow; - WebPSamplers[MODE_bgrA] = YuvToBgraRow; - WebPSamplers[MODE_Argb] = YuvToArgbRow; + WebPSamplers[MODE_RGB_565] = YuvToRgb565Row; + WebPSamplers[MODE_rgbA] = YuvToRgbaRow; + WebPSamplers[MODE_bgrA] = YuvToBgraRow; + WebPSamplers[MODE_Argb] = YuvToArgbRow; WebPSamplers[MODE_rgbA_4444] = YuvToRgba4444Row; // If defined, use CPUInfo() to overwrite some pointers with faster versions. @@ -128,8 +128,8 @@ static void ConvertARGBToY_C(const uint32_t* WEBP_RESTRICT argb, int i; for (i = 0; i < width; ++i) { const uint32_t p = argb[i]; - y[i] = VP8RGBToY((p >> 16) & 0xff, (p >> 8) & 0xff, (p >> 0) & 0xff, - YUV_HALF); + y[i] = + VP8RGBToY((p >> 16) & 0xff, (p >> 8) & 0xff, (p >> 0) & 0xff, YUV_HALF); } } @@ -145,8 +145,8 @@ void WebPConvertARGBToUV_C(const uint32_t* WEBP_RESTRICT argb, // VP8RGBToU/V expects four accumulated pixels. Hence we need to // scale r/g/b value by a factor 2. We just shift v0/v1 one bit less. const int r = ((v0 >> 15) & 0x1fe) + ((v1 >> 15) & 0x1fe); - const int g = ((v0 >> 7) & 0x1fe) + ((v1 >> 7) & 0x1fe); - const int b = ((v0 << 1) & 0x1fe) + ((v1 << 1) & 0x1fe); + const int g = ((v0 >> 7) & 0x1fe) + ((v1 >> 7) & 0x1fe); + const int b = ((v0 << 1) & 0x1fe) + ((v1 << 1) & 0x1fe); const int tmp_u = VP8RGBToU(r, g, b, YUV_HALF << 2); const int tmp_v = VP8RGBToV(r, g, b, YUV_HALF << 2); if (do_store) { @@ -158,11 +158,11 @@ void WebPConvertARGBToUV_C(const uint32_t* WEBP_RESTRICT argb, v[i] = (v[i] + tmp_v + 1) >> 1; } } - if (src_width & 1) { // last pixel + if (src_width & 1) { // last pixel const uint32_t v0 = argb[2 * i + 0]; const int r = (v0 >> 14) & 0x3fc; - const int g = (v0 >> 6) & 0x3fc; - const int b = (v0 << 2) & 0x3fc; + const int g = (v0 >> 6) & 0x3fc; + const int b = (v0 << 2) & 0x3fc; const int tmp_u = VP8RGBToU(r, g, b, YUV_HALF << 2); const int tmp_v = VP8RGBToV(r, g, b, YUV_HALF << 2); if (do_store) { diff --git a/src/dsp/yuv.h b/src/dsp/yuv.h index 6f218cf7..57b03dd7 100644 --- a/src/dsp/yuv.h +++ b/src/dsp/yuv.h @@ -48,17 +48,17 @@ extern "C" { #endif enum { - YUV_FIX = 16, // fixed-point precision for RGB->YUV + YUV_FIX = 16, // fixed-point precision for RGB->YUV YUV_HALF = 1 << (YUV_FIX - 1), - YUV_FIX2 = 6, // fixed-point precision for YUV->RGB + YUV_FIX2 = 6, // fixed-point precision for YUV->RGB YUV_MASK2 = (256 << YUV_FIX2) - 1 }; //------------------------------------------------------------------------------ // slower on x86 by ~7-8%, but bit-exact with the SSE2/NEON version -static WEBP_INLINE int MultHi(int v, int coeff) { // _mm_mulhi_epu16 emulation +static WEBP_INLINE int MultHi(int v, int coeff) { // _mm_mulhi_epu16 emulation return (v * coeff) >> 8; } @@ -78,15 +78,13 @@ static WEBP_INLINE int VP8YUVToB(int y, int u) { return VP8Clip8(MultHi(y, 19077) + MultHi(u, 33050) - 17685); } -static WEBP_INLINE void VP8YuvToRgb(int y, int u, int v, - uint8_t* const rgb) { +static WEBP_INLINE void VP8YuvToRgb(int y, int u, int v, uint8_t* const rgb) { rgb[0] = VP8YUVToR(y, v); rgb[1] = VP8YUVToG(y, u, v); rgb[2] = VP8YUVToB(y, u); } -static WEBP_INLINE void VP8YuvToBgr(int y, int u, int v, - uint8_t* const bgr) { +static WEBP_INLINE void VP8YuvToBgr(int y, int u, int v, uint8_t* const bgr) { bgr[0] = VP8YUVToB(y, u); bgr[1] = VP8YUVToG(y, u, v); bgr[2] = VP8YUVToR(y, v); @@ -94,9 +92,9 @@ static WEBP_INLINE void VP8YuvToBgr(int y, int u, int v, static WEBP_INLINE void VP8YuvToRgb565(int y, int u, int v, uint8_t* const rgb) { - const int r = VP8YUVToR(y, v); // 5 usable bits - const int g = VP8YUVToG(y, u, v); // 6 usable bits - const int b = VP8YUVToB(y, u); // 5 usable bits + const int r = VP8YUVToR(y, v); // 5 usable bits + const int g = VP8YUVToG(y, u, v); // 6 usable bits + const int b = VP8YUVToB(y, u); // 5 usable bits const int rg = (r & 0xf8) | (g >> 5); const int gb = ((g << 3) & 0xe0) | (b >> 3); #if (WEBP_SWAP_16BIT_CSP == 1) @@ -110,11 +108,11 @@ static WEBP_INLINE void VP8YuvToRgb565(int y, int u, int v, static WEBP_INLINE void VP8YuvToRgba4444(int y, int u, int v, uint8_t* const argb) { - const int r = VP8YUVToR(y, v); // 4 usable bits - const int g = VP8YUVToG(y, u, v); // 4 usable bits - const int b = VP8YUVToB(y, u); // 4 usable bits + const int r = VP8YUVToR(y, v); // 4 usable bits + const int g = VP8YUVToG(y, u, v); // 4 usable bits + const int b = VP8YUVToB(y, u); // 4 usable bits const int rg = (r & 0xf0) | (g >> 4); - const int ba = (b & 0xf0) | 0x0f; // overwrite the lower 4 bits + const int ba = (b & 0xf0) | 0x0f; // overwrite the lower 4 bits #if (WEBP_SWAP_16BIT_CSP == 1) argb[0] = ba; argb[1] = rg; @@ -180,7 +178,7 @@ void VP8YuvToRgb56532_SSE2(const uint8_t* WEBP_RESTRICT y, const uint8_t* WEBP_RESTRICT v, uint8_t* WEBP_RESTRICT dst); -#endif // WEBP_USE_SSE2 +#endif // WEBP_USE_SSE2 //----------------------------------------------------------------------------- // SSE41 extra functions (mostly for upsampling_sse41.c) @@ -197,7 +195,7 @@ void VP8YuvToBgr32_SSE41(const uint8_t* WEBP_RESTRICT y, const uint8_t* WEBP_RESTRICT v, uint8_t* WEBP_RESTRICT dst); -#endif // WEBP_USE_SSE41 +#endif // WEBP_USE_SSE41 //------------------------------------------------------------------------------ // RGB -> YUV conversion @@ -224,7 +222,7 @@ static WEBP_INLINE int VP8RGBToV(int r, int g, int b, int rounding) { } #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_DSP_YUV_H_ diff --git a/src/dsp/yuv_mips32.c b/src/dsp/yuv_mips32.c index 1f634858..7fb3ed5f 100644 --- a/src/dsp/yuv_mips32.c +++ b/src/dsp/yuv_mips32.c @@ -21,67 +21,66 @@ //------------------------------------------------------------------------------ // simple point-sampling -#define ROW_FUNC(FUNC_NAME, XSTEP, R, G, B, A) \ -static void FUNC_NAME(const uint8_t* WEBP_RESTRICT y, \ - const uint8_t* WEBP_RESTRICT u, \ - const uint8_t* WEBP_RESTRICT v, \ - uint8_t* WEBP_RESTRICT dst, int len) { \ - int i, r, g, b; \ - int temp0, temp1, temp2, temp3, temp4; \ - for (i = 0; i < (len >> 1); i++) { \ - temp1 = MultHi(v[0], 26149); \ - temp3 = MultHi(v[0], 13320); \ - temp2 = MultHi(u[0], 6419); \ - temp4 = MultHi(u[0], 33050); \ - temp0 = MultHi(y[0], 19077); \ - temp1 -= 14234; \ - temp3 -= 8708; \ - temp2 += temp3; \ - temp4 -= 17685; \ - r = VP8Clip8(temp0 + temp1); \ - g = VP8Clip8(temp0 - temp2); \ - b = VP8Clip8(temp0 + temp4); \ - temp0 = MultHi(y[1], 19077); \ - dst[R] = r; \ - dst[G] = g; \ - dst[B] = b; \ - if (A) dst[A] = 0xff; \ - r = VP8Clip8(temp0 + temp1); \ - g = VP8Clip8(temp0 - temp2); \ - b = VP8Clip8(temp0 + temp4); \ - dst[R + XSTEP] = r; \ - dst[G + XSTEP] = g; \ - dst[B + XSTEP] = b; \ - if (A) dst[A + XSTEP] = 0xff; \ - y += 2; \ - ++u; \ - ++v; \ - dst += 2 * XSTEP; \ - } \ - if (len & 1) { \ - temp1 = MultHi(v[0], 26149); \ - temp3 = MultHi(v[0], 13320); \ - temp2 = MultHi(u[0], 6419); \ - temp4 = MultHi(u[0], 33050); \ - temp0 = MultHi(y[0], 19077); \ - temp1 -= 14234; \ - temp3 -= 8708; \ - temp2 += temp3; \ - temp4 -= 17685; \ - r = VP8Clip8(temp0 + temp1); \ - g = VP8Clip8(temp0 - temp2); \ - b = VP8Clip8(temp0 + temp4); \ - dst[R] = r; \ - dst[G] = g; \ - dst[B] = b; \ - if (A) dst[A] = 0xff; \ - } \ -} +#define ROW_FUNC(FUNC_NAME, XSTEP, R, G, B, A) \ + static void FUNC_NAME( \ + const uint8_t* WEBP_RESTRICT y, const uint8_t* WEBP_RESTRICT u, \ + const uint8_t* WEBP_RESTRICT v, uint8_t* WEBP_RESTRICT dst, int len) { \ + int i, r, g, b; \ + int temp0, temp1, temp2, temp3, temp4; \ + for (i = 0; i < (len >> 1); i++) { \ + temp1 = MultHi(v[0], 26149); \ + temp3 = MultHi(v[0], 13320); \ + temp2 = MultHi(u[0], 6419); \ + temp4 = MultHi(u[0], 33050); \ + temp0 = MultHi(y[0], 19077); \ + temp1 -= 14234; \ + temp3 -= 8708; \ + temp2 += temp3; \ + temp4 -= 17685; \ + r = VP8Clip8(temp0 + temp1); \ + g = VP8Clip8(temp0 - temp2); \ + b = VP8Clip8(temp0 + temp4); \ + temp0 = MultHi(y[1], 19077); \ + dst[R] = r; \ + dst[G] = g; \ + dst[B] = b; \ + if (A) dst[A] = 0xff; \ + r = VP8Clip8(temp0 + temp1); \ + g = VP8Clip8(temp0 - temp2); \ + b = VP8Clip8(temp0 + temp4); \ + dst[R + XSTEP] = r; \ + dst[G + XSTEP] = g; \ + dst[B + XSTEP] = b; \ + if (A) dst[A + XSTEP] = 0xff; \ + y += 2; \ + ++u; \ + ++v; \ + dst += 2 * XSTEP; \ + } \ + if (len & 1) { \ + temp1 = MultHi(v[0], 26149); \ + temp3 = MultHi(v[0], 13320); \ + temp2 = MultHi(u[0], 6419); \ + temp4 = MultHi(u[0], 33050); \ + temp0 = MultHi(y[0], 19077); \ + temp1 -= 14234; \ + temp3 -= 8708; \ + temp2 += temp3; \ + temp4 -= 17685; \ + r = VP8Clip8(temp0 + temp1); \ + g = VP8Clip8(temp0 - temp2); \ + b = VP8Clip8(temp0 + temp4); \ + dst[R] = r; \ + dst[G] = g; \ + dst[B] = b; \ + if (A) dst[A] = 0xff; \ + } \ + } -ROW_FUNC(YuvToRgbRow_MIPS32, 3, 0, 1, 2, 0) -ROW_FUNC(YuvToRgbaRow_MIPS32, 4, 0, 1, 2, 3) -ROW_FUNC(YuvToBgrRow_MIPS32, 3, 2, 1, 0, 0) -ROW_FUNC(YuvToBgraRow_MIPS32, 4, 2, 1, 0, 3) +ROW_FUNC(YuvToRgbRow_MIPS32, 3, 0, 1, 2, 0) +ROW_FUNC(YuvToRgbaRow_MIPS32, 4, 0, 1, 2, 3) +ROW_FUNC(YuvToBgrRow_MIPS32, 3, 2, 1, 0, 0) +ROW_FUNC(YuvToBgraRow_MIPS32, 4, 2, 1, 0, 3) #undef ROW_FUNC @@ -91,9 +90,9 @@ ROW_FUNC(YuvToBgraRow_MIPS32, 4, 2, 1, 0, 3) extern void WebPInitSamplersMIPS32(void); WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersMIPS32(void) { - WebPSamplers[MODE_RGB] = YuvToRgbRow_MIPS32; + WebPSamplers[MODE_RGB] = YuvToRgbRow_MIPS32; WebPSamplers[MODE_RGBA] = YuvToRgbaRow_MIPS32; - WebPSamplers[MODE_BGR] = YuvToBgrRow_MIPS32; + WebPSamplers[MODE_BGR] = YuvToBgrRow_MIPS32; WebPSamplers[MODE_BGRA] = YuvToBgraRow_MIPS32; } diff --git a/src/dsp/yuv_mips_dsp_r2.c b/src/dsp/yuv_mips_dsp_r2.c index 816340fe..1534dc5b 100644 --- a/src/dsp/yuv_mips_dsp_r2.c +++ b/src/dsp/yuv_mips_dsp_r2.c @@ -21,20 +21,21 @@ //------------------------------------------------------------------------------ // simple point-sampling -#define ROW_FUNC_PART_1() \ - "lbu %[temp3], 0(%[v]) \n\t" \ - "lbu %[temp4], 0(%[u]) \n\t" \ - "lbu %[temp0], 0(%[y]) \n\t" \ - "mul %[temp1], %[t_con_1], %[temp3] \n\t" \ - "mul %[temp3], %[t_con_2], %[temp3] \n\t" \ - "mul %[temp2], %[t_con_3], %[temp4] \n\t" \ - "mul %[temp4], %[t_con_4], %[temp4] \n\t" \ - "mul %[temp0], %[t_con_5], %[temp0] \n\t" \ - "subu %[temp1], %[temp1], %[t_con_6] \n\t" \ - "subu %[temp3], %[temp3], %[t_con_7] \n\t" \ - "addu %[temp2], %[temp2], %[temp3] \n\t" \ - "subu %[temp4], %[temp4], %[t_con_8] \n\t" \ +#define ROW_FUNC_PART_1() \ + "lbu %[temp3], 0(%[v]) \n\t" \ + "lbu %[temp4], 0(%[u]) \n\t" \ + "lbu %[temp0], 0(%[y]) \n\t" \ + "mul %[temp1], %[t_con_1], %[temp3] \n\t" \ + "mul %[temp3], %[t_con_2], %[temp3] \n\t" \ + "mul %[temp2], %[t_con_3], %[temp4] \n\t" \ + "mul %[temp4], %[t_con_4], %[temp4] \n\t" \ + "mul %[temp0], %[t_con_5], %[temp0] \n\t" \ + "subu %[temp1], %[temp1], %[t_con_6] \n\t" \ + "subu %[temp3], %[temp3], %[t_con_7] \n\t" \ + "addu %[temp2], %[temp2], %[temp3] \n\t" \ + "subu %[temp4], %[temp4], %[t_con_8] \n\t" +// clang-format off #define ROW_FUNC_PART_2(R, G, B, K) \ "addu %[temp5], %[temp0], %[temp1] \n\t" \ "subu %[temp6], %[temp0], %[temp2] \n\t" \ @@ -56,60 +57,63 @@ "srl %[temp7], %[temp7], 24 \n\t" \ "sb %[temp5], " #R "(%[dst]) \n\t" \ "sb %[temp6], " #G "(%[dst]) \n\t" \ - "sb %[temp7], " #B "(%[dst]) \n\t" \ + "sb %[temp7], " #B "(%[dst]) \n\t" +// clang-format on -#define ASM_CLOBBER_LIST() \ - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), \ - [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), \ - [temp6]"=&r"(temp6), [temp7]"=&r"(temp7) \ - : [t_con_1]"r"(t_con_1), [t_con_2]"r"(t_con_2), [t_con_3]"r"(t_con_3), \ - [t_con_4]"r"(t_con_4), [t_con_5]"r"(t_con_5), [t_con_6]"r"(t_con_6), \ - [u]"r"(u), [v]"r"(v), [y]"r"(y), [dst]"r"(dst), \ - [t_con_7]"r"(t_con_7), [t_con_8]"r"(t_con_8) \ - : "memory", "hi", "lo" \ +#define ASM_CLOBBER_LIST() \ + : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), \ + [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), \ + [temp6]"=&r"(temp6), [temp7]"=&r"(temp7) \ + : [t_con_1]"r"(t_con_1), [t_con_2]"r"(t_con_2), [t_con_3]"r"(t_con_3), \ + [t_con_4]"r"(t_con_4), [t_con_5]"r"(t_con_5), [t_con_6]"r"(t_con_6), \ + [u]"r"(u), [v]"r"(v), [y]"r"(y), [dst]"r"(dst), \ + [t_con_7]"r"(t_con_7), [t_con_8]"r"(t_con_8) \ + : "memory", "hi", "lo" +// clang-format off #define ROW_FUNC(FUNC_NAME, XSTEP, R, G, B, A) \ -static void FUNC_NAME(const uint8_t* WEBP_RESTRICT y, \ - const uint8_t* WEBP_RESTRICT u, \ - const uint8_t* WEBP_RESTRICT v, \ - uint8_t* WEBP_RESTRICT dst, int len) { \ - int i; \ - uint32_t temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7; \ - const int t_con_1 = 26149; \ - const int t_con_2 = 13320; \ - const int t_con_3 = 6419; \ - const int t_con_4 = 33050; \ - const int t_con_5 = 19077; \ - const int t_con_6 = 14234; \ - const int t_con_7 = 8708; \ - const int t_con_8 = 17685; \ - for (i = 0; i < (len >> 1); i++) { \ - __asm__ volatile ( \ - ROW_FUNC_PART_1() \ - ROW_FUNC_PART_2(R, G, B, 1) \ - ROW_FUNC_PART_2(R + XSTEP, G + XSTEP, B + XSTEP, 0) \ - ASM_CLOBBER_LIST() \ - ); \ - if (A) dst[A] = dst[A + XSTEP] = 0xff; \ - y += 2; \ - ++u; \ - ++v; \ - dst += 2 * XSTEP; \ - } \ - if (len & 1) { \ - __asm__ volatile ( \ - ROW_FUNC_PART_1() \ - ROW_FUNC_PART_2(R, G, B, 0) \ - ASM_CLOBBER_LIST() \ - ); \ - if (A) dst[A] = 0xff; \ - } \ -} + static void FUNC_NAME(const uint8_t* WEBP_RESTRICT y, \ + const uint8_t* WEBP_RESTRICT u, \ + const uint8_t* WEBP_RESTRICT v, \ + uint8_t* WEBP_RESTRICT dst, int len) { \ + int i; \ + uint32_t temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7; \ + const int t_con_1 = 26149; \ + const int t_con_2 = 13320; \ + const int t_con_3 = 6419; \ + const int t_con_4 = 33050; \ + const int t_con_5 = 19077; \ + const int t_con_6 = 14234; \ + const int t_con_7 = 8708; \ + const int t_con_8 = 17685; \ + for (i = 0; i < (len >> 1); i++) { \ + __asm__ volatile( \ + ROW_FUNC_PART_1() \ + ROW_FUNC_PART_2(R, G, B, 1) \ + ROW_FUNC_PART_2(R + XSTEP, G + XSTEP, B + XSTEP, 0) \ + ASM_CLOBBER_LIST() \ + ); \ + if (A) dst[A] = dst[A + XSTEP] = 0xff; \ + y += 2; \ + ++u; \ + ++v; \ + dst += 2 * XSTEP; \ + } \ + if (len & 1) { \ + __asm__ volatile( \ + ROW_FUNC_PART_1() \ + ROW_FUNC_PART_2(R, G, B, 0) \ + ASM_CLOBBER_LIST() \ + ); \ + if (A) dst[A] = 0xff; \ + } \ + } +// clang-format on -ROW_FUNC(YuvToRgbRow_MIPSdspR2, 3, 0, 1, 2, 0) -ROW_FUNC(YuvToRgbaRow_MIPSdspR2, 4, 0, 1, 2, 3) -ROW_FUNC(YuvToBgrRow_MIPSdspR2, 3, 2, 1, 0, 0) -ROW_FUNC(YuvToBgraRow_MIPSdspR2, 4, 2, 1, 0, 3) +ROW_FUNC(YuvToRgbRow_MIPSdspR2, 3, 0, 1, 2, 0) +ROW_FUNC(YuvToRgbaRow_MIPSdspR2, 4, 0, 1, 2, 3) +ROW_FUNC(YuvToBgrRow_MIPSdspR2, 3, 2, 1, 0, 0) +ROW_FUNC(YuvToBgraRow_MIPSdspR2, 4, 2, 1, 0, 3) #undef ROW_FUNC #undef ASM_CLOBBER_LIST @@ -122,9 +126,9 @@ ROW_FUNC(YuvToBgraRow_MIPSdspR2, 4, 2, 1, 0, 3) extern void WebPInitSamplersMIPSdspR2(void); WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersMIPSdspR2(void) { - WebPSamplers[MODE_RGB] = YuvToRgbRow_MIPSdspR2; + WebPSamplers[MODE_RGB] = YuvToRgbRow_MIPSdspR2; WebPSamplers[MODE_RGBA] = YuvToRgbaRow_MIPSdspR2; - WebPSamplers[MODE_BGR] = YuvToBgrRow_MIPSdspR2; + WebPSamplers[MODE_BGR] = YuvToBgrRow_MIPSdspR2; WebPSamplers[MODE_BGRA] = YuvToBgraRow_MIPSdspR2; } diff --git a/src/dsp/yuv_neon.c b/src/dsp/yuv_neon.c index 3e0afa0e..c16de88e 100644 --- a/src/dsp/yuv_neon.c +++ b/src/dsp/yuv_neon.c @@ -23,8 +23,7 @@ //----------------------------------------------------------------------------- -static uint8x8_t ConvertRGBToYImpl_NEON(const uint8x8_t R, - const uint8x8_t G, +static uint8x8_t ConvertRGBToYImpl_NEON(const uint8x8_t R, const uint8x8_t G, const uint8x8_t B) { const uint16x8_t r = vmovl_u8(R); const uint16x8_t g = vmovl_u8(G); @@ -35,14 +34,14 @@ static uint8x8_t ConvertRGBToYImpl_NEON(const uint8x8_t R, const uint16x4_t g_hi = vget_high_u16(g); const uint16x4_t b_lo = vget_low_u16(b); const uint16x4_t b_hi = vget_high_u16(b); - const uint32x4_t tmp0_lo = vmull_n_u16( r_lo, 16839u); - const uint32x4_t tmp0_hi = vmull_n_u16( r_hi, 16839u); + const uint32x4_t tmp0_lo = vmull_n_u16(r_lo, 16839u); + const uint32x4_t tmp0_hi = vmull_n_u16(r_hi, 16839u); const uint32x4_t tmp1_lo = vmlal_n_u16(tmp0_lo, g_lo, 33059u); const uint32x4_t tmp1_hi = vmlal_n_u16(tmp0_hi, g_hi, 33059u); const uint32x4_t tmp2_lo = vmlal_n_u16(tmp1_lo, b_lo, 6420u); const uint32x4_t tmp2_hi = vmlal_n_u16(tmp1_hi, b_hi, 6420u); - const uint16x8_t Y1 = vcombine_u16(vrshrn_n_u32(tmp2_lo, 16), - vrshrn_n_u32(tmp2_hi, 16)); + const uint16x8_t Y1 = + vcombine_u16(vrshrn_n_u32(tmp2_lo, 16), vrshrn_n_u32(tmp2_hi, 16)); const uint16x8_t Y2 = vaddq_u16(Y1, vdupq_n_u16(16)); return vqmovn_u16(Y2); } @@ -102,10 +101,10 @@ static void ConvertARGBToY_NEON(const uint32_t* WEBP_RESTRICT argb, ConvertRGBToYImpl_NEON(RGB.val[2], RGB.val[1], RGB.val[0]); vst1_u8(y + i, Y); } - for (; i < width; ++i) { // left-over + for (; i < width; ++i) { // left-over const uint32_t p = argb[i]; - y[i] = VP8RGBToY((p >> 16) & 0xff, (p >> 8) & 0xff, (p >> 0) & 0xff, - YUV_HALF); + y[i] = + VP8RGBToY((p >> 16) & 0xff, (p >> 8) & 0xff, (p >> 0) & 0xff, YUV_HALF); } } @@ -120,24 +119,26 @@ static void ConvertARGBToY_NEON(const uint32_t* WEBP_RESTRICT argb, const int16x4_t b_lo = vreinterpret_s16_u16(vget_low_u16(b)); \ const int16x4_t b_hi = vreinterpret_s16_u16(vget_high_u16(b)) -#define MULTIPLY_16b(C0, C1, C2, CST, DST_s16) do { \ - const int32x4_t tmp0_lo = vmull_n_s16( r_lo, C0); \ - const int32x4_t tmp0_hi = vmull_n_s16( r_hi, C0); \ - const int32x4_t tmp1_lo = vmlal_n_s16(tmp0_lo, g_lo, C1); \ - const int32x4_t tmp1_hi = vmlal_n_s16(tmp0_hi, g_hi, C1); \ - const int32x4_t tmp2_lo = vmlal_n_s16(tmp1_lo, b_lo, C2); \ - const int32x4_t tmp2_hi = vmlal_n_s16(tmp1_hi, b_hi, C2); \ - const int16x8_t tmp3 = vcombine_s16(vshrn_n_s32(tmp2_lo, 16), \ - vshrn_n_s32(tmp2_hi, 16)); \ - DST_s16 = vaddq_s16(tmp3, vdupq_n_s16(CST)); \ -} while (0) +#define MULTIPLY_16b(C0, C1, C2, CST, DST_s16) \ + do { \ + const int32x4_t tmp0_lo = vmull_n_s16(r_lo, C0); \ + const int32x4_t tmp0_hi = vmull_n_s16(r_hi, C0); \ + const int32x4_t tmp1_lo = vmlal_n_s16(tmp0_lo, g_lo, C1); \ + const int32x4_t tmp1_hi = vmlal_n_s16(tmp0_hi, g_hi, C1); \ + const int32x4_t tmp2_lo = vmlal_n_s16(tmp1_lo, b_lo, C2); \ + const int32x4_t tmp2_hi = vmlal_n_s16(tmp1_hi, b_hi, C2); \ + const int16x8_t tmp3 = \ + vcombine_s16(vshrn_n_s32(tmp2_lo, 16), vshrn_n_s32(tmp2_hi, 16)); \ + DST_s16 = vaddq_s16(tmp3, vdupq_n_s16(CST)); \ + } while (0) // This needs to be a macro, since (128 << SHIFT) needs to be an immediate. -#define CONVERT_RGB_TO_UV(r, g, b, SHIFT, U_DST, V_DST) do { \ - MULTIPLY_16b_PREAMBLE(r, g, b); \ - MULTIPLY_16b(-9719, -19081, 28800, 128 << SHIFT, U_DST); \ - MULTIPLY_16b(28800, -24116, -4684, 128 << SHIFT, V_DST); \ -} while (0) +#define CONVERT_RGB_TO_UV(r, g, b, SHIFT, U_DST, V_DST) \ + do { \ + MULTIPLY_16b_PREAMBLE(r, g, b); \ + MULTIPLY_16b(-9719, -19081, 28800, 128 << SHIFT, U_DST); \ + MULTIPLY_16b(28800, -24116, -4684, 128 << SHIFT, V_DST); \ + } while (0) static void ConvertRGBA32ToUV_NEON(const uint16_t* WEBP_RESTRICT rgb, uint8_t* WEBP_RESTRICT u, @@ -159,8 +160,8 @@ static void ConvertRGBA32ToUV_NEON(const uint16_t* WEBP_RESTRICT rgb, static void ConvertARGBToUV_NEON(const uint32_t* WEBP_RESTRICT argb, uint8_t* WEBP_RESTRICT u, - uint8_t* WEBP_RESTRICT v, - int src_width, int do_store) { + uint8_t* WEBP_RESTRICT v, int src_width, + int do_store) { int i; for (i = 0; i + 16 <= src_width; i += 16, u += 8, v += 8) { const uint8x16x4_t RGB = vld4q_u8((const uint8_t*)&argb[i]); @@ -188,7 +189,6 @@ static void ConvertARGBToUV_NEON(const uint32_t* WEBP_RESTRICT argb, } } - //------------------------------------------------------------------------------ extern void WebPInitConvertARGBToYUVNEON(void); diff --git a/src/dsp/yuv_sse2.c b/src/dsp/yuv_sse2.c index c024ea38..037846f4 100644 --- a/src/dsp/yuv_sse2.c +++ b/src/dsp/yuv_sse2.c @@ -15,7 +15,6 @@ #if defined(WEBP_USE_SSE2) #include - #include #include "src/dsp/common_sse2.h" @@ -34,19 +33,17 @@ // B = (19077 * y + 33050 * u - 17685) >> 6 static void ConvertYUV444ToRGB_SSE2(const __m128i* const Y0, const __m128i* const U0, - const __m128i* const V0, - __m128i* const R, - __m128i* const G, - __m128i* const B) { + const __m128i* const V0, __m128i* const R, + __m128i* const G, __m128i* const B) { const __m128i k19077 = _mm_set1_epi16(19077); const __m128i k26149 = _mm_set1_epi16(26149); const __m128i k14234 = _mm_set1_epi16(14234); // 33050 doesn't fit in a signed short: only use this with unsigned arithmetic const __m128i k33050 = _mm_set1_epi16((short)33050); const __m128i k17685 = _mm_set1_epi16(17685); - const __m128i k6419 = _mm_set1_epi16(6419); + const __m128i k6419 = _mm_set1_epi16(6419); const __m128i k13320 = _mm_set1_epi16(13320); - const __m128i k8708 = _mm_set1_epi16(8708); + const __m128i k8708 = _mm_set1_epi16(8708); const __m128i Y1 = _mm_mulhi_epu16(*Y0, k19077); @@ -66,9 +63,9 @@ static void ConvertYUV444ToRGB_SSE2(const __m128i* const Y0, const __m128i B2 = _mm_subs_epu16(B1, k17685); // use logical shift for B2, which can be larger than 32767 - *R = _mm_srai_epi16(R2, 6); // range: [-14234, 30815] - *G = _mm_srai_epi16(G4, 6); // range: [-10953, 27710] - *B = _mm_srli_epi16(B2, 6); // range: [0, 34238] + *R = _mm_srai_epi16(R2, 6); // range: [-14234, 30815] + *G = _mm_srai_epi16(G4, 6); // range: [-10953, 27710] + *B = _mm_srli_epi16(B2, 6); // range: [0, 34238] } // Load the bytes into the *upper* part of 16b words. That's "<< 8", basically. @@ -82,7 +79,7 @@ static WEBP_INLINE __m128i Load_UV_HI_8_SSE2(const uint8_t* src) { const __m128i zero = _mm_setzero_si128(); const __m128i tmp0 = _mm_cvtsi32_si128(WebPMemToInt32(src)); const __m128i tmp1 = _mm_unpacklo_epi8(zero, tmp0); - return _mm_unpacklo_epi16(tmp1, tmp1); // replicate samples + return _mm_unpacklo_epi16(tmp1, tmp1); // replicate samples } // Convert 32 samples of YUV444 to R/G/B @@ -119,14 +116,14 @@ static WEBP_INLINE void PackAndStore4_SSE2(const __m128i* const R, const __m128i ba = _mm_unpackhi_epi8(rb, ga); const __m128i RGBA_lo = _mm_unpacklo_epi16(rg, ba); const __m128i RGBA_hi = _mm_unpackhi_epi16(rg, ba); - _mm_storeu_si128((__m128i*)(dst + 0), RGBA_lo); + _mm_storeu_si128((__m128i*)(dst + 0), RGBA_lo); _mm_storeu_si128((__m128i*)(dst + 16), RGBA_hi); } // Pack R/G/B/A results into 16b output. static WEBP_INLINE void PackAndStore4444_SSE2( - const __m128i* const R, const __m128i* const G, const __m128i* const B, - const __m128i* const A, uint8_t* WEBP_RESTRICT const dst) { + const __m128i* const R, const __m128i* const G, const __m128i* const B, + const __m128i* const A, uint8_t* WEBP_RESTRICT const dst) { #if (WEBP_SWAP_16BIT_CSP == 0) const __m128i rg0 = _mm_packus_epi16(*R, *G); const __m128i ba0 = _mm_packus_epi16(*B, *A); @@ -187,7 +184,7 @@ static WEBP_INLINE void PlanarTo24b_SSE2(__m128i* const in0, __m128i* const in1, // r0g0b0r1 | g1b1r2g2 | b2r3g3b3 | r4g4b4r5 | g5b5r6g6 | b6r7g7b7 VP8PlanarTo24b_SSE2(in0, in1, in2, in3, in4, in5); - _mm_storeu_si128((__m128i*)(rgb + 0), *in0); + _mm_storeu_si128((__m128i*)(rgb + 0), *in0); _mm_storeu_si128((__m128i*)(rgb + 16), *in1); _mm_storeu_si128((__m128i*)(rgb + 32), *in2); _mm_storeu_si128((__m128i*)(rgb + 48), *in3); @@ -290,8 +287,8 @@ void VP8YuvToBgr32_SSE2(const uint8_t* WEBP_RESTRICT y, __m128i R0, R1, R2, R3, G0, G1, G2, G3, B0, B1, B2, B3; __m128i bgr0, bgr1, bgr2, bgr3, bgr4, bgr5; - YUV444ToRGB_SSE2(y + 0, u + 0, v + 0, &R0, &G0, &B0); - YUV444ToRGB_SSE2(y + 8, u + 8, v + 8, &R1, &G1, &B1); + YUV444ToRGB_SSE2(y + 0, u + 0, v + 0, &R0, &G0, &B0); + YUV444ToRGB_SSE2(y + 8, u + 8, v + 8, &R1, &G1, &B1); YUV444ToRGB_SSE2(y + 16, u + 16, v + 16, &R2, &G2, &B2); YUV444ToRGB_SSE2(y + 24, u + 24, v + 24, &R3, &G3, &B3); @@ -301,7 +298,7 @@ void VP8YuvToBgr32_SSE2(const uint8_t* WEBP_RESTRICT y, bgr2 = _mm_packus_epi16(G0, G1); bgr3 = _mm_packus_epi16(G2, G3); bgr4 = _mm_packus_epi16(R0, R1); - bgr5= _mm_packus_epi16(R2, R3); + bgr5 = _mm_packus_epi16(R2, R3); // Pack as BGRBGRBGRBGR. PlanarTo24b_SSE2(&bgr0, &bgr1, &bgr2, &bgr3, &bgr4, &bgr5, dst); @@ -324,7 +321,7 @@ static void YuvToRgbaRow_SSE2(const uint8_t* WEBP_RESTRICT y, u += 4; v += 4; } - for (; n < len; ++n) { // Finish off + for (; n < len; ++n) { // Finish off VP8YuvToRgba(y[0], u[0], v[0], dst); dst += 4; y += 1; @@ -347,7 +344,7 @@ static void YuvToBgraRow_SSE2(const uint8_t* WEBP_RESTRICT y, u += 4; v += 4; } - for (; n < len; ++n) { // Finish off + for (; n < len; ++n) { // Finish off VP8YuvToBgra(y[0], u[0], v[0], dst); dst += 4; y += 1; @@ -370,7 +367,7 @@ static void YuvToArgbRow_SSE2(const uint8_t* WEBP_RESTRICT y, u += 4; v += 4; } - for (; n < len; ++n) { // Finish off + for (; n < len; ++n) { // Finish off VP8YuvToArgb(y[0], u[0], v[0], dst); dst += 4; y += 1; @@ -388,9 +385,9 @@ static void YuvToRgbRow_SSE2(const uint8_t* WEBP_RESTRICT y, __m128i R0, R1, R2, R3, G0, G1, G2, G3, B0, B1, B2, B3; __m128i rgb0, rgb1, rgb2, rgb3, rgb4, rgb5; - YUV420ToRGB_SSE2(y + 0, u + 0, v + 0, &R0, &G0, &B0); - YUV420ToRGB_SSE2(y + 8, u + 4, v + 4, &R1, &G1, &B1); - YUV420ToRGB_SSE2(y + 16, u + 8, v + 8, &R2, &G2, &B2); + YUV420ToRGB_SSE2(y + 0, u + 0, v + 0, &R0, &G0, &B0); + YUV420ToRGB_SSE2(y + 8, u + 4, v + 4, &R1, &G1, &B1); + YUV420ToRGB_SSE2(y + 16, u + 8, v + 8, &R2, &G2, &B2); YUV420ToRGB_SSE2(y + 24, u + 12, v + 12, &R3, &G3, &B3); // Cast to 8b and store as RRRRGGGGBBBB. @@ -408,7 +405,7 @@ static void YuvToRgbRow_SSE2(const uint8_t* WEBP_RESTRICT y, u += 16; v += 16; } - for (; n < len; ++n) { // Finish off + for (; n < len; ++n) { // Finish off VP8YuvToRgb(y[0], u[0], v[0], dst); dst += 3; y += 1; @@ -426,9 +423,9 @@ static void YuvToBgrRow_SSE2(const uint8_t* WEBP_RESTRICT y, __m128i R0, R1, R2, R3, G0, G1, G2, G3, B0, B1, B2, B3; __m128i bgr0, bgr1, bgr2, bgr3, bgr4, bgr5; - YUV420ToRGB_SSE2(y + 0, u + 0, v + 0, &R0, &G0, &B0); - YUV420ToRGB_SSE2(y + 8, u + 4, v + 4, &R1, &G1, &B1); - YUV420ToRGB_SSE2(y + 16, u + 8, v + 8, &R2, &G2, &B2); + YUV420ToRGB_SSE2(y + 0, u + 0, v + 0, &R0, &G0, &B0); + YUV420ToRGB_SSE2(y + 8, u + 4, v + 4, &R1, &G1, &B1); + YUV420ToRGB_SSE2(y + 16, u + 8, v + 8, &R2, &G2, &B2); YUV420ToRGB_SSE2(y + 24, u + 12, v + 12, &R3, &G3, &B3); // Cast to 8b and store as BBBBGGGGRRRR. @@ -446,7 +443,7 @@ static void YuvToBgrRow_SSE2(const uint8_t* WEBP_RESTRICT y, u += 16; v += 16; } - for (; n < len; ++n) { // Finish off + for (; n < len; ++n) { // Finish off VP8YuvToBgr(y[0], u[0], v[0], dst); dst += 3; y += 1; @@ -461,9 +458,9 @@ static void YuvToBgrRow_SSE2(const uint8_t* WEBP_RESTRICT y, extern void WebPInitSamplersSSE2(void); WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersSSE2(void) { - WebPSamplers[MODE_RGB] = YuvToRgbRow_SSE2; + WebPSamplers[MODE_RGB] = YuvToRgbRow_SSE2; WebPSamplers[MODE_RGBA] = YuvToRgbaRow_SSE2; - WebPSamplers[MODE_BGR] = YuvToBgrRow_SSE2; + WebPSamplers[MODE_BGR] = YuvToBgrRow_SSE2; WebPSamplers[MODE_BGRA] = YuvToBgraRow_SSE2; WebPSamplers[MODE_ARGB] = YuvToArgbRow_SSE2; } @@ -494,7 +491,7 @@ static WEBP_INLINE void RGB24PackedToPlanarHelper_SSE2( static WEBP_INLINE void RGBPackedToPlanar_SSE2( const uint8_t* WEBP_RESTRICT const rgb, __m128i* const out /*out[6]*/) { __m128i tmp[6]; - tmp[0] = _mm_loadu_si128((const __m128i*)(rgb + 0)); + tmp[0] = _mm_loadu_si128((const __m128i*)(rgb + 0)); tmp[1] = _mm_loadu_si128((const __m128i*)(rgb + 16)); tmp[2] = _mm_loadu_si128((const __m128i*)(rgb + 32)); tmp[3] = _mm_loadu_si128((const __m128i*)(rgb + 48)); @@ -551,20 +548,21 @@ static WEBP_INLINE void RGB32PackedToPlanar16_SSE2( // This macro computes (RG * MULT_RG + GB * MULT_GB + ROUNDER) >> DESCALE_FIX // It's a macro and not a function because we need to use immediate values with // srai_epi32, e.g. -#define TRANSFORM(RG_LO, RG_HI, GB_LO, GB_HI, MULT_RG, MULT_GB, \ - ROUNDER, DESCALE_FIX, OUT) do { \ - const __m128i V0_lo = _mm_madd_epi16(RG_LO, MULT_RG); \ - const __m128i V0_hi = _mm_madd_epi16(RG_HI, MULT_RG); \ - const __m128i V1_lo = _mm_madd_epi16(GB_LO, MULT_GB); \ - const __m128i V1_hi = _mm_madd_epi16(GB_HI, MULT_GB); \ - const __m128i V2_lo = _mm_add_epi32(V0_lo, V1_lo); \ - const __m128i V2_hi = _mm_add_epi32(V0_hi, V1_hi); \ - const __m128i V3_lo = _mm_add_epi32(V2_lo, ROUNDER); \ - const __m128i V3_hi = _mm_add_epi32(V2_hi, ROUNDER); \ - const __m128i V5_lo = _mm_srai_epi32(V3_lo, DESCALE_FIX); \ - const __m128i V5_hi = _mm_srai_epi32(V3_hi, DESCALE_FIX); \ - (OUT) = _mm_packs_epi32(V5_lo, V5_hi); \ -} while (0) +#define TRANSFORM(RG_LO, RG_HI, GB_LO, GB_HI, MULT_RG, MULT_GB, ROUNDER, \ + DESCALE_FIX, OUT) \ + do { \ + const __m128i V0_lo = _mm_madd_epi16(RG_LO, MULT_RG); \ + const __m128i V0_hi = _mm_madd_epi16(RG_HI, MULT_RG); \ + const __m128i V1_lo = _mm_madd_epi16(GB_LO, MULT_GB); \ + const __m128i V1_hi = _mm_madd_epi16(GB_HI, MULT_GB); \ + const __m128i V2_lo = _mm_add_epi32(V0_lo, V1_lo); \ + const __m128i V2_hi = _mm_add_epi32(V0_hi, V1_hi); \ + const __m128i V3_lo = _mm_add_epi32(V2_lo, ROUNDER); \ + const __m128i V3_hi = _mm_add_epi32(V2_hi, ROUNDER); \ + const __m128i V5_lo = _mm_srai_epi32(V3_lo, DESCALE_FIX); \ + const __m128i V5_hi = _mm_srai_epi32(V3_hi, DESCALE_FIX); \ + (OUT) = _mm_packs_epi32(V5_lo, V5_hi); \ + } while (0) #define MK_CST_16(A, B) _mm_set_epi16((B), (A), (B), (A), (B), (A), (B), (A)) static WEBP_INLINE void ConvertRGBToYImpl_SSE2(const __m128i* const R, @@ -597,10 +595,10 @@ static WEBP_INLINE void ConvertRGBToUV_SSE2(const __m128i* const R, const __m128i RG_hi = _mm_unpackhi_epi16(*R, *G); const __m128i GB_lo = _mm_unpacklo_epi16(*G, *B); const __m128i GB_hi = _mm_unpackhi_epi16(*G, *B); - TRANSFORM(RG_lo, RG_hi, GB_lo, GB_hi, kRG_u, kGB_u, - kHALF_UV, YUV_FIX + 2, *U); - TRANSFORM(RG_lo, RG_hi, GB_lo, GB_hi, kRG_v, kGB_v, - kHALF_UV, YUV_FIX + 2, *V); + TRANSFORM(RG_lo, RG_hi, GB_lo, GB_hi, kRG_u, kGB_u, kHALF_UV, YUV_FIX + 2, + *U); + TRANSFORM(RG_lo, RG_hi, GB_lo, GB_hi, kRG_v, kGB_v, kHALF_UV, YUV_FIX + 2, + *V); } #undef MK_CST_16 @@ -685,18 +683,17 @@ static void ConvertARGBToY_SSE2(const uint32_t* WEBP_RESTRICT argb, ConvertRGBToYImpl_SSE2(&rgb[1], &rgb[3], &rgb[5], &Y1); STORE_16(_mm_packus_epi16(Y0, Y1), y + i); } - for (; i < width; ++i) { // left-over + for (; i < width; ++i) { // left-over const uint32_t p = argb[i]; - y[i] = VP8RGBToY((p >> 16) & 0xff, (p >> 8) & 0xff, (p >> 0) & 0xff, - YUV_HALF); + y[i] = + VP8RGBToY((p >> 16) & 0xff, (p >> 8) & 0xff, (p >> 0) & 0xff, YUV_HALF); } } // Horizontal add (doubled) of two 16b values, result is 16b. // in: A | B | C | D | ... -> out: 2*(A+B) | 2*(C+D) | ... static void HorizontalAddPack_SSE2(const __m128i* const A, - const __m128i* const B, - __m128i* const out) { + const __m128i* const B, __m128i* const out) { const __m128i k2 = _mm_set1_epi16(2); const __m128i C = _mm_madd_epi16(*A, k2); const __m128i D = _mm_madd_epi16(*B, k2); @@ -705,8 +702,8 @@ static void HorizontalAddPack_SSE2(const __m128i* const A, static void ConvertARGBToUV_SSE2(const uint32_t* WEBP_RESTRICT argb, uint8_t* WEBP_RESTRICT u, - uint8_t* WEBP_RESTRICT v, - int src_width, int do_store) { + uint8_t* WEBP_RESTRICT v, int src_width, + int do_store) { const int max_width = src_width & ~31; int i; for (i = 0; i < max_width; i += 32, u += 16, v += 16) { @@ -741,10 +738,10 @@ static void ConvertARGBToUV_SSE2(const uint32_t* WEBP_RESTRICT argb, // Convert 16 packed ARGB 16b-values to r[], g[], b[] static WEBP_INLINE void RGBA32PackedToPlanar_16b_SSE2( - const uint16_t* WEBP_RESTRICT const rgbx, - __m128i* const r, __m128i* const g, __m128i* const b) { - const __m128i in0 = LOAD_16(rgbx + 0); // r0 | g0 | b0 |x| r1 | g1 | b1 |x - const __m128i in1 = LOAD_16(rgbx + 8); // r2 | g2 | b2 |x| r3 | g3 | b3 |x + const uint16_t* WEBP_RESTRICT const rgbx, __m128i* const r, + __m128i* const g, __m128i* const b) { + const __m128i in0 = LOAD_16(rgbx + 0); // r0 | g0 | b0 |x| r1 | g1 | b1 |x + const __m128i in1 = LOAD_16(rgbx + 8); // r2 | g2 | b2 |x| r3 | g3 | b3 |x const __m128i in2 = LOAD_16(rgbx + 16); // r4 | ... const __m128i in3 = LOAD_16(rgbx + 24); // r6 | ... // column-wise transpose @@ -768,7 +765,7 @@ static void ConvertRGBA32ToUV_SSE2(const uint16_t* WEBP_RESTRICT rgb, const uint16_t* const last_rgb = rgb + 4 * max_width; while (rgb < last_rgb) { __m128i r, g, b, U0, V0, U1, V1; - RGBA32PackedToPlanar_16b_SSE2(rgb + 0, &r, &g, &b); + RGBA32PackedToPlanar_16b_SSE2(rgb + 0, &r, &g, &b); ConvertRGBToUV_SSE2(&r, &g, &b, &U0, &V0); RGBA32PackedToPlanar_16b_SSE2(rgb + 32, &r, &g, &b); ConvertRGBToUV_SSE2(&r, &g, &b, &U1, &V1); diff --git a/src/dsp/yuv_sse41.c b/src/dsp/yuv_sse41.c index dfcb2cc0..ee24af94 100644 --- a/src/dsp/yuv_sse41.c +++ b/src/dsp/yuv_sse41.c @@ -16,7 +16,6 @@ #if defined(WEBP_USE_SSE41) #include #include - #include #include "src/dsp/common_sse41.h" @@ -35,19 +34,17 @@ // B = (19077 * y + 33050 * u - 17685) >> 6 static void ConvertYUV444ToRGB_SSE41(const __m128i* const Y0, const __m128i* const U0, - const __m128i* const V0, - __m128i* const R, - __m128i* const G, - __m128i* const B) { + const __m128i* const V0, __m128i* const R, + __m128i* const G, __m128i* const B) { const __m128i k19077 = _mm_set1_epi16(19077); const __m128i k26149 = _mm_set1_epi16(26149); const __m128i k14234 = _mm_set1_epi16(14234); // 33050 doesn't fit in a signed short: only use this with unsigned arithmetic const __m128i k33050 = _mm_set1_epi16((short)33050); const __m128i k17685 = _mm_set1_epi16(17685); - const __m128i k6419 = _mm_set1_epi16(6419); + const __m128i k6419 = _mm_set1_epi16(6419); const __m128i k13320 = _mm_set1_epi16(13320); - const __m128i k8708 = _mm_set1_epi16(8708); + const __m128i k8708 = _mm_set1_epi16(8708); const __m128i Y1 = _mm_mulhi_epu16(*Y0, k19077); @@ -67,9 +64,9 @@ static void ConvertYUV444ToRGB_SSE41(const __m128i* const Y0, const __m128i B2 = _mm_subs_epu16(B1, k17685); // use logical shift for B2, which can be larger than 32767 - *R = _mm_srai_epi16(R2, 6); // range: [-14234, 30815] - *G = _mm_srai_epi16(G4, 6); // range: [-10953, 27710] - *B = _mm_srli_epi16(B2, 6); // range: [0, 34238] + *R = _mm_srai_epi16(R2, 6); // range: [-14234, 30815] + *G = _mm_srai_epi16(G4, 6); // range: [-10953, 27710] + *B = _mm_srli_epi16(B2, 6); // range: [0, 34238] } // Load the bytes into the *upper* part of 16b words. That's "<< 8", basically. @@ -83,7 +80,7 @@ static WEBP_INLINE __m128i Load_UV_HI_8_SSE41(const uint8_t* src) { const __m128i zero = _mm_setzero_si128(); const __m128i tmp0 = _mm_cvtsi32_si128(WebPMemToInt32(src)); const __m128i tmp1 = _mm_unpacklo_epi8(zero, tmp0); - return _mm_unpacklo_epi16(tmp1, tmp1); // replicate samples + return _mm_unpacklo_epi16(tmp1, tmp1); // replicate samples } // Convert 32 samples of YUV444 to R/G/B @@ -129,7 +126,7 @@ static WEBP_INLINE void PlanarTo24b_SSE41( // r0g0b0r1 | g1b1r2g2 | b2r3g3b3 | r4g4b4r5 | g5b5r6g6 | b6r7g7b7 VP8PlanarTo24b_SSE41(in0, in1, in2, in3, in4, in5); - _mm_storeu_si128((__m128i*)(rgb + 0), *in0); + _mm_storeu_si128((__m128i*)(rgb + 0), *in0); _mm_storeu_si128((__m128i*)(rgb + 16), *in1); _mm_storeu_si128((__m128i*)(rgb + 32), *in2); _mm_storeu_si128((__m128i*)(rgb + 48), *in3); @@ -168,8 +165,8 @@ void VP8YuvToBgr32_SSE41(const uint8_t* WEBP_RESTRICT y, __m128i R0, R1, R2, R3, G0, G1, G2, G3, B0, B1, B2, B3; __m128i bgr0, bgr1, bgr2, bgr3, bgr4, bgr5; - YUV444ToRGB_SSE41(y + 0, u + 0, v + 0, &R0, &G0, &B0); - YUV444ToRGB_SSE41(y + 8, u + 8, v + 8, &R1, &G1, &B1); + YUV444ToRGB_SSE41(y + 0, u + 0, v + 0, &R0, &G0, &B0); + YUV444ToRGB_SSE41(y + 8, u + 8, v + 8, &R1, &G1, &B1); YUV444ToRGB_SSE41(y + 16, u + 16, v + 16, &R2, &G2, &B2); YUV444ToRGB_SSE41(y + 24, u + 24, v + 24, &R3, &G3, &B3); @@ -179,7 +176,7 @@ void VP8YuvToBgr32_SSE41(const uint8_t* WEBP_RESTRICT y, bgr2 = _mm_packus_epi16(G0, G1); bgr3 = _mm_packus_epi16(G2, G3); bgr4 = _mm_packus_epi16(R0, R1); - bgr5= _mm_packus_epi16(R2, R3); + bgr5 = _mm_packus_epi16(R2, R3); // Pack as BGRBGRBGRBGR. PlanarTo24b_SSE41(&bgr0, &bgr1, &bgr2, &bgr3, &bgr4, &bgr5, dst); @@ -197,9 +194,9 @@ static void YuvToRgbRow_SSE41(const uint8_t* WEBP_RESTRICT y, __m128i R0, R1, R2, R3, G0, G1, G2, G3, B0, B1, B2, B3; __m128i rgb0, rgb1, rgb2, rgb3, rgb4, rgb5; - YUV420ToRGB_SSE41(y + 0, u + 0, v + 0, &R0, &G0, &B0); - YUV420ToRGB_SSE41(y + 8, u + 4, v + 4, &R1, &G1, &B1); - YUV420ToRGB_SSE41(y + 16, u + 8, v + 8, &R2, &G2, &B2); + YUV420ToRGB_SSE41(y + 0, u + 0, v + 0, &R0, &G0, &B0); + YUV420ToRGB_SSE41(y + 8, u + 4, v + 4, &R1, &G1, &B1); + YUV420ToRGB_SSE41(y + 16, u + 8, v + 8, &R2, &G2, &B2); YUV420ToRGB_SSE41(y + 24, u + 12, v + 12, &R3, &G3, &B3); // Cast to 8b and store as RRRRGGGGBBBB. @@ -217,7 +214,7 @@ static void YuvToRgbRow_SSE41(const uint8_t* WEBP_RESTRICT y, u += 16; v += 16; } - for (; n < len; ++n) { // Finish off + for (; n < len; ++n) { // Finish off VP8YuvToRgb(y[0], u[0], v[0], dst); dst += 3; y += 1; @@ -235,9 +232,9 @@ static void YuvToBgrRow_SSE41(const uint8_t* WEBP_RESTRICT y, __m128i R0, R1, R2, R3, G0, G1, G2, G3, B0, B1, B2, B3; __m128i bgr0, bgr1, bgr2, bgr3, bgr4, bgr5; - YUV420ToRGB_SSE41(y + 0, u + 0, v + 0, &R0, &G0, &B0); - YUV420ToRGB_SSE41(y + 8, u + 4, v + 4, &R1, &G1, &B1); - YUV420ToRGB_SSE41(y + 16, u + 8, v + 8, &R2, &G2, &B2); + YUV420ToRGB_SSE41(y + 0, u + 0, v + 0, &R0, &G0, &B0); + YUV420ToRGB_SSE41(y + 8, u + 4, v + 4, &R1, &G1, &B1); + YUV420ToRGB_SSE41(y + 16, u + 8, v + 8, &R2, &G2, &B2); YUV420ToRGB_SSE41(y + 24, u + 12, v + 12, &R3, &G3, &B3); // Cast to 8b and store as BBBBGGGGRRRR. @@ -255,7 +252,7 @@ static void YuvToBgrRow_SSE41(const uint8_t* WEBP_RESTRICT y, u += 16; v += 16; } - for (; n < len; ++n) { // Finish off + for (; n < len; ++n) { // Finish off VP8YuvToBgr(y[0], u[0], v[0], dst); dst += 3; y += 1; @@ -270,8 +267,8 @@ static void YuvToBgrRow_SSE41(const uint8_t* WEBP_RESTRICT y, extern void WebPInitSamplersSSE41(void); WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersSSE41(void) { - WebPSamplers[MODE_RGB] = YuvToRgbRow_SSE41; - WebPSamplers[MODE_BGR] = YuvToBgrRow_SSE41; + WebPSamplers[MODE_RGB] = YuvToRgbRow_SSE41; + WebPSamplers[MODE_BGR] = YuvToBgrRow_SSE41; } //------------------------------------------------------------------------------ @@ -282,27 +279,28 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersSSE41(void) { // Store either 16b-words into *dst #define STORE_16(V, dst) _mm_storeu_si128((__m128i*)(dst), (V)) -#define WEBP_SSE41_SHUFF(OUT) do { \ - const __m128i tmp0 = _mm_shuffle_epi8(A0, shuff0); \ - const __m128i tmp1 = _mm_shuffle_epi8(A1, shuff1); \ - const __m128i tmp2 = _mm_shuffle_epi8(A2, shuff2); \ - const __m128i tmp3 = _mm_shuffle_epi8(A3, shuff0); \ - const __m128i tmp4 = _mm_shuffle_epi8(A4, shuff1); \ - const __m128i tmp5 = _mm_shuffle_epi8(A5, shuff2); \ - \ - /* OR everything to get one channel */ \ - const __m128i tmp6 = _mm_or_si128(tmp0, tmp1); \ - const __m128i tmp7 = _mm_or_si128(tmp3, tmp4); \ - out[OUT + 0] = _mm_or_si128(tmp6, tmp2); \ - out[OUT + 1] = _mm_or_si128(tmp7, tmp5); \ -} while (0); +#define WEBP_SSE41_SHUFF(OUT) \ + do { \ + const __m128i tmp0 = _mm_shuffle_epi8(A0, shuff0); \ + const __m128i tmp1 = _mm_shuffle_epi8(A1, shuff1); \ + const __m128i tmp2 = _mm_shuffle_epi8(A2, shuff2); \ + const __m128i tmp3 = _mm_shuffle_epi8(A3, shuff0); \ + const __m128i tmp4 = _mm_shuffle_epi8(A4, shuff1); \ + const __m128i tmp5 = _mm_shuffle_epi8(A5, shuff2); \ + \ + /* OR everything to get one channel */ \ + const __m128i tmp6 = _mm_or_si128(tmp0, tmp1); \ + const __m128i tmp7 = _mm_or_si128(tmp3, tmp4); \ + out[OUT + 0] = _mm_or_si128(tmp6, tmp2); \ + out[OUT + 1] = _mm_or_si128(tmp7, tmp5); \ + } while (0); // Unpack the 8b input rgbrgbrgbrgb ... as contiguous registers: // rrrr... rrrr... gggg... gggg... bbbb... bbbb.... // Similar to PlanarTo24bHelper(), but in reverse order. static WEBP_INLINE void RGBPackedToPlanar_SSE41( const uint8_t* WEBP_RESTRICT const rgb, __m128i* const out /*out[6]*/) { - const __m128i A0 = _mm_loadu_si128((const __m128i*)(rgb + 0)); + const __m128i A0 = _mm_loadu_si128((const __m128i*)(rgb + 0)); const __m128i A1 = _mm_loadu_si128((const __m128i*)(rgb + 16)); const __m128i A2 = _mm_loadu_si128((const __m128i*)(rgb + 32)); const __m128i A3 = _mm_loadu_si128((const __m128i*)(rgb + 48)); @@ -311,32 +309,32 @@ static WEBP_INLINE void RGBPackedToPlanar_SSE41( // Compute RR. { - const __m128i shuff0 = _mm_set_epi8( - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15, 12, 9, 6, 3, 0); - const __m128i shuff1 = _mm_set_epi8( - -1, -1, -1, -1, -1, 14, 11, 8, 5, 2, -1, -1, -1, -1, -1, -1); - const __m128i shuff2 = _mm_set_epi8( - 13, 10, 7, 4, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1); + const __m128i shuff0 = _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 15, 12, 9, 6, 3, 0); + const __m128i shuff1 = _mm_set_epi8(-1, -1, -1, -1, -1, 14, 11, 8, 5, 2, -1, + -1, -1, -1, -1, -1); + const __m128i shuff2 = _mm_set_epi8(13, 10, 7, 4, 1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1); WEBP_SSE41_SHUFF(0) } // Compute GG. { - const __m128i shuff0 = _mm_set_epi8( - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13, 10, 7, 4, 1); - const __m128i shuff1 = _mm_set_epi8( - -1, -1, -1, -1, -1, 15, 12, 9, 6, 3, 0, -1, -1, -1, -1, -1); - const __m128i shuff2 = _mm_set_epi8( - 14, 11, 8, 5, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1); + const __m128i shuff0 = _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 13, 10, 7, 4, 1); + const __m128i shuff1 = _mm_set_epi8(-1, -1, -1, -1, -1, 15, 12, 9, 6, 3, 0, + -1, -1, -1, -1, -1); + const __m128i shuff2 = _mm_set_epi8(14, 11, 8, 5, 2, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1); WEBP_SSE41_SHUFF(2) } // Compute BB. { - const __m128i shuff0 = _mm_set_epi8( - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 11, 8, 5, 2); - const __m128i shuff1 = _mm_set_epi8( - -1, -1, -1, -1, -1, -1, 13, 10, 7, 4, 1, -1, -1, -1, -1, -1); - const __m128i shuff2 = _mm_set_epi8( - 15, 12, 9, 6, 3, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1); + const __m128i shuff0 = _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 14, 11, 8, 5, 2); + const __m128i shuff1 = _mm_set_epi8(-1, -1, -1, -1, -1, -1, 13, 10, 7, 4, 1, + -1, -1, -1, -1, -1); + const __m128i shuff2 = _mm_set_epi8(15, 12, 9, 6, 3, 0, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1); WEBP_SSE41_SHUFF(4) } } @@ -384,20 +382,21 @@ static WEBP_INLINE void ARGBPackedToRGBPlanar16_SSE41( // This macro computes (RG * MULT_RG + GB * MULT_GB + ROUNDER) >> DESCALE_FIX // It's a macro and not a function because we need to use immediate values with // srai_epi32, e.g. -#define TRANSFORM(RG_LO, RG_HI, GB_LO, GB_HI, MULT_RG, MULT_GB, \ - ROUNDER, DESCALE_FIX, OUT) do { \ - const __m128i V0_lo = _mm_madd_epi16(RG_LO, MULT_RG); \ - const __m128i V0_hi = _mm_madd_epi16(RG_HI, MULT_RG); \ - const __m128i V1_lo = _mm_madd_epi16(GB_LO, MULT_GB); \ - const __m128i V1_hi = _mm_madd_epi16(GB_HI, MULT_GB); \ - const __m128i V2_lo = _mm_add_epi32(V0_lo, V1_lo); \ - const __m128i V2_hi = _mm_add_epi32(V0_hi, V1_hi); \ - const __m128i V3_lo = _mm_add_epi32(V2_lo, ROUNDER); \ - const __m128i V3_hi = _mm_add_epi32(V2_hi, ROUNDER); \ - const __m128i V5_lo = _mm_srai_epi32(V3_lo, DESCALE_FIX); \ - const __m128i V5_hi = _mm_srai_epi32(V3_hi, DESCALE_FIX); \ - (OUT) = _mm_packs_epi32(V5_lo, V5_hi); \ -} while (0) +#define TRANSFORM(RG_LO, RG_HI, GB_LO, GB_HI, MULT_RG, MULT_GB, ROUNDER, \ + DESCALE_FIX, OUT) \ + do { \ + const __m128i V0_lo = _mm_madd_epi16(RG_LO, MULT_RG); \ + const __m128i V0_hi = _mm_madd_epi16(RG_HI, MULT_RG); \ + const __m128i V1_lo = _mm_madd_epi16(GB_LO, MULT_GB); \ + const __m128i V1_hi = _mm_madd_epi16(GB_HI, MULT_GB); \ + const __m128i V2_lo = _mm_add_epi32(V0_lo, V1_lo); \ + const __m128i V2_hi = _mm_add_epi32(V0_hi, V1_hi); \ + const __m128i V3_lo = _mm_add_epi32(V2_lo, ROUNDER); \ + const __m128i V3_hi = _mm_add_epi32(V2_hi, ROUNDER); \ + const __m128i V5_lo = _mm_srai_epi32(V3_lo, DESCALE_FIX); \ + const __m128i V5_hi = _mm_srai_epi32(V3_hi, DESCALE_FIX); \ + (OUT) = _mm_packs_epi32(V5_lo, V5_hi); \ + } while (0) #define MK_CST_16(A, B) _mm_set_epi16((B), (A), (B), (A), (B), (A), (B), (A)) static WEBP_INLINE void ConvertRGBToYImpl_SSE41(const __m128i* const R, @@ -430,10 +429,10 @@ static WEBP_INLINE void ConvertRGBToUV_SSE41(const __m128i* const R, const __m128i RG_hi = _mm_unpackhi_epi16(*R, *G); const __m128i GB_lo = _mm_unpacklo_epi16(*G, *B); const __m128i GB_hi = _mm_unpackhi_epi16(*G, *B); - TRANSFORM(RG_lo, RG_hi, GB_lo, GB_hi, kRG_u, kGB_u, - kHALF_UV, YUV_FIX + 2, *U); - TRANSFORM(RG_lo, RG_hi, GB_lo, GB_hi, kRG_v, kGB_v, - kHALF_UV, YUV_FIX + 2, *V); + TRANSFORM(RG_lo, RG_hi, GB_lo, GB_hi, kRG_u, kGB_u, kHALF_UV, YUV_FIX + 2, + *U); + TRANSFORM(RG_lo, RG_hi, GB_lo, GB_hi, kRG_v, kGB_v, kHALF_UV, YUV_FIX + 2, + *V); } #undef MK_CST_16 @@ -518,10 +517,10 @@ static void ConvertARGBToY_SSE41(const uint32_t* WEBP_RESTRICT argb, ConvertRGBToYImpl_SSE41(&rgb[1], &rgb[3], &rgb[5], &Y1); STORE_16(_mm_packus_epi16(Y0, Y1), y + i); } - for (; i < width; ++i) { // left-over + for (; i < width; ++i) { // left-over const uint32_t p = argb[i]; - y[i] = VP8RGBToY((p >> 16) & 0xff, (p >> 8) & 0xff, (p >> 0) & 0xff, - YUV_HALF); + y[i] = + VP8RGBToY((p >> 16) & 0xff, (p >> 8) & 0xff, (p >> 0) & 0xff, YUV_HALF); } } @@ -538,8 +537,8 @@ static void HorizontalAddPack_SSE41(const __m128i* const A, static void ConvertARGBToUV_SSE41(const uint32_t* WEBP_RESTRICT argb, uint8_t* WEBP_RESTRICT u, - uint8_t* WEBP_RESTRICT v, - int src_width, int do_store) { + uint8_t* WEBP_RESTRICT v, int src_width, + int do_store) { const int max_width = src_width & ~31; int i; for (i = 0; i < max_width; i += 32, u += 16, v += 16) { @@ -574,10 +573,10 @@ static void ConvertARGBToUV_SSE41(const uint32_t* WEBP_RESTRICT argb, // Convert 16 packed ARGB 16b-values to r[], g[], b[] static WEBP_INLINE void RGBA32PackedToPlanar_16b_SSE41( - const uint16_t* WEBP_RESTRICT const rgbx, - __m128i* const r, __m128i* const g, __m128i* const b) { - const __m128i in0 = LOAD_16(rgbx + 0); // r0 | g0 | b0 |x| r1 | g1 | b1 |x - const __m128i in1 = LOAD_16(rgbx + 8); // r2 | g2 | b2 |x| r3 | g3 | b3 |x + const uint16_t* WEBP_RESTRICT const rgbx, __m128i* const r, + __m128i* const g, __m128i* const b) { + const __m128i in0 = LOAD_16(rgbx + 0); // r0 | g0 | b0 |x| r1 | g1 | b1 |x + const __m128i in1 = LOAD_16(rgbx + 8); // r2 | g2 | b2 |x| r3 | g3 | b3 |x const __m128i in2 = LOAD_16(rgbx + 16); // r4 | ... const __m128i in3 = LOAD_16(rgbx + 24); // r6 | ... // aarrggbb as 16-bit. @@ -611,7 +610,7 @@ static void ConvertRGBA32ToUV_SSE41(const uint16_t* WEBP_RESTRICT rgb, const uint16_t* const last_rgb = rgb + 4 * max_width; while (rgb < last_rgb) { __m128i r, g, b, U0, V0, U1, V1; - RGBA32PackedToPlanar_16b_SSE41(rgb + 0, &r, &g, &b); + RGBA32PackedToPlanar_16b_SSE41(rgb + 0, &r, &g, &b); ConvertRGBToUV_SSE41(&r, &g, &b, &U0, &V0); RGBA32PackedToPlanar_16b_SSE41(rgb + 32, &r, &g, &b); ConvertRGBToUV_SSE41(&r, &g, &b, &U1, &V1); diff --git a/src/enc/alpha_enc.c b/src/enc/alpha_enc.c index 7153fc24..56b46153 100644 --- a/src/enc/alpha_enc.c +++ b/src/enc/alpha_enc.c @@ -16,7 +16,6 @@ #include #include "src/dsp/dsp.h" -#include "src/webp/types.h" #include "src/enc/vp8i_enc.h" #include "src/utils/bit_writer_utils.h" #include "src/utils/filters_utils.h" @@ -25,6 +24,7 @@ #include "src/utils/utils.h" #include "src/webp/encode.h" #include "src/webp/format_constants.h" +#include "src/webp/types.h" // ----------------------------------------------------------------------------- // Encodes the given alpha data via specified compression method 'method'. @@ -110,8 +110,7 @@ typedef struct { static int EncodeAlphaInternal(const uint8_t* const data, int width, int height, int method, int filter, int reduce_levels, int effort_level, // in [0..6] range - uint8_t* const tmp_alpha, - FilterTrial* result) { + uint8_t* const tmp_alpha, FilterTrial* result) { int ok = 0; const uint8_t* alpha_src; WebPFilterFunc filter_func; @@ -131,7 +130,7 @@ static int EncodeAlphaInternal(const uint8_t* const data, int width, int height, if (filter_func != NULL) { filter_func(data, width, height, width, tmp_alpha); alpha_src = tmp_alpha; - } else { + } else { alpha_src = data; } @@ -187,7 +186,7 @@ static int GetNumColors(const uint8_t* data, int width, int height, int stride) { int j; int colors = 0; - uint8_t color[256] = { 0 }; + uint8_t color[256] = {0}; for (j = 0; j < height; ++j) { int i; @@ -217,8 +216,8 @@ static uint32_t GetFilterMap(const uint8_t* alpha, int width, int height, const int num_colors = GetNumColors(alpha, width, height, width); // For low number of colors, NONE yields better compression. filter = (num_colors <= kMinColorsForFilterNone) - ? WEBP_FILTER_NONE - : WebPEstimateBestFilter(alpha, width, height, width); + ? WEBP_FILTER_NONE + : WebPEstimateBestFilter(alpha, width, height, width); bit_map |= 1 << filter; // For large number of colors, try FILTER_NONE in addition to the best // filter as well. @@ -246,12 +245,11 @@ static int ApplyFiltersAndEncode(const uint8_t* alpha, int width, int height, WebPAuxStats* const stats) { int ok = 1; FilterTrial best; - uint32_t try_map = - GetFilterMap(alpha, width, height, filter, effort_level); + uint32_t try_map = GetFilterMap(alpha, width, height, filter, effort_level); InitFilterTrial(&best); if (try_map != FILTER_TRY_NONE) { - uint8_t* filtered_alpha = (uint8_t*)WebPSafeMalloc(1ULL, data_size); + uint8_t* filtered_alpha = (uint8_t*)WebPSafeMalloc(1ULL, data_size); if (filtered_alpha == NULL) return 0; for (filter = WEBP_FILTER_NONE; ok && try_map; ++filter, try_map >>= 1) { @@ -297,10 +295,9 @@ static int ApplyFiltersAndEncode(const uint8_t* alpha, int width, int height, return ok; } -static int EncodeAlpha(VP8Encoder* const enc, - int quality, int method, int filter, - int effort_level, - uint8_t** const output, size_t* const output_size) { +static int EncodeAlpha(VP8Encoder* const enc, int quality, int method, + int filter, int effort_level, uint8_t** const output, + size_t* const output_size) { const WebPPicture* const pic = enc->pic; const int width = pic->width; const int height = pic->height; @@ -344,8 +341,8 @@ static int EncodeAlpha(VP8Encoder* const enc, // 16 alpha levels gives quite a low MSE w.r.t original alpha plane hence // mapped to moderate quality 70. Hence Quality:[0, 70] -> Levels:[2, 16] // and Quality:]70, 100] -> Levels:]16, 256]. - const int alpha_levels = (quality <= 70) ? (2 + quality / 5) - : (16 + (quality - 70) * 8); + const int alpha_levels = + (quality <= 70) ? (2 + quality / 5) : (16 + (quality - 70) * 8); ok = QuantizeLevels(quant_alpha, width, height, alpha_levels, &sse); } @@ -379,9 +376,9 @@ static int CompressAlphaJob(void* arg1, void* unused) { size_t alpha_size = 0; const int effort_level = config->method; // maps to [0..6] const WEBP_FILTER_TYPE filter = - (config->alpha_filtering == 0) ? WEBP_FILTER_NONE : - (config->alpha_filtering == 1) ? WEBP_FILTER_FAST : - WEBP_FILTER_BEST; + (config->alpha_filtering == 0) ? WEBP_FILTER_NONE + : (config->alpha_filtering == 1) ? WEBP_FILTER_FAST + : WEBP_FILTER_BEST; if (!EncodeAlpha(enc, config->alpha_quality, config->alpha_compression, filter, effort_level, &alpha_data, &alpha_size)) { return 0; @@ -421,7 +418,7 @@ int VP8EncStartAlpha(VP8Encoder* const enc) { WebPGetWorkerInterface()->Launch(worker); return 1; } else { - return CompressAlphaJob(enc, NULL); // just do the job right away + return CompressAlphaJob(enc, NULL); // just do the job right away } } return 1; diff --git a/src/enc/analysis_enc.c b/src/enc/analysis_enc.c index f80f61e2..aebdccab 100644 --- a/src/enc/analysis_enc.c +++ b/src/enc/analysis_enc.c @@ -23,7 +23,7 @@ #include "src/webp/encode.h" #include "src/webp/types.h" -#define MAX_ITERS_K_MEANS 6 +#define MAX_ITERS_K_MEANS 6 //------------------------------------------------------------------------------ // Smooth the segment map by replacing isolated block by the majority of its @@ -35,23 +35,23 @@ static void SmoothSegmentMap(VP8Encoder* const enc) { const int h = enc->mb_h; const int majority_cnt_3_x_3_grid = 5; uint8_t* const tmp = (uint8_t*)WebPSafeMalloc(w * h, sizeof(*tmp)); - assert((uint64_t)(w * h) == (uint64_t)w * h); // no overflow, as per spec + assert((uint64_t)(w * h) == (uint64_t)w * h); // no overflow, as per spec if (tmp == NULL) return; for (y = 1; y < h - 1; ++y) { for (x = 1; x < w - 1; ++x) { - int cnt[NUM_MB_SEGMENTS] = { 0 }; + int cnt[NUM_MB_SEGMENTS] = {0}; const VP8MBInfo* const mb = &enc->mb_info[x + w * y]; int majority_seg = mb->segment; // Check the 8 neighbouring segment values. cnt[mb[-w - 1].segment]++; // top-left cnt[mb[-w + 0].segment]++; // top cnt[mb[-w + 1].segment]++; // top-right - cnt[mb[ - 1].segment]++; // left - cnt[mb[ + 1].segment]++; // right - cnt[mb[ w - 1].segment]++; // bottom-left - cnt[mb[ w + 0].segment]++; // bottom - cnt[mb[ w + 1].segment]++; // bottom-right + cnt[mb[-1].segment]++; // left + cnt[mb[+1].segment]++; // right + cnt[mb[w - 1].segment]++; // bottom-left + cnt[mb[w + 0].segment]++; // bottom + cnt[mb[w + 1].segment]++; // bottom-right for (n = 0; n < NUM_MB_SEGMENTS; ++n) { if (cnt[n] >= majority_cnt_3_x_3_grid) { majority_seg = n; @@ -78,8 +78,7 @@ static WEBP_INLINE int clip(int v, int m, int M) { } static void SetSegmentAlphas(VP8Encoder* const enc, - const int centers[NUM_MB_SEGMENTS], - int mid) { + const int centers[NUM_MB_SEGMENTS], int mid) { const int nb = enc->segment_hdr.num_segments; int min = centers[0], max = centers[0]; int n; @@ -138,8 +137,9 @@ static void AssignSegments(VP8Encoder* const enc, // 'num_segments' is previously validated and <= NUM_MB_SEGMENTS, but an // explicit check is needed to avoid spurious warning about 'n + 1' exceeding // array bounds of 'centers' with some compilers (noticed with gcc-4.9). - const int nb = (enc->segment_hdr.num_segments < NUM_MB_SEGMENTS) ? - enc->segment_hdr.num_segments : NUM_MB_SEGMENTS; + const int nb = (enc->segment_hdr.num_segments < NUM_MB_SEGMENTS) + ? enc->segment_hdr.num_segments + : NUM_MB_SEGMENTS; int centers[NUM_MB_SEGMENTS]; int weighted_average = 0; int map[MAX_ALPHA + 1]; @@ -152,9 +152,11 @@ static void AssignSegments(VP8Encoder* const enc, assert(nb <= NUM_MB_SEGMENTS); // bracket the input - for (n = 0; n <= MAX_ALPHA && alphas[n] == 0; ++n) {} + for (n = 0; n <= MAX_ALPHA && alphas[n] == 0; ++n) { + } min_a = n; - for (n = MAX_ALPHA; n > min_a && alphas[n] == 0; --n) {} + for (n = MAX_ALPHA; n > min_a && alphas[n] == 0; --n) { + } max_a = n; range_a = max_a - min_a; @@ -164,7 +166,7 @@ static void AssignSegments(VP8Encoder* const enc, centers[k] = min_a + (n * range_a) / (2 * nb); } - for (k = 0; k < MAX_ITERS_K_MEANS; ++k) { // few iters are enough + for (k = 0; k < MAX_ITERS_K_MEANS; ++k) { // few iters are enough int total_weight; int displaced; // Reset stats @@ -173,7 +175,7 @@ static void AssignSegments(VP8Encoder* const enc, dist_accum[n] = 0; } // Assign nearest center for each 'a' - n = 0; // track the nearest center for current 'a' + n = 0; // track the nearest center for current 'a' for (a = min_a; a <= max_a; ++a) { if (alphas[a]) { while (n + 1 < nb && abs(a - centers[n + 1]) < abs(a - centers[n])) { @@ -200,7 +202,7 @@ static void AssignSegments(VP8Encoder* const enc, } } weighted_average = (weighted_average + total_weight / 2) / total_weight; - if (displaced < 5) break; // no need to keep on looping... + if (displaced < 5) break; // no need to keep on looping... } // Map each original value to the closest centroid @@ -228,8 +230,8 @@ static void AssignSegments(VP8Encoder* const enc, // the possible modes during the analysis phase: we risk falling into a local // optimum, or be subject to boundary effect #define MAX_INTRA16_MODE 2 -#define MAX_INTRA4_MODE 2 -#define MAX_UV_MODE 2 +#define MAX_INTRA4_MODE 2 +#define MAX_UV_MODE 2 static int MBAnalyzeBestIntra16Mode(VP8EncIterator* const it) { const int max_mode = MAX_INTRA16_MODE; @@ -244,8 +246,7 @@ static int MBAnalyzeBestIntra16Mode(VP8EncIterator* const it) { InitHistogram(&histo); VP8CollectHistogram(it->yuv_in + Y_OFF_ENC, - it->yuv_p + VP8I16ModeOffsets[mode], - 0, 16, &histo); + it->yuv_p + VP8I16ModeOffsets[mode], 0, 16, &histo); alpha = GetAlpha(&histo); if (IS_BETTER_ALPHA(alpha, best_alpha)) { best_alpha = alpha; @@ -271,9 +272,9 @@ static int FastMBAnalyze(VP8EncIterator* const it) { m2 += dc[k] * dc[k]; } if (kThreshold * m2 < m * m) { - VP8SetIntra16Mode(it, 0); // DC16 + VP8SetIntra16Mode(it, 0); // DC16 } else { - const uint8_t modes[16] = { 0 }; // DC4 + const uint8_t modes[16] = {0}; // DC4 VP8SetIntra4Mode(it, modes); } return 0; @@ -292,8 +293,8 @@ static int MBAnalyzeBestUVMode(VP8EncIterator* const it) { int alpha; InitHistogram(&histo); VP8CollectHistogram(it->yuv_in + U_OFF_ENC, - it->yuv_p + VP8UVModeOffsets[mode], - 16, 16 + 4 + 4, &histo); + it->yuv_p + VP8UVModeOffsets[mode], 16, 16 + 4 + 4, + &histo); alpha = GetAlpha(&histo); if (IS_BETTER_ALPHA(alpha, best_alpha)) { best_alpha = alpha; @@ -308,8 +309,7 @@ static int MBAnalyzeBestUVMode(VP8EncIterator* const it) { return best_alpha; } -static void MBAnalyze(VP8EncIterator* const it, - int alphas[MAX_ALPHA + 1], +static void MBAnalyze(VP8EncIterator* const it, int alphas[MAX_ALPHA + 1], int* const alpha, int* const uv_alpha) { const VP8Encoder* const enc = it->enc; int best_alpha, best_uv_alpha; @@ -329,15 +329,15 @@ static void MBAnalyze(VP8EncIterator* const it, best_alpha = (3 * best_alpha + best_uv_alpha + 2) >> 2; best_alpha = FinalAlphaValue(best_alpha); alphas[best_alpha]++; - it->mb->alpha = best_alpha; // for later remapping. + it->mb->alpha = best_alpha; // for later remapping. // Accumulate for later complexity analysis. - *alpha += best_alpha; // mixed susceptibility (not just luma) + *alpha += best_alpha; // mixed susceptibility (not just luma) *uv_alpha += best_uv_alpha; } static void DefaultMBInfo(VP8MBInfo* const mb) { - mb->type = 1; // I16x16 + mb->type = 1; // I16x16 mb->uv_mode = 0; mb->skip = 0; // not skipped mb->segment = 0; // default segment @@ -426,7 +426,7 @@ static void InitSegmentJob(VP8Encoder* const enc, SegmentJob* const job, int VP8EncAnalyze(VP8Encoder* const enc) { int ok = 1; const int do_segments = - enc->config->emulate_jpeg_size || // We need the complexity evaluation. + enc->config->emulate_jpeg_size || // We need the complexity evaluation. (enc->segment_hdr.num_segments > 1) || (enc->method <= 1); // for method 0 - 1, we need preds[] to be filled. if (do_segments) { @@ -462,7 +462,7 @@ int VP8EncAnalyze(VP8Encoder* const enc) { } worker_interface->End(&side_job.worker); if (ok) MergeJobs(&side_job, &main_job); // merge results together -#endif // WEBP_USE_THREAD +#endif // WEBP_USE_THREAD } else { // Even for single-thread case, we use the generic Worker tools. InitSegmentJob(enc, &main_job, 0, last_row); @@ -475,7 +475,7 @@ int VP8EncAnalyze(VP8Encoder* const enc) { enc->uv_alpha = main_job.uv_alpha / total_mb; AssignSegments(enc, main_job.alphas); } - } else { // Use only one default segment. + } else { // Use only one default segment. ResetAllMBInfo(enc); } if (!ok) { diff --git a/src/enc/backward_references_cost_enc.c b/src/enc/backward_references_cost_enc.c index 6474dd67..ea8d2113 100644 --- a/src/enc/backward_references_cost_enc.c +++ b/src/enc/backward_references_cost_enc.c @@ -69,23 +69,22 @@ static int CostModelBuild(CostModel* const m, int xsize, int cache_bits, // The following code is similar to VP8LHistogramCreate but converts the // distance to plane code. - VP8LHistogramInit(histo, cache_bits, /*init_arrays=*/ 1); + VP8LHistogramInit(histo, cache_bits, /*init_arrays=*/1); VP8LHistogramStoreRefs(refs, VP8LDistanceToPlaneCode, xsize, histo); ConvertPopulationCountTableToBitEstimates( VP8LHistogramNumCodes(histo->palette_code_bits), histo->literal, m->literal); - ConvertPopulationCountTableToBitEstimates( - VALUES_IN_BYTE, histo->red, m->red); - ConvertPopulationCountTableToBitEstimates( - VALUES_IN_BYTE, histo->blue, m->blue); - ConvertPopulationCountTableToBitEstimates( - VALUES_IN_BYTE, histo->alpha, m->alpha); - ConvertPopulationCountTableToBitEstimates( - NUM_DISTANCE_CODES, histo->distance, m->distance); + ConvertPopulationCountTableToBitEstimates(VALUES_IN_BYTE, histo->red, m->red); + ConvertPopulationCountTableToBitEstimates(VALUES_IN_BYTE, histo->blue, + m->blue); + ConvertPopulationCountTableToBitEstimates(VALUES_IN_BYTE, histo->alpha, + m->alpha); + ConvertPopulationCountTableToBitEstimates(NUM_DISTANCE_CODES, histo->distance, + m->distance); ok = 1; - Error: +Error: VP8LFreeHistogram(histo); return ok; } @@ -172,7 +171,7 @@ struct CostInterval { typedef struct { int64_t cost; int start; - int end; // Exclusive. + int end; // Exclusive. } CostCacheInterval; // This structure is in charge of managing intervals and costs. @@ -309,8 +308,7 @@ static int CostManagerInit(CostManager* const manager, manager->cache_intervals_size); } - manager->costs = - (int64_t*)WebPSafeMalloc(pix_count, sizeof(*manager->costs)); + manager->costs = (int64_t*)WebPSafeMalloc(pix_count, sizeof(*manager->costs)); if (manager->costs == NULL) { CostManagerClear(manager); return 0; @@ -490,14 +488,14 @@ static WEBP_INLINE void PushInterval(CostManager* const manager, return; } - for (i = 0; i < manager->cache_intervals_size && - cost_cache_intervals[i].start < len; + for (i = 0; + i < manager->cache_intervals_size && cost_cache_intervals[i].start < len; ++i) { // Define the intersection of the ith interval with the new one. int start = position + cost_cache_intervals[i].start; - const int end = position + (cost_cache_intervals[i].end > len - ? len - : cost_cache_intervals[i].end); + const int end = + position + + (cost_cache_intervals[i].end > len ? len : cost_cache_intervals[i].end); const int64_t cost = distance_cost + cost_cache_intervals[i].cost; for (; interval != NULL && interval->start < end; @@ -681,7 +679,7 @@ static int BackwardReferencesHashChainDistanceOnly( } ok = !refs->error; - Error: +Error: if (cc_init) VP8LColorCacheClear(&hashers); CostManagerClear(cost_manager); WebPSafeFree(cost_model); @@ -692,8 +690,7 @@ static int BackwardReferencesHashChainDistanceOnly( // We pack the path at the end of *dist_array and return // a pointer to this part of the array. Example: // dist_array = [1x2xx3x2] => packed [1x2x1232], chosen_path = [1232] -static void TraceBackwards(uint16_t* const dist_array, - int dist_array_size, +static void TraceBackwards(uint16_t* const dist_array, int dist_array_size, uint16_t** const chosen_path, int* const chosen_path_size) { uint16_t* path = dist_array + dist_array_size; @@ -754,7 +751,7 @@ static int BackwardReferencesHashChainFollowChosenPath( } } ok = !refs->error; - Error: +Error: if (cc_init) VP8LColorCacheClear(&hashers); return ok; } @@ -790,7 +787,7 @@ int VP8LBackwardReferencesTraceBackwards(int xsize, int ysize, goto Error; } ok = 1; - Error: +Error: WebPSafeFree(dist_array); return ok; } diff --git a/src/enc/backward_references_enc.c b/src/enc/backward_references_enc.c index 911ce524..8ab6aae3 100644 --- a/src/enc/backward_references_enc.c +++ b/src/enc/backward_references_enc.c @@ -38,15 +38,14 @@ // ----------------------------------------------------------------------------- static const uint8_t plane_to_code_lut[128] = { - 96, 73, 55, 39, 23, 13, 5, 1, 255, 255, 255, 255, 255, 255, 255, 255, - 101, 78, 58, 42, 26, 16, 8, 2, 0, 3, 9, 17, 27, 43, 59, 79, - 102, 86, 62, 46, 32, 20, 10, 6, 4, 7, 11, 21, 33, 47, 63, 87, - 105, 90, 70, 52, 37, 28, 18, 14, 12, 15, 19, 29, 38, 53, 71, 91, - 110, 99, 82, 66, 48, 35, 30, 24, 22, 25, 31, 36, 49, 67, 83, 100, - 115, 108, 94, 76, 64, 50, 44, 40, 34, 41, 45, 51, 65, 77, 95, 109, - 118, 113, 103, 92, 80, 68, 60, 56, 54, 57, 61, 69, 81, 93, 104, 114, - 119, 116, 111, 106, 97, 88, 84, 74, 72, 75, 85, 89, 98, 107, 112, 117 -}; + 96, 73, 55, 39, 23, 13, 5, 1, 255, 255, 255, 255, 255, 255, 255, 255, + 101, 78, 58, 42, 26, 16, 8, 2, 0, 3, 9, 17, 27, 43, 59, 79, + 102, 86, 62, 46, 32, 20, 10, 6, 4, 7, 11, 21, 33, 47, 63, 87, + 105, 90, 70, 52, 37, 28, 18, 14, 12, 15, 19, 29, 38, 53, 71, 91, + 110, 99, 82, 66, 48, 35, 30, 24, 22, 25, 31, 36, 49, 67, 83, 100, + 115, 108, 94, 76, 64, 50, 44, 40, 34, 41, 45, 51, 65, 77, 95, 109, + 118, 113, 103, 92, 80, 68, 60, 56, 54, 57, 61, 69, 81, 93, 104, 114, + 119, 116, 111, 106, 97, 88, 84, 74, 72, 75, 85, 89, 98, 107, 112, 117}; extern int VP8LDistanceToPlaneCode(int xsize, int dist); int VP8LDistanceToPlaneCode(int xsize, int dist) { @@ -79,9 +78,9 @@ static WEBP_INLINE int FindMatchLength(const uint32_t* const array1, // VP8LBackwardRefs struct PixOrCopyBlock { - PixOrCopyBlock* next; // next block (or NULL) - PixOrCopy* start; // data start - int size; // currently used size + PixOrCopyBlock* next; // next block (or NULL) + PixOrCopy* start; // data start + int size; // currently used size }; extern void VP8LClearBackwardRefs(VP8LBackwardRefs* const refs); @@ -151,9 +150,8 @@ void VP8LRefsCursorNextBlock(VP8LRefsCursor* const c) { // Create a new block, either from the free list or allocated static PixOrCopyBlock* BackwardRefsNewBlock(VP8LBackwardRefs* const refs) { PixOrCopyBlock* b = refs->free_blocks; - if (b == NULL) { // allocate new memory chunk - const size_t total_size = - sizeof(*b) + refs->block_size * sizeof(*b->start); + if (b == NULL) { // allocate new memory chunk + const size_t total_size = sizeof(*b) + refs->block_size * sizeof(*b->start); b = (PixOrCopyBlock*)WebPSafeMalloc(1ULL, total_size); if (b == NULL) { refs->error |= 1; @@ -194,7 +192,7 @@ void VP8LBackwardRefsCursorAdd(VP8LBackwardRefs* const refs, PixOrCopyBlock* b = refs->last_block; if (b == NULL || b->size == refs->block_size) { b = BackwardRefsNewBlock(refs); - if (b == NULL) return; // refs->error is set + if (b == NULL) return; // refs->error is set } b->start[b->size++] = v; } @@ -206,8 +204,7 @@ int VP8LHashChainInit(VP8LHashChain* const p, int size) { assert(p->size == 0); assert(p->offset_length == NULL); assert(size > 0); - p->offset_length = - (uint32_t*)WebPSafeMalloc(size, sizeof(*p->offset_length)); + p->offset_length = (uint32_t*)WebPSafeMalloc(size, sizeof(*p->offset_length)); if (p->offset_length == NULL) return 0; p->size = size; @@ -227,10 +224,10 @@ void VP8LHashChainClear(VP8LHashChain* const p) { static const uint32_t kHashMultiplierHi = 0xc6a4a793u; static const uint32_t kHashMultiplierLo = 0x5bd1e996u; -static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE -uint32_t GetPixPairHash64(const uint32_t* const argb) { +static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE uint32_t +GetPixPairHash64(const uint32_t* const argb) { uint32_t key; - key = argb[1] * kHashMultiplierHi; + key = argb[1] * kHashMultiplierHi; key += argb[0] * kHashMultiplierLo; key = key >> (32 - HASH_BITS); return key; @@ -243,10 +240,10 @@ static int GetMaxItersForQuality(int quality) { } static int GetWindowSizeForHashChain(int quality, int xsize) { - const int max_window_size = (quality > 75) ? WINDOW_SIZE - : (quality > 50) ? (xsize << 8) - : (quality > 25) ? (xsize << 6) - : (xsize << 4); + const int max_window_size = (quality > 75) ? WINDOW_SIZE + : (quality > 50) ? (xsize << 8) + : (quality > 25) ? (xsize << 6) + : (xsize << 4); assert(xsize > 0); return (max_window_size > WINDOW_SIZE) ? WINDOW_SIZE : max_window_size; } @@ -469,8 +466,8 @@ static WEBP_INLINE void AddSingleLiteral(uint32_t pixel, int use_color_cache, } static int BackwardReferencesRle(int xsize, int ysize, - const uint32_t* const argb, - int cache_bits, VP8LBackwardRefs* const refs) { + const uint32_t* const argb, int cache_bits, + VP8LBackwardRefs* const refs) { const int pix_count = xsize * ysize; int i, k; const int use_color_cache = (cache_bits > 0); @@ -486,8 +483,9 @@ static int BackwardReferencesRle(int xsize, int ysize, while (i < pix_count) { const int max_len = MaxFindCopyLength(pix_count - i); const int rle_len = FindMatchLength(argb + i, argb + i - 1, 0, max_len); - const int prev_row_len = (i < xsize) ? 0 : - FindMatchLength(argb + i, argb + i - xsize, 0, max_len); + const int prev_row_len = + (i < xsize) ? 0 + : FindMatchLength(argb + i, argb + i - xsize, 0, max_len); if (rle_len >= prev_row_len && rle_len >= MIN_LENGTH) { VP8LBackwardRefsCursorAdd(refs, PixOrCopyCreateCopy(1, rle_len)); // We don't need to update the color cache here since it is always the @@ -574,7 +572,7 @@ static int BackwardReferencesLz77(int xsize, int ysize, } ok = !refs->error; - Error: +Error: if (cc_init) VP8LColorCacheClear(&hashers); return ok; } @@ -758,10 +756,10 @@ static int CalculateBestCacheSize(const uint32_t* argb, int quality, int i; const int cache_bits_max = (quality <= 25) ? 0 : *best_cache_bits; uint64_t entropy_min = WEBP_UINT64_MAX; - int cc_init[MAX_COLOR_CACHE_BITS + 1] = { 0 }; + int cc_init[MAX_COLOR_CACHE_BITS + 1] = {0}; VP8LColorCache hashers[MAX_COLOR_CACHE_BITS + 1]; VP8LRefsCursor c = VP8LRefsCursorInit(refs); - VP8LHistogram* histos[MAX_COLOR_CACHE_BITS + 1] = { NULL }; + VP8LHistogram* histos[MAX_COLOR_CACHE_BITS + 1] = {NULL}; int ok = 0; assert(cache_bits_max >= 0 && cache_bits_max <= MAX_COLOR_CACHE_BITS); @@ -776,7 +774,7 @@ static int CalculateBestCacheSize(const uint32_t* argb, int quality, for (i = 0; i <= cache_bits_max; ++i) { histos[i] = VP8LAllocateHistogram(i); if (histos[i] == NULL) goto Error; - VP8LHistogramInit(histos[i], i, /*init_arrays=*/ 1); + VP8LHistogramInit(histos[i], i, /*init_arrays=*/1); if (i == 0) continue; cc_init[i] = VP8LColorCacheInit(&hashers[i], i); if (!cc_init[i]) goto Error; @@ -791,8 +789,8 @@ static int CalculateBestCacheSize(const uint32_t* argb, int quality, const uint32_t pix = *argb++; const uint32_t a = (pix >> 24) & 0xff; const uint32_t r = (pix >> 16) & 0xff; - const uint32_t g = (pix >> 8) & 0xff; - const uint32_t b = (pix >> 0) & 0xff; + const uint32_t g = (pix >> 8) & 0xff; + const uint32_t b = (pix >> 0) & 0xff; // The keys of the caches can be derived from the longest one. int key = VP8LHashPix(pix, 32 - cache_bits_max); // Do not use the color cache for cache_bits = 0. @@ -849,7 +847,7 @@ static int CalculateBestCacheSize(const uint32_t* argb, int quality, } } ok = 1; - Error: +Error: for (i = 0; i <= cache_bits_max; ++i) { if (cc_init[i]) VP8LColorCacheClear(&hashers[i]); VP8LFreeHistogram(histos[i]); @@ -893,9 +891,8 @@ static int BackwardRefsWithLocalCache(const uint32_t* const argb, } static VP8LBackwardRefs* GetBackwardReferencesLowEffort( - int width, int height, const uint32_t* const argb, - int* const cache_bits, const VP8LHashChain* const hash_chain, - VP8LBackwardRefs* const refs_lz77) { + int width, int height, const uint32_t* const argb, int* const cache_bits, + const VP8LHashChain* const hash_chain, VP8LBackwardRefs* const refs_lz77) { *cache_bits = 0; if (!BackwardReferencesLz77(width, height, argb, 0, hash_chain, refs_lz77)) { return NULL; @@ -1030,7 +1027,7 @@ static int GetBackwardReferences(int width, int height, } status = 1; - Error: +Error: VP8LHashChainClear(&hash_chain_box); VP8LFreeHistogram(histo); return status; diff --git a/src/enc/backward_references_enc.h b/src/enc/backward_references_enc.h index b9738d06..a65ed3de 100644 --- a/src/enc/backward_references_enc.h +++ b/src/enc/backward_references_enc.h @@ -30,12 +30,7 @@ extern "C" { // ----------------------------------------------------------------------------- // PixOrCopy -enum Mode { - kLiteral, - kCacheIdx, - kCopy, - kNone -}; +enum Mode { kLiteral, kCacheIdx, kCopy, kNone }; typedef struct { // mode as uint8_t to make the memory layout to be exactly 8 bytes. @@ -166,7 +161,7 @@ static WEBP_INLINE void VP8LHashChainFindCopy(const VP8LHashChain* const p, // maximum number of reference blocks the image will be segmented into #define MAX_REFS_BLOCK_PER_IMAGE 16 -typedef struct PixOrCopyBlock PixOrCopyBlock; // forward declaration +typedef struct PixOrCopyBlock PixOrCopyBlock; // forward declaration typedef struct VP8LBackwardRefs VP8LBackwardRefs; // Container for blocks chain @@ -188,10 +183,10 @@ void VP8LBackwardRefsClear(VP8LBackwardRefs* const refs); // Cursor for iterating on references content typedef struct { // public: - PixOrCopy* cur_pos; // current position + PixOrCopy* cur_pos; // current position // private: - PixOrCopyBlock* cur_block; // current block in the refs list - const PixOrCopy* last_pos; // sentinel for switching to next block + PixOrCopyBlock* cur_block; // current block in the refs list + const PixOrCopy* last_pos; // sentinel for switching to next block } VP8LRefsCursor; // Returns a cursor positioned at the beginning of the references list. @@ -212,11 +207,7 @@ static WEBP_INLINE void VP8LRefsCursorNext(VP8LRefsCursor* const c) { // ----------------------------------------------------------------------------- // Main entry points -enum VP8LLZ77Type { - kLZ77Standard = 1, - kLZ77RLE = 2, - kLZ77Box = 4 -}; +enum VP8LLZ77Type { kLZ77Standard = 1, kLZ77RLE = 2, kLZ77Box = 4 }; // Evaluates best possible backward references for specified quality. // The input cache_bits to 'VP8LGetBackwardReferences' sets the maximum cache diff --git a/src/enc/config_enc.c b/src/enc/config_enc.c index 6d3d4424..fa631bfe 100644 --- a/src/enc/config_enc.c +++ b/src/enc/config_enc.c @@ -24,10 +24,10 @@ // WebPConfig //------------------------------------------------------------------------------ -int WebPConfigInitInternal(WebPConfig* config, - WebPPreset preset, float quality, int version) { +int WebPConfigInitInternal(WebPConfig* config, WebPPreset preset, float quality, + int version) { if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_ENCODER_ABI_VERSION)) { - return 0; // caller/system version mismatch! + return 0; // caller/system version mismatch! } if (config == NULL) return 0; @@ -36,9 +36,9 @@ int WebPConfigInitInternal(WebPConfig* config, config->target_PSNR = 0.; config->method = 4; config->sns_strength = 50; - config->filter_strength = 60; // mid-filtering + config->filter_strength = 60; // mid-filtering config->filter_sharpness = 0; - config->filter_type = 1; // default: strong (so U/V is filtered too) + config->filter_type = 1; // default: strong (so U/V is filtered too) config->partitions = 0; config->segments = 4; config->pass = 1; @@ -66,7 +66,7 @@ int WebPConfigInitInternal(WebPConfig* config, config->sns_strength = 80; config->filter_sharpness = 4; config->filter_strength = 35; - config->preprocessing &= ~2; // no dithering + config->preprocessing &= ~2; // no dithering break; case WEBP_PRESET_PHOTO: config->sns_strength = 80; @@ -81,13 +81,13 @@ int WebPConfigInitInternal(WebPConfig* config, break; case WEBP_PRESET_ICON: config->sns_strength = 0; - config->filter_strength = 0; // disable filtering to retain sharpness - config->preprocessing &= ~2; // no dithering + config->filter_strength = 0; // disable filtering to retain sharpness + config->preprocessing &= ~2; // no dithering break; case WEBP_PRESET_TEXT: config->sns_strength = 0; - config->filter_strength = 0; // disable filtering to retain sharpness - config->preprocessing &= ~2; // no dithering + config->filter_strength = 0; // disable filtering to retain sharpness + config->preprocessing &= ~2; // no dithering config->segments = 2; break; case WEBP_PRESET_DEFAULT: @@ -140,10 +140,9 @@ int WebPValidateConfig(const WebPConfig* config) { static const struct { uint8_t method; uint8_t quality; -} kLosslessPresets[MAX_LEVEL + 1] = { - { 0, 0 }, { 1, 20 }, { 2, 25 }, { 3, 30 }, { 3, 50 }, - { 4, 50 }, { 4, 75 }, { 4, 90 }, { 5, 90 }, { 6, 100 } -}; +} kLosslessPresets[MAX_LEVEL + 1] = {{0, 0}, {1, 20}, {2, 25}, {3, 30}, + {3, 50}, {4, 50}, {4, 75}, {4, 90}, + {5, 90}, {6, 100}}; int WebPConfigLosslessPreset(WebPConfig* config, int level) { if (config == NULL || level < 0 || level > MAX_LEVEL) return 0; diff --git a/src/enc/cost_enc.c b/src/enc/cost_enc.c index 3ed4eea4..9d8ca5de 100644 --- a/src/enc/cost_enc.c +++ b/src/enc/cost_enc.c @@ -11,13 +11,14 @@ // // Author: Skal (pascal.massimino@gmail.com) +#include "src/enc/cost_enc.h" + #include #include "src/dec/common_dec.h" -#include "src/webp/types.h" #include "src/dsp/dsp.h" -#include "src/enc/cost_enc.h" #include "src/enc/vp8i_enc.h" +#include "src/webp/types.h" //------------------------------------------------------------------------------ // Level cost tables @@ -26,24 +27,23 @@ // use for coding it (in [][0]) as well as the bit value to use for each // context (in [][1]). static const uint16_t VP8LevelCodes[MAX_VARIABLE_LEVEL][2] = { - {0x001, 0x000}, {0x007, 0x001}, {0x00f, 0x005}, - {0x00f, 0x00d}, {0x033, 0x003}, {0x033, 0x003}, {0x033, 0x023}, - {0x033, 0x023}, {0x033, 0x023}, {0x033, 0x023}, {0x0d3, 0x013}, - {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x013}, - {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x093}, - {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, - {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, - {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, - {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, - {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x153} -}; + {0x001, 0x000}, {0x007, 0x001}, {0x00f, 0x005}, {0x00f, 0x00d}, + {0x033, 0x003}, {0x033, 0x003}, {0x033, 0x023}, {0x033, 0x023}, + {0x033, 0x023}, {0x033, 0x023}, {0x0d3, 0x013}, {0x0d3, 0x013}, + {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x013}, + {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x093}, {0x0d3, 0x093}, + {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, + {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, + {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, + {0x0d3, 0x093}, {0x0d3, 0x093}, {0x153, 0x053}, {0x153, 0x053}, + {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, + {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, + {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, + {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, + {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, + {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, + {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x053}, + {0x153, 0x053}, {0x153, 0x053}, {0x153, 0x153}}; static int VariableLevelCost(int level, const uint8_t probas[NUM_PROBAS]) { int pattern = VP8LevelCodes[level - 1][0]; @@ -85,7 +85,7 @@ void VP8CalculateLevelCosts(VP8EncProba* const proba) { // actually constant. } } - for (n = 0; n < 16; ++n) { // replicate bands. We don't need to sentinel. + for (n = 0; n < 16; ++n) { // replicate bands. We don't need to sentinel. for (ctx = 0; ctx < NUM_CTX; ++ctx) { proba->remapped_costs[ctype][n][ctx] = proba->level_cost[ctype][VP8EncBands[n]][ctx]; @@ -100,119 +100,118 @@ void VP8CalculateLevelCosts(VP8EncProba* const proba) { // These are the fixed probabilities (in the coding trees) turned into bit-cost // by calling VP8BitCost(). -const uint16_t VP8FixedCostsUV[4] = { 302, 984, 439, 642 }; +const uint16_t VP8FixedCostsUV[4] = {302, 984, 439, 642}; // note: these values include the fixed VP8BitCost(1, 145) mode selection cost. -const uint16_t VP8FixedCostsI16[4] = { 663, 919, 872, 919 }; +const uint16_t VP8FixedCostsI16[4] = {663, 919, 872, 919}; const uint16_t VP8FixedCostsI4[NUM_BMODES][NUM_BMODES][NUM_BMODES] = { - { { 40, 1151, 1723, 1874, 2103, 2019, 1628, 1777, 2226, 2137 }, - { 192, 469, 1296, 1308, 1849, 1794, 1781, 1703, 1713, 1522 }, - { 142, 910, 762, 1684, 1849, 1576, 1460, 1305, 1801, 1657 }, - { 559, 641, 1370, 421, 1182, 1569, 1612, 1725, 863, 1007 }, - { 299, 1059, 1256, 1108, 636, 1068, 1581, 1883, 869, 1142 }, - { 277, 1111, 707, 1362, 1089, 672, 1603, 1541, 1545, 1291 }, - { 214, 781, 1609, 1303, 1632, 2229, 726, 1560, 1713, 918 }, - { 152, 1037, 1046, 1759, 1983, 2174, 1358, 742, 1740, 1390 }, - { 512, 1046, 1420, 753, 752, 1297, 1486, 1613, 460, 1207 }, - { 424, 827, 1362, 719, 1462, 1202, 1199, 1476, 1199, 538 } }, - { { 240, 402, 1134, 1491, 1659, 1505, 1517, 1555, 1979, 2099 }, - { 467, 242, 960, 1232, 1714, 1620, 1834, 1570, 1676, 1391 }, - { 500, 455, 463, 1507, 1699, 1282, 1564, 982, 2114, 2114 }, - { 672, 643, 1372, 331, 1589, 1667, 1453, 1938, 996, 876 }, - { 458, 783, 1037, 911, 738, 968, 1165, 1518, 859, 1033 }, - { 504, 815, 504, 1139, 1219, 719, 1506, 1085, 1268, 1268 }, - { 333, 630, 1445, 1239, 1883, 3672, 799, 1548, 1865, 598 }, - { 399, 644, 746, 1342, 1856, 1350, 1493, 613, 1855, 1015 }, - { 622, 749, 1205, 608, 1066, 1408, 1290, 1406, 546, 971 }, - { 500, 753, 1041, 668, 1230, 1617, 1297, 1425, 1383, 523 } }, - { { 394, 553, 523, 1502, 1536, 981, 1608, 1142, 1666, 2181 }, - { 655, 430, 375, 1411, 1861, 1220, 1677, 1135, 1978, 1553 }, - { 690, 640, 245, 1954, 2070, 1194, 1528, 982, 1972, 2232 }, - { 559, 834, 741, 867, 1131, 980, 1225, 852, 1092, 784 }, - { 690, 875, 516, 959, 673, 894, 1056, 1190, 1528, 1126 }, - { 740, 951, 384, 1277, 1177, 492, 1579, 1155, 1846, 1513 }, - { 323, 775, 1062, 1776, 3062, 1274, 813, 1188, 1372, 655 }, - { 488, 971, 484, 1767, 1515, 1775, 1115, 503, 1539, 1461 }, - { 740, 1006, 998, 709, 851, 1230, 1337, 788, 741, 721 }, - { 522, 1073, 573, 1045, 1346, 887, 1046, 1146, 1203, 697 } }, - { { 105, 864, 1442, 1009, 1934, 1840, 1519, 1920, 1673, 1579 }, - { 534, 305, 1193, 683, 1388, 2164, 1802, 1894, 1264, 1170 }, - { 305, 518, 877, 1108, 1426, 3215, 1425, 1064, 1320, 1242 }, - { 683, 732, 1927, 257, 1493, 2048, 1858, 1552, 1055, 947 }, - { 394, 814, 1024, 660, 959, 1556, 1282, 1289, 893, 1047 }, - { 528, 615, 996, 940, 1201, 635, 1094, 2515, 803, 1358 }, - { 347, 614, 1609, 1187, 3133, 1345, 1007, 1339, 1017, 667 }, - { 218, 740, 878, 1605, 3650, 3650, 1345, 758, 1357, 1617 }, - { 672, 750, 1541, 558, 1257, 1599, 1870, 2135, 402, 1087 }, - { 592, 684, 1161, 430, 1092, 1497, 1475, 1489, 1095, 822 } }, - { { 228, 1056, 1059, 1368, 752, 982, 1512, 1518, 987, 1782 }, - { 494, 514, 818, 942, 965, 892, 1610, 1356, 1048, 1363 }, - { 512, 648, 591, 1042, 761, 991, 1196, 1454, 1309, 1463 }, - { 683, 749, 1043, 676, 841, 1396, 1133, 1138, 654, 939 }, - { 622, 1101, 1126, 994, 361, 1077, 1203, 1318, 877, 1219 }, - { 631, 1068, 857, 1650, 651, 477, 1650, 1419, 828, 1170 }, - { 555, 727, 1068, 1335, 3127, 1339, 820, 1331, 1077, 429 }, - { 504, 879, 624, 1398, 889, 889, 1392, 808, 891, 1406 }, - { 683, 1602, 1289, 977, 578, 983, 1280, 1708, 406, 1122 }, - { 399, 865, 1433, 1070, 1072, 764, 968, 1477, 1223, 678 } }, - { { 333, 760, 935, 1638, 1010, 529, 1646, 1410, 1472, 2219 }, - { 512, 494, 750, 1160, 1215, 610, 1870, 1868, 1628, 1169 }, - { 572, 646, 492, 1934, 1208, 603, 1580, 1099, 1398, 1995 }, - { 786, 789, 942, 581, 1018, 951, 1599, 1207, 731, 768 }, - { 690, 1015, 672, 1078, 582, 504, 1693, 1438, 1108, 2897 }, - { 768, 1267, 571, 2005, 1243, 244, 2881, 1380, 1786, 1453 }, - { 452, 899, 1293, 903, 1311, 3100, 465, 1311, 1319, 813 }, - { 394, 927, 942, 1103, 1358, 1104, 946, 593, 1363, 1109 }, - { 559, 1005, 1007, 1016, 658, 1173, 1021, 1164, 623, 1028 }, - { 564, 796, 632, 1005, 1014, 863, 2316, 1268, 938, 764 } }, - { { 266, 606, 1098, 1228, 1497, 1243, 948, 1030, 1734, 1461 }, - { 366, 585, 901, 1060, 1407, 1247, 876, 1134, 1620, 1054 }, - { 452, 565, 542, 1729, 1479, 1479, 1016, 886, 2938, 1150 }, - { 555, 1088, 1533, 950, 1354, 895, 834, 1019, 1021, 496 }, - { 704, 815, 1193, 971, 973, 640, 1217, 2214, 832, 578 }, - { 672, 1245, 579, 871, 875, 774, 872, 1273, 1027, 949 }, - { 296, 1134, 2050, 1784, 1636, 3425, 442, 1550, 2076, 722 }, - { 342, 982, 1259, 1846, 1848, 1848, 622, 568, 1847, 1052 }, - { 555, 1064, 1304, 828, 746, 1343, 1075, 1329, 1078, 494 }, - { 288, 1167, 1285, 1174, 1639, 1639, 833, 2254, 1304, 509 } }, - { { 342, 719, 767, 1866, 1757, 1270, 1246, 550, 1746, 2151 }, - { 483, 653, 694, 1509, 1459, 1410, 1218, 507, 1914, 1266 }, - { 488, 757, 447, 2979, 1813, 1268, 1654, 539, 1849, 2109 }, - { 522, 1097, 1085, 851, 1365, 1111, 851, 901, 961, 605 }, - { 709, 716, 841, 728, 736, 945, 941, 862, 2845, 1057 }, - { 512, 1323, 500, 1336, 1083, 681, 1342, 717, 1604, 1350 }, - { 452, 1155, 1372, 1900, 1501, 3290, 311, 944, 1919, 922 }, - { 403, 1520, 977, 2132, 1733, 3522, 1076, 276, 3335, 1547 }, - { 559, 1374, 1101, 615, 673, 2462, 974, 795, 984, 984 }, - { 547, 1122, 1062, 812, 1410, 951, 1140, 622, 1268, 651 } }, - { { 165, 982, 1235, 938, 1334, 1366, 1659, 1578, 964, 1612 }, - { 592, 422, 925, 847, 1139, 1112, 1387, 2036, 861, 1041 }, - { 403, 837, 732, 770, 941, 1658, 1250, 809, 1407, 1407 }, - { 896, 874, 1071, 381, 1568, 1722, 1437, 2192, 480, 1035 }, - { 640, 1098, 1012, 1032, 684, 1382, 1581, 2106, 416, 865 }, - { 559, 1005, 819, 914, 710, 770, 1418, 920, 838, 1435 }, - { 415, 1258, 1245, 870, 1278, 3067, 770, 1021, 1287, 522 }, - { 406, 990, 601, 1009, 1265, 1265, 1267, 759, 1017, 1277 }, - { 968, 1182, 1329, 788, 1032, 1292, 1705, 1714, 203, 1403 }, - { 732, 877, 1279, 471, 901, 1161, 1545, 1294, 755, 755 } }, - { { 111, 931, 1378, 1185, 1933, 1648, 1148, 1714, 1873, 1307 }, - { 406, 414, 1030, 1023, 1910, 1404, 1313, 1647, 1509, 793 }, - { 342, 640, 575, 1088, 1241, 1349, 1161, 1350, 1756, 1502 }, - { 559, 766, 1185, 357, 1682, 1428, 1329, 1897, 1219, 802 }, - { 473, 909, 1164, 771, 719, 2508, 1427, 1432, 722, 782 }, - { 342, 892, 785, 1145, 1150, 794, 1296, 1550, 973, 1057 }, - { 208, 1036, 1326, 1343, 1606, 3395, 815, 1455, 1618, 712 }, - { 228, 928, 890, 1046, 3499, 1711, 994, 829, 1720, 1318 }, - { 768, 724, 1058, 636, 991, 1075, 1319, 1324, 616, 825 }, - { 305, 1167, 1358, 899, 1587, 1587, 987, 1988, 1332, 501 } } -}; + {{40, 1151, 1723, 1874, 2103, 2019, 1628, 1777, 2226, 2137}, + {192, 469, 1296, 1308, 1849, 1794, 1781, 1703, 1713, 1522}, + {142, 910, 762, 1684, 1849, 1576, 1460, 1305, 1801, 1657}, + {559, 641, 1370, 421, 1182, 1569, 1612, 1725, 863, 1007}, + {299, 1059, 1256, 1108, 636, 1068, 1581, 1883, 869, 1142}, + {277, 1111, 707, 1362, 1089, 672, 1603, 1541, 1545, 1291}, + {214, 781, 1609, 1303, 1632, 2229, 726, 1560, 1713, 918}, + {152, 1037, 1046, 1759, 1983, 2174, 1358, 742, 1740, 1390}, + {512, 1046, 1420, 753, 752, 1297, 1486, 1613, 460, 1207}, + {424, 827, 1362, 719, 1462, 1202, 1199, 1476, 1199, 538}}, + {{240, 402, 1134, 1491, 1659, 1505, 1517, 1555, 1979, 2099}, + {467, 242, 960, 1232, 1714, 1620, 1834, 1570, 1676, 1391}, + {500, 455, 463, 1507, 1699, 1282, 1564, 982, 2114, 2114}, + {672, 643, 1372, 331, 1589, 1667, 1453, 1938, 996, 876}, + {458, 783, 1037, 911, 738, 968, 1165, 1518, 859, 1033}, + {504, 815, 504, 1139, 1219, 719, 1506, 1085, 1268, 1268}, + {333, 630, 1445, 1239, 1883, 3672, 799, 1548, 1865, 598}, + {399, 644, 746, 1342, 1856, 1350, 1493, 613, 1855, 1015}, + {622, 749, 1205, 608, 1066, 1408, 1290, 1406, 546, 971}, + {500, 753, 1041, 668, 1230, 1617, 1297, 1425, 1383, 523}}, + {{394, 553, 523, 1502, 1536, 981, 1608, 1142, 1666, 2181}, + {655, 430, 375, 1411, 1861, 1220, 1677, 1135, 1978, 1553}, + {690, 640, 245, 1954, 2070, 1194, 1528, 982, 1972, 2232}, + {559, 834, 741, 867, 1131, 980, 1225, 852, 1092, 784}, + {690, 875, 516, 959, 673, 894, 1056, 1190, 1528, 1126}, + {740, 951, 384, 1277, 1177, 492, 1579, 1155, 1846, 1513}, + {323, 775, 1062, 1776, 3062, 1274, 813, 1188, 1372, 655}, + {488, 971, 484, 1767, 1515, 1775, 1115, 503, 1539, 1461}, + {740, 1006, 998, 709, 851, 1230, 1337, 788, 741, 721}, + {522, 1073, 573, 1045, 1346, 887, 1046, 1146, 1203, 697}}, + {{105, 864, 1442, 1009, 1934, 1840, 1519, 1920, 1673, 1579}, + {534, 305, 1193, 683, 1388, 2164, 1802, 1894, 1264, 1170}, + {305, 518, 877, 1108, 1426, 3215, 1425, 1064, 1320, 1242}, + {683, 732, 1927, 257, 1493, 2048, 1858, 1552, 1055, 947}, + {394, 814, 1024, 660, 959, 1556, 1282, 1289, 893, 1047}, + {528, 615, 996, 940, 1201, 635, 1094, 2515, 803, 1358}, + {347, 614, 1609, 1187, 3133, 1345, 1007, 1339, 1017, 667}, + {218, 740, 878, 1605, 3650, 3650, 1345, 758, 1357, 1617}, + {672, 750, 1541, 558, 1257, 1599, 1870, 2135, 402, 1087}, + {592, 684, 1161, 430, 1092, 1497, 1475, 1489, 1095, 822}}, + {{228, 1056, 1059, 1368, 752, 982, 1512, 1518, 987, 1782}, + {494, 514, 818, 942, 965, 892, 1610, 1356, 1048, 1363}, + {512, 648, 591, 1042, 761, 991, 1196, 1454, 1309, 1463}, + {683, 749, 1043, 676, 841, 1396, 1133, 1138, 654, 939}, + {622, 1101, 1126, 994, 361, 1077, 1203, 1318, 877, 1219}, + {631, 1068, 857, 1650, 651, 477, 1650, 1419, 828, 1170}, + {555, 727, 1068, 1335, 3127, 1339, 820, 1331, 1077, 429}, + {504, 879, 624, 1398, 889, 889, 1392, 808, 891, 1406}, + {683, 1602, 1289, 977, 578, 983, 1280, 1708, 406, 1122}, + {399, 865, 1433, 1070, 1072, 764, 968, 1477, 1223, 678}}, + {{333, 760, 935, 1638, 1010, 529, 1646, 1410, 1472, 2219}, + {512, 494, 750, 1160, 1215, 610, 1870, 1868, 1628, 1169}, + {572, 646, 492, 1934, 1208, 603, 1580, 1099, 1398, 1995}, + {786, 789, 942, 581, 1018, 951, 1599, 1207, 731, 768}, + {690, 1015, 672, 1078, 582, 504, 1693, 1438, 1108, 2897}, + {768, 1267, 571, 2005, 1243, 244, 2881, 1380, 1786, 1453}, + {452, 899, 1293, 903, 1311, 3100, 465, 1311, 1319, 813}, + {394, 927, 942, 1103, 1358, 1104, 946, 593, 1363, 1109}, + {559, 1005, 1007, 1016, 658, 1173, 1021, 1164, 623, 1028}, + {564, 796, 632, 1005, 1014, 863, 2316, 1268, 938, 764}}, + {{266, 606, 1098, 1228, 1497, 1243, 948, 1030, 1734, 1461}, + {366, 585, 901, 1060, 1407, 1247, 876, 1134, 1620, 1054}, + {452, 565, 542, 1729, 1479, 1479, 1016, 886, 2938, 1150}, + {555, 1088, 1533, 950, 1354, 895, 834, 1019, 1021, 496}, + {704, 815, 1193, 971, 973, 640, 1217, 2214, 832, 578}, + {672, 1245, 579, 871, 875, 774, 872, 1273, 1027, 949}, + {296, 1134, 2050, 1784, 1636, 3425, 442, 1550, 2076, 722}, + {342, 982, 1259, 1846, 1848, 1848, 622, 568, 1847, 1052}, + {555, 1064, 1304, 828, 746, 1343, 1075, 1329, 1078, 494}, + {288, 1167, 1285, 1174, 1639, 1639, 833, 2254, 1304, 509}}, + {{342, 719, 767, 1866, 1757, 1270, 1246, 550, 1746, 2151}, + {483, 653, 694, 1509, 1459, 1410, 1218, 507, 1914, 1266}, + {488, 757, 447, 2979, 1813, 1268, 1654, 539, 1849, 2109}, + {522, 1097, 1085, 851, 1365, 1111, 851, 901, 961, 605}, + {709, 716, 841, 728, 736, 945, 941, 862, 2845, 1057}, + {512, 1323, 500, 1336, 1083, 681, 1342, 717, 1604, 1350}, + {452, 1155, 1372, 1900, 1501, 3290, 311, 944, 1919, 922}, + {403, 1520, 977, 2132, 1733, 3522, 1076, 276, 3335, 1547}, + {559, 1374, 1101, 615, 673, 2462, 974, 795, 984, 984}, + {547, 1122, 1062, 812, 1410, 951, 1140, 622, 1268, 651}}, + {{165, 982, 1235, 938, 1334, 1366, 1659, 1578, 964, 1612}, + {592, 422, 925, 847, 1139, 1112, 1387, 2036, 861, 1041}, + {403, 837, 732, 770, 941, 1658, 1250, 809, 1407, 1407}, + {896, 874, 1071, 381, 1568, 1722, 1437, 2192, 480, 1035}, + {640, 1098, 1012, 1032, 684, 1382, 1581, 2106, 416, 865}, + {559, 1005, 819, 914, 710, 770, 1418, 920, 838, 1435}, + {415, 1258, 1245, 870, 1278, 3067, 770, 1021, 1287, 522}, + {406, 990, 601, 1009, 1265, 1265, 1267, 759, 1017, 1277}, + {968, 1182, 1329, 788, 1032, 1292, 1705, 1714, 203, 1403}, + {732, 877, 1279, 471, 901, 1161, 1545, 1294, 755, 755}}, + {{111, 931, 1378, 1185, 1933, 1648, 1148, 1714, 1873, 1307}, + {406, 414, 1030, 1023, 1910, 1404, 1313, 1647, 1509, 793}, + {342, 640, 575, 1088, 1241, 1349, 1161, 1350, 1756, 1502}, + {559, 766, 1185, 357, 1682, 1428, 1329, 1897, 1219, 802}, + {473, 909, 1164, 771, 719, 2508, 1427, 1432, 722, 782}, + {342, 892, 785, 1145, 1150, 794, 1296, 1550, 973, 1057}, + {208, 1036, 1326, 1343, 1606, 3395, 815, 1455, 1618, 712}, + {228, 928, 890, 1046, 3499, 1711, 994, 829, 1720, 1318}, + {768, 724, 1058, 636, 991, 1075, 1319, 1324, 616, 825}, + {305, 1167, 1358, 899, 1587, 1587, 987, 1988, 1332, 501}}}; //------------------------------------------------------------------------------ // helper functions for residuals struct VP8Residual. -void VP8InitResidual(int first, int coeff_type, - VP8Encoder* const enc, VP8Residual* const res) { +void VP8InitResidual(int first, int coeff_type, VP8Encoder* const enc, + VP8Residual* const res) { res->coeff_type = coeff_type; - res->prob = enc->proba.coeffs[coeff_type]; + res->prob = enc->proba.coeffs[coeff_type]; res->stats = enc->proba.stats[coeff_type]; res->costs = enc->proba.remapped_costs[coeff_type]; res->first = first; @@ -241,7 +240,7 @@ int VP8GetCostLuma16(VP8EncIterator* const it, const VP8ModeScore* const rd) { int x, y; int R = 0; - VP8IteratorNzToBytes(it); // re-import the non-zero context + VP8IteratorNzToBytes(it); // re-import the non-zero context // DC VP8InitResidual(0, 1, enc, &res); @@ -283,7 +282,6 @@ int VP8GetCostUV(VP8EncIterator* const it, const VP8ModeScore* const rd) { return R; } - //------------------------------------------------------------------------------ // Recording of token probabilities. @@ -296,7 +294,7 @@ int VP8RecordCoeffs(int ctx, const VP8Residual* const res) { int n = res->first; // should be stats[VP8EncBands[n]], but it's equivalent for n=0 or 1 proba_t* s = res->stats[n][ctx]; - if (res->last < 0) { + if (res->last < 0) { VP8RecordStats(0, s + 0); return 0; } @@ -314,8 +312,7 @@ int VP8RecordCoeffs(int ctx, const VP8Residual* const res) { v = abs(v); #if !defined(USE_LEVEL_CODE_TABLE) if (!VP8RecordStats(v > 4, s + 3)) { - if (VP8RecordStats(v != 2, s + 4)) - VP8RecordStats(v == 4, s + 5); + if (VP8RecordStats(v != 2, s + 4)) VP8RecordStats(v == 4, s + 5); } else if (!VP8RecordStats(v > 10, s + 6)) { VP8RecordStats(v > 6, s + 7); } else if (!VP8RecordStats((v >= 3 + (8 << 2)), s + 8)) { diff --git a/src/enc/cost_enc.h b/src/enc/cost_enc.h index d2ffcc12..e8e8d187 100644 --- a/src/enc/cost_enc.h +++ b/src/enc/cost_enc.h @@ -35,13 +35,13 @@ struct VP8Residual { const int16_t* coeffs; int coeff_type; - ProbaArray* prob; - StatsArray* stats; - CostArrayPtr costs; + ProbaArray* prob; + StatsArray* stats; + CostArrayPtr costs; }; -void VP8InitResidual(int first, int coeff_type, - VP8Encoder* const enc, VP8Residual* const res); +void VP8InitResidual(int first, int coeff_type, VP8Encoder* const enc, + VP8Residual* const res); int VP8RecordCoeffs(int ctx, const VP8Residual* const res); @@ -67,8 +67,8 @@ static WEBP_INLINE int VP8BitCost(int bit, uint8_t proba) { // Level cost calculations void VP8CalculateLevelCosts(VP8EncProba* const proba); static WEBP_INLINE int VP8LevelCost(const uint16_t* const table, int level) { - return VP8LevelFixedCosts[level] - + table[(level > MAX_VARIABLE_LEVEL) ? MAX_VARIABLE_LEVEL : level]; + return VP8LevelFixedCosts[level] + + table[(level > MAX_VARIABLE_LEVEL) ? MAX_VARIABLE_LEVEL : level]; } // Mode costs @@ -79,7 +79,7 @@ extern const uint16_t VP8FixedCostsI4[NUM_BMODES][NUM_BMODES][NUM_BMODES]; //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_ENC_COST_ENC_H_ diff --git a/src/enc/filter_enc.c b/src/enc/filter_enc.c index 8790ac81..7d249c9f 100644 --- a/src/enc/filter_enc.c +++ b/src/enc/filter_enc.c @@ -16,9 +16,9 @@ #include #include "src/dec/common_dec.h" -#include "src/webp/types.h" #include "src/dsp/dsp.h" #include "src/enc/vp8i_enc.h" +#include "src/webp/types.h" // This table gives, for a given sharpness, the filtering strength to be // used (at least) in order to filter a given edge step delta. @@ -27,39 +27,38 @@ // true. #define MAX_DELTA_SIZE 64 static const uint8_t kLevelsFromDelta[8][MAX_DELTA_SIZE] = { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 }, - { 0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 17, 18, - 20, 21, 23, 24, 26, 27, 29, 30, 32, 33, 35, 36, 38, 39, 41, 42, - 44, 45, 47, 48, 50, 51, 53, 54, 56, 57, 59, 60, 62, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63 }, - { 0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 14, 16, 17, 19, - 20, 22, 23, 25, 26, 28, 29, 31, 32, 34, 35, 37, 38, 40, 41, 43, - 44, 46, 47, 49, 50, 52, 53, 55, 56, 58, 59, 61, 62, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63 }, - { 0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 18, 19, - 21, 22, 24, 25, 27, 28, 30, 31, 33, 34, 36, 37, 39, 40, 42, 43, - 45, 46, 48, 49, 51, 52, 54, 55, 57, 58, 60, 61, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63 }, - { 0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 14, 15, 17, 18, 20, - 21, 23, 24, 26, 27, 29, 30, 32, 33, 35, 36, 38, 39, 41, 42, 44, - 45, 47, 48, 50, 51, 53, 54, 56, 57, 59, 60, 62, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63 }, - { 0, 1, 2, 4, 5, 7, 8, 9, 11, 12, 13, 15, 16, 17, 19, 20, - 22, 23, 25, 26, 28, 29, 31, 32, 34, 35, 37, 38, 40, 41, 43, 44, - 46, 47, 49, 50, 52, 53, 55, 56, 58, 59, 61, 62, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63 }, - { 0, 1, 2, 4, 5, 7, 8, 9, 11, 12, 13, 15, 16, 18, 19, 21, - 22, 24, 25, 27, 28, 30, 31, 33, 34, 36, 37, 39, 40, 42, 43, 45, - 46, 48, 49, 51, 52, 54, 55, 57, 58, 60, 61, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63 }, - { 0, 1, 2, 4, 5, 7, 8, 9, 11, 12, 14, 15, 17, 18, 20, 21, - 23, 24, 26, 27, 29, 30, 32, 33, 35, 36, 38, 39, 41, 42, 44, 45, - 47, 48, 50, 51, 53, 54, 56, 57, 59, 60, 62, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63 } -}; + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}, + {0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 17, 18, + 20, 21, 23, 24, 26, 27, 29, 30, 32, 33, 35, 36, 38, 39, 41, 42, + 44, 45, 47, 48, 50, 51, 53, 54, 56, 57, 59, 60, 62, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63}, + {0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 14, 16, 17, 19, + 20, 22, 23, 25, 26, 28, 29, 31, 32, 34, 35, 37, 38, 40, 41, 43, + 44, 46, 47, 49, 50, 52, 53, 55, 56, 58, 59, 61, 62, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63}, + {0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 15, 16, 18, 19, + 21, 22, 24, 25, 27, 28, 30, 31, 33, 34, 36, 37, 39, 40, 42, 43, + 45, 46, 48, 49, 51, 52, 54, 55, 57, 58, 60, 61, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63}, + {0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 14, 15, 17, 18, 20, + 21, 23, 24, 26, 27, 29, 30, 32, 33, 35, 36, 38, 39, 41, 42, 44, + 45, 47, 48, 50, 51, 53, 54, 56, 57, 59, 60, 62, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63}, + {0, 1, 2, 4, 5, 7, 8, 9, 11, 12, 13, 15, 16, 17, 19, 20, + 22, 23, 25, 26, 28, 29, 31, 32, 34, 35, 37, 38, 40, 41, 43, 44, + 46, 47, 49, 50, 52, 53, 55, 56, 58, 59, 61, 62, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63}, + {0, 1, 2, 4, 5, 7, 8, 9, 11, 12, 13, 15, 16, 18, 19, 21, + 22, 24, 25, 27, 28, 30, 31, 33, 34, 36, 37, 39, 40, 42, 43, 45, + 46, 48, 49, 51, 52, 54, 55, 57, 58, 60, 61, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63}, + {0, 1, 2, 4, 5, 7, 8, 9, 11, 12, 14, 15, 17, 18, 20, 21, + 23, 24, 26, 27, 29, 30, 32, 33, 35, 36, 38, 39, 41, 42, 44, 45, + 47, 48, 50, 51, 53, 54, 56, 57, 59, 60, 62, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63}}; int VP8FilterStrengthFromDelta(int sharpness, int delta) { const int pos = (delta < MAX_DELTA_SIZE) ? delta : MAX_DELTA_SIZE - 1; @@ -99,10 +98,10 @@ static void DoFilter(const VP8EncIterator* const it, int level) { // copy current block to yuv_out2 memcpy(y_dst, it->yuv_out, YUV_SIZE_ENC * sizeof(uint8_t)); - if (enc->filter_hdr.simple == 1) { // simple + if (enc->filter_hdr.simple == 1) { // simple VP8SimpleHFilter16i(y_dst, BPS, limit); VP8SimpleVFilter16i(y_dst, BPS, limit); - } else { // complex + } else { // complex const int hev_thresh = (level >= 40) ? 2 : (level >= 15) ? 1 : 0; VP8HFilter16i(y_dst, BPS, limit, ilevel, hev_thresh); VP8HFilter8i(u_dst, v_dst, BPS, limit, ilevel, hev_thresh); @@ -121,16 +120,16 @@ static double GetMBSSIM(const uint8_t* yuv1, const uint8_t* yuv2) { // compute SSIM in a 10 x 10 window for (y = VP8_SSIM_KERNEL; y < 16 - VP8_SSIM_KERNEL; y++) { for (x = VP8_SSIM_KERNEL; x < 16 - VP8_SSIM_KERNEL; x++) { - sum += VP8SSIMGetClipped(yuv1 + Y_OFF_ENC, BPS, yuv2 + Y_OFF_ENC, BPS, - x, y, 16, 16); + sum += VP8SSIMGetClipped(yuv1 + Y_OFF_ENC, BPS, yuv2 + Y_OFF_ENC, BPS, x, + y, 16, 16); } } for (x = 1; x < 7; x++) { for (y = 1; y < 7; y++) { - sum += VP8SSIMGetClipped(yuv1 + U_OFF_ENC, BPS, yuv2 + U_OFF_ENC, BPS, - x, y, 8, 8); - sum += VP8SSIMGetClipped(yuv1 + V_OFF_ENC, BPS, yuv2 + V_OFF_ENC, BPS, - x, y, 8, 8); + sum += VP8SSIMGetClipped(yuv1 + U_OFF_ENC, BPS, yuv2 + U_OFF_ENC, BPS, x, + y, 8, 8); + sum += VP8SSIMGetClipped(yuv1 + V_OFF_ENC, BPS, yuv2 + V_OFF_ENC, BPS, x, + y, 8, 8); } } return sum; @@ -191,7 +190,7 @@ void VP8StoreFilterStats(VP8EncIterator* const it) { DoFilter(it, level); (*it->lf_stats)[s][level] += GetMBSSIM(it->yuv_in, it->yuv_out2); } -#else // defined(WEBP_REDUCE_SIZE) +#else // defined(WEBP_REDUCE_SIZE) (void)it; #endif // !defined(WEBP_REDUCE_SIZE) } diff --git a/src/enc/frame_enc.c b/src/enc/frame_enc.c index 5a50085c..0c52fef9 100644 --- a/src/enc/frame_enc.c +++ b/src/enc/frame_enc.c @@ -16,22 +16,22 @@ #include #include "src/dec/common_dec.h" -#include "src/webp/types.h" #include "src/dsp/dsp.h" #include "src/enc/cost_enc.h" #include "src/enc/vp8i_enc.h" #include "src/utils/bit_writer_utils.h" #include "src/webp/encode.h" #include "src/webp/format_constants.h" // RIFF constants +#include "src/webp/types.h" #define SEGMENT_VISU 0 -#define DEBUG_SEARCH 0 // useful to track search convergence +#define DEBUG_SEARCH 0 // useful to track search convergence //------------------------------------------------------------------------------ // multi-pass convergence -#define HEADER_SIZE_ESTIMATE (RIFF_HEADER_SIZE + CHUNK_HEADER_SIZE + \ - VP8_FRAME_HEADER_SIZE) +#define HEADER_SIZE_ESTIMATE \ + (RIFF_HEADER_SIZE + CHUNK_HEADER_SIZE + VP8_FRAME_HEADER_SIZE) #define DQ_LIMIT 0.4 // convergence is considered reached if dq < DQ_LIMIT // we allow 2k of extra head-room in PARTITION0 limit. #define PARTITION0_SIZE_LIMIT ((VP8_MAX_PARTITION0_SIZE - 2048ULL) << 11) @@ -45,7 +45,7 @@ typedef struct { // struct for organizing convergence in either size or PSNR float dq; float q, last_q; float qmin, qmax; - double value, last_value; // PSNR or size + double value, last_value; // PSNR or size double target; int do_size_search; } PassStats; @@ -60,9 +60,9 @@ static int InitPassStats(const VP8Encoder* const enc, PassStats* const s) { s->qmin = 1.f * enc->config->qmin; s->qmax = 1.f * enc->config->qmax; s->q = s->last_q = Clamp(enc->config->quality, s->qmin, s->qmax); - s->target = do_size_search ? (double)target_size - : (target_PSNR > 0.) ? target_PSNR - : 40.; // default, just in case + s->target = do_size_search ? (double)target_size + : (target_PSNR > 0.) ? target_PSNR + : 40.; // default, just in case s->value = s->last_value = 0.; s->do_size_search = do_size_search; return do_size_search; @@ -90,11 +90,11 @@ static float ComputeNextQ(PassStats* const s) { //------------------------------------------------------------------------------ // Tables for level coding -const uint8_t VP8Cat3[] = { 173, 148, 140 }; -const uint8_t VP8Cat4[] = { 176, 155, 140, 135 }; -const uint8_t VP8Cat5[] = { 180, 157, 141, 134, 130 }; -const uint8_t VP8Cat6[] = - { 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129 }; +const uint8_t VP8Cat3[] = {173, 148, 140}; +const uint8_t VP8Cat4[] = {176, 155, 140, 135}; +const uint8_t VP8Cat5[] = {180, 157, 141, 134, 130}; +const uint8_t VP8Cat6[] = {254, 254, 243, 230, 196, 177, + 153, 140, 133, 130, 129}; //------------------------------------------------------------------------------ // Reset the statistics about: number of skips, token proba, level cost,... @@ -122,11 +122,11 @@ static int FinalizeSkipProba(VP8Encoder* const enc) { int size; proba->skip_proba = CalcSkipProba(nb_events, nb_mbs); proba->use_skip_proba = (proba->skip_proba < SKIP_PROBA_THRESHOLD); - size = 256; // 'use_skip_proba' bit + size = 256; // 'use_skip_proba' bit if (proba->use_skip_proba) { - size += nb_events * VP8BitCost(1, proba->skip_proba) - + (nb_mbs - nb_events) * VP8BitCost(0, proba->skip_proba); - size += 8 * 256; // cost of signaling the 'skip_proba' itself. + size += nb_events * VP8BitCost(1, proba->skip_proba) + + (nb_mbs - nb_events) * VP8BitCost(0, proba->skip_proba); + size += 8 * 256; // cost of signaling the 'skip_proba' itself. } return size; } @@ -162,11 +162,10 @@ static int FinalizeTokenProbas(VP8EncProba* const proba) { const int update_proba = VP8CoeffsUpdateProba[t][b][c][p]; const int old_p = VP8CoeffsProba0[t][b][c][p]; const int new_p = CalcTokenProba(nb, total); - const int old_cost = BranchCost(nb, total, old_p) - + VP8BitCost(0, update_proba); - const int new_cost = BranchCost(nb, total, new_p) - + VP8BitCost(1, update_proba) - + 8 * 256; + const int old_cost = + BranchCost(nb, total, old_p) + VP8BitCost(0, update_proba); + const int new_cost = BranchCost(nb, total, new_p) + + VP8BitCost(1, update_proba) + 8 * 256; const int use_new_p = (old_cost > new_cost); size += VP8BitCost(use_new_p, update_proba); if (use_new_p) { // only use proba that seem meaningful enough. @@ -189,7 +188,7 @@ static int FinalizeTokenProbas(VP8EncProba* const proba) { static int GetProba(int a, int b) { const int total = a + b; - return (total == 0) ? 255 // that's the default probability. + return (total == 0) ? 255 // that's the default probability. : (255 * a + total / 2) / total; // rounded proba } @@ -201,7 +200,7 @@ static void ResetSegments(VP8Encoder* const enc) { } static void SetSegmentProbas(VP8Encoder* const enc) { - int p[NUM_MB_SEGMENTS] = { 0 }; + int p[NUM_MB_SEGMENTS] = {0}; int n; for (n = 0; n < enc->mb_w * enc->mb_h; ++n) { @@ -271,25 +270,25 @@ static int PutCoeffs(VP8BitWriter* const bw, int ctx, const VP8Residual* res) { } else { int mask; const uint8_t* tab; - if (v < 3 + (8 << 1)) { // VP8Cat3 (3b) + if (v < 3 + (8 << 1)) { // VP8Cat3 (3b) VP8PutBit(bw, 0, p[8]); VP8PutBit(bw, 0, p[9]); v -= 3 + (8 << 0); mask = 1 << 2; tab = VP8Cat3; - } else if (v < 3 + (8 << 2)) { // VP8Cat4 (4b) + } else if (v < 3 + (8 << 2)) { // VP8Cat4 (4b) VP8PutBit(bw, 0, p[8]); VP8PutBit(bw, 1, p[9]); v -= 3 + (8 << 1); mask = 1 << 3; tab = VP8Cat4; - } else if (v < 3 + (8 << 3)) { // VP8Cat5 (5b) + } else if (v < 3 + (8 << 3)) { // VP8Cat5 (5b) VP8PutBit(bw, 1, p[8]); VP8PutBit(bw, 0, p[10]); v -= 3 + (8 << 2); mask = 1 << 4; tab = VP8Cat5; - } else { // VP8Cat6 (11b) + } else { // VP8Cat6 (11b) VP8PutBit(bw, 1, p[8]); VP8PutBit(bw, 1, p[10]); v -= 3 + (8 << 3); @@ -305,7 +304,7 @@ static int PutCoeffs(VP8BitWriter* const bw, int ctx, const VP8Residual* res) { } VP8PutBitUniform(bw, sign); if (n == 16 || !VP8PutBit(bw, n <= res->last, p[0])) { - return 1; // EOB + return 1; // EOB } } return 1; @@ -373,7 +372,7 @@ static void RecordResiduals(VP8EncIterator* const it, VP8IteratorNzToBytes(it); - if (it->mb->type == 1) { // i16x16 + if (it->mb->type == 1) { // i16x16 VP8InitResidual(0, 1, enc, &res); VP8SetResidualCoeffs(rd->y_dc_levels, &res); it->top_nz[8] = it->left_nz[8] = @@ -420,12 +419,11 @@ static int RecordTokens(VP8EncIterator* const it, const VP8ModeScore* const rd, VP8Encoder* const enc = it->enc; VP8IteratorNzToBytes(it); - if (it->mb->type == 1) { // i16x16 + if (it->mb->type == 1) { // i16x16 const int ctx = it->top_nz[8] + it->left_nz[8]; VP8InitResidual(0, 1, enc, &res); VP8SetResidualCoeffs(rd->y_dc_levels, &res); - it->top_nz[8] = it->left_nz[8] = - VP8RecordCoeffTokens(ctx, &res, tokens); + it->top_nz[8] = it->left_nz[8] = VP8RecordCoeffTokens(ctx, &res, tokens); VP8InitResidual(1, 0, enc, &res); } else { VP8InitResidual(0, 3, enc, &res); @@ -436,8 +434,7 @@ static int RecordTokens(VP8EncIterator* const it, const VP8ModeScore* const rd, for (x = 0; x < 4; ++x) { const int ctx = it->top_nz[x] + it->left_nz[y]; VP8SetResidualCoeffs(rd->y_ac_levels[x + y * 4], &res); - it->top_nz[x] = it->left_nz[y] = - VP8RecordCoeffTokens(ctx, &res, tokens); + it->top_nz[x] = it->left_nz[y] = VP8RecordCoeffTokens(ctx, &res, tokens); } } @@ -457,7 +454,7 @@ static int RecordTokens(VP8EncIterator* const it, const VP8ModeScore* const rd, return !tokens->error; } -#endif // !DISABLE_TOKEN_BUFFER +#endif // !DISABLE_TOKEN_BUFFER //------------------------------------------------------------------------------ // ExtraInfo map / Debug function @@ -508,17 +505,32 @@ static void StoreSideInfo(const VP8EncIterator* const it) { if (pic->extra_info != NULL) { uint8_t* const info = &pic->extra_info[it->x + it->y * enc->mb_w]; switch (pic->extra_info_type) { - case 1: *info = mb->type; break; - case 2: *info = mb->segment; break; - case 3: *info = enc->dqm[mb->segment].quant; break; - case 4: *info = (mb->type == 1) ? it->preds[0] : 0xff; break; - case 5: *info = mb->uv_mode; break; + case 1: + *info = mb->type; + break; + case 2: + *info = mb->segment; + break; + case 3: + *info = enc->dqm[mb->segment].quant; + break; + case 4: + *info = (mb->type == 1) ? it->preds[0] : 0xff; + break; + case 5: + *info = mb->uv_mode; + break; case 6: { const int b = (int)((it->luma_bits + it->uv_bits + 7) >> 3); - *info = (b > 255) ? 255 : b; break; + *info = (b > 255) ? 255 : b; + break; } - case 7: *info = mb->alpha; break; - default: *info = 0; break; + case 7: + *info = mb->alpha; + break; + default: + *info = 0; + break; } } #if SEGMENT_VISU // visualize segments and prediction modes @@ -536,24 +548,20 @@ static void ResetSideInfo(const VP8EncIterator* const it) { } ResetSSE(enc); } -#else // defined(WEBP_DISABLE_STATS) -static void ResetSSE(VP8Encoder* const enc) { - (void)enc; -} +#else // defined(WEBP_DISABLE_STATS) +static void ResetSSE(VP8Encoder* const enc) { (void)enc; } static void StoreSideInfo(const VP8EncIterator* const it) { VP8Encoder* const enc = it->enc; WebPPicture* const pic = enc->pic; if (pic->extra_info != NULL) { - if (it->x == 0 && it->y == 0) { // only do it once, at start + if (it->x == 0 && it->y == 0) { // only do it once, at start memset(pic->extra_info, 0, enc->mb_w * enc->mb_h * sizeof(*pic->extra_info)); } } } -static void ResetSideInfo(const VP8EncIterator* const it) { - (void)it; -} +static void ResetSideInfo(const VP8EncIterator* const it) { (void)it; } #endif // !defined(WEBP_DISABLE_STATS) static double GetPSNR(uint64_t mse, uint64_t size) { @@ -569,16 +577,15 @@ static void SetLoopParams(VP8Encoder* const enc, float q) { // Make sure the quality parameter is inside valid bounds q = Clamp(q, 0.f, 100.f); - VP8SetSegmentParams(enc, q); // setup segment quantizations and filters - SetSegmentProbas(enc); // compute segment probabilities + VP8SetSegmentParams(enc, q); // setup segment quantizations and filters + SetSegmentProbas(enc); // compute segment probabilities ResetStats(enc); ResetSSE(enc); } static uint64_t OneStatPass(VP8Encoder* const enc, VP8RDLevel rd_opt, - int nb_mbs, int percent_delta, - PassStats* const s) { + int nb_mbs, int percent_delta, PassStats* const s) { VP8EncIterator it; uint64_t size = 0; uint64_t size_p0 = 0; @@ -650,13 +657,13 @@ static int StatLoop(VP8Encoder* const enc) { OneStatPass(enc, rd_opt, nb_mbs, percent_per_pass, &stats); if (size_p0 == 0) return 0; #if (DEBUG_SEARCH > 0) - printf("#%d value:%.1lf -> %.1lf q:%.2f -> %.2f\n", - num_pass_left, stats.last_value, stats.value, stats.last_q, stats.q); + printf("#%d value:%.1lf -> %.1lf q:%.2f -> %.2f\n", num_pass_left, + stats.last_value, stats.value, stats.last_q, stats.q); #endif if (enc->max_i4_header_bits > 0 && size_p0 > PARTITION0_SIZE_LIMIT) { ++num_pass_left; - enc->max_i4_header_bits >>= 1; // strengthen header bit limitation... - continue; // ...and start over + enc->max_i4_header_bits >>= 1; // strengthen header bit limitation... + continue; // ...and start over } if (is_last_pass) { break; @@ -680,7 +687,7 @@ static int StatLoop(VP8Encoder* const enc) { // Main loops // -static const uint8_t kAverageBytesPerMB[8] = { 50, 24, 16, 9, 7, 5, 3, 2 }; +static const uint8_t kAverageBytesPerMB[8] = {50, 24, 16, 9, 7, 5, 3, 2}; static int PreLoopInitialize(VP8Encoder* const enc) { int p; @@ -701,7 +708,7 @@ static int PreLoopInitialize(VP8Encoder* const enc) { static int PostLoopFinalize(VP8EncIterator* const it, int ok) { VP8Encoder* const enc = it->enc; - if (ok) { // Finalize the partitions, check for extra errors. + if (ok) { // Finalize the partitions, check for extra errors. int p; for (p = 0; p < enc->num_parts; ++p) { VP8BitWriterFinish(enc->parts + p); @@ -709,7 +716,7 @@ static int PostLoopFinalize(VP8EncIterator* const it, int ok) { } } - if (ok) { // All good. Finish up. + if (ok) { // All good. Finish up. #if !defined(WEBP_DISABLE_STATS) if (enc->pic->stats != NULL) { // finalize byte counters... int i, s; @@ -720,7 +727,7 @@ static int PostLoopFinalize(VP8EncIterator* const it, int ok) { } } #endif - VP8AdjustFilterStrength(it); // ...and store filter stats. + VP8AdjustFilterStrength(it); // ...and store filter stats. } else { // Something bad happened -> need to do some memory cleanup. VP8EncFreeBitWriters(enc); @@ -765,7 +772,7 @@ int VP8EncLoop(VP8Encoder* const enc) { ok = 0; break; } - } else { // reset predictors after a skip + } else { // reset predictors after a skip ResetAfterSkip(&it); } StoreSideInfo(&it); @@ -807,7 +814,7 @@ int VP8EncTokenLoop(VP8Encoder* const enc) { assert(enc->num_parts == 1); assert(enc->use_tokens); assert(proba->use_skip_proba == 0); - assert(rd_opt >= RD_OPT_BASIC); // otherwise, token-buffer won't be useful + assert(rd_opt >= RD_OPT_BASIC); // otherwise, token-buffer won't be useful assert(num_pass_left > 0); while (ok && num_pass_left-- > 0) { @@ -856,8 +863,7 @@ int VP8EncTokenLoop(VP8Encoder* const enc) { size_p0 += enc->segment_hdr.size; if (stats.do_size_search) { uint64_t size = FinalizeTokenProbas(&enc->proba); - size += VP8EstimateTokenSize(&enc->tokens, - (const uint8_t*)proba->coeffs); + size += VP8EstimateTokenSize(&enc->tokens, (const uint8_t*)proba->coeffs); size = (size + size_p0 + 1024) >> 11; // -> size in bytes size += HEADER_SIZE_ESTIMATE; stats.value = (double)size; @@ -866,10 +872,11 @@ int VP8EncTokenLoop(VP8Encoder* const enc) { } #if (DEBUG_SEARCH > 0) - printf("#%2d metric:%.1lf -> %.1lf last_q=%.2lf q=%.2lf dq=%.2lf " - " range:[%.1f, %.1f]\n", - num_pass_left, stats.last_value, stats.value, - stats.last_q, stats.q, stats.dq, stats.qmin, stats.qmax); + printf( + "#%2d metric:%.1lf -> %.1lf last_q=%.2lf q=%.2lf dq=%.2lf " + " range:[%.1f, %.1f]\n", + num_pass_left, stats.last_value, stats.value, stats.last_q, stats.q, + stats.dq, stats.qmin, stats.qmax); #endif if (enc->max_i4_header_bits > 0 && size_p0 > PARTITION0_SIZE_LIMIT) { ++num_pass_left; @@ -877,10 +884,10 @@ int VP8EncTokenLoop(VP8Encoder* const enc) { if (is_last_pass) { ResetSideInfo(&it); } - continue; // ...and start over + continue; // ...and start over } if (is_last_pass) { - break; // done + break; // done } if (do_search) { ComputeNextQ(&stats); // Adjust q @@ -902,9 +909,9 @@ int VP8EncTokenLoop(VP8Encoder* const enc) { int VP8EncTokenLoop(VP8Encoder* const enc) { (void)enc; - return 0; // we shouldn't be here. + return 0; // we shouldn't be here. } -#endif // DISABLE_TOKEN_BUFFER +#endif // DISABLE_TOKEN_BUFFER //------------------------------------------------------------------------------ diff --git a/src/enc/histogram_enc.c b/src/enc/histogram_enc.c index b7f265c0..da833d76 100644 --- a/src/enc/histogram_enc.c +++ b/src/enc/histogram_enc.c @@ -36,13 +36,7 @@ #define MAX_HISTO_GREEDY 100 // Enum to meaningfully access the elements of the Histogram arrays. -typedef enum { - LITERAL = 0, - RED, - BLUE, - ALPHA, - DISTANCE -} HistogramIndex; +typedef enum { LITERAL = 0, RED, BLUE, ALPHA, DISTANCE } HistogramIndex; // Return the size of the histogram for a given cache_bits. static int GetHistogramSize(int cache_bits) { @@ -127,7 +121,7 @@ VP8LHistogram* VP8LAllocateHistogram(int cache_bits) { histo = (VP8LHistogram*)memory; // 'literal' won't necessary be aligned. histo->literal = (uint32_t*)(memory + sizeof(VP8LHistogram)); - VP8LHistogramInit(histo, cache_bits, /*init_arrays=*/ 0); + VP8LHistogramInit(histo, cache_bits, /*init_arrays=*/0); return histo; } @@ -136,11 +130,11 @@ static void HistogramSetResetPointers(VP8LHistogramSet* const set, int cache_bits) { int i; const int histo_size = GetHistogramSize(cache_bits); - uint8_t* memory = (uint8_t*) (set->histograms); + uint8_t* memory = (uint8_t*)(set->histograms); memory += set->max_size * sizeof(*set->histograms); for (i = 0; i < set->max_size; ++i) { - memory = (uint8_t*) WEBP_ALIGN(memory); - set->histograms[i] = (VP8LHistogram*) memory; + memory = (uint8_t*)WEBP_ALIGN(memory); + set->histograms[i] = (VP8LHistogram*)memory; // 'literal' won't necessary be aligned. set->histograms[i]->literal = (uint32_t*)(memory + sizeof(VP8LHistogram)); memory += histo_size; @@ -150,8 +144,8 @@ static void HistogramSetResetPointers(VP8LHistogramSet* const set, // Returns the total size of the VP8LHistogramSet. static size_t HistogramSetTotalSize(int size, int cache_bits) { const int histo_size = GetHistogramSize(cache_bits); - return (sizeof(VP8LHistogramSet) + size * (sizeof(VP8LHistogram*) + - histo_size + WEBP_ALIGN_CST)); + return (sizeof(VP8LHistogramSet) + + size * (sizeof(VP8LHistogram*) + histo_size + WEBP_ALIGN_CST)); } VP8LHistogramSet* VP8LAllocateHistogramSet(int size, int cache_bits) { @@ -168,7 +162,7 @@ VP8LHistogramSet* VP8LAllocateHistogramSet(int size, int cache_bits) { set->size = size; HistogramSetResetPointers(set, cache_bits); for (i = 0; i < size; ++i) { - VP8LHistogramInit(set->histograms[i], cache_bits, /*init_arrays=*/ 0); + VP8LHistogramInit(set->histograms[i], cache_bits, /*init_arrays=*/0); } return set; } @@ -563,8 +557,8 @@ static void DominantCostRangeInit(DominantCostRange* const c) { c->blue_min = WEBP_UINT64_MAX; } -static void UpdateDominantCostRange( - const VP8LHistogram* const h, DominantCostRange* const c) { +static void UpdateDominantCostRange(const VP8LHistogram* const h, + DominantCostRange* const c) { if (c->literal_max < h->costs[LITERAL]) c->literal_max = h->costs[LITERAL]; if (c->literal_min > h->costs[LITERAL]) c->literal_min = h->costs[LITERAL]; if (c->red_max < h->costs[RED]) c->red_max = h->costs[RED]; @@ -614,9 +608,9 @@ static int GetHistoBinIndex(const VP8LHistogram* const h, } // Construct the histograms from backward references. -static void HistogramBuild( - int xsize, int histo_bits, const VP8LBackwardRefs* const backward_refs, - VP8LHistogramSet* const image_histo) { +static void HistogramBuild(int xsize, int histo_bits, + const VP8LBackwardRefs* const backward_refs, + VP8LHistogramSet* const image_histo) { int x = 0, y = 0; const int histo_xsize = VP8LSubSampleSize(xsize, histo_bits); VP8LHistogram** const histograms = image_histo->histograms; @@ -697,9 +691,9 @@ static void HistogramCombineEntropyBin(VP8LHistogramSet* const image_histo, VP8LHistogram** const histograms = image_histo->histograms; int idx; struct { - int16_t first; // position of the histogram that accumulates all - // histograms with the same bin_id - uint16_t num_combine_failures; // number of combine failures per bin_id + int16_t first; // position of the histogram that accumulates all + // histograms with the same bin_id + uint16_t num_combine_failures; // number of combine failures per bin_id } bin_info[BIN_SIZE]; assert(num_bins <= BIN_SIZE); @@ -940,8 +934,8 @@ static int HistogramCombineGreedy(VP8LHistogramSet* const image_histo) { // Remove pairs intersecting the just combined best pair. for (i = 0; i < histo_queue.size;) { HistogramPair* const p = histo_queue.queue + i; - if (p->idx1 == idx1 || p->idx2 == idx1 || - p->idx1 == idx2 || p->idx2 == idx2) { + if (p->idx1 == idx1 || p->idx2 == idx1 || p->idx1 == idx2 || + p->idx2 == idx2) { HistoQueuePopPair(&histo_queue, p); } else { HistoQueueFixPair(image_histo->size, idx2, p); @@ -959,7 +953,7 @@ static int HistogramCombineGreedy(VP8LHistogramSet* const image_histo) { ok = 1; - End: +End: HistoQueueClear(&histo_queue); return ok; } @@ -992,8 +986,8 @@ static int HistogramCombineStochastic(VP8LHistogramSet* const image_histo, // Collapse similar histograms in 'image_histo'. for (iter = 0; iter < outer_iters && image_histo->size >= min_cluster_size && - ++tries_with_no_success < num_tries_no_success; - ++iter) { + ++tries_with_no_success < num_tries_no_success; + ++iter) { int64_t best_cost = (histo_queue.size == 0) ? 0 : histo_queue.queue[0].cost_diff; int best_idx1 = -1, best_idx2 = 1; @@ -1064,7 +1058,7 @@ static int HistogramCombineStochastic(VP8LHistogramSet* const image_histo, *do_greedy = (image_histo->size <= min_cluster_size); ok = 1; - End: +End: HistoQueueClear(&histo_queue); return ok; } @@ -1201,7 +1195,7 @@ int VP8LGetHistoImageSymbols(int xsize, int ysize, goto Error; } - Error: +Error: VP8LFreeHistogramSet(orig_histo); return (pic->error_code == VP8_ENC_OK); } diff --git a/src/enc/histogram_enc.h b/src/enc/histogram_enc.h index 303c1e2e..422377a2 100644 --- a/src/enc/histogram_enc.h +++ b/src/enc/histogram_enc.h @@ -30,7 +30,7 @@ extern "C" { typedef struct { // 'literal' contains green literal, palette-code and // copy-length-prefix histogram - uint32_t* literal; // Pointer to the allocated buffer for literal. + uint32_t* literal; // Pointer to the allocated buffer for literal. uint32_t red[NUM_LITERAL_CODES]; uint32_t blue[NUM_LITERAL_CODES]; uint32_t alpha[NUM_LITERAL_CODES]; @@ -42,18 +42,18 @@ typedef struct { // Index of the unique value of a histogram if any, VP8L_NON_TRIVIAL_SYM // otherwise. uint16_t trivial_symbol[5]; - uint64_t bit_cost; // Cached value of total bit cost. + uint64_t bit_cost; // Cached value of total bit cost. // Cached values of entropy costs: literal, red, blue, alpha, distance uint64_t costs[5]; - uint8_t is_used[5]; // 5 for literal, red, blue, alpha, distance - uint16_t bin_id; // entropy bin index. + uint8_t is_used[5]; // 5 for literal, red, blue, alpha, distance + uint16_t bin_id; // entropy bin index. } VP8LHistogram; // Collection of histograms with fixed capacity, allocated as one // big memory chunk. Can be destroyed by calling WebPSafeFree(). typedef struct { - int size; // number of slots currently in use - int max_size; // maximum capacity + int size; // number of slots currently in use + int max_size; // maximum capacity VP8LHistogram** histograms; } VP8LHistogramSet; @@ -99,7 +99,7 @@ VP8LHistogram* VP8LAllocateHistogram(int cache_bits); static WEBP_INLINE int VP8LHistogramNumCodes(int palette_code_bits) { return NUM_LITERAL_CODES + NUM_LENGTH_CODES + - ((palette_code_bits > 0) ? (1 << palette_code_bits) : 0); + ((palette_code_bits > 0) ? (1 << palette_code_bits) : 0); } // Builds the histogram image. pic and percent are for progress. diff --git a/src/enc/iterator_enc.c b/src/enc/iterator_enc.c index bc807d5e..2b7e126b 100644 --- a/src/enc/iterator_enc.c +++ b/src/enc/iterator_enc.c @@ -24,8 +24,7 @@ //------------------------------------------------------------------------------ static void InitLeft(VP8EncIterator* const it) { - it->y_left[-1] = it->u_left[-1] = it->v_left[-1] = - (it->y > 0) ? 129 : 127; + it->y_left[-1] = it->u_left[-1] = it->v_left[-1] = (it->y > 0) ? 129 : 127; memset(it->y_left, 129, 16); memset(it->u_left, 129, 8); memset(it->v_left, 129, 8); @@ -78,10 +77,10 @@ int VP8IteratorIsDone(const VP8EncIterator* const it) { void VP8IteratorInit(VP8Encoder* const enc, VP8EncIterator* const it) { it->enc = enc; - it->yuv_in = (uint8_t*)WEBP_ALIGN(it->yuv_mem); - it->yuv_out = it->yuv_in + YUV_SIZE_ENC; + it->yuv_in = (uint8_t*)WEBP_ALIGN(it->yuv_mem); + it->yuv_out = it->yuv_in + YUV_SIZE_ENC; it->yuv_out2 = it->yuv_out + YUV_SIZE_ENC; - it->yuv_p = it->yuv_out2 + YUV_SIZE_ENC; + it->yuv_p = it->yuv_out2 + YUV_SIZE_ENC; it->lf_stats = enc->lf_stats; it->percent0 = enc->percent; it->y_left = (uint8_t*)WEBP_ALIGN(it->yuv_left_mem + 1); @@ -96,8 +95,8 @@ int VP8IteratorProgress(const VP8EncIterator* const it, int delta) { if (delta && enc->pic->progress_hook != NULL) { const int done = it->count_down0 - it->count_down; const int percent = (it->count_down0 <= 0) - ? it->percent0 - : it->percent0 + delta * done / it->count_down0; + ? it->percent0 + : it->percent0 + delta * done / it->count_down0; return WebPReportProgress(enc->pic, percent, &enc->percent); } return 1; @@ -109,8 +108,8 @@ int VP8IteratorProgress(const VP8EncIterator* const it, int delta) { static WEBP_INLINE int MinSize(int a, int b) { return (a < b) ? a : b; } -static void ImportBlock(const uint8_t* src, int src_stride, - uint8_t* dst, int w, int h, int size) { +static void ImportBlock(const uint8_t* src, int src_stride, uint8_t* dst, int w, + int h, int size) { int i; for (i = 0; i < h; ++i) { memcpy(dst, src, w); @@ -126,8 +125,8 @@ static void ImportBlock(const uint8_t* src, int src_stride, } } -static void ImportLine(const uint8_t* src, int src_stride, - uint8_t* dst, int len, int total_len) { +static void ImportLine(const uint8_t* src, int src_stride, uint8_t* dst, + int len, int total_len) { int i; for (i = 0; i < len; ++i, src += src_stride) dst[i] = *src; for (; i < total_len; ++i) dst[i] = dst[len - 1]; @@ -137,7 +136,7 @@ void VP8IteratorImport(VP8EncIterator* const it, uint8_t* const tmp_32) { const VP8Encoder* const enc = it->enc; const int x = it->x, y = it->y; const WebPPicture* const pic = enc->pic; - const uint8_t* const ysrc = pic->y + (y * pic->y_stride + x) * 16; + const uint8_t* const ysrc = pic->y + (y * pic->y_stride + x) * 16; const uint8_t* const usrc = pic->u + (y * pic->uv_stride + x) * 8; const uint8_t* const vsrc = pic->v + (y * pic->uv_stride + x) * 8; const int w = MinSize(pic->width - x * 16, 16); @@ -145,7 +144,7 @@ void VP8IteratorImport(VP8EncIterator* const it, uint8_t* const tmp_32) { const int uv_w = (w + 1) >> 1; const int uv_h = (h + 1) >> 1; - ImportBlock(ysrc, pic->y_stride, it->yuv_in + Y_OFF_ENC, w, h, 16); + ImportBlock(ysrc, pic->y_stride, it->yuv_in + Y_OFF_ENC, w, h, 16); ImportBlock(usrc, pic->uv_stride, it->yuv_in + U_OFF_ENC, uv_w, uv_h, 8); ImportBlock(vsrc, pic->uv_stride, it->yuv_in + V_OFF_ENC, uv_w, uv_h, 8); @@ -158,22 +157,22 @@ void VP8IteratorImport(VP8EncIterator* const it, uint8_t* const tmp_32) { if (y == 0) { it->y_left[-1] = it->u_left[-1] = it->v_left[-1] = 127; } else { - it->y_left[-1] = ysrc[- 1 - pic->y_stride]; - it->u_left[-1] = usrc[- 1 - pic->uv_stride]; - it->v_left[-1] = vsrc[- 1 - pic->uv_stride]; + it->y_left[-1] = ysrc[-1 - pic->y_stride]; + it->u_left[-1] = usrc[-1 - pic->uv_stride]; + it->v_left[-1] = vsrc[-1 - pic->uv_stride]; } - ImportLine(ysrc - 1, pic->y_stride, it->y_left, h, 16); + ImportLine(ysrc - 1, pic->y_stride, it->y_left, h, 16); ImportLine(usrc - 1, pic->uv_stride, it->u_left, uv_h, 8); ImportLine(vsrc - 1, pic->uv_stride, it->v_left, uv_h, 8); } - it->y_top = tmp_32 + 0; + it->y_top = tmp_32 + 0; it->uv_top = tmp_32 + 16; if (y == 0) { memset(tmp_32, 127, 32 * sizeof(*tmp_32)); } else { - ImportLine(ysrc - pic->y_stride, 1, tmp_32, w, 16); - ImportLine(usrc - pic->uv_stride, 1, tmp_32 + 16, uv_w, 8); + ImportLine(ysrc - pic->y_stride, 1, tmp_32, w, 16); + ImportLine(usrc - pic->uv_stride, 1, tmp_32 + 16, uv_w, 8); ImportLine(vsrc - pic->uv_stride, 1, tmp_32 + 16 + 8, uv_w, 8); } } @@ -181,8 +180,8 @@ void VP8IteratorImport(VP8EncIterator* const it, uint8_t* const tmp_32) { //------------------------------------------------------------------------------ // Copy back the compressed samples into user space if requested. -static void ExportBlock(const uint8_t* src, uint8_t* dst, int dst_stride, - int w, int h) { +static void ExportBlock(const uint8_t* src, uint8_t* dst, int dst_stride, int w, + int h) { while (h-- > 0) { memcpy(dst, src, w); dst += dst_stride; @@ -210,7 +209,7 @@ void VP8IteratorExport(const VP8EncIterator* const it) { // Luma plane ExportBlock(ysrc, ydst, pic->y_stride, w, h); - { // U/V planes + { // U/V planes const int uv_w = (w + 1) >> 1; const int uv_h = (h + 1) >> 1; ExportBlock(usrc, udst, pic->uv_stride, uv_w, uv_h); @@ -256,8 +255,8 @@ void VP8IteratorNzToBytes(VP8EncIterator* const it) { top_nz[8] = BIT(tnz, 24); // left-Y - left_nz[0] = BIT(lnz, 3); - left_nz[1] = BIT(lnz, 7); + left_nz[0] = BIT(lnz, 3); + left_nz[1] = BIT(lnz, 7); left_nz[2] = BIT(lnz, 11); left_nz[3] = BIT(lnz, 15); // left-U @@ -297,7 +296,7 @@ void VP8IteratorSaveBoundary(VP8EncIterator* const it) { const int x = it->x, y = it->y; const uint8_t* const ysrc = it->yuv_out + Y_OFF_ENC; const uint8_t* const uvsrc = it->yuv_out + U_OFF_ENC; - if (x < enc->mb_w - 1) { // left + if (x < enc->mb_w - 1) { // left int i; for (i = 0; i < 16; ++i) { it->y_left[i] = ysrc[15 + i * BPS]; @@ -398,25 +397,21 @@ void VP8SetSegment(const VP8EncIterator* const it, int segment) { // Array to record the position of the top sample to pass to the prediction // functions in dsp.c. -static const uint8_t VP8TopLeftI4[16] = { - 17, 21, 25, 29, - 13, 17, 21, 25, - 9, 13, 17, 21, - 5, 9, 13, 17 -}; +static const uint8_t VP8TopLeftI4[16] = {17, 21, 25, 29, 13, 17, 21, 25, + 9, 13, 17, 21, 5, 9, 13, 17}; void VP8IteratorStartI4(VP8EncIterator* const it) { const VP8Encoder* const enc = it->enc; int i; - it->i4 = 0; // first 4x4 sub-block + it->i4 = 0; // first 4x4 sub-block it->i4_top = it->i4_boundary + VP8TopLeftI4[0]; // Import the boundary samples - for (i = 0; i < 17; ++i) { // left + for (i = 0; i < 17; ++i) { // left it->i4_boundary[i] = it->y_left[15 - i]; } - for (i = 0; i < 16; ++i) { // top + for (i = 0; i < 16; ++i) { // top it->i4_boundary[17 + i] = it->y_top[i]; } // top-right samples have a special case on the far right of the picture @@ -424,7 +419,7 @@ void VP8IteratorStartI4(VP8EncIterator* const it) { for (i = 16; i < 16 + 4; ++i) { it->i4_boundary[17 + i] = it->y_top[i]; } - } else { // else, replicate the last valid pixel four times + } else { // else, replicate the last valid pixel four times for (i = 16; i < 16 + 4; ++i) { it->i4_boundary[17 + i] = it->i4_boundary[17 + 15]; } @@ -449,10 +444,10 @@ int VP8IteratorRotateI4(VP8EncIterator* const it, // Update the cache with 7 fresh samples for (i = 0; i <= 3; ++i) { - top[-4 + i] = blk[i + 3 * BPS]; // store future top samples + top[-4 + i] = blk[i + 3 * BPS]; // store future top samples } if ((it->i4 & 3) != 3) { // if not on the right sub-blocks #3, #7, #11, #15 - for (i = 0; i <= 2; ++i) { // store future left samples + for (i = 0; i <= 2; ++i) { // store future left samples top[i] = blk[3 + (2 - i) * BPS]; } } else { // else replicate top-right samples, as says the specs. @@ -462,7 +457,7 @@ int VP8IteratorRotateI4(VP8EncIterator* const it, } // move pointers to next sub-block ++it->i4; - if (it->i4 == 16) { // we're done + if (it->i4 == 16) { // we're done return 0; } diff --git a/src/enc/near_lossless_enc.c b/src/enc/near_lossless_enc.c index 4bb0e891..6a336c77 100644 --- a/src/enc/near_lossless_enc.c +++ b/src/enc/near_lossless_enc.c @@ -19,15 +19,15 @@ #include #include "src/dsp/lossless_common.h" -#include "src/webp/types.h" #include "src/enc/vp8li_enc.h" #include "src/utils/utils.h" #include "src/webp/encode.h" +#include "src/webp/types.h" #if (WEBP_NEAR_LOSSLESS == 1) #define MIN_DIM_FOR_NEAR_LOSSLESS 64 -#define MAX_LIMIT_BITS 5 +#define MAX_LIMIT_BITS 5 // Quantizes the value up or down to a multiple of 1<> 24, bits) << 24) | - (FindClosestDiscretized((a >> 16) & 0xff, bits) << 16) | - (FindClosestDiscretized((a >> 8) & 0xff, bits) << 8) | - (FindClosestDiscretized(a & 0xff, bits)); + return (FindClosestDiscretized(a >> 24, bits) << 24) | + (FindClosestDiscretized((a >> 16) & 0xff, bits) << 16) | + (FindClosestDiscretized((a >> 8) & 0xff, bits) << 8) | + (FindClosestDiscretized(a & 0xff, bits)); } // Checks if distance between corresponding channel values of pixels a and b @@ -64,8 +63,7 @@ static int IsNear(uint32_t a, uint32_t b, int limit) { static int IsSmooth(const uint32_t* const prev_row, const uint32_t* const curr_row, - const uint32_t* const next_row, - int ix, int limit) { + const uint32_t* const next_row, int ix, int limit) { // Check that all pixels in 4-connected neighborhood are smooth. return (IsNear(curr_row[ix], curr_row[ix - 1], limit) && IsNear(curr_row[ix], curr_row[ix + 1], limit) && diff --git a/src/enc/picture_csp_enc.c b/src/enc/picture_csp_enc.c index 3ebf93d3..016b843f 100644 --- a/src/enc/picture_csp_enc.c +++ b/src/enc/picture_csp_enc.c @@ -43,7 +43,7 @@ #define CHANNEL_OFFSET(i) (i) #else // uint32_t 0xff000000 is 0x00,00,00,ff in memory -#define CHANNEL_OFFSET(i) (3-(i)) +#define CHANNEL_OFFSET(i) (3 - (i)) #endif #define ALPHA_OFFSET CHANNEL_OFFSET(0) @@ -74,13 +74,13 @@ int WebPPictureHasTransparency(const WebPPicture* picture) { if (picture->use_argb) { if (picture->argb != NULL) { return CheckNonOpaque((const uint8_t*)picture->argb + ALPHA_OFFSET, - picture->width, picture->height, - 4, picture->argb_stride * sizeof(*picture->argb)); + picture->width, picture->height, 4, + picture->argb_stride * sizeof(*picture->argb)); } return 0; } - return CheckNonOpaque(picture->a, picture->width, picture->height, - 1, picture->a_stride); + return CheckNonOpaque(picture->a, picture->width, picture->height, 1, + picture->a_stride); } //------------------------------------------------------------------------------ @@ -89,8 +89,8 @@ int WebPPictureHasTransparency(const WebPPicture* picture) { #if defined(USE_GAMMA_COMPRESSION) // Gamma correction compensates loss of resolution during chroma subsampling. -#define GAMMA_FIX 12 // fixed-point precision for linear values -#define GAMMA_TAB_FIX 7 // fixed-point fractional bits precision +#define GAMMA_FIX 12 // fixed-point precision for linear values +#define GAMMA_TAB_FIX 7 // fixed-point fractional bits precision #define GAMMA_TAB_SIZE (1 << (GAMMA_FIX - GAMMA_TAB_FIX)) static const double kGamma = 0.80; static const int kGammaScale = ((1 << GAMMA_FIX) - 1); @@ -124,11 +124,11 @@ static WEBP_INLINE uint32_t GammaToLinear(uint8_t v) { } static WEBP_INLINE int Interpolate(int v) { - const int tab_pos = v >> (GAMMA_TAB_FIX + 2); // integer part + const int tab_pos = v >> (GAMMA_TAB_FIX + 2); // integer part const int x = v & ((kGammaTabScale << 2) - 1); // fractional part const int v0 = kLinearToGammaTab[tab_pos]; const int v1 = kLinearToGammaTab[tab_pos + 1]; - const int y = v1 * x + v0 * ((kGammaTabScale << 2) - x); // interpolate + const int y = v1 * x + v0 * ((kGammaTabScale << 2) - x); // interpolate assert(tab_pos + 1 < GAMMA_TAB_SIZE + 1); return y; } @@ -136,8 +136,8 @@ static WEBP_INLINE int Interpolate(int v) { // Convert a linear value 'v' to YUV_FIX+2 fixed-point precision // U/V value, suitable for RGBToU/V calls. static WEBP_INLINE int LinearToGamma(uint32_t base_value, int shift) { - const int y = Interpolate(base_value << shift); // final uplifted value - return (y + kGammaTabRounder) >> GAMMA_TAB_FIX; // descale + const int y = Interpolate(base_value << shift); // final uplifted value + return (y + kGammaTabRounder) >> GAMMA_TAB_FIX; // descale } #else @@ -148,7 +148,7 @@ static WEBP_INLINE int LinearToGamma(uint32_t base_value, int shift) { return (int)(base_value << shift); } -#endif // USE_GAMMA_COMPRESSION +#endif // USE_GAMMA_COMPRESSION //------------------------------------------------------------------------------ // RGB -> YUV conversion @@ -176,16 +176,14 @@ static const int kMinDimensionIterativeConversion = 4; //------------------------------------------------------------------------------ // Main function -static int PreprocessARGB(const uint8_t* r_ptr, - const uint8_t* g_ptr, - const uint8_t* b_ptr, - int step, int rgb_stride, +static int PreprocessARGB(const uint8_t* r_ptr, const uint8_t* g_ptr, + const uint8_t* b_ptr, int step, int rgb_stride, WebPPicture* const picture) { const int ok = SharpYuvConvert( - r_ptr, g_ptr, b_ptr, step, rgb_stride, /*rgb_bit_depth=*/8, - picture->y, picture->y_stride, picture->u, picture->uv_stride, picture->v, - picture->uv_stride, /*yuv_bit_depth=*/8, picture->width, - picture->height, SharpYuvGetConversionMatrix(kSharpYuvMatrixWebp)); + r_ptr, g_ptr, b_ptr, step, rgb_stride, /*rgb_bit_depth=*/8, picture->y, + picture->y_stride, picture->u, picture->uv_stride, picture->v, + picture->uv_stride, /*yuv_bit_depth=*/8, picture->width, picture->height, + SharpYuvGetConversionMatrix(kSharpYuvMatrixWebp)); if (!ok) { return WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY); } @@ -195,14 +193,14 @@ static int PreprocessARGB(const uint8_t* r_ptr, //------------------------------------------------------------------------------ // "Fast" regular RGB->YUV -#define SUM4(ptr, step) LinearToGamma( \ - GammaToLinear((ptr)[0]) + \ - GammaToLinear((ptr)[(step)]) + \ - GammaToLinear((ptr)[rgb_stride]) + \ - GammaToLinear((ptr)[rgb_stride + (step)]), 0) \ +#define SUM4(ptr, step) \ + LinearToGamma(GammaToLinear((ptr)[0]) + GammaToLinear((ptr)[(step)]) + \ + GammaToLinear((ptr)[rgb_stride]) + \ + GammaToLinear((ptr)[rgb_stride + (step)]), \ + 0) #define SUM2(ptr) \ - LinearToGamma(GammaToLinear((ptr)[0]) + GammaToLinear((ptr)[rgb_stride]), 1) + LinearToGamma(GammaToLinear((ptr)[0]) + GammaToLinear((ptr)[rgb_stride]), 1) #define SUM2ALPHA(ptr) ((ptr)[0] + (ptr)[rgb_stride]) #define SUM4ALPHA(ptr) (SUM2ALPHA(ptr) + SUM2ALPHA((ptr) + 4)) @@ -218,140 +216,113 @@ static const int kAlphaFix = 19; // with ai in [0..255] and pi in [0..1<> (kAlphaFix - 2)) +#define DIVIDE_BY_ALPHA(sum, a) (((sum) * kInvAlpha[(a)]) >> (kAlphaFix - 2)) #else @@ -377,10 +348,8 @@ static WEBP_INLINE int LinearToGammaWeighted(const uint8_t* src, static WEBP_INLINE void ConvertRowToY(const uint8_t* const r_ptr, const uint8_t* const g_ptr, - const uint8_t* const b_ptr, - int step, - uint8_t* const dst_y, - int width, + const uint8_t* const b_ptr, int step, + uint8_t* const dst_y, int width, VP8Random* const rg) { int i, j; for (i = 0, j = 0; i < width; i += 1, j += step) { @@ -392,8 +361,8 @@ static WEBP_INLINE void AccumulateRGBA(const uint8_t* const r_ptr, const uint8_t* const g_ptr, const uint8_t* const b_ptr, const uint8_t* const a_ptr, - int rgb_stride, - uint16_t* dst, int width) { + int rgb_stride, uint16_t* dst, + int width) { int i, j; // we loop over 2x2 blocks and produce one R/G/B/A value for each. for (i = 0, j = 0; i < (width >> 1); i += 1, j += 2 * 4, dst += 4) { @@ -434,9 +403,9 @@ static WEBP_INLINE void AccumulateRGBA(const uint8_t* const r_ptr, static WEBP_INLINE void AccumulateRGB(const uint8_t* const r_ptr, const uint8_t* const g_ptr, - const uint8_t* const b_ptr, - int step, int rgb_stride, - uint16_t* dst, int width) { + const uint8_t* const b_ptr, int step, + int rgb_stride, uint16_t* dst, + int width) { int i, j; for (i = 0, j = 0; i < (width >> 1); i += 1, j += 2 * step, dst += 4) { dst[0] = SUM4(r_ptr + j, step); @@ -461,8 +430,7 @@ static WEBP_INLINE void AccumulateRGB(const uint8_t* const r_ptr, static WEBP_INLINE void ConvertRowsToUV(const uint16_t* rgb, uint8_t* const dst_u, - uint8_t* const dst_v, - int width, + uint8_t* const dst_v, int width, VP8Random* const rg) { int i; for (i = 0; i < width; i += 1, rgb += 4) { @@ -474,14 +442,11 @@ static WEBP_INLINE void ConvertRowsToUV(const uint16_t* rgb, extern void SharpYuvInit(VP8CPUInfo cpu_info_func); -static int ImportYUVAFromRGBA(const uint8_t* r_ptr, - const uint8_t* g_ptr, - const uint8_t* b_ptr, - const uint8_t* a_ptr, - int step, // bytes per pixel - int rgb_stride, // bytes per scanline - float dithering, - int use_iterative_conversion, +static int ImportYUVAFromRGBA(const uint8_t* r_ptr, const uint8_t* g_ptr, + const uint8_t* b_ptr, const uint8_t* a_ptr, + int step, // bytes per pixel + int rgb_stride, // bytes per scanline + float dithering, int use_iterative_conversion, WebPPicture* const picture) { int y; const int width = picture->width; @@ -514,8 +479,8 @@ static int ImportYUVAFromRGBA(const uint8_t* r_ptr, return 0; } if (has_alpha) { - WebPExtractAlpha(a_ptr, rgb_stride, width, height, - picture->a, picture->a_stride); + WebPExtractAlpha(a_ptr, rgb_stride, width, height, picture->a, + picture->a_stride); } } else { const int uv_width = (width + 1) >> 1; @@ -555,15 +520,14 @@ static int ImportYUVAFromRGBA(const uint8_t* r_ptr, } } else { ConvertRowToY(r_ptr, g_ptr, b_ptr, step, dst_y, width, rg); - ConvertRowToY(r_ptr + rgb_stride, - g_ptr + rgb_stride, - b_ptr + rgb_stride, step, - dst_y + picture->y_stride, width, rg); + ConvertRowToY(r_ptr + rgb_stride, g_ptr + rgb_stride, + b_ptr + rgb_stride, step, dst_y + picture->y_stride, + width, rg); } dst_y += 2 * picture->y_stride; if (has_alpha) { - rows_have_alpha &= !WebPExtractAlpha(a_ptr, rgb_stride, width, 2, - dst_a, picture->a_stride); + rows_have_alpha &= !WebPExtractAlpha(a_ptr, rgb_stride, width, 2, dst_a, + picture->a_stride); dst_a += 2 * picture->a_stride; } // Collect averaged R/G/B(/A) @@ -585,7 +549,7 @@ static int ImportYUVAFromRGBA(const uint8_t* r_ptr, g_ptr += 2 * rgb_stride; if (has_alpha) a_ptr += 2 * rgb_stride; } - if (height & 1) { // extra last row + if (height & 1) { // extra last row int row_has_alpha = has_alpha; if (rg == NULL) { if (is_rgb) { @@ -602,8 +566,8 @@ static int ImportYUVAFromRGBA(const uint8_t* r_ptr, // Collect averaged R/G/B(/A) if (!row_has_alpha) { // Collect averaged R/G/B - AccumulateRGB(r_ptr, g_ptr, b_ptr, step, /* rgb_stride = */ 0, - tmp_rgb, width); + AccumulateRGB(r_ptr, g_ptr, b_ptr, step, /* rgb_stride = */ 0, tmp_rgb, + width); } else { AccumulateRGBA(r_ptr, g_ptr, b_ptr, a_ptr, /* rgb_stride = */ 0, tmp_rgb, width); @@ -689,7 +653,7 @@ int WebPPictureYUVAToARGB(WebPPicture* picture) { const int height = picture->height; const int argb_stride = 4 * picture->argb_stride; uint8_t* dst = (uint8_t*)picture->argb; - const uint8_t* cur_u = picture->u, *cur_v = picture->v, *cur_y = picture->y; + const uint8_t *cur_u = picture->u, *cur_v = picture->v, *cur_y = picture->y; WebPUpsampleLinePairFunc upsample = WebPGetLinePairConverter(ALPHA_OFFSET > 0); @@ -730,9 +694,8 @@ int WebPPictureYUVAToARGB(WebPPicture* picture) { //------------------------------------------------------------------------------ // automatic import / conversion -static int Import(WebPPicture* const picture, - const uint8_t* rgb, int rgb_stride, - int step, int swap_rb, int import_alpha) { +static int Import(WebPPicture* const picture, const uint8_t* rgb, + int rgb_stride, int step, int swap_rb, int import_alpha) { int y; // swap_rb -> b,g,r,a , !swap_rb -> r,g,b,a const uint8_t* r_ptr = rgb + (swap_rb ? 2 : 0); @@ -799,46 +762,45 @@ static int Import(WebPPicture* const picture, #if !defined(WEBP_REDUCE_CSP) -int WebPPictureImportBGR(WebPPicture* picture, - const uint8_t* bgr, int bgr_stride) { +int WebPPictureImportBGR(WebPPicture* picture, const uint8_t* bgr, + int bgr_stride) { return (picture != NULL && bgr != NULL) ? Import(picture, bgr, bgr_stride, 3, 1, 0) : 0; } -int WebPPictureImportBGRA(WebPPicture* picture, - const uint8_t* bgra, int bgra_stride) { +int WebPPictureImportBGRA(WebPPicture* picture, const uint8_t* bgra, + int bgra_stride) { return (picture != NULL && bgra != NULL) ? Import(picture, bgra, bgra_stride, 4, 1, 1) : 0; } - -int WebPPictureImportBGRX(WebPPicture* picture, - const uint8_t* bgrx, int bgrx_stride) { +int WebPPictureImportBGRX(WebPPicture* picture, const uint8_t* bgrx, + int bgrx_stride) { return (picture != NULL && bgrx != NULL) ? Import(picture, bgrx, bgrx_stride, 4, 1, 0) : 0; } -#endif // WEBP_REDUCE_CSP +#endif // WEBP_REDUCE_CSP -int WebPPictureImportRGB(WebPPicture* picture, - const uint8_t* rgb, int rgb_stride) { +int WebPPictureImportRGB(WebPPicture* picture, const uint8_t* rgb, + int rgb_stride) { return (picture != NULL && rgb != NULL) ? Import(picture, rgb, rgb_stride, 3, 0, 0) : 0; } -int WebPPictureImportRGBA(WebPPicture* picture, - const uint8_t* rgba, int rgba_stride) { +int WebPPictureImportRGBA(WebPPicture* picture, const uint8_t* rgba, + int rgba_stride) { return (picture != NULL && rgba != NULL) ? Import(picture, rgba, rgba_stride, 4, 0, 1) : 0; } -int WebPPictureImportRGBX(WebPPicture* picture, - const uint8_t* rgbx, int rgbx_stride) { +int WebPPictureImportRGBX(WebPPicture* picture, const uint8_t* rgbx, + int rgbx_stride) { return (picture != NULL && rgbx != NULL) ? Import(picture, rgbx, rgbx_stride, 4, 0, 0) : 0; diff --git a/src/enc/picture_enc.c b/src/enc/picture_enc.c index 3638e849..6ed93c01 100644 --- a/src/enc/picture_enc.c +++ b/src/enc/picture_enc.c @@ -36,7 +36,7 @@ static int DummyWriter(const uint8_t* data, size_t data_size, int WebPPictureInitInternal(WebPPicture* picture, int version) { if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_ENCODER_ABI_VERSION)) { - return 0; // caller/system version mismatch! + return 0; // caller/system version mismatch! } if (picture != NULL) { memset(picture, 0, sizeof(*picture)); @@ -126,13 +126,13 @@ int WebPPictureAllocYUVA(WebPPicture* const picture) { a_stride = a_width; y_size = (uint64_t)y_stride * height; uv_size = (uint64_t)uv_stride * uv_height; - a_size = (uint64_t)a_stride * height; + a_size = (uint64_t)a_stride * height; total_size = y_size + a_size + 2 * uv_size; // Security and validation checks - if (width <= 0 || height <= 0 || // luma/alpha param error - uv_width <= 0 || uv_height <= 0) { // u/v param error + if (width <= 0 || height <= 0 || // luma/alpha param error + uv_width <= 0 || uv_height <= 0) { // u/v param error return WebPEncodingSetError(picture, VP8_ENC_ERROR_BAD_DIMENSION); } // allocate a new buffer. @@ -143,9 +143,9 @@ int WebPPictureAllocYUVA(WebPPicture* const picture) { // From now on, we're in the clear, we can no longer fail... picture->memory_ = (void*)mem; - picture->y_stride = y_stride; + picture->y_stride = y_stride; picture->uv_stride = uv_stride; - picture->a_stride = a_stride; + picture->a_stride = a_stride; // TODO(skal): we could align the y/u/v planes and adjust stride. picture->y = mem; @@ -166,7 +166,7 @@ int WebPPictureAllocYUVA(WebPPicture* const picture) { int WebPPictureAlloc(WebPPicture* picture) { if (picture != NULL) { - WebPPictureFree(picture); // erase previous buffer + WebPPictureFree(picture); // erase previous buffer if (!picture->use_argb) { return WebPPictureAllocYUVA(picture); @@ -272,11 +272,11 @@ static size_t Encode(const uint8_t* rgba, int width, int height, int stride, return wrt.size; } -#define ENCODE_FUNC(NAME, IMPORTER) \ -size_t NAME(const uint8_t* in, int w, int h, int bps, float q, \ - uint8_t** out) { \ - return Encode(in, w, h, bps, IMPORTER, q, 0, out); \ -} +#define ENCODE_FUNC(NAME, IMPORTER) \ + size_t NAME(const uint8_t* in, int w, int h, int bps, float q, \ + uint8_t** out) { \ + return Encode(in, w, h, bps, IMPORTER, q, 0, out); \ + } ENCODE_FUNC(WebPEncodeRGB, WebPPictureImportRGB) ENCODE_FUNC(WebPEncodeRGBA, WebPPictureImportRGBA) @@ -288,10 +288,10 @@ ENCODE_FUNC(WebPEncodeBGRA, WebPPictureImportBGRA) #undef ENCODE_FUNC #define LOSSLESS_DEFAULT_QUALITY 70. -#define LOSSLESS_ENCODE_FUNC(NAME, IMPORTER) \ -size_t NAME(const uint8_t* in, int w, int h, int bps, uint8_t** out) { \ - return Encode(in, w, h, bps, IMPORTER, LOSSLESS_DEFAULT_QUALITY, 1, out); \ -} +#define LOSSLESS_ENCODE_FUNC(NAME, IMPORTER) \ + size_t NAME(const uint8_t* in, int w, int h, int bps, uint8_t** out) { \ + return Encode(in, w, h, bps, IMPORTER, LOSSLESS_DEFAULT_QUALITY, 1, out); \ + } LOSSLESS_ENCODE_FUNC(WebPEncodeLosslessRGB, WebPPictureImportRGB) LOSSLESS_ENCODE_FUNC(WebPEncodeLosslessRGBA, WebPPictureImportRGBA) diff --git a/src/enc/picture_psnr_enc.c b/src/enc/picture_psnr_enc.c index c6bb9b94..22c08189 100644 --- a/src/enc/picture_psnr_enc.c +++ b/src/enc/picture_psnr_enc.c @@ -18,14 +18,14 @@ #include #include -#include "src/webp/types.h" #include "src/dsp/dsp.h" #include "src/enc/vp8i_enc.h" #include "src/utils/utils.h" +#include "src/webp/types.h" typedef double (*AccumulateFunc)(const uint8_t* src, int src_stride, - const uint8_t* ref, int ref_stride, - int w, int h); + const uint8_t* ref, int ref_stride, int w, + int h); //------------------------------------------------------------------------------ // local-min distortion @@ -36,8 +36,7 @@ typedef double (*AccumulateFunc)(const uint8_t* src, int src_stride, #define RADIUS 2 // search radius. Shouldn't be too large. static double AccumulateLSIM(const uint8_t* src, int src_stride, - const uint8_t* ref, int ref_stride, - int w, int h) { + const uint8_t* ref, int ref_stride, int w, int h) { int x, y; double total_sse = 0.; for (y = 0; y < h; ++y) { @@ -65,8 +64,7 @@ static double AccumulateLSIM(const uint8_t* src, int src_stride, #undef RADIUS static double AccumulateSSE(const uint8_t* src, int src_stride, - const uint8_t* ref, int ref_stride, - int w, int h) { + const uint8_t* ref, int ref_stride, int w, int h) { int y; double total_sse = 0.; for (y = 0; y < h; ++y) { @@ -80,8 +78,7 @@ static double AccumulateSSE(const uint8_t* src, int src_stride, //------------------------------------------------------------------------------ static double AccumulateSSIM(const uint8_t* src, int src_stride, - const uint8_t* ref, int ref_stride, - int w, int h) { + const uint8_t* ref, int ref_stride, int w, int h) { const int w0 = (w < VP8_SSIM_KERNEL) ? w : VP8_SSIM_KERNEL; const int w1 = w - VP8_SSIM_KERNEL - 1; const int h0 = (h < VP8_SSIM_KERNEL) ? h : VP8_SSIM_KERNEL; @@ -131,21 +128,20 @@ static double GetLogSSIM(double v, double size) { } int WebPPlaneDistortion(const uint8_t* src, size_t src_stride, - const uint8_t* ref, size_t ref_stride, - int width, int height, size_t x_step, - int type, float* distortion, float* result) { + const uint8_t* ref, size_t ref_stride, int width, + int height, size_t x_step, int type, float* distortion, + float* result) { uint8_t* allocated = NULL; - const AccumulateFunc metric = (type == 0) ? AccumulateSSE : - (type == 1) ? AccumulateSSIM : - AccumulateLSIM; - if (src == NULL || ref == NULL || - src_stride < x_step * width || ref_stride < x_step * width || - result == NULL || distortion == NULL) { + const AccumulateFunc metric = (type == 0) ? AccumulateSSE + : (type == 1) ? AccumulateSSIM + : AccumulateLSIM; + if (src == NULL || ref == NULL || src_stride < x_step * width || + ref_stride < x_step * width || result == NULL || distortion == NULL) { return 0; } VP8SSIMDspInit(); - if (x_step != 1) { // extract a packed plane if needed + if (x_step != 1) { // extract a packed plane if needed int x, y; uint8_t* tmp1; uint8_t* tmp2; @@ -172,9 +168,9 @@ int WebPPlaneDistortion(const uint8_t* src, size_t src_stride, } #ifdef WORDS_BIGENDIAN -#define BLUE_OFFSET 3 // uint32_t 0x000000ff is 0x00,00,00,ff in memory +#define BLUE_OFFSET 3 // uint32_t 0x000000ff is 0x00,00,00,ff in memory #else -#define BLUE_OFFSET 0 // uint32_t 0x000000ff is 0xff,00,00,00 in memory +#define BLUE_OFFSET 0 // uint32_t 0x000000ff is 0xff,00,00,00 in memory #endif int WebPPictureDistortion(const WebPPicture* src, const WebPPicture* ref, @@ -183,9 +179,8 @@ int WebPPictureDistortion(const WebPPicture* src, const WebPPicture* ref, int ok = 0; WebPPicture p0, p1; double total_size = 0., total_distortion = 0.; - if (src == NULL || ref == NULL || - src->width != ref->width || src->height != ref->height || - results == NULL) { + if (src == NULL || ref == NULL || src->width != ref->width || + src->height != ref->height || results == NULL) { return 0; } @@ -206,8 +201,8 @@ int WebPPictureDistortion(const WebPPicture* src, const WebPPicture* ref, // results are reported as BGRA const int offset = c ^ BLUE_OFFSET; if (!WebPPlaneDistortion((const uint8_t*)p0.argb + offset, stride0, - (const uint8_t*)p1.argb + offset, stride1, - w, h, 4, type, &distortion, results + c)) { + (const uint8_t*)p1.argb + offset, stride1, w, h, 4, + type, &distortion, results + c)) { goto Error; } total_distortion += distortion; @@ -218,7 +213,7 @@ int WebPPictureDistortion(const WebPPicture* src, const WebPPicture* ref, : (float)GetPSNR(total_distortion, total_size); ok = 1; - Error: +Error: WebPPictureFree(&p0); WebPPictureFree(&p1); return ok; @@ -228,9 +223,9 @@ int WebPPictureDistortion(const WebPPicture* src, const WebPPicture* ref, #else // defined(WEBP_DISABLE_STATS) int WebPPlaneDistortion(const uint8_t* src, size_t src_stride, - const uint8_t* ref, size_t ref_stride, - int width, int height, size_t x_step, - int type, float* distortion, float* result) { + const uint8_t* ref, size_t ref_stride, int width, + int height, size_t x_step, int type, float* distortion, + float* result) { (void)src; (void)src_stride; (void)ref; diff --git a/src/enc/picture_rescale_enc.c b/src/enc/picture_rescale_enc.c index 097172bf..95813e3e 100644 --- a/src/enc/picture_rescale_enc.c +++ b/src/enc/picture_rescale_enc.c @@ -11,14 +11,13 @@ // // Author: Skal (pascal.massimino@gmail.com) -#include "src/webp/encode.h" - #include #include -#include "src/webp/types.h" #include "src/dsp/dsp.h" #include "src/enc/vp8i_enc.h" +#include "src/webp/encode.h" +#include "src/webp/types.h" #if !defined(WEBP_REDUCE_SIZE) #include "src/utils/rescaler_utils.h" @@ -39,8 +38,8 @@ static void PictureGrabSpecs(const WebPPicture* const src, //------------------------------------------------------------------------------ // Adjust top-left corner to chroma sample position. -static void SnapTopLeftPosition(const WebPPicture* const pic, - int* const left, int* const top) { +static void SnapTopLeftPosition(const WebPPicture* const pic, int* const left, + int* const top) { if (!pic->use_argb) { *left &= ~1; *top &= ~1; @@ -49,8 +48,8 @@ static void SnapTopLeftPosition(const WebPPicture* const pic, // Adjust top-left corner and verify that the sub-rectangle is valid. static int AdjustAndCheckRectangle(const WebPPicture* const pic, - int* const left, int* const top, - int width, int height) { + int* const left, int* const top, int width, + int height) { SnapTopLeftPosition(pic, left, top); if ((*left) < 0 || (*top) < 0) return 0; if (width <= 0 || height <= 0) return 0; @@ -68,20 +67,20 @@ int WebPPictureCopy(const WebPPicture* src, WebPPicture* dst) { if (!WebPPictureAlloc(dst)) return 0; if (!src->use_argb) { - WebPCopyPlane(src->y, src->y_stride, - dst->y, dst->y_stride, dst->width, dst->height); + WebPCopyPlane(src->y, src->y_stride, dst->y, dst->y_stride, dst->width, + dst->height); WebPCopyPlane(src->u, src->uv_stride, dst->u, dst->uv_stride, HALVE(dst->width), HALVE(dst->height)); WebPCopyPlane(src->v, src->uv_stride, dst->v, dst->uv_stride, HALVE(dst->width), HALVE(dst->height)); - if (dst->a != NULL) { - WebPCopyPlane(src->a, src->a_stride, - dst->a, dst->a_stride, dst->width, dst->height); + if (dst->a != NULL) { + WebPCopyPlane(src->a, src->a_stride, dst->a, dst->a_stride, dst->width, + dst->height); } } else { WebPCopyPlane((const uint8_t*)src->argb, 4 * src->argb_stride, - (uint8_t*)dst->argb, 4 * dst->argb_stride, - 4 * dst->width, dst->height); + (uint8_t*)dst->argb, 4 * dst->argb_stride, 4 * dst->width, + dst->height); } return 1; } @@ -95,9 +94,8 @@ int WebPPictureIsView(const WebPPicture* picture) { return (picture->memory_ == NULL); } -int WebPPictureView(const WebPPicture* src, - int left, int top, int width, int height, - WebPPicture* dst) { +int WebPPictureView(const WebPPicture* src, int left, int top, int width, + int height, WebPPicture* dst) { if (src == NULL || dst == NULL) return 0; // verify rectangle position. @@ -129,8 +127,8 @@ int WebPPictureView(const WebPPicture* src, //------------------------------------------------------------------------------ // Picture cropping -int WebPPictureCrop(WebPPicture* pic, - int left, int top, int width, int height) { +int WebPPictureCrop(WebPPicture* pic, int left, int top, int width, + int height) { WebPPicture tmp; if (pic == NULL) return 0; @@ -146,17 +144,17 @@ int WebPPictureCrop(WebPPicture* pic, if (!pic->use_argb) { const int y_offset = top * pic->y_stride + left; const int uv_offset = (top / 2) * pic->uv_stride + left / 2; - WebPCopyPlane(pic->y + y_offset, pic->y_stride, - tmp.y, tmp.y_stride, width, height); - WebPCopyPlane(pic->u + uv_offset, pic->uv_stride, - tmp.u, tmp.uv_stride, HALVE(width), HALVE(height)); - WebPCopyPlane(pic->v + uv_offset, pic->uv_stride, - tmp.v, tmp.uv_stride, HALVE(width), HALVE(height)); + WebPCopyPlane(pic->y + y_offset, pic->y_stride, tmp.y, tmp.y_stride, width, + height); + WebPCopyPlane(pic->u + uv_offset, pic->uv_stride, tmp.u, tmp.uv_stride, + HALVE(width), HALVE(height)); + WebPCopyPlane(pic->v + uv_offset, pic->uv_stride, tmp.v, tmp.uv_stride, + HALVE(width), HALVE(height)); if (tmp.a != NULL) { const int a_offset = top * pic->a_stride + left; - WebPCopyPlane(pic->a + a_offset, pic->a_stride, - tmp.a, tmp.a_stride, width, height); + WebPCopyPlane(pic->a + a_offset, pic->a_stride, tmp.a, tmp.a_stride, + width, height); } } else { const uint8_t* const src = @@ -172,22 +170,19 @@ int WebPPictureCrop(WebPPicture* pic, //------------------------------------------------------------------------------ // Simple picture rescaler -static int RescalePlane(const uint8_t* src, - int src_width, int src_height, int src_stride, - uint8_t* dst, - int dst_width, int dst_height, int dst_stride, - rescaler_t* const work, +static int RescalePlane(const uint8_t* src, int src_width, int src_height, + int src_stride, uint8_t* dst, int dst_width, + int dst_height, int dst_stride, rescaler_t* const work, int num_channels) { WebPRescaler rescaler; int y = 0; - if (!WebPRescalerInit(&rescaler, src_width, src_height, - dst, dst_width, dst_height, dst_stride, - num_channels, work)) { + if (!WebPRescalerInit(&rescaler, src_width, src_height, dst, dst_width, + dst_height, dst_stride, num_channels, work)) { return 0; } while (y < src_height) { - y += WebPRescalerImport(&rescaler, src_height - y, - src + y * src_stride, src_stride); + y += WebPRescalerImport(&rescaler, src_height - y, src + y * src_stride, + src_stride); WebPRescalerExport(&rescaler); } return 1; @@ -201,8 +196,8 @@ static void AlphaMultiplyARGB(WebPPicture* const pic, int inverse) { static void AlphaMultiplyY(WebPPicture* const pic, int inverse) { if (pic->a != NULL) { - WebPMultRows(pic->y, pic->y_stride, pic->a, pic->a_stride, - pic->width, pic->height, inverse); + WebPMultRows(pic->y, pic->y_stride, pic->a, pic->a_stride, pic->width, + pic->height, inverse); } } @@ -214,8 +209,8 @@ int WebPPictureRescale(WebPPicture* picture, int width, int height) { if (picture == NULL) return 0; prev_width = picture->width; prev_height = picture->height; - if (!WebPRescalerGetScaledDimensions( - prev_width, prev_height, &width, &height)) { + if (!WebPRescalerGetScaledDimensions(prev_width, prev_height, &width, + &height)) { return WebPEncodingSetError(picture, VP8_ENC_ERROR_BAD_DIMENSION); } @@ -279,7 +274,7 @@ int WebPPictureRescale(WebPPicture* picture, int width, int height) { return 1; } -#else // defined(WEBP_REDUCE_SIZE) +#else // defined(WEBP_REDUCE_SIZE) int WebPPictureCopy(const WebPPicture* src, WebPPicture* dst) { (void)src; @@ -287,8 +282,8 @@ int WebPPictureCopy(const WebPPicture* src, WebPPicture* dst) { return 0; } -int WebPPictureCrop(WebPPicture* pic, - int left, int top, int width, int height) { +int WebPPictureCrop(WebPPicture* pic, int left, int top, int width, + int height) { (void)pic; (void)left; (void)top; diff --git a/src/enc/picture_tools_enc.c b/src/enc/picture_tools_enc.c index a2ea3630..20f01b6c 100644 --- a/src/enc/picture_tools_enc.c +++ b/src/enc/picture_tools_enc.c @@ -92,7 +92,7 @@ void WebPReplaceTransparentPixels(WebPPicture* const pic, uint32_t color) { if (pic != NULL && pic->use_argb) { int y = pic->height; uint32_t* argb = pic->argb; - color &= 0xffffffu; // force alpha=0 + color &= 0xffffffu; // force alpha=0 WebPInitAlphaProcessing(); while (y-- > 0) { WebPAlphaReplace(argb, pic->width, color); @@ -135,22 +135,22 @@ void WebPCleanupTransparentArea(WebPPicture* pic) { uint8_t* u_ptr = pic->u; uint8_t* v_ptr = pic->v; const uint8_t* a_ptr = pic->a; - int values[3] = { 0 }; + int values[3] = {0}; if (a_ptr == NULL || y_ptr == NULL || u_ptr == NULL || v_ptr == NULL) { return; } for (y = 0; y + SIZE <= height; y += SIZE) { int need_reset = 1; for (x = 0; x + SIZE <= width; x += SIZE) { - if (SmoothenBlock(a_ptr + x, a_stride, y_ptr + x, y_stride, - SIZE, SIZE)) { + if (SmoothenBlock(a_ptr + x, a_stride, y_ptr + x, y_stride, SIZE, + SIZE)) { if (need_reset) { values[0] = y_ptr[x]; values[1] = u_ptr[x >> 1]; values[2] = v_ptr[x >> 1]; need_reset = 0; } - Flatten(y_ptr + x, values[0], y_stride, SIZE); + Flatten(y_ptr + x, values[0], y_stride, SIZE); Flatten(u_ptr + (x >> 1), values[1], uv_stride, SIZE2); Flatten(v_ptr + (x >> 1), values[2], uv_stride, SIZE2); } else { @@ -158,8 +158,8 @@ void WebPCleanupTransparentArea(WebPPicture* pic) { } } if (x < width) { - SmoothenBlock(a_ptr + x, a_stride, y_ptr + x, y_stride, - width - x, SIZE); + SmoothenBlock(a_ptr + x, a_stride, y_ptr + x, y_stride, width - x, + SIZE); } a_ptr += SIZE * a_stride; y_ptr += SIZE * y_stride; @@ -169,12 +169,12 @@ void WebPCleanupTransparentArea(WebPPicture* pic) { if (y < height) { const int sub_height = height - y; for (x = 0; x + SIZE <= width; x += SIZE) { - SmoothenBlock(a_ptr + x, a_stride, y_ptr + x, y_stride, - SIZE, sub_height); + SmoothenBlock(a_ptr + x, a_stride, y_ptr + x, y_stride, SIZE, + sub_height); } if (x < width) { - SmoothenBlock(a_ptr + x, a_stride, y_ptr + x, y_stride, - width - x, sub_height); + SmoothenBlock(a_ptr + x, a_stride, y_ptr + x, y_stride, width - x, + sub_height); } } } @@ -187,9 +187,9 @@ void WebPCleanupTransparentArea(WebPPicture* pic) { // Blend color and remove transparency info #define BLEND(V0, V1, ALPHA) \ - ((((V0) * (255 - (ALPHA)) + (V1) * (ALPHA)) * 0x101 + 256) >> 16) + ((((V0) * (255 - (ALPHA)) + (V1) * (ALPHA)) * 0x101 + 256) >> 16) #define BLEND_10BIT(V0, V1, ALPHA) \ - ((((V0) * (1020 - (ALPHA)) + (V1) * (ALPHA)) * 0x101 + 1024) >> 18) + ((((V0) * (1020 - (ALPHA)) + (V1) * (ALPHA)) * 0x101 + 1024) >> 18) static WEBP_INLINE uint32_t MakeARGB32(int r, int g, int b) { return (0xff000000u | (r << 16) | (g << 8) | b); @@ -213,7 +213,7 @@ void WebPBlendAlpha(WebPPicture* picture, uint32_t background_rgb) { uint8_t* u_ptr = picture->u; uint8_t* v_ptr = picture->v; uint8_t* a_ptr = picture->a; - if (!has_alpha || a_ptr == NULL) return; // nothing to do + if (!has_alpha || a_ptr == NULL) return; // nothing to do for (y = 0; y < picture->height; ++y) { // Luma blending for (x = 0; x < picture->width; ++x) { @@ -229,9 +229,8 @@ void WebPBlendAlpha(WebPPicture* picture, uint32_t background_rgb) { for (x = 0; x < uv_width; ++x) { // Average four alpha values into a single blending weight. // TODO(skal): might lead to visible contouring. Can we do better? - const uint32_t alpha = - a_ptr[2 * x + 0] + a_ptr[2 * x + 1] + - a_ptr2[2 * x + 0] + a_ptr2[2 * x + 1]; + const uint32_t alpha = a_ptr[2 * x + 0] + a_ptr[2 * x + 1] + + a_ptr2[2 * x + 0] + a_ptr2[2 * x + 1]; u_ptr[x] = BLEND_10BIT(U0, u_ptr[x], alpha); v_ptr[x] = BLEND_10BIT(V0, v_ptr[x], alpha); } @@ -257,8 +256,8 @@ void WebPBlendAlpha(WebPPicture* picture, uint32_t background_rgb) { if (alpha != 0xff) { if (alpha > 0) { int r = (argb[x] >> 16) & 0xff; - int g = (argb[x] >> 8) & 0xff; - int b = (argb[x] >> 0) & 0xff; + int g = (argb[x] >> 8) & 0xff; + int b = (argb[x] >> 0) & 0xff; r = BLEND(red, r, alpha); g = BLEND(green, g, alpha); b = BLEND(blue, b, alpha); diff --git a/src/enc/predictor_enc.c b/src/enc/predictor_enc.c index 3ead56c1..71a6cb27 100644 --- a/src/enc/predictor_enc.c +++ b/src/enc/predictor_enc.c @@ -428,8 +428,7 @@ static void ComputeResidualsForTile( // pixel to the right in all cases except at the bottom right corner of // the image (wrapping to the leftmost pixel of the next row if it does // not exist in the current row). - memcpy(current_row + context_start_x, - argb + y * width + context_start_x, + memcpy(current_row + context_start_x, argb + y * width + context_start_x, sizeof(*argb) * (max_x + have_left + (y + 1 < height))); #if (WEBP_NEAR_LOSSLESS == 1) if (max_quantization > 1 && y >= 1 && y + 1 < height) { @@ -838,17 +837,15 @@ static WEBP_INLINE void MultipliersClear(VP8LMultipliers* const m) { static WEBP_INLINE void ColorCodeToMultipliers(uint32_t color_code, VP8LMultipliers* const m) { - m->green_to_red = (color_code >> 0) & 0xff; - m->green_to_blue = (color_code >> 8) & 0xff; - m->red_to_blue = (color_code >> 16) & 0xff; + m->green_to_red = (color_code >> 0) & 0xff; + m->green_to_blue = (color_code >> 8) & 0xff; + m->red_to_blue = (color_code >> 16) & 0xff; } -static WEBP_INLINE uint32_t MultipliersToColorCode( - const VP8LMultipliers* const m) { - return 0xff000000u | - ((uint32_t)(m->red_to_blue) << 16) | - ((uint32_t)(m->green_to_blue) << 8) | - m->green_to_red; +static WEBP_INLINE uint32_t +MultipliersToColorCode(const VP8LMultipliers* const m) { + return 0xff000000u | ((uint32_t)(m->red_to_blue) << 16) | + ((uint32_t)(m->green_to_blue) << 8) | m->green_to_red; } static int64_t PredictionCostCrossColor(const uint32_t accumulated[256], @@ -864,7 +861,7 @@ static int64_t GetPredictionCostCrossColorRed( const uint32_t* argb, int stride, int tile_width, int tile_height, VP8LMultipliers prev_x, VP8LMultipliers prev_y, int green_to_red, const uint32_t accumulated_red_histo[256]) { - uint32_t histo[256] = { 0 }; + uint32_t histo[256] = {0}; int64_t cur_diff; VP8LCollectColorRedTransforms(argb, stride, tile_width, tile_height, @@ -920,7 +917,7 @@ static int64_t GetPredictionCostCrossColorBlue( const uint32_t* argb, int stride, int tile_width, int tile_height, VP8LMultipliers prev_x, VP8LMultipliers prev_y, int green_to_blue, int red_to_blue, const uint32_t accumulated_blue_histo[256]) { - uint32_t histo[256] = { 0 }; + uint32_t histo[256] = {0}; int64_t cur_diff; VP8LCollectColorBlueTransforms(argb, stride, tile_width, tile_height, @@ -960,11 +957,12 @@ static void GetBestGreenRedToBlue(const uint32_t* argb, int stride, VP8LMultipliers prev_y, int quality, const uint32_t accumulated_blue_histo[256], VP8LMultipliers* const best_tx) { - const int8_t offset[kGreenRedToBlueNumAxis][2] = - {{0, -1}, {0, 1}, {-1, 0}, {1, 0}, {-1, -1}, {-1, 1}, {1, -1}, {1, 1}}; - const int8_t delta_lut[kGreenRedToBlueMaxIters] = { 16, 16, 8, 4, 2, 2, 2 }; - const int iters = - (quality < 25) ? 1 : (quality > 50) ? kGreenRedToBlueMaxIters : 4; + const int8_t offset[kGreenRedToBlueNumAxis][2] = { + {0, -1}, {0, 1}, {-1, 0}, {1, 0}, {-1, -1}, {-1, 1}, {1, -1}, {1, 1}}; + const int8_t delta_lut[kGreenRedToBlueMaxIters] = {16, 16, 8, 4, 2, 2, 2}; + const int iters = (quality < 25) ? 1 + : (quality > 50) ? kGreenRedToBlueMaxIters + : 4; int green_to_blue_best = 0; int red_to_blue_best = 0; int iter; @@ -1015,22 +1013,20 @@ static VP8LMultipliers GetBestColorTransformForTile( const int all_y_max = GetMin(tile_y_offset + max_tile_size, ysize); const int tile_width = all_x_max - tile_x_offset; const int tile_height = all_y_max - tile_y_offset; - const uint32_t* const tile_argb = argb + tile_y_offset * xsize - + tile_x_offset; + const uint32_t* const tile_argb = + argb + tile_y_offset * xsize + tile_x_offset; VP8LMultipliers best_tx; MultipliersClear(&best_tx); - GetBestGreenToRed(tile_argb, xsize, tile_width, tile_height, - prev_x, prev_y, quality, accumulated_red_histo, &best_tx); - GetBestGreenRedToBlue(tile_argb, xsize, tile_width, tile_height, - prev_x, prev_y, quality, accumulated_blue_histo, - &best_tx); + GetBestGreenToRed(tile_argb, xsize, tile_width, tile_height, prev_x, prev_y, + quality, accumulated_red_histo, &best_tx); + GetBestGreenRedToBlue(tile_argb, xsize, tile_width, tile_height, prev_x, + prev_y, quality, accumulated_blue_histo, &best_tx); return best_tx; } -static void CopyTileWithColorTransform(int xsize, int ysize, - int tile_x, int tile_y, - int max_tile_size, +static void CopyTileWithColorTransform(int xsize, int ysize, int tile_x, + int tile_y, int max_tile_size, VP8LMultipliers color_transform, uint32_t* argb) { const int xscan = GetMin(max_tile_size, xsize - tile_x); @@ -1050,8 +1046,8 @@ int VP8LColorSpaceTransform(int width, int height, int bits, int quality, const int tile_xsize = VP8LSubSampleSize(width, bits); const int tile_ysize = VP8LSubSampleSize(height, bits); int percent_start = *percent; - uint32_t accumulated_red_histo[256] = { 0 }; - uint32_t accumulated_blue_histo[256] = { 0 }; + uint32_t accumulated_red_histo[256] = {0}; + uint32_t accumulated_blue_histo[256] = {0}; int tile_x, tile_y; VP8LMultipliers prev_x, prev_y; MultipliersClear(&prev_y); @@ -1067,12 +1063,9 @@ int VP8LColorSpaceTransform(int width, int height, int bits, int quality, if (tile_y != 0) { ColorCodeToMultipliers(image[offset - tile_xsize], &prev_y); } - prev_x = GetBestColorTransformForTile(tile_x, tile_y, bits, - prev_x, prev_y, - quality, width, height, - accumulated_red_histo, - accumulated_blue_histo, - argb); + prev_x = GetBestColorTransformForTile( + tile_x, tile_y, bits, prev_x, prev_y, quality, width, height, + accumulated_red_histo, accumulated_blue_histo, argb); image[offset] = MultipliersToColorCode(&prev_x); CopyTileWithColorTransform(width, height, tile_x_offset, tile_y_offset, max_tile_size, prev_x, argb); @@ -1083,15 +1076,11 @@ int VP8LColorSpaceTransform(int width, int height, int bits, int quality, const int ix_end = ix + all_x_max - tile_x_offset; for (; ix < ix_end; ++ix) { const uint32_t pix = argb[ix]; - if (ix >= 2 && - pix == argb[ix - 2] && - pix == argb[ix - 1]) { + if (ix >= 2 && pix == argb[ix - 2] && pix == argb[ix - 1]) { continue; // repeated pixels are handled by backward references } - if (ix >= width + 2 && - argb[ix - 2] == argb[ix - width - 2] && - argb[ix - 1] == argb[ix - width - 1] && - pix == argb[ix - width]) { + if (ix >= width + 2 && argb[ix - 2] == argb[ix - width - 2] && + argb[ix - 1] == argb[ix - width - 1] && pix == argb[ix - width]) { continue; // repeated pixels are handled by backward references } ++accumulated_red_histo[(pix >> 16) & 0xff]; @@ -1099,9 +1088,9 @@ int VP8LColorSpaceTransform(int width, int height, int bits, int quality, } } } - if (!WebPReportProgress( - pic, percent_start + percent_range * tile_y / tile_ysize, - percent)) { + if (!WebPReportProgress(pic, + percent_start + percent_range * tile_y / tile_ysize, + percent)) { return 0; } } diff --git a/src/enc/quant_enc.c b/src/enc/quant_enc.c index 4b8cb5e9..4adc1a48 100644 --- a/src/enc/quant_enc.c +++ b/src/enc/quant_enc.c @@ -23,28 +23,29 @@ #include "src/enc/vp8i_enc.h" #include "src/webp/types.h" -#define DO_TRELLIS_I4 1 -#define DO_TRELLIS_I16 1 // not a huge gain, but ok at low bitrate. -#define DO_TRELLIS_UV 0 // disable trellis for UV. Risky. Not worth. +#define DO_TRELLIS_I4 1 +#define DO_TRELLIS_I16 1 // not a huge gain, but ok at low bitrate. +#define DO_TRELLIS_UV 0 // disable trellis for UV. Risky. Not worth. #define USE_TDISTO 1 -#define MID_ALPHA 64 // neutral value for susceptibility -#define MIN_ALPHA 30 // lowest usable value for susceptibility -#define MAX_ALPHA 100 // higher meaningful value for susceptibility +#define MID_ALPHA 64 // neutral value for susceptibility +#define MIN_ALPHA 30 // lowest usable value for susceptibility +#define MAX_ALPHA 100 // higher meaningful value for susceptibility -#define SNS_TO_DQ 0.9 // Scaling constant between the sns value and the QP - // power-law modulation. Must be strictly less than 1. +#define SNS_TO_DQ \ + 0.9 // Scaling constant between the sns value and the QP + // power-law modulation. Must be strictly less than 1. // number of non-zero coeffs below which we consider the block very flat // (and apply a penalty to complex predictions) -#define FLATNESS_LIMIT_I16 0 // I16 mode (special case) -#define FLATNESS_LIMIT_I4 3 // I4 mode -#define FLATNESS_LIMIT_UV 2 // UV mode -#define FLATNESS_PENALTY 140 // roughly ~1bit per block +#define FLATNESS_LIMIT_I16 0 // I16 mode (special case) +#define FLATNESS_LIMIT_I4 3 // I4 mode +#define FLATNESS_LIMIT_UV 2 // UV mode +#define FLATNESS_PENALTY 140 // roughly ~1bit per block #define MULT_8B(a, b) (((a) * (b) + 128) >> 8) -#define RD_DISTO_MULT 256 // distortion multiplier (equivalent of lambda) +#define RD_DISTO_MULT 256 // distortion multiplier (equivalent of lambda) // #define DEBUG_BLOCK @@ -74,7 +75,7 @@ static void PrintBlockInfo(const VP8EncIterator* const it, } printf("\n"); } - printf("\n"); // newline before the U/V block + printf("\n"); // newline before the U/V block for (j = 0; j < 8; ++j) { for (i = 0; i < 8; ++i) printf("%3d ", uv_in[i + j * BPS]); printf(" "); @@ -93,9 +94,8 @@ static void PrintBlockInfo(const VP8EncIterator* const it, } printf("\n"); } - printf("\nD:%d SD:%d R:%d H:%d nz:0x%x score:%d\n", - (int)rd->D, (int)rd->SD, (int)rd->R, (int)rd->H, (int)rd->nz, - (int)rd->score); + printf("\nD:%d SD:%d R:%d H:%d nz:0x%x score:%d\n", (int)rd->D, (int)rd->SD, + (int)rd->R, (int)rd->H, (int)rd->nz, (int)rd->score); if (is_i16) { printf("Mode: %d\n", rd->mode_i16); printf("y_dc_levels:"); @@ -123,7 +123,7 @@ static void PrintBlockInfo(const VP8EncIterator* const it, } } -#endif // DEBUG_BLOCK +#endif // DEBUG_BLOCK //------------------------------------------------------------------------------ @@ -131,80 +131,52 @@ static WEBP_INLINE int clip(int v, int m, int M) { return v < m ? m : v > M ? M : v; } -static const uint8_t kZigzag[16] = { - 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15 -}; +static const uint8_t kZigzag[16] = {0, 1, 4, 8, 5, 2, 3, 6, + 9, 12, 13, 10, 7, 11, 14, 15}; static const uint8_t kDcTable[128] = { - 4, 5, 6, 7, 8, 9, 10, 10, - 11, 12, 13, 14, 15, 16, 17, 17, - 18, 19, 20, 20, 21, 21, 22, 22, - 23, 23, 24, 25, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, - 37, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, - 91, 93, 95, 96, 98, 100, 101, 102, - 104, 106, 108, 110, 112, 114, 116, 118, - 122, 124, 126, 128, 130, 132, 134, 136, - 138, 140, 143, 145, 148, 151, 154, 157 -}; + 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, + 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 91, 93, 95, 96, 98, 100, 101, 102, 104, + 106, 108, 110, 112, 114, 116, 118, 122, 124, 126, 128, 130, 132, 134, 136, + 138, 140, 143, 145, 148, 151, 154, 157}; static const uint16_t kAcTable[128] = { - 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 60, - 62, 64, 66, 68, 70, 72, 74, 76, - 78, 80, 82, 84, 86, 88, 90, 92, - 94, 96, 98, 100, 102, 104, 106, 108, - 110, 112, 114, 116, 119, 122, 125, 128, - 131, 134, 137, 140, 143, 146, 149, 152, - 155, 158, 161, 164, 167, 170, 173, 177, - 181, 185, 189, 193, 197, 201, 205, 209, - 213, 217, 221, 225, 229, 234, 239, 245, - 249, 254, 259, 264, 269, 274, 279, 284 -}; + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 66, 68, + 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, + 100, 102, 104, 106, 108, 110, 112, 114, 116, 119, 122, 125, 128, 131, 134, + 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 177, 181, + 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 234, 239, 245, + 249, 254, 259, 264, 269, 274, 279, 284}; static const uint16_t kAcTable2[128] = { - 8, 8, 9, 10, 12, 13, 15, 17, - 18, 20, 21, 23, 24, 26, 27, 29, - 31, 32, 34, 35, 37, 38, 40, 41, - 43, 44, 46, 48, 49, 51, 52, 54, - 55, 57, 58, 60, 62, 63, 65, 66, - 68, 69, 71, 72, 74, 75, 77, 79, - 80, 82, 83, 85, 86, 88, 89, 93, - 96, 99, 102, 105, 108, 111, 114, 117, - 120, 124, 127, 130, 133, 136, 139, 142, - 145, 148, 151, 155, 158, 161, 164, 167, - 170, 173, 176, 179, 184, 189, 193, 198, - 203, 207, 212, 217, 221, 226, 230, 235, - 240, 244, 249, 254, 258, 263, 268, 274, - 280, 286, 292, 299, 305, 311, 317, 323, - 330, 336, 342, 348, 354, 362, 370, 379, - 385, 393, 401, 409, 416, 424, 432, 440 -}; + 8, 8, 9, 10, 12, 13, 15, 17, 18, 20, 21, 23, 24, 26, 27, + 29, 31, 32, 34, 35, 37, 38, 40, 41, 43, 44, 46, 48, 49, 51, + 52, 54, 55, 57, 58, 60, 62, 63, 65, 66, 68, 69, 71, 72, 74, + 75, 77, 79, 80, 82, 83, 85, 86, 88, 89, 93, 96, 99, 102, 105, + 108, 111, 114, 117, 120, 124, 127, 130, 133, 136, 139, 142, 145, 148, 151, + 155, 158, 161, 164, 167, 170, 173, 176, 179, 184, 189, 193, 198, 203, 207, + 212, 217, 221, 226, 230, 235, 240, 244, 249, 254, 258, 263, 268, 274, 280, + 286, 292, 299, 305, 311, 317, 323, 330, 336, 342, 348, 354, 362, 370, 379, + 385, 393, 401, 409, 416, 424, 432, 440}; static const uint8_t kBiasMatrices[3][2] = { // [luma-ac,luma-dc,chroma][dc,ac] - { 96, 110 }, { 96, 108 }, { 110, 115 } -}; + {96, 110}, + {96, 108}, + {110, 115}}; // Sharpening by (slightly) raising the hi-frequency coeffs. // Hack-ish but helpful for mid-bitrate range. Use with care. #define SHARPEN_BITS 11 // number of descaling bits for sharpening bias -static const uint8_t kFreqSharpening[16] = { - 0, 30, 60, 90, - 30, 60, 90, 90, - 60, 90, 90, 90, - 90, 90, 90, 90 -}; +static const uint8_t kFreqSharpening[16] = {0, 30, 60, 90, 30, 60, 90, 90, + 60, 90, 90, 90, 90, 90, 90, 90}; //------------------------------------------------------------------------------ // Initialize quantization parameters in VP8Matrix @@ -239,39 +211,39 @@ static int ExpandMatrix(VP8Matrix* const m, int type) { return (sum + 8) >> 4; } -static void CheckLambdaValue(int* const v) { if (*v < 1) *v = 1; } +static void CheckLambdaValue(int* const v) { + if (*v < 1) *v = 1; +} static void SetupMatrices(VP8Encoder* enc) { int i; - const int tlambda_scale = - (enc->method >= 4) ? enc->config->sns_strength - : 0; + const int tlambda_scale = (enc->method >= 4) ? enc->config->sns_strength : 0; const int num_segments = enc->segment_hdr.num_segments; for (i = 0; i < num_segments; ++i) { VP8SegmentInfo* const m = &enc->dqm[i]; const int q = m->quant; int q_i4, q_i16, q_uv; m->y1.q[0] = kDcTable[clip(q + enc->dq_y1_dc, 0, 127)]; - m->y1.q[1] = kAcTable[clip(q, 0, 127)]; + m->y1.q[1] = kAcTable[clip(q, 0, 127)]; - m->y2.q[0] = kDcTable[ clip(q + enc->dq_y2_dc, 0, 127)] * 2; + m->y2.q[0] = kDcTable[clip(q + enc->dq_y2_dc, 0, 127)] * 2; m->y2.q[1] = kAcTable2[clip(q + enc->dq_y2_ac, 0, 127)]; m->uv.q[0] = kDcTable[clip(q + enc->dq_uv_dc, 0, 117)]; m->uv.q[1] = kAcTable[clip(q + enc->dq_uv_ac, 0, 127)]; - q_i4 = ExpandMatrix(&m->y1, 0); + q_i4 = ExpandMatrix(&m->y1, 0); q_i16 = ExpandMatrix(&m->y2, 1); - q_uv = ExpandMatrix(&m->uv, 2); + q_uv = ExpandMatrix(&m->uv, 2); - m->lambda_i4 = (3 * q_i4 * q_i4) >> 7; - m->lambda_i16 = (3 * q_i16 * q_i16); - m->lambda_uv = (3 * q_uv * q_uv) >> 6; - m->lambda_mode = (1 * q_i4 * q_i4) >> 7; - m->lambda_trellis_i4 = (7 * q_i4 * q_i4) >> 3; + m->lambda_i4 = (3 * q_i4 * q_i4) >> 7; + m->lambda_i16 = (3 * q_i16 * q_i16); + m->lambda_uv = (3 * q_uv * q_uv) >> 6; + m->lambda_mode = (1 * q_i4 * q_i4) >> 7; + m->lambda_trellis_i4 = (7 * q_i4 * q_i4) >> 3; m->lambda_trellis_i16 = (q_i16 * q_i16) >> 2; - m->lambda_trellis_uv = (q_uv * q_uv) << 1; - m->tlambda = (tlambda_scale * q_i4) >> 5; + m->lambda_trellis_uv = (q_uv * q_uv) << 1; + m->tlambda = (tlambda_scale * q_i4) >> 5; // none of these constants should be < 1 CheckLambdaValue(&m->lambda_i4); @@ -283,8 +255,8 @@ static void SetupMatrices(VP8Encoder* enc) { CheckLambdaValue(&m->lambda_trellis_uv); CheckLambdaValue(&m->tlambda); - m->min_disto = 20 * m->y1.q[0]; // quantization-aware min disto - m->max_edge = 0; + m->min_disto = 20 * m->y1.q[0]; // quantization-aware min disto + m->max_edge = 0; m->i4_penalty = 1000 * q_i4 * q_i4; } @@ -351,9 +323,9 @@ static double QualityToJPEGCompression(double c, double alpha) { const double slope = (exp_min - exp_max) / (amax - amin); // Linearly interpolate 'expn' from exp_min to exp_max // in the [amin, amax] range. - const double expn = (alpha > amax) ? exp_min - : (alpha < amin) ? exp_max - : exp_max + slope * (alpha - amin); + const double expn = (alpha > amax) ? exp_min + : (alpha < amin) ? exp_max + : exp_max + slope * (alpha - amin); const double v = pow(c, expn); return v; } @@ -364,7 +336,7 @@ static int SegmentsAreEquivalent(const VP8SegmentInfo* const S1, } static void SimplifySegments(VP8Encoder* const enc) { - int map[NUM_MB_SEGMENTS] = { 0, 1, 2, 3 }; + int map[NUM_MB_SEGMENTS] = {0, 1, 2, 3}; // 'num_segments' is previously validated and <= NUM_MB_SEGMENTS, but an // explicit check is needed to avoid a spurious warning about 'i' exceeding // array bounds of 'dqm' with some compilers (noticed with gcc-4.9). @@ -373,7 +345,7 @@ static void SimplifySegments(VP8Encoder* const enc) { : NUM_MB_SEGMENTS; int num_final_segments = 1; int s1, s2; - for (s1 = 1; s1 < num_segments; ++s1) { // find similar segments + for (s1 = 1; s1 < num_segments; ++s1) { // find similar segments const VP8SegmentInfo* const S1 = &enc->dqm[s1]; int found = 0; // check if we already have similar segment @@ -409,9 +381,9 @@ void VP8SetSegmentParams(VP8Encoder* const enc, float quality) { const int num_segments = enc->segment_hdr.num_segments; const double amp = SNS_TO_DQ * enc->config->sns_strength / 100. / 128.; const double Q = quality / 100.; - const double c_base = enc->config->emulate_jpeg_size ? - QualityToJPEGCompression(Q, enc->alpha / 255.) : - QualityToCompression(Q); + const double c_base = enc->config->emulate_jpeg_size + ? QualityToJPEGCompression(Q, enc->alpha / 255.) + : QualityToCompression(Q); for (i = 0; i < num_segments; ++i) { // We modulate the base coefficient to accommodate for the quantization // susceptibility and allow denser segments to be quantized more. @@ -433,8 +405,8 @@ void VP8SetSegmentParams(VP8Encoder* const enc, float quality) { // uv_alpha is normally spread around ~60. The useful range is // typically ~30 (quite bad) to ~100 (ok to decimate UV more). // We map it to the safe maximal range of MAX/MIN_DQ_UV for dq_uv. - dq_uv_ac = (enc->uv_alpha - MID_ALPHA) * (MAX_DQ_UV - MIN_DQ_UV) - / (MAX_ALPHA - MIN_ALPHA); + dq_uv_ac = (enc->uv_alpha - MID_ALPHA) * (MAX_DQ_UV - MIN_DQ_UV) / + (MAX_ALPHA - MIN_ALPHA); // we rescale by the user-defined strength of adaptation dq_uv_ac = dq_uv_ac * enc->config->sns_strength / 100; // and make it safe. @@ -443,32 +415,31 @@ void VP8SetSegmentParams(VP8Encoder* const enc, float quality) { // U/V channels are quite more reactive to high quants (flat DC-blocks // tend to appear, and are unpleasant). dq_uv_dc = -4 * enc->config->sns_strength / 100; - dq_uv_dc = clip(dq_uv_dc, -15, 15); // 4bit-signed max allowed + dq_uv_dc = clip(dq_uv_dc, -15, 15); // 4bit-signed max allowed - enc->dq_y1_dc = 0; // TODO(skal): dq-lum + enc->dq_y1_dc = 0; // TODO(skal): dq-lum enc->dq_y2_dc = 0; enc->dq_y2_ac = 0; enc->dq_uv_dc = dq_uv_dc; enc->dq_uv_ac = dq_uv_ac; - SetupFilterStrength(enc); // initialize segments' filtering, eventually + SetupFilterStrength(enc); // initialize segments' filtering, eventually if (num_segments > 1) SimplifySegments(enc); - SetupMatrices(enc); // finalize quantization matrices + SetupMatrices(enc); // finalize quantization matrices } //------------------------------------------------------------------------------ // Form the predictions in cache // Must be ordered using {DC_PRED, TM_PRED, V_PRED, H_PRED} as index -const uint16_t VP8I16ModeOffsets[4] = { I16DC16, I16TM16, I16VE16, I16HE16 }; -const uint16_t VP8UVModeOffsets[4] = { C8DC8, C8TM8, C8VE8, C8HE8 }; +const uint16_t VP8I16ModeOffsets[4] = {I16DC16, I16TM16, I16VE16, I16HE16}; +const uint16_t VP8UVModeOffsets[4] = {C8DC8, C8TM8, C8VE8, C8HE8}; // Must be indexed using {B_DC_PRED -> B_HU_PRED} as index static const uint16_t VP8I4ModeOffsets[NUM_BMODES] = { - I4DC4, I4TM4, I4VE4, I4HE4, I4RD4, I4VR4, I4LD4, I4VL4, I4HD4, I4HU4 -}; + I4DC4, I4TM4, I4VE4, I4HE4, I4RD4, I4VR4, I4LD4, I4VL4, I4HD4, I4HU4}; void VP8MakeLuma16Preds(const VP8EncIterator* const it) { const uint8_t* const left = it->x ? it->y_left : NULL; @@ -499,63 +470,62 @@ static void MakeIntra4Preds(const VP8EncIterator* const it) { // |YYYY|....| 12 // +----+----+ -const uint16_t VP8Scan[16] = { // Luma - 0 + 0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS, - 0 + 4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS, - 0 + 8 * BPS, 4 + 8 * BPS, 8 + 8 * BPS, 12 + 8 * BPS, - 0 + 12 * BPS, 4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS, +const uint16_t VP8Scan[16] = { + // Luma + 0 + 0 * BPS, 4 + 0 * BPS, 8 + 0 * BPS, 12 + 0 * BPS, + 0 + 4 * BPS, 4 + 4 * BPS, 8 + 4 * BPS, 12 + 4 * BPS, + 0 + 8 * BPS, 4 + 8 * BPS, 8 + 8 * BPS, 12 + 8 * BPS, + 0 + 12 * BPS, 4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS, }; static const uint16_t VP8ScanUV[4 + 4] = { - 0 + 0 * BPS, 4 + 0 * BPS, 0 + 4 * BPS, 4 + 4 * BPS, // U - 8 + 0 * BPS, 12 + 0 * BPS, 8 + 4 * BPS, 12 + 4 * BPS // V + 0 + 0 * BPS, 4 + 0 * BPS, 0 + 4 * BPS, 4 + 4 * BPS, // U + 8 + 0 * BPS, 12 + 0 * BPS, 8 + 4 * BPS, 12 + 4 * BPS // V }; //------------------------------------------------------------------------------ // Distortion measurement -static const uint16_t kWeightY[16] = { - 38, 32, 20, 9, 32, 28, 17, 7, 20, 17, 10, 4, 9, 7, 4, 2 -}; +static const uint16_t kWeightY[16] = {38, 32, 20, 9, 32, 28, 17, 7, + 20, 17, 10, 4, 9, 7, 4, 2}; static const uint16_t kWeightTrellis[16] = { #if USE_TDISTO == 0 - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 + 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16 #else - 30, 27, 19, 11, - 27, 24, 17, 10, - 19, 17, 12, 8, - 11, 10, 8, 6 + 30, 27, 19, 11, 27, 24, 17, 10, 19, + 17, 12, 8, 11, 10, 8, 6 #endif }; // Init/Copy the common fields in score. static void InitScore(VP8ModeScore* const rd) { - rd->D = 0; + rd->D = 0; rd->SD = 0; - rd->R = 0; - rd->H = 0; + rd->R = 0; + rd->H = 0; rd->nz = 0; rd->score = MAX_COST; } static void CopyScore(VP8ModeScore* WEBP_RESTRICT const dst, const VP8ModeScore* WEBP_RESTRICT const src) { - dst->D = src->D; + dst->D = src->D; dst->SD = src->SD; - dst->R = src->R; - dst->H = src->H; - dst->nz = src->nz; // note that nz is not accumulated, but just copied. + dst->R = src->R; + dst->H = src->H; + dst->nz = src->nz; // note that nz is not accumulated, but just copied. dst->score = src->score; } static void AddScore(VP8ModeScore* WEBP_RESTRICT const dst, const VP8ModeScore* WEBP_RESTRICT const src) { - dst->D += src->D; + dst->D += src->D; dst->SD += src->SD; - dst->R += src->R; - dst->H += src->H; - dst->nz |= src->nz; // here, new nz bits are accumulated. + dst->R += src->R; + dst->H += src->H; + dst->nz |= src->nz; // here, new nz bits are accumulated. dst->score += src->score; } @@ -564,9 +534,9 @@ static void AddScore(VP8ModeScore* WEBP_RESTRICT const dst, // Trellis node typedef struct { - int8_t prev; // best previous node - int8_t sign; // sign of coeff_i - int16_t level; // level + int8_t prev; // best previous node + int8_t sign; // sign of coeff_i + int16_t level; // level } Node; // Score state @@ -578,8 +548,8 @@ typedef struct { // If a coefficient was quantized to a value Q (using a neutral bias), // we test all alternate possibilities between [Q-MIN_DELTA, Q+MAX_DELTA] // We don't test negative values though. -#define MIN_DELTA 0 // how much lower level to try -#define MAX_DELTA 1 // how much higher +#define MIN_DELTA 0 // how much lower level to try +#define MAX_DELTA 1 // how much higher #define NUM_NODES (MIN_DELTA + 1 + MAX_DELTA) #define NODE(n, l) (nodes[(n)][(l) + MIN_DELTA]) #define SCORE_STATE(n, l) (score_states[n][(l) + MIN_DELTA]) @@ -597,8 +567,8 @@ static WEBP_INLINE score_t RDScoreTrellis(int lambda, score_t rate, enum { TYPE_I16_AC = 0, TYPE_I16_DC = 1, TYPE_CHROMA_A = 2, TYPE_I4_AC = 3 }; static int TrellisQuantizeBlock(const VP8Encoder* WEBP_RESTRICT const enc, - int16_t in[16], int16_t out[16], - int ctx0, int coeff_type, + int16_t in[16], int16_t out[16], int ctx0, + int coeff_type, const VP8Matrix* WEBP_RESTRICT const mtx, int lambda) { const ProbaArray* const probas = enc->proba.coeffs[coeff_type]; @@ -609,7 +579,7 @@ static int TrellisQuantizeBlock(const VP8Encoder* WEBP_RESTRICT const enc, ScoreState score_states[2][NUM_NODES]; ScoreState* ss_cur = &SCORE_STATE(0, MIN_DELTA); ScoreState* ss_prev = &SCORE_STATE(1, MIN_DELTA); - int best_path[3] = {-1, -1, -1}; // store best-last/best-level/best-previous + int best_path[3] = {-1, -1, -1}; // store best-last/best-level/best-previous score_t best_score; int n, m, p, last; @@ -647,9 +617,9 @@ static int TrellisQuantizeBlock(const VP8Encoder* WEBP_RESTRICT const enc, // traverse trellis. for (n = first; n <= last; ++n) { const int j = kZigzag[n]; - const uint32_t Q = mtx->q[j]; + const uint32_t Q = mtx->q[j]; const uint32_t iQ = mtx->iq[j]; - const uint32_t B = BIAS(0x00); // neutral bias + const uint32_t B = BIAS(0x00); // neutral bias // note: it's important to take sign of the _original_ coeff, // so we don't have to consider level < 0 afterward. const int sign = (in[j] < 0); @@ -659,7 +629,7 @@ static int TrellisQuantizeBlock(const VP8Encoder* WEBP_RESTRICT const enc, if (thresh_level > MAX_LEVEL) thresh_level = MAX_LEVEL; if (level0 > MAX_LEVEL) level0 = MAX_LEVEL; - { // Swap current and previous score states + { // Swap current and previous score states ScoreState* const tmp = ss_cur; ss_cur = ss_prev; ss_prev = tmp; @@ -726,9 +696,9 @@ static int TrellisQuantizeBlock(const VP8Encoder* WEBP_RESTRICT const enc, score = best_cur_score + last_pos_score; if (score < best_score) { best_score = score; - best_path[0] = n; // best eob position - best_path[1] = m; // best node index - best_path[2] = best_prev; // best predecessor + best_path[0] = n; // best eob position + best_path[1] = m; // best node index + best_path[2] = best_prev; // best predecessor } } } @@ -754,7 +724,7 @@ static int TrellisQuantizeBlock(const VP8Encoder* WEBP_RESTRICT const enc, int nz = 0; int best_node = best_path[1]; n = best_path[0]; - NODE(n, best_node).prev = best_path[2]; // force best-prev for terminal + NODE(n, best_node).prev = best_path[2]; // force best-prev for terminal for (; n >= first; --n) { const Node* const node = &NODE(n, best_node); @@ -777,8 +747,7 @@ static int TrellisQuantizeBlock(const VP8Encoder* WEBP_RESTRICT const enc, static int ReconstructIntra16(VP8EncIterator* WEBP_RESTRICT const it, VP8ModeScore* WEBP_RESTRICT const rd, - uint8_t* WEBP_RESTRICT const yuv_out, - int mode) { + uint8_t* WEBP_RESTRICT const yuv_out, int mode) { const VP8Encoder* const enc = it->enc; const uint8_t* const ref = it->yuv_p + VP8I16ModeOffsets[mode]; const uint8_t* const src = it->yuv_in + Y_OFF_ENC; @@ -830,8 +799,7 @@ static int ReconstructIntra16(VP8EncIterator* WEBP_RESTRICT const it, static int ReconstructIntra4(VP8EncIterator* WEBP_RESTRICT const it, int16_t levels[16], const uint8_t* WEBP_RESTRICT const src, - uint8_t* WEBP_RESTRICT const yuv_out, - int mode) { + uint8_t* WEBP_RESTRICT const yuv_out, int mode) { const VP8Encoder* const enc = it->enc; const uint8_t* const ref = it->yuv_p + VP8I4ModeOffsets[mode]; const VP8SegmentInfo* const dqm = &enc->dqm[it->mb->segment]; @@ -856,10 +824,10 @@ static int ReconstructIntra4(VP8EncIterator* WEBP_RESTRICT const it, // Diffusion weights. We under-correct a bit (15/16th of the error is actually // diffused) to avoid 'rainbow' chessboard pattern of blocks at q~=0. -#define C1 7 // fraction of error sent to the 4x4 block below -#define C2 8 // fraction of error sent to the 4x4 block on the right +#define C1 7 // fraction of error sent to the 4x4 block below +#define C2 8 // fraction of error sent to the 4x4 block on the right #define DSHIFT 4 -#define DSCALE 1 // storage descaling, needed to make the error fit int8_t +#define DSCALE 1 // storage descaling, needed to make the error fit int8_t // Quantize as usual, but also compute and return the quantization error. // Error is already divided by DSHIFT. @@ -893,7 +861,7 @@ static void CorrectDCValues(const VP8EncIterator* WEBP_RESTRICT const it, for (ch = 0; ch <= 1; ++ch) { const int8_t* const top = it->top_derr[it->x][ch]; const int8_t* const left = it->left_derr[ch]; - int16_t (* const c)[16] = &tmp[ch * 4]; + int16_t(*const c)[16] = &tmp[ch * 4]; int err0, err1, err2, err3; c[0][0] += (C1 * top[0] + C2 * left[0]) >> (DSHIFT - DSCALE); err0 = QuantizeSingle(&c[0][0], mtx); @@ -918,10 +886,10 @@ static void StoreDiffusionErrors(VP8EncIterator* WEBP_RESTRICT const it, for (ch = 0; ch <= 1; ++ch) { int8_t* const top = it->top_derr[it->x][ch]; int8_t* const left = it->left_derr[ch]; - left[0] = rd->derr[ch][0]; // restore err1 - left[1] = 3 * rd->derr[ch][2] >> 2; // ... 3/4th of err3 - top[0] = rd->derr[ch][1]; // ... err2 - top[1] = rd->derr[ch][2] - left[1]; // ... 1/4th of err3. + left[0] = rd->derr[ch][0]; // restore err1 + left[1] = 3 * rd->derr[ch][2] >> 2; // ... 3/4th of err3 + top[0] = rd->derr[ch][1]; // ... err2 + top[1] = rd->derr[ch][2] - left[1]; // ... 1/4th of err3. } } @@ -1052,7 +1020,7 @@ static void PickBestIntra16(VP8EncIterator* WEBP_RESTRICT const it, if (rd_best != rd) { memcpy(rd, rd_best, sizeof(*rd)); } - SetRDScore(dqm->lambda_mode, rd); // finalize score for mode decision. + SetRDScore(dqm->lambda_mode, rd); // finalize score for mode decision. VP8SetIntra16Mode(it, rd->mode_i16); // we have a blocky macroblock (only DCs are non-zero) with fairly high @@ -1102,7 +1070,7 @@ static int PickBestIntra4(VP8EncIterator* WEBP_RESTRICT const it, const uint8_t* const src = src0 + VP8Scan[it->i4]; const uint16_t* const mode_costs = GetCostModeI4(it, rd->modes_i4); uint8_t* best_block = best_blocks + VP8Scan[it->i4]; - uint8_t* tmp_dst = it->yuv_p + I4TMP; // scratch buffer. + uint8_t* tmp_dst = it->yuv_p + I4TMP; // scratch buffer. InitScore(&rd_i4); MakeIntra4Preds(it); @@ -1111,14 +1079,13 @@ static int PickBestIntra4(VP8EncIterator* WEBP_RESTRICT const it, int16_t tmp_levels[16]; // Reconstruct - rd_tmp.nz = - ReconstructIntra4(it, tmp_levels, src, tmp_dst, mode) << it->i4; + rd_tmp.nz = ReconstructIntra4(it, tmp_levels, src, tmp_dst, mode) + << it->i4; // Compute RD-score rd_tmp.D = VP8SSE4x4(src, tmp_dst); rd_tmp.SD = - tlambda ? MULT_8B(tlambda, VP8TDisto4x4(src, tmp_dst, kWeightY)) - : 0; + tlambda ? MULT_8B(tlambda, VP8TDisto4x4(src, tmp_dst, kWeightY)) : 0; rd_tmp.H = mode_costs[mode]; // Add flatness penalty, to avoid flat area to be mispredicted @@ -1150,7 +1117,7 @@ static int PickBestIntra4(VP8EncIterator* WEBP_RESTRICT const it, if (rd_best.score >= rd->score) { return 0; } - total_header_bits += (int)rd_i4.H; // <- equal to mode_costs[best_mode]; + total_header_bits += (int)rd_i4.H; // <- equal to mode_costs[best_mode]; if (total_header_bits > enc->max_i4_header_bits) { return 0; } @@ -1167,7 +1134,7 @@ static int PickBestIntra4(VP8EncIterator* WEBP_RESTRICT const it, VP8SetIntra4Mode(it, rd->modes_i4); SwapOut(it); memcpy(rd->y_ac_levels, rd_best.y_ac_levels, sizeof(rd->y_ac_levels)); - return 1; // select intra4x4 over intra16x16 + return 1; // select intra4x4 over intra16x16 } //------------------------------------------------------------------------------ @@ -1193,10 +1160,10 @@ static void PickBestUV(VP8EncIterator* WEBP_RESTRICT const it, rd_uv.nz = ReconstructUV(it, &rd_uv, tmp_dst, mode); // Compute RD-score - rd_uv.D = VP8SSE16x8(src, tmp_dst); - rd_uv.SD = 0; // not calling TDisto here: it tends to flatten areas. - rd_uv.H = VP8FixedCostsUV[mode]; - rd_uv.R = VP8GetCostUV(it, &rd_uv); + rd_uv.D = VP8SSE16x8(src, tmp_dst); + rd_uv.SD = 0; // not calling TDisto here: it tends to flatten areas. + rd_uv.H = VP8FixedCostsUV[mode]; + rd_uv.R = VP8GetCostUV(it, &rd_uv); if (mode > 0 && IsFlat(rd_uv.uv_levels[0], kNumBlocks, FLATNESS_LIMIT_UV)) { rd_uv.R += FLATNESS_PENALTY * kNumBlocks; } @@ -1214,7 +1181,7 @@ static void PickBestUV(VP8EncIterator* WEBP_RESTRICT const it, } VP8SetIntraUVMode(it, rd->mode_uv); AddScore(rd, &rd_best); - if (dst != dst0) { // copy 16x8 block if needed + if (dst != dst0) { // copy 16x8 block if needed VP8Copy16x8(dst, dst0); } if (it->top_derr != NULL) { // store diffusion errors for next block @@ -1236,13 +1203,12 @@ static void SimpleQuantize(VP8EncIterator* WEBP_RESTRICT const it, } else { VP8IteratorStartI4(it); do { - const int mode = - it->preds[(it->i4 & 3) + (it->i4 >> 2) * enc->preds_w]; + const int mode = it->preds[(it->i4 & 3) + (it->i4 >> 2) * enc->preds_w]; const uint8_t* const src = it->yuv_in + Y_OFF_ENC + VP8Scan[it->i4]; uint8_t* const dst = it->yuv_out + Y_OFF_ENC + VP8Scan[it->i4]; MakeIntra4Preds(it); - nz |= ReconstructIntra4(it, rd->y_ac_levels[it->i4], - src, dst, mode) << it->i4; + nz |= ReconstructIntra4(it, rd->y_ac_levels[it->i4], src, dst, mode) + << it->i4; } while (VP8IteratorRotateI4(it, it->yuv_out + Y_OFF_ENC)); } @@ -1269,13 +1235,13 @@ static void RefineUsingDistortion(VP8EncIterator* WEBP_RESTRICT const it, const score_t bit_limit = try_both_modes ? it->enc->mb_header_limit : MAX_COST; // no early-out allowed - if (is_i16) { // First, evaluate Intra16 distortion + if (is_i16) { // First, evaluate Intra16 distortion int best_mode = -1; const uint8_t* const src = it->yuv_in + Y_OFF_ENC; for (mode = 0; mode < NUM_PRED_MODES; ++mode) { const uint8_t* const ref = it->yuv_p + VP8I16ModeOffsets[mode]; - const score_t score = (score_t)VP8SSE16x16(src, ref) * RD_DISTO_MULT - + VP8FixedCostsI16[mode] * lambda_d_i16; + const score_t score = (score_t)VP8SSE16x16(src, ref) * RD_DISTO_MULT + + VP8FixedCostsI16[mode] * lambda_d_i16; if (mode > 0 && VP8FixedCostsI16[mode] > bit_limit) { continue; } @@ -1311,8 +1277,8 @@ static void RefineUsingDistortion(VP8EncIterator* WEBP_RESTRICT const it, MakeIntra4Preds(it); for (mode = 0; mode < NUM_BMODES; ++mode) { const uint8_t* const ref = it->yuv_p + VP8I4ModeOffsets[mode]; - const score_t score = VP8SSE4x4(src, ref) * RD_DISTO_MULT - + mode_costs[mode] * lambda_d_i4; + const score_t score = VP8SSE4x4(src, ref) * RD_DISTO_MULT + + mode_costs[mode] * lambda_d_i4; if (score < best_i4_score) { best_i4_mode = mode; best_i4_score = score; @@ -1327,8 +1293,9 @@ static void RefineUsingDistortion(VP8EncIterator* WEBP_RESTRICT const it, break; } else { // reconstruct partial block inside yuv_out2 buffer uint8_t* const tmp_dst = it->yuv_out2 + Y_OFF_ENC + VP8Scan[it->i4]; - nz |= ReconstructIntra4(it, rd->y_ac_levels[it->i4], - src, tmp_dst, best_i4_mode) << it->i4; + nz |= ReconstructIntra4(it, rd->y_ac_levels[it->i4], src, tmp_dst, + best_i4_mode) + << it->i4; } } while (VP8IteratorRotateI4(it, it->yuv_out2 + Y_OFF_ENC)); } @@ -1349,8 +1316,8 @@ static void RefineUsingDistortion(VP8EncIterator* WEBP_RESTRICT const it, const uint8_t* const src = it->yuv_in + U_OFF_ENC; for (mode = 0; mode < NUM_PRED_MODES; ++mode) { const uint8_t* const ref = it->yuv_p + VP8UVModeOffsets[mode]; - const score_t score = VP8SSE16x8(src, ref) * RD_DISTO_MULT - + VP8FixedCostsUV[mode] * lambda_d_uv; + const score_t score = VP8SSE16x8(src, ref) * RD_DISTO_MULT + + VP8FixedCostsUV[mode] * lambda_d_uv; if (score < best_uv_score) { best_mode = mode; best_uv_score = score; @@ -1368,8 +1335,7 @@ static void RefineUsingDistortion(VP8EncIterator* WEBP_RESTRICT const it, // Entry point int VP8Decimate(VP8EncIterator* WEBP_RESTRICT const it, - VP8ModeScore* WEBP_RESTRICT const rd, - VP8RDLevel rd_opt) { + VP8ModeScore* WEBP_RESTRICT const rd, VP8RDLevel rd_opt) { int is_skipped; const int method = it->enc->method; @@ -1387,7 +1353,7 @@ int VP8Decimate(VP8EncIterator* WEBP_RESTRICT const it, PickBestIntra4(it, rd); } PickBestUV(it, rd); - if (rd_opt == RD_OPT_TRELLIS) { // finish off with trellis-optim now + if (rd_opt == RD_OPT_TRELLIS) { // finish off with trellis-optim now it->do_trellis = 1; SimpleQuantize(it, rd); } diff --git a/src/enc/syntax_enc.c b/src/enc/syntax_enc.c index 6edc3c21..a2b54f0e 100644 --- a/src/enc/syntax_enc.c +++ b/src/enc/syntax_enc.c @@ -15,13 +15,13 @@ #include #include "src/dec/common_dec.h" -#include "src/webp/types.h" #include "src/enc/vp8i_enc.h" #include "src/utils/bit_writer_utils.h" #include "src/utils/utils.h" #include "src/webp/encode.h" #include "src/webp/format_constants.h" // RIFF constants #include "src/webp/mux_types.h" // ALPHA_FLAG +#include "src/webp/types.h" //------------------------------------------------------------------------------ // Helper functions @@ -32,7 +32,7 @@ static int IsVP8XNeeded(const VP8Encoder* const enc) { } static int PutPaddingByte(const WebPPicture* const pic) { - const uint8_t pad_byte[1] = { 0 }; + const uint8_t pad_byte[1] = {0}; return !!pic->writer(pad_byte, 1, pic); } @@ -42,9 +42,8 @@ static int PutPaddingByte(const WebPPicture* const pic) { static WebPEncodingError PutRIFFHeader(const VP8Encoder* const enc, size_t riff_size) { const WebPPicture* const pic = enc->pic; - uint8_t riff[RIFF_HEADER_SIZE] = { - 'R', 'I', 'F', 'F', 0, 0, 0, 0, 'W', 'E', 'B', 'P' - }; + uint8_t riff[RIFF_HEADER_SIZE] = {'R', 'I', 'F', 'F', 0, 0, + 0, 0, 'W', 'E', 'B', 'P'}; assert(riff_size == (uint32_t)riff_size); PutLE32(riff + TAG_SIZE, (uint32_t)riff_size); if (!pic->writer(riff, sizeof(riff), pic)) { @@ -55,9 +54,7 @@ static WebPEncodingError PutRIFFHeader(const VP8Encoder* const enc, static WebPEncodingError PutVP8XHeader(const VP8Encoder* const enc) { const WebPPicture* const pic = enc->pic; - uint8_t vp8x[CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE] = { - 'V', 'P', '8', 'X' - }; + uint8_t vp8x[CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE] = {'V', 'P', '8', 'X'}; uint32_t flags = 0; assert(IsVP8XNeeded(enc)); @@ -68,8 +65,8 @@ static WebPEncodingError PutVP8XHeader(const VP8Encoder* const enc) { flags |= ALPHA_FLAG; } - PutLE32(vp8x + TAG_SIZE, VP8X_CHUNK_SIZE); - PutLE32(vp8x + CHUNK_HEADER_SIZE, flags); + PutLE32(vp8x + TAG_SIZE, VP8X_CHUNK_SIZE); + PutLE32(vp8x + CHUNK_HEADER_SIZE, flags); PutLE24(vp8x + CHUNK_HEADER_SIZE + 4, pic->width - 1); PutLE24(vp8x + CHUNK_HEADER_SIZE + 7, pic->height - 1); if (!pic->writer(vp8x, sizeof(vp8x), pic)) { @@ -80,9 +77,7 @@ static WebPEncodingError PutVP8XHeader(const VP8Encoder* const enc) { static WebPEncodingError PutAlphaChunk(const VP8Encoder* const enc) { const WebPPicture* const pic = enc->pic; - uint8_t alpha_chunk_hdr[CHUNK_HEADER_SIZE] = { - 'A', 'L', 'P', 'H' - }; + uint8_t alpha_chunk_hdr[CHUNK_HEADER_SIZE] = {'A', 'L', 'P', 'H'}; assert(enc->has_alpha); @@ -106,9 +101,7 @@ static WebPEncodingError PutAlphaChunk(const VP8Encoder* const enc) { static WebPEncodingError PutVP8Header(const WebPPicture* const pic, size_t vp8_size) { - uint8_t vp8_chunk_hdr[CHUNK_HEADER_SIZE] = { - 'V', 'P', '8', ' ' - }; + uint8_t vp8_chunk_hdr[CHUNK_HEADER_SIZE] = {'V', 'P', '8', ' '}; assert(vp8_size == (uint32_t)vp8_size); PutLE32(vp8_chunk_hdr + TAG_SIZE, (uint32_t)vp8_size); if (!pic->writer(vp8_chunk_hdr, sizeof(vp8_chunk_hdr), pic)) { @@ -127,17 +120,17 @@ static WebPEncodingError PutVP8FrameHeader(const WebPPicture* const pic, } // Paragraph 9.1. - bits = 0 // keyframe (1b) - | (profile << 1) // profile (3b) - | (1 << 4) // visible (1b) - | ((uint32_t)size0 << 5); // partition length (19b) - vp8_frm_hdr[0] = (bits >> 0) & 0xff; - vp8_frm_hdr[1] = (bits >> 8) & 0xff; + bits = 0 // keyframe (1b) + | (profile << 1) // profile (3b) + | (1 << 4) // visible (1b) + | ((uint32_t)size0 << 5); // partition length (19b) + vp8_frm_hdr[0] = (bits >> 0) & 0xff; + vp8_frm_hdr[1] = (bits >> 8) & 0xff; vp8_frm_hdr[2] = (bits >> 16) & 0xff; // signature vp8_frm_hdr[3] = (VP8_SIGNATURE >> 16) & 0xff; - vp8_frm_hdr[4] = (VP8_SIGNATURE >> 8) & 0xff; - vp8_frm_hdr[5] = (VP8_SIGNATURE >> 0) & 0xff; + vp8_frm_hdr[4] = (VP8_SIGNATURE >> 8) & 0xff; + vp8_frm_hdr[5] = (VP8_SIGNATURE >> 0) & 0xff; // dimensions vp8_frm_hdr[6] = pic->width & 0xff; vp8_frm_hdr[7] = pic->width >> 8; @@ -184,7 +177,7 @@ static int PutWebPHeaders(const VP8Encoder* const enc, size_t size0, return 1; // Error. - Error: +Error: return WebPEncodingSetError(pic, err); } @@ -200,7 +193,7 @@ static void PutSegmentHeader(VP8BitWriter* const bw, VP8PutBitUniform(bw, hdr->update_map); if (VP8PutBitUniform(bw, update_data)) { // we always use absolute values, not relative ones - VP8PutBitUniform(bw, 1); // (segment_feature_mode = 1. Paragraph 9.3.) + VP8PutBitUniform(bw, 1); // (segment_feature_mode = 1. Paragraph 9.3.) for (s = 0; s < NUM_MB_SEGMENTS; ++s) { VP8PutSignedBits(bw, enc->dqm[s].quant, 7); } @@ -233,14 +226,13 @@ static void PutFilterHeader(VP8BitWriter* const bw, VP8PutBits(bw, 0, 4); // we use mode_lf_delta for i4x4 VP8PutSignedBits(bw, hdr->i4x4_lf_delta, 6); - VP8PutBits(bw, 0, 3); // all others unused + VP8PutBits(bw, 0, 3); // all others unused } } } // Nominal quantization parameters -static void PutQuant(VP8BitWriter* const bw, - const VP8Encoder* const enc) { +static void PutQuant(VP8BitWriter* const bw, const VP8Encoder* const enc) { VP8PutBits(bw, enc->base_quant, 7); VP8PutSignedBits(bw, enc->dq_y1_dc, 4); VP8PutSignedBits(bw, enc->dq_y2_dc, 4); @@ -259,8 +251,8 @@ static int EmitPartitionsSize(const VP8Encoder* const enc, if (part_size >= VP8_MAX_PARTITION_SIZE) { return WebPEncodingSetError(pic, VP8_ENC_ERROR_PARTITION_OVERFLOW); } - buf[3 * p + 0] = (part_size >> 0) & 0xff; - buf[3 * p + 1] = (part_size >> 8) & 0xff; + buf[3 * p + 0] = (part_size >> 0) & 0xff; + buf[3 * p + 1] = (part_size >> 8) & 0xff; buf[3 * p + 2] = (part_size >> 16) & 0xff; } if (p && !pic->writer(buf, 3 * p, pic)) { @@ -277,19 +269,22 @@ static int GeneratePartition0(VP8Encoder* const enc) { uint64_t pos1, pos2, pos3; pos1 = VP8BitWriterPos(bw); - if (!VP8BitWriterInit(bw, mb_size * 7 / 8)) { // ~7 bits per macroblock + if (!VP8BitWriterInit(bw, mb_size * 7 / 8)) { // ~7 bits per macroblock return WebPEncodingSetError(enc->pic, VP8_ENC_ERROR_OUT_OF_MEMORY); } - VP8PutBitUniform(bw, 0); // colorspace - VP8PutBitUniform(bw, 0); // clamp type + VP8PutBitUniform(bw, 0); // colorspace + VP8PutBitUniform(bw, 0); // clamp type PutSegmentHeader(bw, enc); PutFilterHeader(bw, &enc->filter_hdr); - VP8PutBits(bw, enc->num_parts == 8 ? 3 : - enc->num_parts == 4 ? 2 : - enc->num_parts == 2 ? 1 : 0, 2); + VP8PutBits(bw, + enc->num_parts == 8 ? 3 + : enc->num_parts == 4 ? 2 + : enc->num_parts == 2 ? 1 + : 0, + 2); PutQuant(bw, enc); - VP8PutBitUniform(bw, 0); // no proba update + VP8PutBitUniform(bw, 0); // no proba update VP8WriteProbas(bw, &enc->proba); pos2 = VP8BitWriterPos(bw); VP8CodeIntraModes(enc); @@ -337,9 +332,8 @@ int VP8EncWrite(VP8Encoder* const enc) { if (!ok) return 0; // Compute VP8 size - vp8_size = VP8_FRAME_HEADER_SIZE + - VP8BitWriterSize(bw) + - 3 * (enc->num_parts - 1); + vp8_size = + VP8_FRAME_HEADER_SIZE + VP8BitWriterSize(bw) + 3 * (enc->num_parts - 1); for (p = 0; p < enc->num_parts; ++p) { vp8_size += VP8BitWriterSize(enc->parts + p); } @@ -353,8 +347,8 @@ int VP8EncWrite(VP8Encoder* const enc) { riff_size += CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE; } if (enc->has_alpha) { // Add size for: ALPH header + data. - const uint32_t padded_alpha_size = enc->alpha_data_size + - (enc->alpha_data_size & 1); + const uint32_t padded_alpha_size = + enc->alpha_data_size + (enc->alpha_data_size & 1); riff_size += CHUNK_HEADER_SIZE + padded_alpha_size; } // RIFF size should fit in 32-bits. @@ -366,10 +360,9 @@ int VP8EncWrite(VP8Encoder* const enc) { { const uint8_t* const part0 = VP8BitWriterBuf(bw); const size_t size0 = VP8BitWriterSize(bw); - ok = ok && PutWebPHeaders(enc, size0, vp8_size, riff_size) - && pic->writer(part0, size0, pic) - && EmitPartitionsSize(enc, pic); - VP8BitWriterWipeOut(bw); // will free the internal buffer. + ok = ok && PutWebPHeaders(enc, size0, vp8_size, riff_size) && + pic->writer(part0, size0, pic) && EmitPartitionsSize(enc, pic); + VP8BitWriterWipeOut(bw); // will free the internal buffer. } // Token partitions @@ -377,7 +370,7 @@ int VP8EncWrite(VP8Encoder* const enc) { const uint8_t* const buf = VP8BitWriterBuf(enc->parts + p); const size_t size = VP8BitWriterSize(enc->parts + p); if (size) ok = ok && pic->writer(buf, size, pic); - VP8BitWriterWipeOut(enc->parts + p); // will free the internal buffer. + VP8BitWriterWipeOut(enc->parts + p); // will free the internal buffer. ok = ok && WebPReportProgress(pic, enc->percent + percent_per_part, &enc->percent); } diff --git a/src/enc/token_enc.c b/src/enc/token_enc.c index 9c8b8ee9..2c0838bb 100644 --- a/src/enc/token_enc.c +++ b/src/enc/token_enc.c @@ -31,14 +31,14 @@ #if !defined(DISABLE_TOKEN_BUFFER) // we use pages to reduce the number of memcpy() -#define MIN_PAGE_SIZE 8192 // minimum number of token per page +#define MIN_PAGE_SIZE 8192 // minimum number of token per page #define FIXED_PROBA_BIT (1u << 14) typedef uint16_t token_t; // bit #15: bit value // bit #14: flags for constant proba or idx // bits #0..13: slot or constant proba struct VP8Tokens { - VP8Tokens* next; // pointer to next page + VP8Tokens* next; // pointer to next page }; // Token data is located in memory just after the 'next' field. // This macro is used to return their address and hide the trick. @@ -89,11 +89,10 @@ static int TBufferNewPage(VP8TBuffer* const b) { //------------------------------------------------------------------------------ #define TOKEN_ID(t, b, ctx) \ - (NUM_PROBAS * ((ctx) + NUM_CTX * ((b) + NUM_BANDS * (t)))) + (NUM_PROBAS * ((ctx) + NUM_CTX * ((b) + NUM_BANDS * (t)))) static WEBP_INLINE uint32_t AddToken(VP8TBuffer* const b, uint32_t bit, - uint32_t proba_idx, - proba_t* const stats) { + uint32_t proba_idx, proba_t* const stats) { assert(proba_idx < FIXED_PROBA_BIT); assert(bit <= 1); if (b->left > 0 || TBufferNewPage(b)) { @@ -104,8 +103,8 @@ static WEBP_INLINE uint32_t AddToken(VP8TBuffer* const b, uint32_t bit, return bit; } -static WEBP_INLINE void AddConstantToken(VP8TBuffer* const b, - uint32_t bit, uint32_t proba) { +static WEBP_INLINE void AddConstantToken(VP8TBuffer* const b, uint32_t bit, + uint32_t proba) { assert(proba < 256); assert(bit <= 1); if (b->left > 0 || TBufferNewPage(b)) { @@ -155,25 +154,25 @@ int VP8RecordCoeffTokens(int ctx, const struct VP8Residual* const res, int mask; const uint8_t* tab; uint32_t residue = v - 3; - if (residue < (8 << 1)) { // VP8Cat3 (3b) + if (residue < (8 << 1)) { // VP8Cat3 (3b) AddToken(tokens, 0, base_id + 8, s + 8); AddToken(tokens, 0, base_id + 9, s + 9); residue -= (8 << 0); mask = 1 << 2; tab = VP8Cat3; - } else if (residue < (8 << 2)) { // VP8Cat4 (4b) + } else if (residue < (8 << 2)) { // VP8Cat4 (4b) AddToken(tokens, 0, base_id + 8, s + 8); AddToken(tokens, 1, base_id + 9, s + 9); residue -= (8 << 1); mask = 1 << 3; tab = VP8Cat4; - } else if (residue < (8 << 3)) { // VP8Cat5 (5b) + } else if (residue < (8 << 3)) { // VP8Cat5 (5b) AddToken(tokens, 1, base_id + 8, s + 8); AddToken(tokens, 0, base_id + 10, s + 9); residue -= (8 << 2); mask = 1 << 4; tab = VP8Cat5; - } else { // VP8Cat6 (11b) + } else { // VP8Cat6 (11b) AddToken(tokens, 1, base_id + 8, s + 8); AddToken(tokens, 1, base_id + 10, s + 9); residue -= (8 << 3); @@ -190,7 +189,7 @@ int VP8RecordCoeffTokens(int ctx, const struct VP8Residual* const res, } AddConstantToken(tokens, sign, 128); if (n == 16 || !AddToken(tokens, n <= last, base_id + 0, s + 0)) { - return 1; // EOB + return 1; // EOB } } return 1; @@ -252,14 +251,12 @@ size_t VP8EstimateTokenSize(VP8TBuffer* const b, const uint8_t* const probas) { //------------------------------------------------------------------------------ -#else // DISABLE_TOKEN_BUFFER +#else // DISABLE_TOKEN_BUFFER void VP8TBufferInit(VP8TBuffer* const b, int page_size) { (void)b; (void)page_size; } -void VP8TBufferClear(VP8TBuffer* const b) { - (void)b; -} +void VP8TBufferClear(VP8TBuffer* const b) { (void)b; } -#endif // !DISABLE_TOKEN_BUFFER +#endif // !DISABLE_TOKEN_BUFFER diff --git a/src/enc/tree_enc.c b/src/enc/tree_enc.c index f6dbb25f..fdb5d15c 100644 --- a/src/enc/tree_enc.c +++ b/src/enc/tree_enc.c @@ -14,149 +14,115 @@ #include #include "src/dec/common_dec.h" -#include "src/webp/types.h" #include "src/enc/vp8i_enc.h" #include "src/utils/bit_writer_utils.h" +#include "src/webp/types.h" //------------------------------------------------------------------------------ // Default probabilities // Paragraph 13.5 -const uint8_t - VP8CoeffsProba0[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS] = { - { { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128 }, - { 189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128 }, - { 106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128 } - }, - { { 1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128 }, - { 181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128 }, - { 78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128 }, - }, - { { 1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128 }, - { 184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128 }, - { 77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128 }, - }, - { { 1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128 }, - { 170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128 }, - { 37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128 } - }, - { { 1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128 }, - { 207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128 }, - { 102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128 } - }, - { { 1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128 }, - { 177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128 }, - { 80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128 } - }, - { { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } - } - }, - { { { 198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62 }, - { 131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1 }, - { 68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128 } - }, - { { 1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128 }, - { 184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128 }, - { 81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128 } - }, - { { 1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128 }, - { 99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128 }, - { 23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128 } - }, - { { 1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128 }, - { 109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128 }, - { 44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128 } - }, - { { 1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128 }, - { 94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128 }, - { 22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128 } - }, - { { 1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128 }, - { 124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128 }, - { 35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128 } - }, - { { 1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128 }, - { 121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128 }, - { 45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128 } - }, - { { 1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128 }, - { 203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128 } - } - }, - { { { 253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128 }, - { 175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128 }, - { 73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128 } - }, - { { 1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128 }, - { 239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128 }, - { 155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128 } - }, - { { 1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128 }, - { 201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128 }, - { 69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128 } - }, - { { 1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128 }, - { 141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128 } - }, - { { 1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128 }, - { 149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - }, - { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } - } - }, - { { { 202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255 }, - { 126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128 }, - { 61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128 } - }, - { { 1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128 }, - { 166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128 }, - { 39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128 } - }, - { { 1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128 }, - { 124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128 }, - { 24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128 } - }, - { { 1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128 }, - { 149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128 }, - { 28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128 } - }, - { { 1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128 }, - { 123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128 }, - { 20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128 } - }, - { { 1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128 }, - { 168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128 }, - { 47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128 } - }, - { { 1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128 }, - { 141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128 }, - { 42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128 } - }, - { { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 } - } - } -}; +const uint8_t VP8CoeffsProba0[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS] = { + {{{128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, + {128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, + {128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}}, + {{253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128}, + {189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128}, + {106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128}}, + { + {1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128}, + {181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128}, + {78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128}, + }, + { + {1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128}, + {184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128}, + {77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128}, + }, + {{1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128}, + {170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128}, + {37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128}}, + {{1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128}, + {207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128}, + {102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128}}, + {{1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128}, + {177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128}, + {80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128}}, + {{1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128}, + {246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128}, + {255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}}}, + {{{198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62}, + {131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1}, + {68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128}}, + {{1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128}, + {184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128}, + {81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128}}, + {{1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128}, + {99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128}, + {23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128}}, + {{1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128}, + {109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128}, + {44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128}}, + {{1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128}, + {94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128}, + {22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128}}, + {{1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128}, + {124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128}, + {35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128}}, + {{1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128}, + {121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128}, + {45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128}}, + {{1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128}, + {203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128}, + {137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128}}}, + {{{253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128}, + {175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128}, + {73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128}}, + {{1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128}, + {239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128}, + {155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128}}, + {{1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128}, + {201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128}, + {69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128}}, + {{1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128}, + {223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128}, + {141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128}}, + {{1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128}, + {190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128}, + {149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128}}, + {{1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128}, + {247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128}, + {240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128}}, + {{1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128}, + {213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128}, + {55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128}}, + {{128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, + {128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, + {128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}}}, + {{{202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255}, + {126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128}, + {61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128}}, + {{1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128}, + {166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128}, + {39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128}}, + {{1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128}, + {124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128}, + {24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128}}, + {{1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128}, + {149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128}, + {28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128}}, + {{1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128}, + {123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128}, + {20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128}}, + {{1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128}, + {168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128}, + {47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128}}, + {{1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128}, + {141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128}, + {42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128}}, + {{1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128}, + {244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128}, + {238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128}}}}; void VP8DefaultProbas(VP8Encoder* const enc) { VP8EncProba* const probas = &enc->proba; @@ -170,107 +136,106 @@ void VP8DefaultProbas(VP8Encoder* const enc) { // Paragraph 11.5. 900bytes. static const uint8_t kBModesProba[NUM_BMODES][NUM_BMODES][NUM_BMODES - 1] = { - { { 231, 120, 48, 89, 115, 113, 120, 152, 112 }, - { 152, 179, 64, 126, 170, 118, 46, 70, 95 }, - { 175, 69, 143, 80, 85, 82, 72, 155, 103 }, - { 56, 58, 10, 171, 218, 189, 17, 13, 152 }, - { 114, 26, 17, 163, 44, 195, 21, 10, 173 }, - { 121, 24, 80, 195, 26, 62, 44, 64, 85 }, - { 144, 71, 10, 38, 171, 213, 144, 34, 26 }, - { 170, 46, 55, 19, 136, 160, 33, 206, 71 }, - { 63, 20, 8, 114, 114, 208, 12, 9, 226 }, - { 81, 40, 11, 96, 182, 84, 29, 16, 36 } }, - { { 134, 183, 89, 137, 98, 101, 106, 165, 148 }, - { 72, 187, 100, 130, 157, 111, 32, 75, 80 }, - { 66, 102, 167, 99, 74, 62, 40, 234, 128 }, - { 41, 53, 9, 178, 241, 141, 26, 8, 107 }, - { 74, 43, 26, 146, 73, 166, 49, 23, 157 }, - { 65, 38, 105, 160, 51, 52, 31, 115, 128 }, - { 104, 79, 12, 27, 217, 255, 87, 17, 7 }, - { 87, 68, 71, 44, 114, 51, 15, 186, 23 }, - { 47, 41, 14, 110, 182, 183, 21, 17, 194 }, - { 66, 45, 25, 102, 197, 189, 23, 18, 22 } }, - { { 88, 88, 147, 150, 42, 46, 45, 196, 205 }, - { 43, 97, 183, 117, 85, 38, 35, 179, 61 }, - { 39, 53, 200, 87, 26, 21, 43, 232, 171 }, - { 56, 34, 51, 104, 114, 102, 29, 93, 77 }, - { 39, 28, 85, 171, 58, 165, 90, 98, 64 }, - { 34, 22, 116, 206, 23, 34, 43, 166, 73 }, - { 107, 54, 32, 26, 51, 1, 81, 43, 31 }, - { 68, 25, 106, 22, 64, 171, 36, 225, 114 }, - { 34, 19, 21, 102, 132, 188, 16, 76, 124 }, - { 62, 18, 78, 95, 85, 57, 50, 48, 51 } }, - { { 193, 101, 35, 159, 215, 111, 89, 46, 111 }, - { 60, 148, 31, 172, 219, 228, 21, 18, 111 }, - { 112, 113, 77, 85, 179, 255, 38, 120, 114 }, - { 40, 42, 1, 196, 245, 209, 10, 25, 109 }, - { 88, 43, 29, 140, 166, 213, 37, 43, 154 }, - { 61, 63, 30, 155, 67, 45, 68, 1, 209 }, - { 100, 80, 8, 43, 154, 1, 51, 26, 71 }, - { 142, 78, 78, 16, 255, 128, 34, 197, 171 }, - { 41, 40, 5, 102, 211, 183, 4, 1, 221 }, - { 51, 50, 17, 168, 209, 192, 23, 25, 82 } }, - { { 138, 31, 36, 171, 27, 166, 38, 44, 229 }, - { 67, 87, 58, 169, 82, 115, 26, 59, 179 }, - { 63, 59, 90, 180, 59, 166, 93, 73, 154 }, - { 40, 40, 21, 116, 143, 209, 34, 39, 175 }, - { 47, 15, 16, 183, 34, 223, 49, 45, 183 }, - { 46, 17, 33, 183, 6, 98, 15, 32, 183 }, - { 57, 46, 22, 24, 128, 1, 54, 17, 37 }, - { 65, 32, 73, 115, 28, 128, 23, 128, 205 }, - { 40, 3, 9, 115, 51, 192, 18, 6, 223 }, - { 87, 37, 9, 115, 59, 77, 64, 21, 47 } }, - { { 104, 55, 44, 218, 9, 54, 53, 130, 226 }, - { 64, 90, 70, 205, 40, 41, 23, 26, 57 }, - { 54, 57, 112, 184, 5, 41, 38, 166, 213 }, - { 30, 34, 26, 133, 152, 116, 10, 32, 134 }, - { 39, 19, 53, 221, 26, 114, 32, 73, 255 }, - { 31, 9, 65, 234, 2, 15, 1, 118, 73 }, - { 75, 32, 12, 51, 192, 255, 160, 43, 51 }, - { 88, 31, 35, 67, 102, 85, 55, 186, 85 }, - { 56, 21, 23, 111, 59, 205, 45, 37, 192 }, - { 55, 38, 70, 124, 73, 102, 1, 34, 98 } }, - { { 125, 98, 42, 88, 104, 85, 117, 175, 82 }, - { 95, 84, 53, 89, 128, 100, 113, 101, 45 }, - { 75, 79, 123, 47, 51, 128, 81, 171, 1 }, - { 57, 17, 5, 71, 102, 57, 53, 41, 49 }, - { 38, 33, 13, 121, 57, 73, 26, 1, 85 }, - { 41, 10, 67, 138, 77, 110, 90, 47, 114 }, - { 115, 21, 2, 10, 102, 255, 166, 23, 6 }, - { 101, 29, 16, 10, 85, 128, 101, 196, 26 }, - { 57, 18, 10, 102, 102, 213, 34, 20, 43 }, - { 117, 20, 15, 36, 163, 128, 68, 1, 26 } }, - { { 102, 61, 71, 37, 34, 53, 31, 243, 192 }, - { 69, 60, 71, 38, 73, 119, 28, 222, 37 }, - { 68, 45, 128, 34, 1, 47, 11, 245, 171 }, - { 62, 17, 19, 70, 146, 85, 55, 62, 70 }, - { 37, 43, 37, 154, 100, 163, 85, 160, 1 }, - { 63, 9, 92, 136, 28, 64, 32, 201, 85 }, - { 75, 15, 9, 9, 64, 255, 184, 119, 16 }, - { 86, 6, 28, 5, 64, 255, 25, 248, 1 }, - { 56, 8, 17, 132, 137, 255, 55, 116, 128 }, - { 58, 15, 20, 82, 135, 57, 26, 121, 40 } }, - { { 164, 50, 31, 137, 154, 133, 25, 35, 218 }, - { 51, 103, 44, 131, 131, 123, 31, 6, 158 }, - { 86, 40, 64, 135, 148, 224, 45, 183, 128 }, - { 22, 26, 17, 131, 240, 154, 14, 1, 209 }, - { 45, 16, 21, 91, 64, 222, 7, 1, 197 }, - { 56, 21, 39, 155, 60, 138, 23, 102, 213 }, - { 83, 12, 13, 54, 192, 255, 68, 47, 28 }, - { 85, 26, 85, 85, 128, 128, 32, 146, 171 }, - { 18, 11, 7, 63, 144, 171, 4, 4, 246 }, - { 35, 27, 10, 146, 174, 171, 12, 26, 128 } }, - { { 190, 80, 35, 99, 180, 80, 126, 54, 45 }, - { 85, 126, 47, 87, 176, 51, 41, 20, 32 }, - { 101, 75, 128, 139, 118, 146, 116, 128, 85 }, - { 56, 41, 15, 176, 236, 85, 37, 9, 62 }, - { 71, 30, 17, 119, 118, 255, 17, 18, 138 }, - { 101, 38, 60, 138, 55, 70, 43, 26, 142 }, - { 146, 36, 19, 30, 171, 255, 97, 27, 20 }, - { 138, 45, 61, 62, 219, 1, 81, 188, 64 }, - { 32, 41, 20, 117, 151, 142, 20, 21, 163 }, - { 112, 19, 12, 61, 195, 128, 48, 4, 24 } } -}; + {{231, 120, 48, 89, 115, 113, 120, 152, 112}, + {152, 179, 64, 126, 170, 118, 46, 70, 95}, + {175, 69, 143, 80, 85, 82, 72, 155, 103}, + {56, 58, 10, 171, 218, 189, 17, 13, 152}, + {114, 26, 17, 163, 44, 195, 21, 10, 173}, + {121, 24, 80, 195, 26, 62, 44, 64, 85}, + {144, 71, 10, 38, 171, 213, 144, 34, 26}, + {170, 46, 55, 19, 136, 160, 33, 206, 71}, + {63, 20, 8, 114, 114, 208, 12, 9, 226}, + {81, 40, 11, 96, 182, 84, 29, 16, 36}}, + {{134, 183, 89, 137, 98, 101, 106, 165, 148}, + {72, 187, 100, 130, 157, 111, 32, 75, 80}, + {66, 102, 167, 99, 74, 62, 40, 234, 128}, + {41, 53, 9, 178, 241, 141, 26, 8, 107}, + {74, 43, 26, 146, 73, 166, 49, 23, 157}, + {65, 38, 105, 160, 51, 52, 31, 115, 128}, + {104, 79, 12, 27, 217, 255, 87, 17, 7}, + {87, 68, 71, 44, 114, 51, 15, 186, 23}, + {47, 41, 14, 110, 182, 183, 21, 17, 194}, + {66, 45, 25, 102, 197, 189, 23, 18, 22}}, + {{88, 88, 147, 150, 42, 46, 45, 196, 205}, + {43, 97, 183, 117, 85, 38, 35, 179, 61}, + {39, 53, 200, 87, 26, 21, 43, 232, 171}, + {56, 34, 51, 104, 114, 102, 29, 93, 77}, + {39, 28, 85, 171, 58, 165, 90, 98, 64}, + {34, 22, 116, 206, 23, 34, 43, 166, 73}, + {107, 54, 32, 26, 51, 1, 81, 43, 31}, + {68, 25, 106, 22, 64, 171, 36, 225, 114}, + {34, 19, 21, 102, 132, 188, 16, 76, 124}, + {62, 18, 78, 95, 85, 57, 50, 48, 51}}, + {{193, 101, 35, 159, 215, 111, 89, 46, 111}, + {60, 148, 31, 172, 219, 228, 21, 18, 111}, + {112, 113, 77, 85, 179, 255, 38, 120, 114}, + {40, 42, 1, 196, 245, 209, 10, 25, 109}, + {88, 43, 29, 140, 166, 213, 37, 43, 154}, + {61, 63, 30, 155, 67, 45, 68, 1, 209}, + {100, 80, 8, 43, 154, 1, 51, 26, 71}, + {142, 78, 78, 16, 255, 128, 34, 197, 171}, + {41, 40, 5, 102, 211, 183, 4, 1, 221}, + {51, 50, 17, 168, 209, 192, 23, 25, 82}}, + {{138, 31, 36, 171, 27, 166, 38, 44, 229}, + {67, 87, 58, 169, 82, 115, 26, 59, 179}, + {63, 59, 90, 180, 59, 166, 93, 73, 154}, + {40, 40, 21, 116, 143, 209, 34, 39, 175}, + {47, 15, 16, 183, 34, 223, 49, 45, 183}, + {46, 17, 33, 183, 6, 98, 15, 32, 183}, + {57, 46, 22, 24, 128, 1, 54, 17, 37}, + {65, 32, 73, 115, 28, 128, 23, 128, 205}, + {40, 3, 9, 115, 51, 192, 18, 6, 223}, + {87, 37, 9, 115, 59, 77, 64, 21, 47}}, + {{104, 55, 44, 218, 9, 54, 53, 130, 226}, + {64, 90, 70, 205, 40, 41, 23, 26, 57}, + {54, 57, 112, 184, 5, 41, 38, 166, 213}, + {30, 34, 26, 133, 152, 116, 10, 32, 134}, + {39, 19, 53, 221, 26, 114, 32, 73, 255}, + {31, 9, 65, 234, 2, 15, 1, 118, 73}, + {75, 32, 12, 51, 192, 255, 160, 43, 51}, + {88, 31, 35, 67, 102, 85, 55, 186, 85}, + {56, 21, 23, 111, 59, 205, 45, 37, 192}, + {55, 38, 70, 124, 73, 102, 1, 34, 98}}, + {{125, 98, 42, 88, 104, 85, 117, 175, 82}, + {95, 84, 53, 89, 128, 100, 113, 101, 45}, + {75, 79, 123, 47, 51, 128, 81, 171, 1}, + {57, 17, 5, 71, 102, 57, 53, 41, 49}, + {38, 33, 13, 121, 57, 73, 26, 1, 85}, + {41, 10, 67, 138, 77, 110, 90, 47, 114}, + {115, 21, 2, 10, 102, 255, 166, 23, 6}, + {101, 29, 16, 10, 85, 128, 101, 196, 26}, + {57, 18, 10, 102, 102, 213, 34, 20, 43}, + {117, 20, 15, 36, 163, 128, 68, 1, 26}}, + {{102, 61, 71, 37, 34, 53, 31, 243, 192}, + {69, 60, 71, 38, 73, 119, 28, 222, 37}, + {68, 45, 128, 34, 1, 47, 11, 245, 171}, + {62, 17, 19, 70, 146, 85, 55, 62, 70}, + {37, 43, 37, 154, 100, 163, 85, 160, 1}, + {63, 9, 92, 136, 28, 64, 32, 201, 85}, + {75, 15, 9, 9, 64, 255, 184, 119, 16}, + {86, 6, 28, 5, 64, 255, 25, 248, 1}, + {56, 8, 17, 132, 137, 255, 55, 116, 128}, + {58, 15, 20, 82, 135, 57, 26, 121, 40}}, + {{164, 50, 31, 137, 154, 133, 25, 35, 218}, + {51, 103, 44, 131, 131, 123, 31, 6, 158}, + {86, 40, 64, 135, 148, 224, 45, 183, 128}, + {22, 26, 17, 131, 240, 154, 14, 1, 209}, + {45, 16, 21, 91, 64, 222, 7, 1, 197}, + {56, 21, 39, 155, 60, 138, 23, 102, 213}, + {83, 12, 13, 54, 192, 255, 68, 47, 28}, + {85, 26, 85, 85, 128, 128, 32, 146, 171}, + {18, 11, 7, 63, 144, 171, 4, 4, 246}, + {35, 27, 10, 146, 174, 171, 12, 26, 128}}, + {{190, 80, 35, 99, 180, 80, 126, 54, 45}, + {85, 126, 47, 87, 176, 51, 41, 20, 32}, + {101, 75, 128, 139, 118, 146, 116, 128, 85}, + {56, 41, 15, 176, 236, 85, 37, 9, 62}, + {71, 30, 17, 119, 118, 255, 17, 18, 138}, + {101, 38, 60, 138, 55, 70, 43, 26, 142}, + {146, 36, 19, 30, 171, 255, 97, 27, 20}, + {138, 45, 61, 62, 219, 1, 81, 188, 64}, + {32, 41, 20, 117, 151, 142, 20, 21, 163}, + {112, 19, 12, 61, 195, 128, 48, 4, 24}}}; static int PutI4Mode(VP8BitWriter* const bw, int mode, const uint8_t* const prob) { @@ -296,16 +261,16 @@ static int PutI4Mode(VP8BitWriter* const bw, int mode, static void PutI16Mode(VP8BitWriter* const bw, int mode) { if (VP8PutBit(bw, (mode == TM_PRED || mode == H_PRED), 156)) { - VP8PutBit(bw, mode == TM_PRED, 128); // TM or HE + VP8PutBit(bw, mode == TM_PRED, 128); // TM or HE } else { - VP8PutBit(bw, mode == V_PRED, 163); // VE or DC + VP8PutBit(bw, mode == V_PRED, 163); // VE or DC } } static void PutUVMode(VP8BitWriter* const bw, int uv_mode) { if (VP8PutBit(bw, uv_mode != DC_PRED, 142)) { if (VP8PutBit(bw, uv_mode != V_PRED, 114)) { - VP8PutBit(bw, uv_mode != H_PRED, 183); // else: TM_PRED + VP8PutBit(bw, uv_mode != H_PRED, 183); // else: TM_PRED } } } @@ -351,141 +316,103 @@ void VP8CodeIntraModes(VP8Encoder* const enc) { //------------------------------------------------------------------------------ // Paragraph 13 -const uint8_t - VP8CoeffsUpdateProba[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS] = { - { { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255 }, - { 250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - }, - { { { 217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255 }, - { 234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255 } - }, - { { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - }, - { { { 186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255 } - }, - { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - }, - { { { 248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255 }, - { 248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - }, - { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, - { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } - } - } -}; +const uint8_t VP8CoeffsUpdateProba[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS] = + {{{{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255}, + {249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255}, + {234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255}, + {250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255}, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}}, + {{{217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255}, + {234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255}}, + {{255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255}, + {250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}}, + {{{186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255}, + {234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255}, + {251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255}}, + {{255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255}}, + {{255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}}, + {{{248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255}, + {248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255}, + {246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255}, + {252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255}}, + {{255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255}, + {248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255}, + {253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255}, + {252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255}, + {250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}, + {{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}}}; void VP8WriteProbas(VP8BitWriter* const bw, const VP8EncProba* const probas) { int t, b, c, p; diff --git a/src/enc/vp8i_enc.h b/src/enc/vp8i_enc.h index 22a2d87b..202ce27f 100644 --- a/src/enc/vp8i_enc.h +++ b/src/enc/vp8i_enc.h @@ -14,7 +14,7 @@ #ifndef WEBP_ENC_VP8I_ENC_H_ #define WEBP_ENC_VP8I_ENC_H_ -#include // for memcpy() +#include // for memcpy() #include "src/dec/common_dec.h" #include "src/dsp/cpu.h" @@ -37,16 +37,17 @@ extern "C" { #define ENC_MIN_VERSION 6 #define ENC_REV_VERSION 0 -enum { MAX_LF_LEVELS = 64, // Maximum loop filter level - MAX_VARIABLE_LEVEL = 67, // last (inclusive) level with variable cost - MAX_LEVEL = 2047 // max level (note: max codable is 2047 + 67) - }; +enum { + MAX_LF_LEVELS = 64, // Maximum loop filter level + MAX_VARIABLE_LEVEL = 67, // last (inclusive) level with variable cost + MAX_LEVEL = 2047 // max level (note: max codable is 2047 + 67) +}; -typedef enum { // Rate-distortion optimization levels - RD_OPT_NONE = 0, // no rd-opt - RD_OPT_BASIC = 1, // basic scoring (no trellis) - RD_OPT_TRELLIS = 2, // perform trellis-quant on the final decision only - RD_OPT_TRELLIS_ALL = 3 // trellis-quant for every scoring (much slower) +typedef enum { // Rate-distortion optimization levels + RD_OPT_NONE = 0, // no rd-opt + RD_OPT_BASIC = 1, // basic scoring (no trellis) + RD_OPT_TRELLIS = 2, // perform trellis-quant on the final decision only + RD_OPT_TRELLIS_ALL = 3 // trellis-quant for every scoring (much slower) } VP8RDLevel; // YUV-cache parameters. Cache is 32-bytes wide (= one cacheline). @@ -73,10 +74,10 @@ typedef enum { // Rate-distortion optimization levels // |I4DC4 I4TM4 I4VE4 I4HE4|I4RD4 I4VR4 I4LD4 I4VL4| // |I4HD4 I4HU4 I4TMP .....|.......................| <- ~31% wasted #define YUV_SIZE_ENC (BPS * 16) -#define PRED_SIZE_ENC (32 * BPS + 16 * BPS + 8 * BPS) // I16+Chroma+I4 preds -#define Y_OFF_ENC (0) -#define U_OFF_ENC (16) -#define V_OFF_ENC (16 + 8) +#define PRED_SIZE_ENC (32 * BPS + 16 * BPS + 8 * BPS) // I16+Chroma+I4 preds +#define Y_OFF_ENC (0) +#define U_OFF_ENC (16) +#define V_OFF_ENC (16 + 8) extern const uint16_t VP8Scan[16]; extern const uint16_t VP8UVModeOffsets[4]; @@ -94,9 +95,9 @@ extern const uint16_t VP8I16ModeOffsets[4]; #define C8VE8 (2 * 16 * BPS + 8 * BPS) #define C8HE8 (C8VE8 + 1 * 16) // intra 4x4 -#define I4DC4 (3 * 16 * BPS + 0) -#define I4TM4 (I4DC4 + 4) -#define I4VE4 (I4DC4 + 8) +#define I4DC4 (3 * 16 * BPS + 0) +#define I4TM4 (I4DC4 + 4) +#define I4VE4 (I4DC4 + 8) #define I4HE4 (I4DC4 + 12) #define I4RD4 (I4DC4 + 16) #define I4VR4 (I4DC4 + 20) @@ -106,13 +107,13 @@ extern const uint16_t VP8I16ModeOffsets[4]; #define I4HU4 (I4HD4 + 4) #define I4TMP (I4HD4 + 8) -typedef int64_t score_t; // type used for scores, rate, distortion +typedef int64_t score_t; // type used for scores, rate, distortion // Note that MAX_COST is not the maximum allowed by sizeof(score_t), // in order to allow overflowing computations. #define MAX_COST ((score_t)0x7fffffffffffffLL) #define QFIX 17 -#define BIAS(b) ((b) << (QFIX - 8)) +#define BIAS(b) ((b) << (QFIX - 8)) // Fun fact: this is the _only_ line where we're actually being lossy and // discarding bits. static WEBP_INLINE int QUANTDIV(uint32_t n, uint32_t iQ, uint32_t B) { @@ -128,11 +129,11 @@ static WEBP_INLINE int QUANTDIV(uint32_t n, uint32_t iQ, uint32_t B) { //------------------------------------------------------------------------------ // Headers -typedef uint32_t proba_t; // 16b + 16b +typedef uint32_t proba_t; // 16b + 16b typedef uint8_t ProbaArray[NUM_CTX][NUM_PROBAS]; typedef proba_t StatsArray[NUM_CTX][NUM_PROBAS]; typedef uint16_t CostArray[NUM_CTX][MAX_VARIABLE_LEVEL + 1]; -typedef const uint16_t* (*CostArrayPtr)[NUM_CTX]; // for easy casting +typedef const uint16_t* (*CostArrayPtr)[NUM_CTX]; // for easy casting typedef const uint16_t* CostArrayMap[16][NUM_CTX]; typedef double LFStats[NUM_MB_SEGMENTS][MAX_LF_LEVELS]; // filter stats @@ -140,32 +141,32 @@ typedef struct VP8Encoder VP8Encoder; // segment features typedef struct { - int num_segments; // Actual number of segments. 1 segment only = unused. - int update_map; // whether to update the segment map or not. - // must be 0 if there's only 1 segment. - int size; // bit-cost for transmitting the segment map + int num_segments; // Actual number of segments. 1 segment only = unused. + int update_map; // whether to update the segment map or not. + // must be 0 if there's only 1 segment. + int size; // bit-cost for transmitting the segment map } VP8EncSegmentHeader; // Struct collecting all frame-persistent probabilities. typedef struct { - uint8_t segments[3]; // probabilities for segment tree - uint8_t skip_proba; // final probability of being skipped. - ProbaArray coeffs[NUM_TYPES][NUM_BANDS]; // 1056 bytes - StatsArray stats[NUM_TYPES][NUM_BANDS]; // 4224 bytes - CostArray level_cost[NUM_TYPES][NUM_BANDS]; // 13056 bytes - CostArrayMap remapped_costs[NUM_TYPES]; // 1536 bytes - int dirty; // if true, need to call VP8CalculateLevelCosts() - int use_skip_proba; // Note: we always use skip_proba for now. - int nb_skip; // number of skipped blocks + uint8_t segments[3]; // probabilities for segment tree + uint8_t skip_proba; // final probability of being skipped. + ProbaArray coeffs[NUM_TYPES][NUM_BANDS]; // 1056 bytes + StatsArray stats[NUM_TYPES][NUM_BANDS]; // 4224 bytes + CostArray level_cost[NUM_TYPES][NUM_BANDS]; // 13056 bytes + CostArrayMap remapped_costs[NUM_TYPES]; // 1536 bytes + int dirty; // if true, need to call VP8CalculateLevelCosts() + int use_skip_proba; // Note: we always use skip_proba for now. + int nb_skip; // number of skipped blocks } VP8EncProba; // Filter parameters. Not actually used in the code (we don't perform // the in-loop filtering), but filled from user's config typedef struct { - int simple; // filtering type: 0=complex, 1=simple - int level; // base filter level [0..63] - int sharpness; // [0..7] - int i4x4_lf_delta; // delta filter level for i4x4 relative to i16x16 + int simple; // filtering type: 0=complex, 1=simple + int level; // base filter level [0..63] + int sharpness; // [0..7] + int i4x4_lf_delta; // delta filter level for i4x4 relative to i16x16 } VP8EncFilterHeader; //------------------------------------------------------------------------------ @@ -173,11 +174,11 @@ typedef struct { typedef struct { // block type - unsigned int type:2; // 0=i4x4, 1=i16x16 - unsigned int uv_mode:2; - unsigned int skip:1; - unsigned int segment:2; - uint8_t alpha; // quantization-susceptibility + unsigned int type : 2; // 0=i4x4, 1=i16x16 + unsigned int uv_mode : 2; + unsigned int skip : 1; + unsigned int segment : 2; + uint8_t alpha; // quantization-susceptibility } VP8MBInfo; typedef struct VP8Matrix { @@ -190,20 +191,20 @@ typedef struct VP8Matrix { typedef struct { VP8Matrix y1, y2, uv; // quantization matrices - int alpha; // quant-susceptibility, range [-127,127]. Zero is neutral. - // Lower values indicate a lower risk of blurriness. - int beta; // filter-susceptibility, range [0,255]. - int quant; // final segment quantizer. - int fstrength; // final in-loop filtering strength - int max_edge; // max edge delta (for filtering strength) - int min_disto; // minimum distortion required to trigger filtering record + int alpha; // quant-susceptibility, range [-127,127]. Zero is neutral. + // Lower values indicate a lower risk of blurriness. + int beta; // filter-susceptibility, range [0,255]. + int quant; // final segment quantizer. + int fstrength; // final in-loop filtering strength + int max_edge; // max edge delta (for filtering strength) + int min_disto; // minimum distortion required to trigger filtering record // reactivities int lambda_i16, lambda_i4, lambda_uv; int lambda_mode, lambda_trellis, tlambda; int lambda_trellis_i16, lambda_trellis_i4, lambda_trellis_uv; // lambda values for distortion-based evaluation - score_t i4_penalty; // penalty for using Intra4 + score_t i4_penalty; // penalty for using Intra4 } VP8SegmentInfo; typedef int8_t DError[2 /* u/v */][2 /* top or left */]; @@ -211,58 +212,58 @@ typedef int8_t DError[2 /* u/v */][2 /* top or left */]; // Handy transient struct to accumulate score and info during RD-optimization // and mode evaluation. typedef struct { - score_t D, SD; // Distortion, spectral distortion - score_t H, R, score; // header bits, rate, score. - int16_t y_dc_levels[16]; // Quantized levels for luma-DC, luma-AC, chroma. + score_t D, SD; // Distortion, spectral distortion + score_t H, R, score; // header bits, rate, score. + int16_t y_dc_levels[16]; // Quantized levels for luma-DC, luma-AC, chroma. int16_t y_ac_levels[16][16]; int16_t uv_levels[4 + 4][16]; - int mode_i16; // mode number for intra16 prediction - uint8_t modes_i4[16]; // mode numbers for intra4 predictions - int mode_uv; // mode number of chroma prediction - uint32_t nz; // non-zero blocks - int8_t derr[2][3]; // DC diffusion errors for U/V for blocks #1/2/3 + int mode_i16; // mode number for intra16 prediction + uint8_t modes_i4[16]; // mode numbers for intra4 predictions + int mode_uv; // mode number of chroma prediction + uint32_t nz; // non-zero blocks + int8_t derr[2][3]; // DC diffusion errors for U/V for blocks #1/2/3 } VP8ModeScore; // Iterator structure to iterate through macroblocks, pointing to the // right neighbouring data (samples, predictions, contexts, ...) typedef struct { - int x, y; // current macroblock - uint8_t* yuv_in; // input samples - uint8_t* yuv_out; // output samples - uint8_t* yuv_out2; // secondary buffer swapped with yuv_out. - uint8_t* yuv_p; // scratch buffer for prediction - VP8Encoder* enc; // back-pointer - VP8MBInfo* mb; // current macroblock - VP8BitWriter* bw; // current bit-writer - uint8_t* preds; // intra mode predictors (4x4 blocks) - uint32_t* nz; // non-zero pattern + int x, y; // current macroblock + uint8_t* yuv_in; // input samples + uint8_t* yuv_out; // output samples + uint8_t* yuv_out2; // secondary buffer swapped with yuv_out. + uint8_t* yuv_p; // scratch buffer for prediction + VP8Encoder* enc; // back-pointer + VP8MBInfo* mb; // current macroblock + VP8BitWriter* bw; // current bit-writer + uint8_t* preds; // intra mode predictors (4x4 blocks) + uint32_t* nz; // non-zero pattern #if WEBP_AARCH64 && BPS == 32 - uint8_t i4_boundary[40]; // 32+8 boundary samples needed by intra4x4 + uint8_t i4_boundary[40]; // 32+8 boundary samples needed by intra4x4 #else - uint8_t i4_boundary[37]; // 32+5 boundary samples needed by intra4x4 + uint8_t i4_boundary[37]; // 32+5 boundary samples needed by intra4x4 #endif - uint8_t* i4_top; // pointer to the current top boundary sample - int i4; // current intra4x4 mode being tested - int top_nz[9]; // top-non-zero context. - int left_nz[9]; // left-non-zero. left_nz[8] is independent. - uint64_t bit_count[4][3]; // bit counters for coded levels. - uint64_t luma_bits; // macroblock bit-cost for luma - uint64_t uv_bits; // macroblock bit-cost for chroma - LFStats* lf_stats; // filter stats (borrowed from enc) - int do_trellis; // if true, perform extra level optimisation - int count_down; // number of mb still to be processed - int count_down0; // starting counter value (for progress) - int percent0; // saved initial progress percent + uint8_t* i4_top; // pointer to the current top boundary sample + int i4; // current intra4x4 mode being tested + int top_nz[9]; // top-non-zero context. + int left_nz[9]; // left-non-zero. left_nz[8] is independent. + uint64_t bit_count[4][3]; // bit counters for coded levels. + uint64_t luma_bits; // macroblock bit-cost for luma + uint64_t uv_bits; // macroblock bit-cost for chroma + LFStats* lf_stats; // filter stats (borrowed from enc) + int do_trellis; // if true, perform extra level optimisation + int count_down; // number of mb still to be processed + int count_down0; // starting counter value (for progress) + int percent0; // saved initial progress percent - DError left_derr; // left error diffusion (u/v) - DError* top_derr; // top diffusion error - NULL if disabled + DError left_derr; // left error diffusion (u/v) + DError* top_derr; // top diffusion error - NULL if disabled - uint8_t* y_left; // left luma samples (addressable from index -1 to 15). - uint8_t* u_left; // left u samples (addressable from index -1 to 7) - uint8_t* v_left; // left v samples (addressable from index -1 to 7) + uint8_t* y_left; // left luma samples (addressable from index -1 to 15). + uint8_t* u_left; // left u samples (addressable from index -1 to 7) + uint8_t* v_left; // left v samples (addressable from index -1 to 7) - uint8_t* y_top; // top luma samples at position 'x' - uint8_t* uv_top; // top u/v samples at position 'x', packed as 16 bytes + uint8_t* y_top; // top luma samples at position 'x' + uint8_t* uv_top; // top u/v samples at position 'x', packed as 16 bytes // memory for storing y/u/v_left uint8_t yuv_left_mem[17 + 16 + 16 + 8 + WEBP_ALIGN_CST]; @@ -270,7 +271,7 @@ typedef struct { uint8_t yuv_mem[3 * YUV_SIZE_ENC + PRED_SIZE_ENC + WEBP_ALIGN_CST]; } VP8EncIterator; - // in iterator.c +// in iterator.c // must be called first void VP8IteratorInit(VP8Encoder* const enc, VP8EncIterator* const it); // reset iterator position to row 'y' @@ -295,8 +296,7 @@ int VP8IteratorProgress(const VP8EncIterator* const it, int delta); // Intra4x4 iterations void VP8IteratorStartI4(VP8EncIterator* const it); // returns true if not done. -int VP8IteratorRotateI4(VP8EncIterator* const it, - const uint8_t* const yuv_out); +int VP8IteratorRotateI4(VP8EncIterator* const it, const uint8_t* const yuv_out); // Non-zero context setup/teardown void VP8IteratorNzToBytes(VP8EncIterator* const it); @@ -316,18 +316,18 @@ typedef struct VP8Tokens VP8Tokens; // struct details in token.c typedef struct { #if !defined(DISABLE_TOKEN_BUFFER) - VP8Tokens* pages; // first page - VP8Tokens** last_page; // last page - uint16_t* tokens; // set to (*last_page)->tokens - int left; // how many free tokens left before the page is full - int page_size; // number of tokens per page + VP8Tokens* pages; // first page + VP8Tokens** last_page; // last page + uint16_t* tokens; // set to (*last_page)->tokens + int left; // how many free tokens left before the page is full + int page_size; // number of tokens per page #endif - int error; // true in case of malloc error + int error; // true in case of malloc error } VP8TBuffer; // initialize an empty buffer void VP8TBufferInit(VP8TBuffer* const b, int page_size); -void VP8TBufferClear(VP8TBuffer* const b); // de-allocate pages memory +void VP8TBufferClear(VP8TBuffer* const b); // de-allocate pages memory #if !defined(DISABLE_TOKEN_BUFFER) @@ -349,18 +349,18 @@ size_t VP8EstimateTokenSize(VP8TBuffer* const b, const uint8_t* const probas); // VP8Encoder struct VP8Encoder { - const WebPConfig* config; // user configuration and parameters - WebPPicture* pic; // input / output picture + const WebPConfig* config; // user configuration and parameters + WebPPicture* pic; // input / output picture // headers - VP8EncFilterHeader filter_hdr; // filtering information - VP8EncSegmentHeader segment_hdr; // segment information + VP8EncFilterHeader filter_hdr; // filtering information + VP8EncSegmentHeader segment_hdr; // segment information - int profile; // VP8's profile, deduced from Config. + int profile; // VP8's profile, deduced from Config. // dimension, in macroblock units. int mb_w, mb_h; - int preds_w; // stride of the *preds prediction plane (=4*mb_w + 1) + int preds_w; // stride of the *preds prediction plane (=4*mb_w + 1) // number of partitions (1, 2, 4 or 8 = MAX_NUM_PARTITIONS) int num_parts; @@ -370,20 +370,20 @@ struct VP8Encoder { VP8BitWriter parts[MAX_NUM_PARTITIONS]; // token partitions VP8TBuffer tokens; // token buffer - int percent; // for progress + int percent; // for progress // transparency blob int has_alpha; - uint8_t* alpha_data; // non-NULL if transparency is present + uint8_t* alpha_data; // non-NULL if transparency is present uint32_t alpha_data_size; WebPWorker alpha_worker; // quantization info (one set of DC/AC dequant factor per segment) VP8SegmentInfo dqm[NUM_MB_SEGMENTS]; - int base_quant; // nominal quantizer value. Only used - // for relative coding of segments' quant. - int alpha; // global susceptibility (<=> complexity) - int uv_alpha; // U/V quantization susceptibility + int base_quant; // nominal quantizer value. Only used + // for relative coding of segments' quant. + int alpha; // global susceptibility (<=> complexity) + int uv_alpha; // U/V quantization susceptibility // global offset of quantizers, shared by all segments int dq_y1_dc; int dq_y2_dc, dq_y2_ac; @@ -391,11 +391,11 @@ struct VP8Encoder { // probabilities and statistics VP8EncProba proba; - uint64_t sse[4]; // sum of Y/U/V/A squared errors for all macroblocks - uint64_t sse_count; // pixel count for the sse[] stats - int coded_size; - int residual_bytes[3][4]; - int block_count[3]; + uint64_t sse[4]; // sum of Y/U/V/A squared errors for all macroblocks + uint64_t sse_count; // pixel count for the sse[] stats + int coded_size; + int residual_bytes[3][4]; + int block_count[3]; // quality/speed settings int method; // 0=fastest, 6=best/slowest. @@ -407,23 +407,23 @@ struct VP8Encoder { int use_tokens; // if true, use token buffer // Memory - VP8MBInfo* mb_info; // contextual macroblock infos (mb_w + 1) - uint8_t* preds; // predictions modes: (4*mb_w+1) * (4*mb_h+1) - uint32_t* nz; // non-zero bit context: mb_w+1 - uint8_t* y_top; // top luma samples. - uint8_t* uv_top; // top u/v samples. - // U and V are packed into 16 bytes (8 U + 8 V) - LFStats* lf_stats; // autofilter stats (if NULL, autofilter is off) - DError* top_derr; // diffusion error (NULL if disabled) + VP8MBInfo* mb_info; // contextual macroblock infos (mb_w + 1) + uint8_t* preds; // predictions modes: (4*mb_w+1) * (4*mb_h+1) + uint32_t* nz; // non-zero bit context: mb_w+1 + uint8_t* y_top; // top luma samples. + uint8_t* uv_top; // top u/v samples. + // U and V are packed into 16 bytes (8 U + 8 V) + LFStats* lf_stats; // autofilter stats (if NULL, autofilter is off) + DError* top_derr; // diffusion error (NULL if disabled) }; //------------------------------------------------------------------------------ // internal functions. Not public. - // in tree.c +// in tree.c extern const uint8_t VP8CoeffsProba0[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS]; -extern const uint8_t - VP8CoeffsUpdateProba[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS]; +extern const uint8_t VP8CoeffsUpdateProba[NUM_TYPES][NUM_BANDS][NUM_CTX] + [NUM_PROBAS]; // Reset the token probabilities to their initial (default) values void VP8DefaultProbas(VP8Encoder* const enc); // Write the token probabilities @@ -431,7 +431,7 @@ void VP8WriteProbas(VP8BitWriter* const bw, const VP8EncProba* const probas); // Writes the partition #0 modes (that is: all intra modes) void VP8CodeIntraModes(VP8Encoder* const enc); - // in syntax.c +// in syntax.c // Generates the final bitstream by coding the partition0 and headers, // and appending an assembly of all the pre-coded token partitions. // Return true if everything is ok. @@ -439,7 +439,7 @@ int VP8EncWrite(VP8Encoder* const enc); // Release memory allocated for bit-writing in VP8EncLoop & seq. void VP8EncFreeBitWriters(VP8Encoder* const enc); - // in frame.c +// in frame.c extern const uint8_t VP8Cat3[]; extern const uint8_t VP8Cat4[]; extern const uint8_t VP8Cat5[]; @@ -457,30 +457,29 @@ int VP8GetCostUV(VP8EncIterator* const it, const VP8ModeScore* const rd); int VP8EncLoop(VP8Encoder* const enc); int VP8EncTokenLoop(VP8Encoder* const enc); - // in webpenc.c +// in webpenc.c // Assign an error code to a picture. Return false for convenience. int WebPEncodingSetError(const WebPPicture* const pic, WebPEncodingError error); -int WebPReportProgress(const WebPPicture* const pic, - int percent, int* const percent_store); +int WebPReportProgress(const WebPPicture* const pic, int percent, + int* const percent_store); - // in analysis.c +// in analysis.c // Main analysis loop. Decides the segmentations and complexity. // Assigns a first guess for Intra16 and 'uvmode' prediction modes. int VP8EncAnalyze(VP8Encoder* const enc); - // in quant.c +// in quant.c // Sets up segment's quantization values, 'base_quant' and filter strengths. void VP8SetSegmentParams(VP8Encoder* const enc, float quality); // Pick best modes and fills the levels. Returns true if skipped. int VP8Decimate(VP8EncIterator* WEBP_RESTRICT const it, - VP8ModeScore* WEBP_RESTRICT const rd, - VP8RDLevel rd_opt); + VP8ModeScore* WEBP_RESTRICT const rd, VP8RDLevel rd_opt); - // in alpha.c -void VP8EncInitAlpha(VP8Encoder* const enc); // initialize alpha compression -int VP8EncStartAlpha(VP8Encoder* const enc); // start alpha coding process -int VP8EncFinishAlpha(VP8Encoder* const enc); // finalize compressed data -int VP8EncDeleteAlpha(VP8Encoder* const enc); // delete compressed data +// in alpha.c +void VP8EncInitAlpha(VP8Encoder* const enc); // initialize alpha compression +int VP8EncStartAlpha(VP8Encoder* const enc); // start alpha coding process +int VP8EncFinishAlpha(VP8Encoder* const enc); // finalize compressed data +int VP8EncDeleteAlpha(VP8Encoder* const enc); // delete compressed data // autofilter void VP8InitFilter(VP8EncIterator* const it); @@ -491,7 +490,7 @@ void VP8AdjustFilterStrength(VP8EncIterator* const it); // step of 'delta', given a sharpness parameter 'sharpness'. int VP8FilterStrengthFromDelta(int sharpness, int delta); - // misc utils for picture_*.c: +// misc utils for picture_*.c: // Returns true if 'picture' is non-NULL and dimensions/colorspace are within // their valid ranges. If returning false, the 'error_code' in 'picture' is @@ -519,7 +518,7 @@ void WebPReplaceTransparentPixels(WebPPicture* const pic, uint32_t color); //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_ENC_VP8I_ENC_H_ diff --git a/src/enc/vp8l_enc.c b/src/enc/vp8l_enc.c index 57651b8d..1d66e4a5 100644 --- a/src/enc/vp8l_enc.c +++ b/src/enc/vp8l_enc.c @@ -32,7 +32,7 @@ #include "src/webp/types.h" // Maximum number of histogram images (sub-blocks). -#define MAX_HUFF_IMAGE_SIZE 2600 +#define MAX_HUFF_IMAGE_SIZE 2600 #define MAX_HUFFMAN_BITS (MIN_HUFFMAN_BITS + (1 << NUM_HUFFMAN_BITS) - 1) // Empirical value for which it becomes too computationally expensive to // compute the best predictor image. @@ -69,7 +69,6 @@ typedef enum { kHistoTotal // Must be last. } HistoIx; - #define NUM_BUCKETS 256 typedef uint32_t HistogramBuckets[NUM_BUCKETS]; @@ -81,20 +80,19 @@ typedef struct { HistogramBuckets category[kHistoTotal]; } Histograms; -static void AddSingleSubGreen(uint32_t p, - HistogramBuckets r, HistogramBuckets b) { +static void AddSingleSubGreen(uint32_t p, HistogramBuckets r, + HistogramBuckets b) { const int green = (int)p >> 8; // The upper bits are masked away later. ++r[(((int)p >> 16) - green) & 0xff]; - ++b[(((int)p >> 0) - green) & 0xff]; + ++b[(((int)p >> 0) - green) & 0xff]; } -static void AddSingle(uint32_t p, - HistogramBuckets a, HistogramBuckets r, +static void AddSingle(uint32_t p, HistogramBuckets a, HistogramBuckets r, HistogramBuckets g, HistogramBuckets b) { ++a[(p >> 24) & 0xff]; ++r[(p >> 16) & 0xff]; - ++g[(p >> 8) & 0xff]; - ++b[(p >> 0) & 0xff]; + ++g[(p >> 8) & 0xff]; + ++b[(p >> 0) & 0xff]; } static WEBP_INLINE uint8_t HashPix(uint32_t pix) { @@ -103,11 +101,9 @@ static WEBP_INLINE uint8_t HashPix(uint32_t pix) { return ((((uint64_t)pix + (pix >> 19)) * 0x39c5fba7ull) & 0xffffffffu) >> 24; } -static int AnalyzeEntropy(const uint32_t* argb, - int width, int height, int argb_stride, - int use_palette, - int palette_size, int transform_bits, - EntropyIx* const min_entropy_ix, +static int AnalyzeEntropy(const uint32_t* argb, int width, int height, + int argb_stride, int use_palette, int palette_size, + int transform_bits, EntropyIx* const min_entropy_ix, int* const red_and_blue_always_zero) { Histograms* histo; @@ -133,21 +129,15 @@ static int AnalyzeEntropy(const uint32_t* argb, if ((pix_diff == 0) || (prev_row != NULL && pix == prev_row[x])) { continue; } - AddSingle(pix, - histo->category[kHistoAlpha], - histo->category[kHistoRed], - histo->category[kHistoGreen], - histo->category[kHistoBlue]); - AddSingle(pix_diff, - histo->category[kHistoAlphaPred], + AddSingle(pix, histo->category[kHistoAlpha], histo->category[kHistoRed], + histo->category[kHistoGreen], histo->category[kHistoBlue]); + AddSingle(pix_diff, histo->category[kHistoAlphaPred], histo->category[kHistoRedPred], histo->category[kHistoGreenPred], histo->category[kHistoBluePred]); - AddSingleSubGreen(pix, - histo->category[kHistoRedSubGreen], + AddSingleSubGreen(pix, histo->category[kHistoRedSubGreen], histo->category[kHistoBlueSubGreen]); - AddSingleSubGreen(pix_diff, - histo->category[kHistoRedPredSubGreen], + AddSingleSubGreen(pix_diff, histo->category[kHistoRedPredSubGreen], histo->category[kHistoBluePredSubGreen]); { // Approximate the palette by the entropy of the multiplicative hash. @@ -177,22 +167,17 @@ static int AnalyzeEntropy(const uint32_t* argb, for (j = 0; j < kHistoTotal; ++j) { entropy_comp[j] = VP8LBitsEntropy(histo->category[j], NUM_BUCKETS); } - entropy[kDirect] = entropy_comp[kHistoAlpha] + - entropy_comp[kHistoRed] + - entropy_comp[kHistoGreen] + - entropy_comp[kHistoBlue]; - entropy[kSpatial] = entropy_comp[kHistoAlphaPred] + - entropy_comp[kHistoRedPred] + - entropy_comp[kHistoGreenPred] + - entropy_comp[kHistoBluePred]; - entropy[kSubGreen] = entropy_comp[kHistoAlpha] + - entropy_comp[kHistoRedSubGreen] + - entropy_comp[kHistoGreen] + - entropy_comp[kHistoBlueSubGreen]; - entropy[kSpatialSubGreen] = entropy_comp[kHistoAlphaPred] + - entropy_comp[kHistoRedPredSubGreen] + - entropy_comp[kHistoGreenPred] + - entropy_comp[kHistoBluePredSubGreen]; + entropy[kDirect] = entropy_comp[kHistoAlpha] + entropy_comp[kHistoRed] + + entropy_comp[kHistoGreen] + entropy_comp[kHistoBlue]; + entropy[kSpatial] = + entropy_comp[kHistoAlphaPred] + entropy_comp[kHistoRedPred] + + entropy_comp[kHistoGreenPred] + entropy_comp[kHistoBluePred]; + entropy[kSubGreen] = + entropy_comp[kHistoAlpha] + entropy_comp[kHistoRedSubGreen] + + entropy_comp[kHistoGreen] + entropy_comp[kHistoBlueSubGreen]; + entropy[kSpatialSubGreen] = + entropy_comp[kHistoAlphaPred] + entropy_comp[kHistoRedPredSubGreen] + + entropy_comp[kHistoGreenPred] + entropy_comp[kHistoBluePredSubGreen]; entropy[kPalette] = entropy_comp[kHistoPalette]; // When including transforms, there is an overhead in bits from @@ -225,12 +210,11 @@ static int AnalyzeEntropy(const uint32_t* argb, // the cross color optimization. { static const uint8_t kHistoPairs[5][2] = { - { kHistoRed, kHistoBlue }, - { kHistoRedPred, kHistoBluePred }, - { kHistoRedSubGreen, kHistoBlueSubGreen }, - { kHistoRedPredSubGreen, kHistoBluePredSubGreen }, - { kHistoRed, kHistoBlue } - }; + {kHistoRed, kHistoBlue}, + {kHistoRedPred, kHistoBluePred}, + {kHistoRedSubGreen, kHistoBlueSubGreen}, + {kHistoRedPredSubGreen, kHistoBluePredSubGreen}, + {kHistoRed, kHistoBlue}}; const HistogramBuckets* const red_histo = &histo->category[kHistoPairs[*min_entropy_ix][0]]; const HistogramBuckets* const blue_histo = @@ -330,8 +314,7 @@ static int EncoderAnalyze(VP8LEncoder* const enc, } // Empirical bit sizes. - enc->histo_bits = GetHistoBits(method, use_palette, - pic->width, pic->height); + enc->histo_bits = GetHistoBits(method, use_palette, pic->width, pic->height); transform_bits = GetTransformBits(method, enc->histo_bits); enc->predictor_transform_bits = transform_bits; enc->cross_color_transform_bits = transform_bits; @@ -455,8 +438,9 @@ static int GetHuffBitLengthsAndCodes( assert(histo != NULL); for (k = 0; k < 5; ++k) { const int num_symbols = - (k == 0) ? VP8LHistogramNumCodes(histo->palette_code_bits) : - (k == 4) ? NUM_DISTANCE_CODES : 256; + (k == 0) ? VP8LHistogramNumCodes(histo->palette_code_bits) + : (k == 4) ? NUM_DISTANCE_CODES + : 256; codes[k].num_symbols = num_symbols; total_length_size += num_symbols; } @@ -485,8 +469,8 @@ static int GetHuffBitLengthsAndCodes( } buf_rle = (uint8_t*)WebPSafeMalloc(1ULL, max_num_symbols); - huff_tree = (HuffmanTree*)WebPSafeMalloc(3ULL * max_num_symbols, - sizeof(*huff_tree)); + huff_tree = + (HuffmanTree*)WebPSafeMalloc(3ULL * max_num_symbols, sizeof(*huff_tree)); if (buf_rle == NULL || huff_tree == NULL) goto End; // Create Huffman trees. @@ -500,7 +484,7 @@ static int GetHuffBitLengthsAndCodes( VP8LCreateHuffmanTree(histo->distance, 15, buf_rle, huff_tree, codes + 4); } ok = 1; - End: +End: WebPSafeFree(huff_tree); WebPSafeFree(buf_rle); if (!ok) { @@ -516,8 +500,7 @@ static void StoreHuffmanTreeOfHuffmanTreeToBitMask( // This sequence is tuned from that, but more weighted for lower symbol count, // and more spiking histograms. static const uint8_t kStorageOrder[CODE_LENGTH_CODES] = { - 17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 - }; + 17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; int i; // Throw away trailing zeros: int codes_to_store = CODE_LENGTH_CODES; @@ -549,9 +532,8 @@ static void ClearHuffmanTreeIfOnlyOneSymbol( } static void StoreHuffmanTreeToBitMask( - VP8LBitWriter* const bw, - const HuffmanTreeToken* const tokens, const int num_tokens, - const HuffmanTreeCode* const huffman_code) { + VP8LBitWriter* const bw, const HuffmanTreeToken* const tokens, + const int num_tokens, const HuffmanTreeCode* const huffman_code) { int i; for (i = 0; i < num_tokens; ++i) { const int ix = tokens[i].code; @@ -576,8 +558,8 @@ static void StoreFullHuffmanCode(VP8LBitWriter* const bw, HuffmanTree* const huff_tree, HuffmanTreeToken* const tokens, const HuffmanTreeCode* const tree) { - uint8_t code_length_bitdepth[CODE_LENGTH_CODES] = { 0 }; - uint16_t code_length_bitdepth_symbols[CODE_LENGTH_CODES] = { 0 }; + uint8_t code_length_bitdepth[CODE_LENGTH_CODES] = {0}; + uint16_t code_length_bitdepth_symbols[CODE_LENGTH_CODES] = {0}; const int max_tokens = tree->num_symbols; int num_tokens; HuffmanTreeCode huffman_code; @@ -588,8 +570,8 @@ static void StoreFullHuffmanCode(VP8LBitWriter* const bw, VP8LPutBits(bw, 0, 1); num_tokens = VP8LCreateCompressedHuffmanTree(tree, tokens, max_tokens); { - uint32_t histogram[CODE_LENGTH_CODES] = { 0 }; - uint8_t buf_rle[CODE_LENGTH_CODES] = { 0 }; + uint32_t histogram[CODE_LENGTH_CODES] = {0}; + uint8_t buf_rle[CODE_LENGTH_CODES] = {0}; int i; for (i = 0; i < num_tokens; ++i) { ++histogram[tokens[i].code]; @@ -609,7 +591,7 @@ static void StoreFullHuffmanCode(VP8LBitWriter* const bw, while (i-- > 0) { const int ix = tokens[i].code; if (ix == 0 || ix == 17 || ix == 18) { - --trimmed_length; // discount trailing zeros + --trimmed_length; // discount trailing zeros trailing_zero_bits += code_length_bitdepth[ix]; if (ix == 17) { trailing_zero_bits += 3; @@ -625,7 +607,7 @@ static void StoreFullHuffmanCode(VP8LBitWriter* const bw, VP8LPutBits(bw, write_trimmed_length, 1); if (write_trimmed_length) { if (trimmed_length == 2) { - VP8LPutBits(bw, 0, 3 + 2); // nbitpairs=1, trimmed_length=2 + VP8LPutBits(bw, 0, 3 + 2); // nbitpairs=1, trimmed_length=2 } else { const int nbits = BitsLog2Floor(trimmed_length - 2); const int nbitpairs = nbits / 2 + 1; @@ -646,7 +628,7 @@ static void StoreHuffmanCode(VP8LBitWriter* const bw, const HuffmanTreeCode* const huffman_code) { int i; int count = 0; - int symbols[2] = { 0, 0 }; + int symbols[2] = {0, 0}; const int kMaxBits = 8; const int kMaxSymbol = 1 << kMaxBits; @@ -658,7 +640,7 @@ static void StoreHuffmanCode(VP8LBitWriter* const bw, } } - if (count == 0) { // emit minimal tree for empty cases + if (count == 0) { // emit minimal tree for empty cases // bits: small tree marker: 1, count-1: 0, large 8-bit code: 0, code: 0 VP8LPutBits(bw, 0x01, 4); } else if (count <= 2 && symbols[0] < kMaxSymbol && symbols[1] < kMaxSymbol) { @@ -680,19 +662,16 @@ static void StoreHuffmanCode(VP8LBitWriter* const bw, } static WEBP_INLINE void WriteHuffmanCode(VP8LBitWriter* const bw, - const HuffmanTreeCode* const code, - int code_index) { + const HuffmanTreeCode* const code, + int code_index) { const int depth = code->code_lengths[code_index]; const int symbol = code->codes[code_index]; VP8LPutBits(bw, symbol, depth); } static WEBP_INLINE void WriteHuffmanCodeWithExtraBits( - VP8LBitWriter* const bw, - const HuffmanTreeCode* const code, - int code_index, - int bits, - int n_bits) { + VP8LBitWriter* const bw, const HuffmanTreeCode* const code, int code_index, + int bits, int n_bits) { const int depth = code->code_lengths[code_index]; const int symbol = code->codes[code_index]; VP8LPutBits(bw, (bits << depth) | symbol, depth + n_bits); @@ -726,7 +705,7 @@ static int StoreImageToBitMask(VP8LBitWriter* const bw, int width, codes = huffman_codes + 5 * histogram_ix; } if (PixOrCopyIsLiteral(v)) { - static const uint8_t order[] = { 1, 2, 0, 3 }; + static const uint8_t order[] = {1, 2, 0, 3}; int k; for (k = 0; k < 4; ++k) { const int code = PixOrCopyLiteral(v, order[k]); @@ -850,7 +829,7 @@ static int EncodeImageNoHuffman(VP8LBitWriter* const bw, goto Error; } - Error: +Error: WebPSafeFree(tokens); WebPSafeFree(huff_tree); VP8LFreeHistogramSet(histogram_image); @@ -906,8 +885,8 @@ static int EncodeImageInternal( } percent_range = remaining_percent / 5; - if (!VP8LHashChainFill(hash_chain, quality, argb, width, height, - low_effort, pic, percent_range, percent)) { + if (!VP8LHashChainFill(hash_chain, quality, argb, width, height, low_effort, + pic, percent_range, percent)) { goto Error; } percent_start += percent_range; @@ -1072,7 +1051,7 @@ static int EncodeImageInternal( goto Error; } - Error: +Error: WebPSafeFree(tokens); WebPSafeFree(huff_tree); VP8LFreeHistogramSet(histogram_image); @@ -1157,8 +1136,9 @@ static int ApplyCrossColorFilter(VP8LEncoder* const enc, int width, int height, static int WriteRiffHeader(const WebPPicture* const pic, size_t riff_size, size_t vp8l_size) { uint8_t riff[RIFF_HEADER_SIZE + CHUNK_HEADER_SIZE + VP8L_SIGNATURE_SIZE] = { - 'R', 'I', 'F', 'F', 0, 0, 0, 0, 'W', 'E', 'B', 'P', - 'V', 'P', '8', 'L', 0, 0, 0, 0, VP8L_MAGIC_BYTE, + 'R', 'I', 'F', 'F', 0, 0, 0, + 0, 'W', 'E', 'B', 'P', 'V', 'P', + '8', 'L', 0, 0, 0, 0, VP8L_MAGIC_BYTE, }; PutLE32(riff + TAG_SIZE, (uint32_t)riff_size); PutLE32(riff + RIFF_HEADER_SIZE + TAG_SIZE, (uint32_t)vp8l_size); @@ -1201,7 +1181,7 @@ static int WriteImage(const WebPPicture* const pic, VP8LBitWriter* const bw, } if (pad) { - const uint8_t pad_byte[1] = { 0 }; + const uint8_t pad_byte[1] = {0}; if (!pic->writer(pad_byte, 1, pic)) { return WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_WRITE); } @@ -1232,7 +1212,7 @@ static int AllocateTransformBuffer(VP8LEncoder* const enc, int width, const uint64_t argb_scratch_size = enc->use_predict ? (width + 1) * 2 + (width * 2 + sizeof(uint32_t) - 1) / sizeof(uint32_t) - : 0; + : 0; const uint64_t transform_data_size = (enc->use_predict || enc->use_cross_color) ? (uint64_t)VP8LSubSampleSize(width, MIN_TRANSFORM_BITS) * @@ -1324,23 +1304,24 @@ static WEBP_INLINE uint32_t ApplyPaletteHash2(uint32_t color) { } // Use 1 pixel cache for ARGB pixels. -#define APPLY_PALETTE_FOR(COLOR_INDEX) do { \ - uint32_t prev_pix = palette[0]; \ - uint32_t prev_idx = 0; \ - for (y = 0; y < height; ++y) { \ - for (x = 0; x < width; ++x) { \ - const uint32_t pix = src[x]; \ - if (pix != prev_pix) { \ - prev_idx = COLOR_INDEX; \ - prev_pix = pix; \ - } \ - tmp_row[x] = prev_idx; \ - } \ - VP8LBundleColorMap(tmp_row, width, xbits, dst); \ - src += src_stride; \ - dst += dst_stride; \ - } \ -} while (0) +#define APPLY_PALETTE_FOR(COLOR_INDEX) \ + do { \ + uint32_t prev_pix = palette[0]; \ + uint32_t prev_idx = 0; \ + for (y = 0; y < height; ++y) { \ + for (x = 0; x < width; ++x) { \ + const uint32_t pix = src[x]; \ + if (pix != prev_pix) { \ + prev_idx = COLOR_INDEX; \ + prev_pix = pix; \ + } \ + tmp_row[x] = prev_idx; \ + } \ + VP8LBundleColorMap(tmp_row, width, xbits, dst); \ + src += src_stride; \ + dst += dst_stride; \ + } \ + } while (0) // Remap argb values in src[] to packed palettes entries in dst[] // using 'row' as a temporary buffer of size 'width'. @@ -1365,8 +1346,7 @@ static int ApplyPalette(const uint32_t* src, uint32_t src_stride, uint32_t* dst, int i, j; uint16_t buffer[PALETTE_INV_SIZE]; uint32_t (*const hash_functions[])(uint32_t) = { - ApplyPaletteHash0, ApplyPaletteHash1, ApplyPaletteHash2 - }; + ApplyPaletteHash0, ApplyPaletteHash1, ApplyPaletteHash2}; // Try to find a perfect hash function able to go from a color to an index // within 1 << PALETTE_INV_SIZE_BITS in order to build a hash map to go @@ -1429,9 +1409,8 @@ static int MapImageFromPalette(VP8LEncoder* const enc) { if (!AllocateTransformBuffer(enc, VP8LSubSampleSize(width, xbits), height)) { return 0; } - if (!ApplyPalette(pic->argb, pic->argb_stride, enc->argb, - enc->current_width, palette, palette_size, width, height, - xbits, pic)) { + if (!ApplyPalette(pic->argb, pic->argb_stride, enc->argb, enc->current_width, + palette, palette_size, width, height, xbits, pic)) { return 0; } enc->argb_content = kEncoderPalette; @@ -1461,9 +1440,9 @@ static int EncodePalette(VP8LBitWriter* const bw, int low_effort, tmp_palette[i] = VP8LSubPixels(palette[i], palette[i - 1]); } tmp_palette[0] = palette[0]; - return EncodeImageNoHuffman( - bw, tmp_palette, &enc->hash_chain, &enc->refs[0], encoded_palette_size, - 1, /*quality=*/20, low_effort, enc->pic, percent_range, percent); + return EncodeImageNoHuffman(bw, tmp_palette, &enc->hash_chain, &enc->refs[0], + encoded_palette_size, 1, /*quality=*/20, + low_effort, enc->pic, percent_range, percent); } // ----------------------------------------------------------------------------- @@ -1569,8 +1548,8 @@ static int EncodeStreamHook(void* input, void* data2) { #if (WEBP_NEAR_LOSSLESS == 1) // Apply near-lossless preprocessing. - use_near_lossless = (config->near_lossless < 100) && !enc->use_palette && - !enc->use_predict; + use_near_lossless = + (config->near_lossless < 100) && !enc->use_palette && !enc->use_predict; if (use_near_lossless) { if (!AllocateTransformBuffer(enc, width, height)) goto Error; if ((enc->argb_content != kEncoderNearLossless) && @@ -1589,8 +1568,7 @@ static int EncodeStreamHook(void* input, void* data2) { // Encode palette if (enc->use_palette) { if (!PaletteSort(crunch_configs[idx].palette_sorting_type, enc->pic, - enc->palette_sorted, enc->palette_size, - enc->palette)) { + enc->palette_sorted, enc->palette_size, enc->palette)) { WebPEncodingSetError(enc->pic, VP8_ENC_ERROR_OUT_OF_MEMORY); goto Error; } @@ -1646,9 +1624,9 @@ static int EncodeStreamHook(void* input, void* data2) { // Encode and write the transformed image. if (!EncodeImageInternal( bw, enc->argb, &enc->hash_chain, enc->refs, enc->current_width, - height, quality, low_effort, &crunch_configs[idx], - &enc->cache_bits, enc->histo_bits, byte_position, &hdr_size, - &data_size, picture, remaining_percent, &percent)) { + height, quality, low_effort, &crunch_configs[idx], &enc->cache_bits, + enc->histo_bits, byte_position, &hdr_size, &data_size, picture, + remaining_percent, &percent)) { goto Error; } @@ -1681,7 +1659,7 @@ static int EncodeStreamHook(void* input, void* data2) { } VP8LBitWriterSwap(&bw_best, bw); - Error: +Error: VP8LBitWriterWipeOut(&bw_best); // The hook should return false in case of error. return (params->picture->error_code == VP8_ENC_OK); @@ -1777,13 +1755,11 @@ int VP8LEncodeStream(const WebPConfig* const config, } // Copy the values that were computed for the main encoder. enc_side->histo_bits = enc_main->histo_bits; - enc_side->predictor_transform_bits = - enc_main->predictor_transform_bits; + enc_side->predictor_transform_bits = enc_main->predictor_transform_bits; enc_side->cross_color_transform_bits = enc_main->cross_color_transform_bits; enc_side->palette_size = enc_main->palette_size; - memcpy(enc_side->palette, enc_main->palette, - sizeof(enc_main->palette)); + memcpy(enc_side->palette, enc_main->palette, sizeof(enc_main->palette)); memcpy(enc_side->palette_sorted, enc_main->palette_sorted, sizeof(enc_main->palette_sorted)); param->enc = enc_side; @@ -1836,7 +1812,7 @@ int VP8LEncodeStream(const WebPConfig* const config, } } - Error: +Error: VP8LBitWriterWipeOut(&bw_side); VP8LEncoderDelete(enc_main); VP8LEncoderDelete(enc_side); @@ -1865,15 +1841,15 @@ int VP8LEncodeImage(const WebPConfig* const config, height = picture->height; // Initialize BitWriter with size corresponding to 16 bpp to photo images and // 8 bpp for graphical images. - initial_size = (config->image_hint == WEBP_HINT_GRAPH) ? - width * height : width * height * 2; + initial_size = (config->image_hint == WEBP_HINT_GRAPH) ? width * height + : width * height * 2; if (!VP8LBitWriterInit(&bw, initial_size)) { WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY); goto Error; } if (!WebPReportProgress(picture, 1, &percent)) { - UserAbort: + UserAbort: WebPEncodingSetError(picture, VP8_ENC_ERROR_USER_ABORT); goto Error; } @@ -1927,7 +1903,7 @@ int VP8LEncodeImage(const WebPConfig* const config, memset(picture->extra_info, 0, mb_w * mb_h * sizeof(*picture->extra_info)); } - Error: +Error: if (bw.error) { WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY); } diff --git a/src/enc/vp8li_enc.h b/src/enc/vp8li_enc.h index 9193fe01..57c80e07 100644 --- a/src/enc/vp8li_enc.h +++ b/src/enc/vp8li_enc.h @@ -26,12 +26,12 @@ #define WEBP_NEAR_LOSSLESS 1 #endif -#include "src/webp/types.h" #include "src/enc/backward_references_enc.h" #include "src/enc/histogram_enc.h" #include "src/utils/bit_writer_utils.h" #include "src/webp/encode.h" #include "src/webp/format_constants.h" +#include "src/webp/types.h" #ifdef __cplusplus extern "C" { @@ -48,8 +48,8 @@ typedef enum { } VP8LEncoderARGBContent; typedef struct { - const WebPConfig* config; // user configuration and parameters - const WebPPicture* pic; // input picture. + const WebPConfig* config; // user configuration and parameters + const WebPPicture* pic; // input picture. uint32_t* argb; // Transformed argb image data. VP8LEncoderARGBContent argb_content; // Content type of the argb buffer. @@ -57,15 +57,15 @@ typedef struct { // (used for prediction). uint32_t* transform_data; // Scratch memory for transform data. uint32_t* transform_mem; // Currently allocated memory. - size_t transform_mem_size; // Currently allocated memory size. + size_t transform_mem_size; // Currently allocated memory size. - int current_width; // Corresponds to packed image width. + int current_width; // Corresponds to packed image width. // Encoding parameters derived from quality parameter. int histo_bits; int predictor_transform_bits; // <= MAX_TRANSFORM_BITS int cross_color_transform_bits; // <= MAX_TRANSFORM_BITS - int cache_bits; // If equal to 0, don't use color cache. + int cache_bits; // If equal to 0, don't use color cache. // Encoding parameters derived from image characteristics. int use_cross_color; @@ -128,7 +128,7 @@ void VP8LOptimizeSampling(uint32_t* const image, int full_width, //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_ENC_VP8LI_ENC_H_ diff --git a/src/enc/webp_enc.c b/src/enc/webp_enc.c index 1e7ee67c..e4a74612 100644 --- a/src/enc/webp_enc.c +++ b/src/enc/webp_enc.c @@ -17,13 +17,13 @@ #include #include "src/dec/common_dec.h" -#include "src/webp/types.h" #include "src/dsp/dsp.h" #include "src/enc/cost_enc.h" #include "src/enc/vp8i_enc.h" #include "src/enc/vp8li_enc.h" #include "src/utils/utils.h" #include "src/webp/encode.h" +#include "src/webp/types.h" // #define PRINT_MEMORY_INFO @@ -44,7 +44,7 @@ int WebPGetEncoderVersion(void) { static void ResetSegmentHeader(VP8Encoder* const enc) { VP8EncSegmentHeader* const hdr = &enc->segment_hdr; hdr->num_segments = enc->config->segments; - hdr->update_map = (hdr->num_segments > 1); + hdr->update_map = (hdr->num_segments > 1); hdr->size = 0; } @@ -68,7 +68,7 @@ static void ResetBoundaryPredictions(VP8Encoder* const enc) { for (i = 0; i < 4 * enc->mb_h; ++i) { left[i * enc->preds_w] = B_DC_PRED; } - enc->nz[-1] = 0; // constant + enc->nz[-1] = 0; // constant } // Mapping from config->method to coding tools used. @@ -101,10 +101,10 @@ static void MapConfigToTools(VP8Encoder* const enc) { const int method = config->method; const int limit = 100 - config->partition_limit; enc->method = method; - enc->rd_opt_level = (method >= 6) ? RD_OPT_TRELLIS_ALL - : (method >= 5) ? RD_OPT_TRELLIS - : (method >= 3) ? RD_OPT_BASIC - : RD_OPT_NONE; + enc->rd_opt_level = (method >= 6) ? RD_OPT_TRELLIS_ALL + : (method >= 5) ? RD_OPT_TRELLIS + : (method >= 3) ? RD_OPT_BASIC + : RD_OPT_NONE; enc->max_i4_header_bits = 256 * 16 * 16 * // upper bound: up to 16bit per 4x4 block (limit * limit) / (100 * 100); // ... modulated with a quadratic curve. @@ -121,7 +121,7 @@ static void MapConfigToTools(VP8Encoder* const enc) { enc->use_tokens = (enc->rd_opt_level >= RD_OPT_BASIC); // need rd stats #endif if (enc->use_tokens) { - enc->num_parts = 1; // doesn't work with multi-partition + enc->num_parts = 1; // doesn't work with multi-partition } } } @@ -159,47 +159,48 @@ static VP8Encoder* InitVP8Encoder(const WebPConfig* const config, const size_t nz_size = (mb_w + 1) * sizeof(*enc->nz) + WEBP_ALIGN_CST; const size_t info_size = mb_w * mb_h * sizeof(*enc->mb_info); const size_t samples_size = - 2 * top_stride * sizeof(*enc->y_top) // top-luma/u/v - + WEBP_ALIGN_CST; // align all + 2 * top_stride * sizeof(*enc->y_top) // top-luma/u/v + + WEBP_ALIGN_CST; // align all const size_t lf_stats_size = config->autofilter ? sizeof(*enc->lf_stats) + WEBP_ALIGN_CST : 0; const size_t top_derr_size = - (config->quality <= ERROR_DIFFUSION_QUALITY || config->pass > 1) ? - mb_w * sizeof(*enc->top_derr) : 0; + (config->quality <= ERROR_DIFFUSION_QUALITY || config->pass > 1) + ? mb_w * sizeof(*enc->top_derr) + : 0; uint8_t* mem; - const uint64_t size = (uint64_t)sizeof(*enc) // main struct - + WEBP_ALIGN_CST // cache alignment - + info_size // modes info - + preds_size // prediction modes - + samples_size // top/left samples - + top_derr_size // top diffusion error - + nz_size // coeff context bits - + lf_stats_size; // autofilter stats + const uint64_t size = (uint64_t)sizeof(*enc) // main struct + + WEBP_ALIGN_CST // cache alignment + + info_size // modes info + + preds_size // prediction modes + + samples_size // top/left samples + + top_derr_size // top diffusion error + + nz_size // coeff context bits + + lf_stats_size; // autofilter stats #ifdef PRINT_MEMORY_INFO printf("===================================\n"); - printf("Memory used:\n" - " encoder: %ld\n" - " info: %ld\n" - " preds: %ld\n" - " top samples: %ld\n" - " top diffusion: %ld\n" - " non-zero: %ld\n" - " lf-stats: %ld\n" - " total: %ld\n", - sizeof(*enc) + WEBP_ALIGN_CST, info_size, - preds_size, samples_size, top_derr_size, nz_size, lf_stats_size, size); - printf("Transient object sizes:\n" - " VP8EncIterator: %ld\n" - " VP8ModeScore: %ld\n" - " VP8SegmentInfo: %ld\n" - " VP8EncProba: %ld\n" - " LFStats: %ld\n", - sizeof(VP8EncIterator), sizeof(VP8ModeScore), - sizeof(VP8SegmentInfo), sizeof(VP8EncProba), - sizeof(LFStats)); - printf("Picture size (yuv): %ld\n", - mb_w * mb_h * 384 * sizeof(uint8_t)); + printf( + "Memory used:\n" + " encoder: %ld\n" + " info: %ld\n" + " preds: %ld\n" + " top samples: %ld\n" + " top diffusion: %ld\n" + " non-zero: %ld\n" + " lf-stats: %ld\n" + " total: %ld\n", + sizeof(*enc) + WEBP_ALIGN_CST, info_size, preds_size, samples_size, + top_derr_size, nz_size, lf_stats_size, size); + printf( + "Transient object sizes:\n" + " VP8EncIterator: %ld\n" + " VP8ModeScore: %ld\n" + " VP8SegmentInfo: %ld\n" + " VP8EncProba: %ld\n" + " LFStats: %ld\n", + sizeof(VP8EncIterator), sizeof(VP8ModeScore), sizeof(VP8SegmentInfo), + sizeof(VP8EncProba), sizeof(LFStats)); + printf("Picture size (yuv): %ld\n", mb_w * mb_h * 384 * sizeof(uint8_t)); printf("===================================\n"); #endif mem = (uint8_t*)WebPSafeMalloc(size, sizeof(*mem)); @@ -302,7 +303,7 @@ static void StoreStats(VP8Encoder* const enc) { stats->block_count[i] = enc->block_count[i]; } } -#else // defined(WEBP_DISABLE_STATS) +#else // defined(WEBP_DISABLE_STATS) WebPReportProgress(enc->pic, 100, &enc->percent); // done! #endif // !defined(WEBP_DISABLE_STATS) } @@ -318,8 +319,8 @@ int WebPEncodingSetError(const WebPPicture* const pic, return 0; } -int WebPReportProgress(const WebPPicture* const pic, - int percent, int* const percent_store) { +int WebPReportProgress(const WebPPicture* const pic, int percent, + int* const percent_store) { if (percent_store != NULL && percent != *percent_store) { *percent_store = percent; if (pic->progress_hook && !pic->progress_hook(percent, pic)) { @@ -336,7 +337,7 @@ int WebPEncode(const WebPConfig* config, WebPPicture* pic) { if (pic == NULL) return 0; pic->error_code = VP8_ENC_OK; // all ok so far - if (config == NULL) { // bad params + if (config == NULL) { // bad params return WebPEncodingSetError(pic, VP8_ENC_ERROR_NULL_PARAMETER); } if (!WebPValidateConfig(config)) { @@ -383,7 +384,7 @@ int WebPEncode(const WebPConfig* config, WebPPicture* pic) { ok = VP8EncAnalyze(enc); // Analysis is done, proceed to actual coding. - ok = ok && VP8EncStartAlpha(enc); // possibly done in parallel + ok = ok && VP8EncStartAlpha(enc); // possibly done in parallel if (!enc->use_tokens) { ok = ok && VP8EncLoop(enc); } else { diff --git a/src/mux/anim_encode.c b/src/mux/anim_encode.c index 8d1f246f..facd6937 100644 --- a/src/mux/anim_encode.c +++ b/src/mux/anim_encode.c @@ -12,7 +12,7 @@ #include #include -#include // for pow() +#include // for pow() #include #include // for abs() #include @@ -49,65 +49,65 @@ typedef struct { } EncodedFrame; struct WebPAnimEncoder { - const int canvas_width; // Canvas width. - const int canvas_height; // Canvas height. - const WebPAnimEncoderOptions options; // Global encoding options. + const int canvas_width; // Canvas width. + const int canvas_height; // Canvas height. + const WebPAnimEncoderOptions options; // Global encoding options. - FrameRectangle prev_rect; // Previous WebP frame rectangle. - WebPConfig last_config; // Cached in case a re-encode is needed. - WebPConfig last_config_reversed; // If 'last_config' uses lossless, then - // this config uses lossy and vice versa; - // only valid if 'options.allow_mixed' - // is true. + FrameRectangle prev_rect; // Previous WebP frame rectangle. + WebPConfig last_config; // Cached in case a re-encode is needed. + WebPConfig last_config_reversed; // If 'last_config' uses lossless, then + // this config uses lossy and vice versa; + // only valid if 'options.allow_mixed' + // is true. - WebPPicture* curr_canvas; // Only pointer; we don't own memory. + WebPPicture* curr_canvas; // Only pointer; we don't own memory. // Canvas buffers. - WebPPicture curr_canvas_copy; // Possibly modified current canvas. - int curr_canvas_copy_modified; // True if pixels in 'curr_canvas_copy' - // differ from those in 'curr_canvas'. + WebPPicture curr_canvas_copy; // Possibly modified current canvas. + int curr_canvas_copy_modified; // True if pixels in 'curr_canvas_copy' + // differ from those in 'curr_canvas'. - WebPPicture prev_canvas; // Previous canvas. - WebPPicture prev_canvas_disposed; // Previous canvas disposed to background. + WebPPicture prev_canvas; // Previous canvas. + WebPPicture prev_canvas_disposed; // Previous canvas disposed to background. // Encoded data. - EncodedFrame* encoded_frames; // Array of encoded frames. - size_t size; // Number of allocated frames. - size_t start; // Frame start index. - size_t count; // Number of valid frames. - size_t flush_count; // If >0, 'flush_count' frames starting from - // 'start' are ready to be added to mux. + EncodedFrame* encoded_frames; // Array of encoded frames. + size_t size; // Number of allocated frames. + size_t start; // Frame start index. + size_t count; // Number of valid frames. + size_t flush_count; // If >0, 'flush_count' frames starting from + // 'start' are ready to be added to mux. // key-frame related. - int64_t best_delta; // min(canvas size - frame size) over the frames. - // Can be negative in certain cases due to - // transparent pixels in a frame. - int keyframe; // Index of selected key-frame relative to 'start'. - int count_since_key_frame; // Frames seen since the last key-frame. + int64_t best_delta; // min(canvas size - frame size) over the frames. + // Can be negative in certain cases due to + // transparent pixels in a frame. + int keyframe; // Index of selected key-frame relative to 'start'. + int count_since_key_frame; // Frames seen since the last key-frame. - int first_timestamp; // Timestamp of the first frame. - int prev_timestamp; // Timestamp of the last added frame. - int prev_candidate_undecided; // True if it's not yet decided if previous - // frame would be a sub-frame or a key-frame. + int first_timestamp; // Timestamp of the first frame. + int prev_timestamp; // Timestamp of the last added frame. + int prev_candidate_undecided; // True if it's not yet decided if previous + // frame would be a sub-frame or a key-frame. // Misc. - int is_first_frame; // True if first frame is yet to be added/being added. - int got_null_frame; // True if WebPAnimEncoderAdd() has already been called - // with a NULL frame. + int is_first_frame; // True if first frame is yet to be added/being added. + int got_null_frame; // True if WebPAnimEncoderAdd() has already been called + // with a NULL frame. size_t in_frame_count; // Number of input frames processed so far. size_t out_frame_count; // Number of frames added to mux so far. This may be // different from 'in_frame_count' due to merging. - WebPMux* mux; // Muxer to assemble the WebP bitstream. + WebPMux* mux; // Muxer to assemble the WebP bitstream. char error_str[ERROR_STR_MAX_LENGTH]; // Error string. Empty if no error. }; // ----------------------------------------------------------------------------- // Life of WebPAnimEncoder object. -#define DELTA_INFINITY (1ULL << 32) -#define KEYFRAME_NONE (-1) +#define DELTA_INFINITY (1ULL << 32) +#define KEYFRAME_NONE (-1) // Reset the counters in the WebPAnimEncoder. static void ResetCounters(WebPAnimEncoder* const enc) { @@ -195,10 +195,10 @@ int WebPAnimEncoderOptionsInitInternal(WebPAnimEncoderOptions* enc_options, // This value is used to match a later call to WebPReplaceTransparentPixels(), // making it a no-op for lossless (see WebPEncode()). -#define TRANSPARENT_COLOR 0x00000000 +#define TRANSPARENT_COLOR 0x00000000 -static void ClearRectangle(WebPPicture* const picture, - int left, int top, int width, int height) { +static void ClearRectangle(WebPPicture* const picture, int left, int top, + int width, int height) { int j; for (j = top; j < top + height; ++j) { uint32_t* const dst = picture->argb + j * picture->argb_stride; @@ -212,8 +212,8 @@ static void ClearRectangle(WebPPicture* const picture, static void WebPUtilClearPic(WebPPicture* const picture, const FrameRectangle* const rect) { if (rect != NULL) { - ClearRectangle(picture, rect->x_offset, rect->y_offset, - rect->width, rect->height); + ClearRectangle(picture, rect->x_offset, rect->y_offset, rect->width, + rect->height); } else { ClearRectangle(picture, 0, 0, picture->width, picture->height); } @@ -229,8 +229,8 @@ static void MarkError(WebPAnimEncoder* const enc, const char* str) { } } -static void MarkError2(WebPAnimEncoder* const enc, - const char* str, int error_code) { +static void MarkError2(WebPAnimEncoder* const enc, const char* str, + int error_code) { if (snprintf(enc->error_str, ERROR_STR_MAX_LENGTH, "%s: %d.", str, error_code) < 0) { assert(0); // FIX ME! @@ -304,7 +304,7 @@ WebPAnimEncoder* WebPAnimEncoderNewInternal( return enc; // All OK. - Err: +Err: WebPAnimEncoderDelete(enc); return NULL; } @@ -414,8 +414,8 @@ static int QualityToMaxDiff(float quality) { // Assumes that an initial valid guess of change rectangle 'rect' is passed. static void MinimizeChangeRectangle(const WebPPicture* const src, const WebPPicture* const dst, - FrameRectangle* const rect, - int is_lossless, float quality) { + FrameRectangle* const rect, int is_lossless, + float quality) { int i, j; const ComparePixelsFunc compare_pixels = is_lossless ? ComparePixelsLossless : ComparePixelsLossy; @@ -490,7 +490,7 @@ static void MinimizeChangeRectangle(const WebPPicture* const src, if (rect->height == 0) goto NoChange; if (IsEmptyRect(rect)) { - NoChange: + NoChange: rect->x_offset = 0; rect->y_offset = 0; rect->width = 0; @@ -507,18 +507,18 @@ static WEBP_INLINE void SnapToEvenOffsets(FrameRectangle* const rect) { } typedef struct { - int should_try; // Should try this set of parameters. - int empty_rect_allowed; // Frame with empty rectangle can be skipped. - FrameRectangle rect_ll; // Frame rectangle for lossless compression. - WebPPicture sub_frame_ll; // Sub-frame pic for lossless compression. - FrameRectangle rect_lossy; // Frame rectangle for lossy compression. - // Could be smaller than 'rect_ll' as pixels - // with small diffs can be ignored. - WebPPicture sub_frame_lossy; // Sub-frame pic for lossy compression. + int should_try; // Should try this set of parameters. + int empty_rect_allowed; // Frame with empty rectangle can be skipped. + FrameRectangle rect_ll; // Frame rectangle for lossless compression. + WebPPicture sub_frame_ll; // Sub-frame pic for lossless compression. + FrameRectangle rect_lossy; // Frame rectangle for lossy compression. + // Could be smaller than 'rect_ll' as pixels + // with small diffs can be ignored. + WebPPicture sub_frame_lossy; // Sub-frame pic for lossy compression. } SubFrameParams; -static int SubFrameParamsInit(SubFrameParams* const params, - int should_try, int empty_rect_allowed) { +static int SubFrameParamsInit(SubFrameParams* const params, int should_try, + int empty_rect_allowed) { params->should_try = should_try; params->empty_rect_allowed = empty_rect_allowed; if (!WebPPictureInit(¶ms->sub_frame_ll) || @@ -545,14 +545,14 @@ static int GetSubRect(const WebPPicture* const prev_canvas, if (!is_key_frame || is_first_frame) { // Optimize frame rectangle. // Note: This behaves as expected for first frame, as 'prev_canvas' is // initialized to a fully transparent canvas in the beginning. - MinimizeChangeRectangle(prev_canvas, curr_canvas, rect, - is_lossless, quality); + MinimizeChangeRectangle(prev_canvas, curr_canvas, rect, is_lossless, + quality); } if (IsEmptyRect(rect)) { if (empty_rect_allowed) { // No need to get 'sub_frame'. return 1; - } else { // Force a 1x1 rectangle. + } else { // Force a 1x1 rectangle. rect->width = 1; rect->height = 1; assert(rect->x_offset == 0); @@ -577,31 +577,32 @@ static int GetSubRects(const WebPPicture* const prev_canvas, params->rect_ll.width = curr_canvas->width; params->rect_ll.height = curr_canvas->height; if (!GetSubRect(prev_canvas, curr_canvas, is_key_frame, is_first_frame, - params->empty_rect_allowed, 1, quality, - ¶ms->rect_ll, ¶ms->sub_frame_ll)) { + params->empty_rect_allowed, 1, quality, ¶ms->rect_ll, + ¶ms->sub_frame_ll)) { return 0; } // Lossy frame rectangle. params->rect_lossy = params->rect_ll; // seed with lossless rect. return GetSubRect(prev_canvas, curr_canvas, is_key_frame, is_first_frame, - params->empty_rect_allowed, 0, quality, - ¶ms->rect_lossy, ¶ms->sub_frame_lossy); + params->empty_rect_allowed, 0, quality, ¶ms->rect_lossy, + ¶ms->sub_frame_lossy); } static WEBP_INLINE int clip(int v, int min_v, int max_v) { return (v < min_v) ? min_v : (v > max_v) ? max_v : v; } -int WebPAnimEncoderRefineRect( - const WebPPicture* const prev_canvas, const WebPPicture* const curr_canvas, - int is_lossless, float quality, int* const x_offset, int* const y_offset, - int* const width, int* const height) { +int WebPAnimEncoderRefineRect(const WebPPicture* const prev_canvas, + const WebPPicture* const curr_canvas, + int is_lossless, float quality, + int* const x_offset, int* const y_offset, + int* const width, int* const height) { FrameRectangle rect; int right, left, bottom, top; if (prev_canvas == NULL || curr_canvas == NULL || prev_canvas->width != curr_canvas->width || - prev_canvas->height != curr_canvas->height || - !prev_canvas->use_argb || !curr_canvas->use_argb) { + prev_canvas->height != curr_canvas->height || !prev_canvas->use_argb || + !curr_canvas->use_argb) { return 0; } right = clip(*x_offset + *width, 0, curr_canvas->width); @@ -750,10 +751,8 @@ static int FlattenSimilarBlocks(const WebPPicture* const src, // If we have a fully similar block, we replace it with an // average transparent block. This compresses better in lossy mode. if (cnt == block_size * block_size) { - const uint32_t color = (0x00 << 24) | - ((avg_r / cnt) << 16) | - ((avg_g / cnt) << 8) | - ((avg_b / cnt) << 0); + const uint32_t color = (0x00 << 24) | ((avg_r / cnt) << 16) | + ((avg_g / cnt) << 8) | ((avg_b / cnt) << 0); for (y = 0; y < block_size; ++y) { for (x = 0; x < block_size; ++x) { pdst[x + y * dst->argb_stride] = color; @@ -779,10 +778,10 @@ static int EncodeFrame(const WebPConfig* const config, WebPPicture* const pic, // Struct representing a candidate encoded frame including its metadata. typedef struct { - WebPMemoryWriter mem; - WebPMuxFrameInfo info; - FrameRectangle rect; - int evaluate; // True if this candidate should be evaluated. + WebPMemoryWriter mem; + WebPMuxFrameInfo info; + FrameRectangle rect; + int evaluate; // True if this candidate should be evaluated. } Candidate; // Generates a candidate encoded frame given a picture and metadata. @@ -823,7 +822,7 @@ static WebPEncodingError EncodeCandidate(WebPPicture* const sub_frame, candidate->evaluate = 1; return error_code; - Err: +Err: WebPMemoryWriterClear(&candidate->mem); return error_code; } @@ -845,13 +844,13 @@ enum { CANDIDATE_COUNT }; -#define MIN_COLORS_LOSSY 31 // Don't try lossy below this threshold. +#define MIN_COLORS_LOSSY 31 // Don't try lossy below this threshold. #define MAX_COLORS_LOSSLESS 194 // Don't try lossless above this threshold. static void GetEncodedData(const WebPMemoryWriter* const memory, WebPData* const encoded_data) { encoded_data->bytes = memory->mem; - encoded_data->size = memory->size; + encoded_data->size = memory->size; } // Sets dispose method of the previous frame to be 'dispose_method'. @@ -867,8 +866,8 @@ static void SetPreviousDisposeMethod(WebPAnimEncoder* const enc, prev_enc_frame->key_frame.dispose_method = dispose_method; } else { WebPMuxFrameInfo* const prev_info = prev_enc_frame->is_key_frame - ? &prev_enc_frame->key_frame - : &prev_enc_frame->sub_frame; + ? &prev_enc_frame->key_frame + : &prev_enc_frame->sub_frame; prev_info->dispose_method = dispose_method; } } @@ -915,16 +914,16 @@ static void PickBestCandidate(WebPAnimEncoder* const enc, static WebPEncodingError GenerateCandidates( WebPAnimEncoder* const enc, Candidate candidates[CANDIDATE_COUNT], WebPMuxAnimDispose dispose_method, int is_lossless, int is_key_frame, - SubFrameParams* const params, - const WebPConfig* const config_ll, const WebPConfig* const config_lossy, - Candidate** const best_candidate, EncodedFrame* const encoded_frame) { + SubFrameParams* const params, const WebPConfig* const config_ll, + const WebPConfig* const config_lossy, Candidate** const best_candidate, + EncodedFrame* const encoded_frame) { WebPEncodingError error_code = VP8_ENC_OK; const int is_dispose_none = (dispose_method == WEBP_MUX_DISPOSE_NONE); Candidate* const candidate_ll = is_dispose_none ? &candidates[LL_DISP_NONE] : &candidates[LL_DISP_BG]; Candidate* const candidate_lossy = is_dispose_none - ? &candidates[LOSSY_DISP_NONE] - : &candidates[LOSSY_DISP_BG]; + ? &candidates[LOSSY_DISP_NONE] + : &candidates[LOSSY_DISP_BG]; WebPPicture* const curr_canvas = &enc->curr_canvas_copy; const WebPPicture* const prev_canvas = is_dispose_none ? &enc->prev_canvas : &enc->prev_canvas_disposed; @@ -994,7 +993,7 @@ static int IncreasePreviousDuration(WebPAnimEncoder* const enc, int duration) { assert(enc->count >= 1); assert(!prev_enc_frame->is_key_frame || prev_enc_frame->sub_frame.duration == - prev_enc_frame->key_frame.duration); + prev_enc_frame->key_frame.duration); assert(prev_enc_frame->sub_frame.duration == (prev_enc_frame->sub_frame.duration & (MAX_DURATION - 1))); assert(duration == (duration & (MAX_DURATION - 1))); @@ -1003,24 +1002,21 @@ static int IncreasePreviousDuration(WebPAnimEncoder* const enc, int duration) { if (new_duration >= MAX_DURATION) { // Special case. // Separate out previous frame from earlier merged frames to avoid overflow. // We add a 1x1 transparent frame for the previous frame, with blending on. - const FrameRectangle rect = { 0, 0, 1, 1 }; + const FrameRectangle rect = {0, 0, 1, 1}; const uint8_t lossless_1x1_bytes[] = { - 0x52, 0x49, 0x46, 0x46, 0x14, 0x00, 0x00, 0x00, 0x57, 0x45, 0x42, 0x50, - 0x56, 0x50, 0x38, 0x4c, 0x08, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, - 0x10, 0x88, 0x88, 0x08 - }; - const WebPData lossless_1x1 = { - lossless_1x1_bytes, sizeof(lossless_1x1_bytes) - }; + 0x52, 0x49, 0x46, 0x46, 0x14, 0x00, 0x00, 0x00, 0x57, 0x45, + 0x42, 0x50, 0x56, 0x50, 0x38, 0x4c, 0x08, 0x00, 0x00, 0x00, + 0x2f, 0x00, 0x00, 0x00, 0x10, 0x88, 0x88, 0x08}; + const WebPData lossless_1x1 = {lossless_1x1_bytes, + sizeof(lossless_1x1_bytes)}; const uint8_t lossy_1x1_bytes[] = { - 0x52, 0x49, 0x46, 0x46, 0x40, 0x00, 0x00, 0x00, 0x57, 0x45, 0x42, 0x50, - 0x56, 0x50, 0x38, 0x58, 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x4c, 0x50, 0x48, 0x02, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x56, 0x50, 0x38, 0x20, 0x18, 0x00, 0x00, 0x00, - 0x30, 0x01, 0x00, 0x9d, 0x01, 0x2a, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, - 0x34, 0x25, 0xa4, 0x00, 0x03, 0x70, 0x00, 0xfe, 0xfb, 0xfd, 0x50, 0x00 - }; - const WebPData lossy_1x1 = { lossy_1x1_bytes, sizeof(lossy_1x1_bytes) }; + 0x52, 0x49, 0x46, 0x46, 0x40, 0x00, 0x00, 0x00, 0x57, 0x45, 0x42, 0x50, + 0x56, 0x50, 0x38, 0x58, 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x4c, 0x50, 0x48, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x56, 0x50, 0x38, 0x20, 0x18, 0x00, 0x00, 0x00, + 0x30, 0x01, 0x00, 0x9d, 0x01, 0x2a, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, + 0x34, 0x25, 0xa4, 0x00, 0x03, 0x70, 0x00, 0xfe, 0xfb, 0xfd, 0x50, 0x00}; + const WebPData lossy_1x1 = {lossy_1x1_bytes, sizeof(lossy_1x1_bytes)}; const int can_use_lossless = (enc->last_config.lossless || enc->options.allow_mixed); EncodedFrame* const curr_enc_frame = GetFrame(enc, enc->count); @@ -1040,7 +1036,7 @@ static int IncreasePreviousDuration(WebPAnimEncoder* const enc, int duration) { enc->flush_count = enc->count - 1; enc->prev_candidate_undecided = 0; enc->prev_rect = rect; - } else { // Regular case. + } else { // Regular case. // Increase duration of the previous frame by 'duration'. prev_enc_frame->sub_frame.duration = new_duration; prev_enc_frame->key_frame.duration = new_duration; @@ -1140,9 +1136,8 @@ static WebPEncodingError SetFrame(WebPAnimEncoder* const enc, if (enc->options.minimize_size) { // Try both dispose methods. dispose_bg_params.should_try = 1; dispose_none_params.should_try = 1; - } else if ((is_lossless && - RectArea(&dispose_bg_params.rect_ll) < - RectArea(&dispose_none_params.rect_ll)) || + } else if ((is_lossless && RectArea(&dispose_bg_params.rect_ll) < + RectArea(&dispose_none_params.rect_ll)) || (!is_lossless && RectArea(&dispose_bg_params.rect_lossy) < RectArea(&dispose_none_params.rect_lossy))) { @@ -1172,14 +1167,14 @@ static WebPEncodingError SetFrame(WebPAnimEncoder* const enc, assert(best_candidate != NULL); goto End; - Err: +Err: for (i = 0; i < CANDIDATE_COUNT; ++i) { if (candidates[i].evaluate) { WebPMemoryWriterClear(&candidates[i].mem); } } - End: +End: SubFrameParamsFree(&dispose_none_params); SubFrameParamsFree(&dispose_bg_params); return error_code; @@ -1231,7 +1226,6 @@ static int CacheFrame(WebPAnimEncoder* const enc, if (frame_skipped) goto Skip; prev_rect_sub = enc->prev_rect; - // Add this as a key-frame to enc, too. error_code = SetFrame(enc, config, 1, encoded_frame, &frame_skipped); if (error_code != VP8_ENC_OK) goto End; @@ -1280,11 +1274,11 @@ static int CacheFrame(WebPAnimEncoder* const enc, WebPCopyPixels(enc->curr_canvas, &enc->prev_canvas); enc->is_first_frame = 0; - Skip: +Skip: ok = 1; ++enc->in_frame_count; - End: +End: if (!ok || frame_skipped) { FrameRelease(encoded_frame); // We reset some counters, as the frame addition failed/was skipped. @@ -1294,7 +1288,7 @@ static int CacheFrame(WebPAnimEncoder* const enc, MarkError2(enc, "ERROR adding frame. WebPEncodingError", error_code); } } - enc->curr_canvas->error_code = error_code; // report error_code + enc->curr_canvas->error_code = error_code; // report error_code assert(ok || error_code != VP8_ENC_OK); return ok; } @@ -1388,7 +1382,8 @@ int WebPAnimEncoderAdd(WebPAnimEncoder* enc, WebPPicture* frame, int timestamp, if (!frame->use_argb) { // Convert frame from YUV(A) to ARGB. if (enc->options.verbose) { - fprintf(stderr, "WARNING: Converting frame from YUV(A) to ARGB format; " + fprintf(stderr, + "WARNING: Converting frame from YUV(A) to ARGB format; " "this incurs a small loss.\n"); } if (!WebPPictureYUVAToARGB(frame)) { @@ -1480,7 +1475,7 @@ static int FrameToFullCanvas(WebPAnimEncoder* const enc, } return 1; - Err: +Err: WebPMemoryWriterClear(&mem1); WebPMemoryWriterClear(&mem2); return 0; @@ -1523,7 +1518,7 @@ static WebPMuxError OptimizeSingleFrame(WebPAnimEncoder* const enc, WebPDataInit(&webp_data2); } - End: +End: WebPDataClear(&frame.bitstream); WebPDataClear(&full_image); WebPMuxDelete(mux); @@ -1584,7 +1579,7 @@ int WebPAnimEncoderAssemble(WebPAnimEncoder* enc, WebPData* webp_data) { } return 1; - Err: +Err: MarkError2(enc, "ERROR assembling WebP", err); return 0; } @@ -1594,21 +1589,22 @@ const char* WebPAnimEncoderGetError(WebPAnimEncoder* enc) { return enc->error_str; } -WebPMuxError WebPAnimEncoderSetChunk( - WebPAnimEncoder* enc, const char fourcc[4], const WebPData* chunk_data, - int copy_data) { +WebPMuxError WebPAnimEncoderSetChunk(WebPAnimEncoder* enc, const char fourcc[4], + const WebPData* chunk_data, + int copy_data) { if (enc == NULL) return WEBP_MUX_INVALID_ARGUMENT; return WebPMuxSetChunk(enc->mux, fourcc, chunk_data, copy_data); } -WebPMuxError WebPAnimEncoderGetChunk( - const WebPAnimEncoder* enc, const char fourcc[4], WebPData* chunk_data) { +WebPMuxError WebPAnimEncoderGetChunk(const WebPAnimEncoder* enc, + const char fourcc[4], + WebPData* chunk_data) { if (enc == NULL) return WEBP_MUX_INVALID_ARGUMENT; return WebPMuxGetChunk(enc->mux, fourcc, chunk_data); } -WebPMuxError WebPAnimEncoderDeleteChunk( - WebPAnimEncoder* enc, const char fourcc[4]) { +WebPMuxError WebPAnimEncoderDeleteChunk(WebPAnimEncoder* enc, + const char fourcc[4]) { if (enc == NULL) return WEBP_MUX_INVALID_ARGUMENT; return WebPMuxDeleteChunk(enc->mux, fourcc); } diff --git a/src/mux/animi.h b/src/mux/animi.h index 34c45ba4..8c6cdfc9 100644 --- a/src/mux/animi.h +++ b/src/mux/animi.h @@ -30,14 +30,14 @@ extern "C" { // x_offset, y_offset, width, height - (in/out) rectangle between the two // input pictures. // Returns true on success. -int WebPAnimEncoderRefineRect( - const struct WebPPicture* const prev_canvas, - const struct WebPPicture* const curr_canvas, - int is_lossless, float quality, int* const x_offset, int* const y_offset, - int* const width, int* const height); +int WebPAnimEncoderRefineRect(const struct WebPPicture* const prev_canvas, + const struct WebPPicture* const curr_canvas, + int is_lossless, float quality, + int* const x_offset, int* const y_offset, + int* const width, int* const height); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_MUX_ANIMI_H_ diff --git a/src/mux/muxedit.c b/src/mux/muxedit.c index 09a8acab..9c755163 100644 --- a/src/mux/muxedit.c +++ b/src/mux/muxedit.c @@ -30,7 +30,7 @@ static void MuxInit(WebPMux* const mux) { assert(mux != NULL); memset(mux, 0, sizeof(*mux)); - mux->canvas_width = 0; // just to be explicit + mux->canvas_width = 0; // just to be explicit mux->canvas_height = 0; } @@ -73,16 +73,16 @@ void WebPMuxDelete(WebPMux* mux) { // Helper method(s). // Handy MACRO, makes MuxSet() very symmetric to MuxGet(). -#define SWITCH_ID_LIST(INDEX, LIST) \ - do { \ - if (idx == (INDEX)) { \ - err = ChunkAssignData(&chunk, data, copy_data, tag); \ - if (err == WEBP_MUX_OK) { \ - err = ChunkSetHead(&chunk, (LIST)); \ - if (err != WEBP_MUX_OK) ChunkRelease(&chunk); \ - } \ - return err; \ - } \ +#define SWITCH_ID_LIST(INDEX, LIST) \ + do { \ + if (idx == (INDEX)) { \ + err = ChunkAssignData(&chunk, data, copy_data, tag); \ + if (err == WEBP_MUX_OK) { \ + err = ChunkSetHead(&chunk, (LIST)); \ + if (err != WEBP_MUX_OK) ChunkRelease(&chunk); \ + } \ + return err; \ + } \ } while (0) static WebPMuxError MuxSet(WebPMux* const mux, uint32_t tag, @@ -94,20 +94,20 @@ static WebPMuxError MuxSet(WebPMux* const mux, uint32_t tag, assert(!IsWPI(kChunks[idx].id)); ChunkInit(&chunk); - SWITCH_ID_LIST(IDX_VP8X, &mux->vp8x); - SWITCH_ID_LIST(IDX_ICCP, &mux->iccp); - SWITCH_ID_LIST(IDX_ANIM, &mux->anim); - SWITCH_ID_LIST(IDX_EXIF, &mux->exif); - SWITCH_ID_LIST(IDX_XMP, &mux->xmp); + SWITCH_ID_LIST(IDX_VP8X, &mux->vp8x); + SWITCH_ID_LIST(IDX_ICCP, &mux->iccp); + SWITCH_ID_LIST(IDX_ANIM, &mux->anim); + SWITCH_ID_LIST(IDX_EXIF, &mux->exif); + SWITCH_ID_LIST(IDX_XMP, &mux->xmp); SWITCH_ID_LIST(IDX_UNKNOWN, &mux->unknown); return err; } #undef SWITCH_ID_LIST // Create data for frame given image data, offsets and duration. -static WebPMuxError CreateFrameData( - int width, int height, const WebPMuxFrameInfo* const info, - WebPData* const frame) { +static WebPMuxError CreateFrameData(int width, int height, + const WebPMuxFrameInfo* const info, + WebPData* const frame) { uint8_t* frame_bytes; const size_t frame_size = kChunks[IDX_ANMF].size; @@ -205,9 +205,9 @@ WebPMuxError WebPMuxSetChunk(WebPMux* mux, const char fourcc[4], } // Creates a chunk from given 'data' and sets it as 1st chunk in 'chunk_list'. -static WebPMuxError AddDataToChunkList( - const WebPData* const data, int copy_data, uint32_t tag, - WebPChunk** chunk_list) { +static WebPMuxError AddDataToChunkList(const WebPData* const data, + int copy_data, uint32_t tag, + WebPChunk** chunk_list) { WebPChunk chunk; WebPMuxError err; ChunkInit(&chunk); @@ -216,15 +216,16 @@ static WebPMuxError AddDataToChunkList( err = ChunkSetHead(&chunk, chunk_list); if (err != WEBP_MUX_OK) goto Err; return WEBP_MUX_OK; - Err: +Err: ChunkRelease(&chunk); return err; } // Extracts image & alpha data from the given bitstream and then sets wpi.alpha // and wpi.img appropriately. -static WebPMuxError SetAlphaAndImageChunks( - const WebPData* const bitstream, int copy_data, WebPMuxImage* const wpi) { +static WebPMuxError SetAlphaAndImageChunks(const WebPData* const bitstream, + int copy_data, + WebPMuxImage* const wpi) { int is_lossless = 0; WebPData image, alpha; WebPMuxError err = GetImageData(bitstream, &image, &alpha, &is_lossless); @@ -267,7 +268,7 @@ WebPMuxError WebPMuxSetImage(WebPMux* mux, const WebPData* bitstream, // All is well. return WEBP_MUX_OK; - Err: // Something bad happened. +Err: // Something bad happened. MuxImageRelease(&wpi); return err; } @@ -288,8 +289,9 @@ WebPMuxError WebPMuxPushFrame(WebPMux* mux, const WebPMuxFrameInfo* info, if (mux->images != NULL) { const WebPMuxImage* const image = mux->images; - const uint32_t image_id = (image->header != NULL) ? - ChunkGetIdFromTag(image->header->tag) : WEBP_CHUNK_IMAGE; + const uint32_t image_id = (image->header != NULL) + ? ChunkGetIdFromTag(image->header->tag) + : WEBP_CHUNK_IMAGE; if (image_id != info->id) { return WEBP_MUX_INVALID_ARGUMENT; // Conflicting frame types. } @@ -328,7 +330,7 @@ WebPMuxError WebPMuxPushFrame(WebPMux* mux, const WebPMuxFrameInfo* info, // All is well. return WEBP_MUX_OK; - Err: // Something bad happened. +Err: // Something bad happened. MuxImageRelease(&wpi); return err; } @@ -337,7 +339,7 @@ WebPMuxError WebPMuxSetAnimationParams(WebPMux* mux, const WebPMuxAnimParams* params) { WebPMuxError err; uint8_t data[ANIM_CHUNK_SIZE]; - const WebPData anim = { data, ANIM_CHUNK_SIZE }; + const WebPData anim = {data, ANIM_CHUNK_SIZE}; if (mux == NULL || params == NULL) return WEBP_MUX_INVALID_ARGUMENT; if (params->loop_count < 0 || params->loop_count >= MAX_LOOP_COUNT) { @@ -354,14 +356,13 @@ WebPMuxError WebPMuxSetAnimationParams(WebPMux* mux, return MuxSet(mux, kChunks[IDX_ANIM].tag, &anim, 1); } -WebPMuxError WebPMuxSetCanvasSize(WebPMux* mux, - int width, int height) { +WebPMuxError WebPMuxSetCanvasSize(WebPMux* mux, int width, int height) { WebPMuxError err; if (mux == NULL) { return WEBP_MUX_INVALID_ARGUMENT; } - if (width < 0 || height < 0 || - width > MAX_CANVAS_SIZE || height > MAX_CANVAS_SIZE) { + if (width < 0 || height < 0 || width > MAX_CANVAS_SIZE || + height > MAX_CANVAS_SIZE) { return WEBP_MUX_INVALID_ARGUMENT; } if (width * (uint64_t)height >= MAX_IMAGE_AREA) { @@ -396,9 +397,9 @@ WebPMuxError WebPMuxDeleteFrame(WebPMux* mux, uint32_t nth) { //------------------------------------------------------------------------------ // Assembly of the WebP RIFF file. -static WebPMuxError GetFrameInfo( - const WebPChunk* const frame_chunk, - int* const x_offset, int* const y_offset, int* const duration) { +static WebPMuxError GetFrameInfo(const WebPChunk* const frame_chunk, + int* const x_offset, int* const y_offset, + int* const duration) { const WebPData* const data = &frame_chunk->data; const size_t expected_data_size = ANMF_CHUNK_SIZE; assert(frame_chunk->tag == kChunks[IDX_ANMF].tag); @@ -413,8 +414,8 @@ static WebPMuxError GetFrameInfo( static WebPMuxError GetImageInfo(const WebPMuxImage* const wpi, int* const x_offset, int* const y_offset, - int* const duration, - int* const width, int* const height) { + int* const duration, int* const width, + int* const height) { const WebPChunk* const frame_chunk = wpi->header; WebPMuxError err; assert(wpi != NULL); @@ -448,8 +449,8 @@ static WebPMuxError GetAdjustedCanvasSize(const WebPMux* const mux, // Aggregate the bounding box for animation frames. for (; wpi != NULL; wpi = wpi->next) { int x_offset = 0, y_offset = 0, duration = 0, w = 0, h = 0; - const WebPMuxError err = GetImageInfo(wpi, &x_offset, &y_offset, - &duration, &w, &h); + const WebPMuxError err = + GetImageInfo(wpi, &x_offset, &y_offset, &duration, &w, &h); const int max_x_pos = x_offset + w; const int max_y_pos = y_offset + h; if (err != WEBP_MUX_OK) return err; @@ -480,7 +481,7 @@ static WebPMuxError CreateVP8XChunk(WebPMux* const mux) { int width = 0; int height = 0; uint8_t data[VP8X_CHUNK_SIZE]; - const WebPData vp8x = { data, VP8X_CHUNK_SIZE }; + const WebPData vp8x = {data, VP8X_CHUNK_SIZE}; const WebPMuxImage* images = NULL; assert(mux != NULL); @@ -545,7 +546,7 @@ static WebPMuxError CreateVP8XChunk(WebPMux* const mux) { flags |= ALPHA_FLAG; } - PutLE32(data + 0, flags); // VP8X chunk flags. + PutLE32(data + 0, flags); // VP8X chunk flags. PutLE24(data + 4, width - 1); // canvas width. PutLE24(data + 7, height - 1); // canvas height. @@ -630,10 +631,10 @@ WebPMuxError WebPMuxAssemble(WebPMux* mux, WebPData* assembled_data) { if (err != WEBP_MUX_OK) return err; // Allocate data. - size = ChunkListDiskSize(mux->vp8x) + ChunkListDiskSize(mux->iccp) - + ChunkListDiskSize(mux->anim) + ImageListDiskSize(mux->images) - + ChunkListDiskSize(mux->exif) + ChunkListDiskSize(mux->xmp) - + ChunkListDiskSize(mux->unknown) + RIFF_HEADER_SIZE; + size = ChunkListDiskSize(mux->vp8x) + ChunkListDiskSize(mux->iccp) + + ChunkListDiskSize(mux->anim) + ImageListDiskSize(mux->images) + + ChunkListDiskSize(mux->exif) + ChunkListDiskSize(mux->xmp) + + ChunkListDiskSize(mux->unknown) + RIFF_HEADER_SIZE; data = (uint8_t*)WebPSafeMalloc(1ULL, size); if (data == NULL) return WEBP_MUX_MEMORY_ERROR; diff --git a/src/mux/muxi.h b/src/mux/muxi.h index f277758a..d92d1117 100644 --- a/src/mux/muxi.h +++ b/src/mux/muxi.h @@ -38,41 +38,41 @@ extern "C" { // Chunk object. typedef struct WebPChunk WebPChunk; struct WebPChunk { - uint32_t tag; - int owner; // True if *data memory is owned internally. - // VP8X, ANIM, and other internally created chunks - // like ANMF are always owned. - WebPData data; - WebPChunk* next; + uint32_t tag; + int owner; // True if *data memory is owned internally. + // VP8X, ANIM, and other internally created chunks + // like ANMF are always owned. + WebPData data; + WebPChunk* next; }; // MuxImage object. Store a full WebP image (including ANMF chunk, ALPH // chunk and VP8/VP8L chunk), typedef struct WebPMuxImage WebPMuxImage; struct WebPMuxImage { - WebPChunk* header; // Corresponds to WEBP_CHUNK_ANMF. - WebPChunk* alpha; // Corresponds to WEBP_CHUNK_ALPHA. - WebPChunk* img; // Corresponds to WEBP_CHUNK_IMAGE. - WebPChunk* unknown; // Corresponds to WEBP_CHUNK_UNKNOWN. - int width; - int height; - int has_alpha; // Through ALPH chunk or as part of VP8L. - int is_partial; // True if only some of the chunks are filled. + WebPChunk* header; // Corresponds to WEBP_CHUNK_ANMF. + WebPChunk* alpha; // Corresponds to WEBP_CHUNK_ALPHA. + WebPChunk* img; // Corresponds to WEBP_CHUNK_IMAGE. + WebPChunk* unknown; // Corresponds to WEBP_CHUNK_UNKNOWN. + int width; + int height; + int has_alpha; // Through ALPH chunk or as part of VP8L. + int is_partial; // True if only some of the chunks are filled. WebPMuxImage* next; }; // Main mux object. Stores data chunks. struct WebPMux { - WebPMuxImage* images; - WebPChunk* iccp; - WebPChunk* exif; - WebPChunk* xmp; - WebPChunk* anim; - WebPChunk* vp8x; + WebPMuxImage* images; + WebPChunk* iccp; + WebPChunk* exif; + WebPChunk* xmp; + WebPChunk* anim; + WebPChunk* vp8x; - WebPChunk* unknown; - int canvas_width; - int canvas_height; + WebPChunk* unknown; + int canvas_width; + int canvas_height; }; // CHUNK_INDEX enum: used for indexing within 'kChunks' (defined below) only. @@ -98,9 +98,9 @@ typedef enum { #define NIL_TAG 0x00000000u // To signal void chunk. typedef struct { - uint32_t tag; - WebPChunkId id; - uint32_t size; + uint32_t tag; + WebPChunkId id; + uint32_t size; } ChunkInfo; extern const ChunkInfo kChunks[IDX_LAST_CHUNK]; @@ -193,8 +193,10 @@ static WEBP_INLINE int IsWPI(WebPChunkId id) { switch (id) { case WEBP_CHUNK_ANMF: case WEBP_CHUNK_ALPHA: - case WEBP_CHUNK_IMAGE: return 1; - default: return 0; + case WEBP_CHUNK_IMAGE: + return 1; + default: + return 0; } } @@ -232,7 +234,7 @@ WebPMuxError MuxValidate(const WebPMux* const mux); //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_MUX_MUXI_H_ diff --git a/src/mux/muxinternal.c b/src/mux/muxinternal.c index 4460e064..3048445c 100644 --- a/src/mux/muxinternal.c +++ b/src/mux/muxinternal.c @@ -17,28 +17,27 @@ #include #include "src/mux/muxi.h" -#include "src/webp/types.h" #include "src/utils/utils.h" #include "src/webp/format_constants.h" #include "src/webp/mux.h" #include "src/webp/mux_types.h" +#include "src/webp/types.h" #define UNDEFINED_CHUNK_SIZE ((uint32_t)(-1)) const ChunkInfo kChunks[] = { - { MKFOURCC('V', 'P', '8', 'X'), WEBP_CHUNK_VP8X, VP8X_CHUNK_SIZE }, - { MKFOURCC('I', 'C', 'C', 'P'), WEBP_CHUNK_ICCP, UNDEFINED_CHUNK_SIZE }, - { MKFOURCC('A', 'N', 'I', 'M'), WEBP_CHUNK_ANIM, ANIM_CHUNK_SIZE }, - { MKFOURCC('A', 'N', 'M', 'F'), WEBP_CHUNK_ANMF, ANMF_CHUNK_SIZE }, - { MKFOURCC('A', 'L', 'P', 'H'), WEBP_CHUNK_ALPHA, UNDEFINED_CHUNK_SIZE }, - { MKFOURCC('V', 'P', '8', ' '), WEBP_CHUNK_IMAGE, UNDEFINED_CHUNK_SIZE }, - { MKFOURCC('V', 'P', '8', 'L'), WEBP_CHUNK_IMAGE, UNDEFINED_CHUNK_SIZE }, - { MKFOURCC('E', 'X', 'I', 'F'), WEBP_CHUNK_EXIF, UNDEFINED_CHUNK_SIZE }, - { MKFOURCC('X', 'M', 'P', ' '), WEBP_CHUNK_XMP, UNDEFINED_CHUNK_SIZE }, - { NIL_TAG, WEBP_CHUNK_UNKNOWN, UNDEFINED_CHUNK_SIZE }, + {MKFOURCC('V', 'P', '8', 'X'), WEBP_CHUNK_VP8X, VP8X_CHUNK_SIZE}, + {MKFOURCC('I', 'C', 'C', 'P'), WEBP_CHUNK_ICCP, UNDEFINED_CHUNK_SIZE}, + {MKFOURCC('A', 'N', 'I', 'M'), WEBP_CHUNK_ANIM, ANIM_CHUNK_SIZE}, + {MKFOURCC('A', 'N', 'M', 'F'), WEBP_CHUNK_ANMF, ANMF_CHUNK_SIZE}, + {MKFOURCC('A', 'L', 'P', 'H'), WEBP_CHUNK_ALPHA, UNDEFINED_CHUNK_SIZE}, + {MKFOURCC('V', 'P', '8', ' '), WEBP_CHUNK_IMAGE, UNDEFINED_CHUNK_SIZE}, + {MKFOURCC('V', 'P', '8', 'L'), WEBP_CHUNK_IMAGE, UNDEFINED_CHUNK_SIZE}, + {MKFOURCC('E', 'X', 'I', 'F'), WEBP_CHUNK_EXIF, UNDEFINED_CHUNK_SIZE}, + {MKFOURCC('X', 'M', 'P', ' '), WEBP_CHUNK_XMP, UNDEFINED_CHUNK_SIZE}, + {NIL_TAG, WEBP_CHUNK_UNKNOWN, UNDEFINED_CHUNK_SIZE}, - { NIL_TAG, WEBP_CHUNK_NIL, UNDEFINED_CHUNK_SIZE } -}; + {NIL_TAG, WEBP_CHUNK_NIL, UNDEFINED_CHUNK_SIZE}}; //------------------------------------------------------------------------------ @@ -131,10 +130,10 @@ WebPMuxError ChunkAssignData(WebPChunk* chunk, const WebPData* const data, ChunkRelease(chunk); if (data != NULL) { - if (copy_data) { // Copy data. + if (copy_data) { // Copy data. if (!WebPDataCopy(data, &chunk->data)) return WEBP_MUX_MEMORY_ERROR; - chunk->owner = 1; // Chunk is owner of data. - } else { // Don't copy data. + chunk->owner = 1; // Chunk is owner of data. + } else { // Don't copy data. chunk->data = *data; } } @@ -202,8 +201,7 @@ static uint8_t* ChunkEmit(const WebPChunk* const chunk, uint8_t* dst) { PutLE32(dst + TAG_SIZE, (uint32_t)chunk_size); assert(chunk_size == (uint32_t)chunk_size); memcpy(dst + CHUNK_HEADER_SIZE, chunk->data.bytes, chunk_size); - if (chunk_size & 1) - dst[CHUNK_HEADER_SIZE + chunk_size] = 0; // Add padding. + if (chunk_size & 1) dst[CHUNK_HEADER_SIZE + chunk_size] = 0; // Add padding. return dst + ChunkDiskSize(chunk); } @@ -255,10 +253,14 @@ static WebPChunk** GetChunkListFromId(const WebPMuxImage* const wpi, WebPChunkId id) { assert(wpi != NULL); switch (id) { - case WEBP_CHUNK_ANMF: return (WebPChunk**)&wpi->header; - case WEBP_CHUNK_ALPHA: return (WebPChunk**)&wpi->alpha; - case WEBP_CHUNK_IMAGE: return (WebPChunk**)&wpi->img; - default: return NULL; + case WEBP_CHUNK_ANMF: + return (WebPChunk**)&wpi->header; + case WEBP_CHUNK_ALPHA: + return (WebPChunk**)&wpi->alpha; + case WEBP_CHUNK_IMAGE: + return (WebPChunk**)&wpi->img; + default: + return NULL; } } @@ -428,12 +430,18 @@ uint8_t* MuxEmitRiffHeader(uint8_t* const data, size_t size) { WebPChunk** MuxGetChunkListFromId(const WebPMux* mux, WebPChunkId id) { assert(mux != NULL); switch (id) { - case WEBP_CHUNK_VP8X: return (WebPChunk**)&mux->vp8x; - case WEBP_CHUNK_ICCP: return (WebPChunk**)&mux->iccp; - case WEBP_CHUNK_ANIM: return (WebPChunk**)&mux->anim; - case WEBP_CHUNK_EXIF: return (WebPChunk**)&mux->exif; - case WEBP_CHUNK_XMP: return (WebPChunk**)&mux->xmp; - default: return (WebPChunk**)&mux->unknown; + case WEBP_CHUNK_VP8X: + return (WebPChunk**)&mux->vp8x; + case WEBP_CHUNK_ICCP: + return (WebPChunk**)&mux->iccp; + case WEBP_CHUNK_ANIM: + return (WebPChunk**)&mux->anim; + case WEBP_CHUNK_EXIF: + return (WebPChunk**)&mux->exif; + case WEBP_CHUNK_XMP: + return (WebPChunk**)&mux->xmp; + default: + return (WebPChunk**)&mux->unknown; } } @@ -448,11 +456,9 @@ static int IsNotCompatible(int feature, int num_items) { // and feature incompatibility (use NO_FLAG to skip). // On success returns WEBP_MUX_OK and stores the chunk count in *num. static WebPMuxError ValidateChunk(const WebPMux* const mux, CHUNK_INDEX idx, - WebPFeatureFlags feature, - uint32_t vp8x_flags, + WebPFeatureFlags feature, uint32_t vp8x_flags, int max, int* num) { - const WebPMuxError err = - WebPMuxNumChunks(mux, kChunks[idx].id, num); + const WebPMuxError err = WebPMuxNumChunks(mux, kChunks[idx].id, num); if (err != WEBP_MUX_OK) return err; if (max > -1 && *num > max) return WEBP_MUX_INVALID_ARGUMENT; if (feature != NO_FLAG && IsNotCompatible(vp8x_flags & feature, *num)) { diff --git a/src/mux/muxread.c b/src/mux/muxread.c index b778070f..d9434c0a 100644 --- a/src/mux/muxread.c +++ b/src/mux/muxread.c @@ -27,18 +27,18 @@ // Helper method(s). // Handy MACRO. -#define SWITCH_ID_LIST(INDEX, LIST) \ - do { \ - if (idx == (INDEX)) { \ - const WebPChunk* const chunk = ChunkSearchList((LIST), nth, \ - kChunks[(INDEX)].tag); \ - if (chunk) { \ - *data = chunk->data; \ - return WEBP_MUX_OK; \ - } else { \ - return WEBP_MUX_NOT_FOUND; \ - } \ - } \ +#define SWITCH_ID_LIST(INDEX, LIST) \ + do { \ + if (idx == (INDEX)) { \ + const WebPChunk* const chunk = \ + ChunkSearchList((LIST), nth, kChunks[(INDEX)].tag); \ + if (chunk) { \ + *data = chunk->data; \ + return WEBP_MUX_OK; \ + } else { \ + return WEBP_MUX_NOT_FOUND; \ + } \ + } \ } while (0) static WebPMuxError MuxGet(const WebPMux* const mux, CHUNK_INDEX idx, @@ -60,9 +60,9 @@ static WebPMuxError MuxGet(const WebPMux* const mux, CHUNK_INDEX idx, // Fill the chunk with the given data (includes chunk header bytes), after some // verifications. -static WebPMuxError ChunkVerifyAndAssign(WebPChunk* chunk, - const uint8_t* data, size_t data_size, - size_t riff_size, int copy_data) { +static WebPMuxError ChunkVerifyAndAssign(WebPChunk* chunk, const uint8_t* data, + size_t data_size, size_t riff_size, + int copy_data) { uint32_t chunk_size; WebPData chunk_data; @@ -89,9 +89,10 @@ int MuxImageFinalize(WebPMuxImage* const wpi) { const int is_lossless = (img->tag == kChunks[IDX_VP8L].tag); int w, h; int vp8l_has_alpha = 0; - const int ok = is_lossless ? - VP8LGetInfo(image->bytes, image->size, &w, &h, &vp8l_has_alpha) : - VP8GetInfo(image->bytes, image->size, image->size, &w, &h); + const int ok = + is_lossless + ? VP8LGetInfo(image->bytes, image->size, &w, &h, &vp8l_has_alpha) + : VP8GetInfo(image->bytes, image->size, image->size, &w, &h); assert(img != NULL); if (ok) { // Ignore ALPH chunk accompanying VP8L. @@ -122,12 +123,12 @@ static int MuxImageParse(const WebPChunk* const chunk, int copy_data, // ANMF. { const size_t hdr_size = ANMF_CHUNK_SIZE; - const WebPData temp = { bytes, hdr_size }; + const WebPData temp = {bytes, hdr_size}; // Each of ANMF chunk contain a header at the beginning. So, its size should // be at least 'hdr_size'. if (size < hdr_size) goto Fail; - if (ChunkAssignData(&subchunk, &temp, copy_data, - chunk->tag) != WEBP_MUX_OK) { + if (ChunkAssignData(&subchunk, &temp, copy_data, chunk->tag) != + WEBP_MUX_OK) { goto Fail; } } @@ -141,8 +142,8 @@ static int MuxImageParse(const WebPChunk* const chunk, int copy_data, while (bytes != last) { ChunkInit(&subchunk); - if (ChunkVerifyAndAssign(&subchunk, bytes, size, size, - copy_data) != WEBP_MUX_OK) { + if (ChunkVerifyAndAssign(&subchunk, bytes, size, size, copy_data) != + WEBP_MUX_OK) { goto Fail; } switch (ChunkGetIdFromTag(subchunk.tag)) { @@ -176,7 +177,7 @@ static int MuxImageParse(const WebPChunk* const chunk, int copy_data, if (wpi->is_partial) goto Fail; return 1; - Fail: +Fail: ChunkRelease(&subchunk); return 0; } @@ -196,7 +197,7 @@ WebPMux* WebPMuxCreateInternal(const WebPData* bitstream, int copy_data, WebPChunk chunk; // Stores the end of the chunk lists so that it is faster to append data to // their ends. - WebPChunk** chunk_list_ends[WEBP_CHUNK_NIL + 1] = { NULL }; + WebPChunk** chunk_list_ends[WEBP_CHUNK_NIL + 1] = {NULL}; ChunkInit(&chunk); if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_MUX_ABI_VERSION)) { @@ -218,8 +219,7 @@ WebPMux* WebPMuxCreateInternal(const WebPData* bitstream, int copy_data, if (mux == NULL) return NULL; tag = GetLE32(data + RIFF_HEADER_SIZE); - if (tag != kChunks[IDX_VP8].tag && - tag != kChunks[IDX_VP8L].tag && + if (tag != kChunks[IDX_VP8].tag && tag != kChunks[IDX_VP8L].tag && tag != kChunks[IDX_VP8X].tag) { goto Err; // First chunk should be VP8, VP8L or VP8X. } @@ -251,8 +251,8 @@ WebPMux* WebPMuxCreateInternal(const WebPData* bitstream, int copy_data, while (data != end) { size_t data_size; WebPChunkId id; - if (ChunkVerifyAndAssign(&chunk, data, size, riff_size, - copy_data) != WEBP_MUX_OK) { + if (ChunkVerifyAndAssign(&chunk, data, size, riff_size, copy_data) != + WEBP_MUX_OK) { goto Err; } data_size = ChunkDiskSize(&chunk); @@ -267,7 +267,7 @@ WebPMux* WebPMuxCreateInternal(const WebPData* bitstream, int copy_data, if (ChunkSetHead(&chunk, &wpi->img) != WEBP_MUX_OK) goto Err; if (!MuxImageFinalize(wpi)) goto Err; wpi->is_partial = 0; // wpi is completely filled. - PushImage: + PushImage: // Add this to mux->images list. if (MuxImagePush(wpi, &mux->images) != WEBP_MUX_OK) goto Err; MuxImageInit(wpi); // Reset for reading next image. @@ -278,8 +278,9 @@ WebPMux* WebPMuxCreateInternal(const WebPData* bitstream, int copy_data, ChunkRelease(&chunk); goto PushImage; default: // A non-image chunk. - if (wpi->is_partial) goto Err; // Encountered a non-image chunk before - // getting all chunks of an image. + if (wpi->is_partial) + goto Err; // Encountered a non-image chunk before + // getting all chunks of an image. if (chunk_list_ends[id] == NULL) { chunk_list_ends[id] = MuxGetChunkListFromId(mux, id); // List to add this chunk. @@ -306,7 +307,7 @@ WebPMux* WebPMuxCreateInternal(const WebPData* bitstream, int copy_data, MuxImageDelete(wpi); return mux; // All OK; - Err: // Something bad happened. +Err: // Something bad happened. ChunkRelease(&chunk); MuxImageDelete(wpi); WebPMuxDelete(mux); @@ -335,8 +336,8 @@ static WebPMuxError ValidateForSingleImage(const WebPMux* const mux) { // Get the canvas width, height and flags after validating that VP8X/VP8/VP8L // chunk and canvas size are valid. -static WebPMuxError MuxGetCanvasInfo(const WebPMux* const mux, - int* width, int* height, uint32_t* flags) { +static WebPMuxError MuxGetCanvasInfo(const WebPMux* const mux, int* width, + int* height, uint32_t* flags) { int w, h; uint32_t f = 0; WebPData data; @@ -383,8 +384,8 @@ WebPMuxError WebPMuxGetFeatures(const WebPMux* mux, uint32_t* flags) { return MuxGetCanvasInfo(mux, NULL, NULL, flags); } -static uint8_t* EmitVP8XChunk(uint8_t* const dst, int width, - int height, uint32_t flags) { +static uint8_t* EmitVP8XChunk(uint8_t* const dst, int width, int height, + uint32_t flags) { const size_t vp8x_size = CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE; assert(width >= 1 && height >= 1); assert(width <= MAX_CANVAS_SIZE && height <= MAX_CANVAS_SIZE); @@ -407,8 +408,8 @@ static WebPMuxError SynthesizeBitstream(const WebPMuxImage* const wpi, const size_t vp8x_size = need_vp8x ? CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE : 0; const size_t alpha_size = need_vp8x ? ChunkDiskSize(wpi->alpha) : 0; // Note: No need to output ANMF chunk for a single image. - const size_t size = RIFF_HEADER_SIZE + vp8x_size + alpha_size + - ChunkDiskSize(wpi->img); + const size_t size = + RIFF_HEADER_SIZE + vp8x_size + alpha_size + ChunkDiskSize(wpi->img); uint8_t* const data = (uint8_t*)WebPSafeMalloc(1ULL, size); if (data == NULL) return WEBP_MUX_MEMORY_ERROR; @@ -421,7 +422,7 @@ static WebPMuxError SynthesizeBitstream(const WebPMuxImage* const wpi, if (need_vp8x) { dst = EmitVP8XChunk(dst, wpi->width, wpi->height, ALPHA_FLAG); // VP8X. - dst = ChunkListEmit(wpi->alpha, dst); // ALPH. + dst = ChunkListEmit(wpi->alpha, dst); // ALPH. } // Bitstream. @@ -442,11 +443,11 @@ WebPMuxError WebPMuxGetChunk(const WebPMux* mux, const char fourcc[4], } idx = ChunkGetIndexFromFourCC(fourcc); assert(idx != IDX_LAST_CHUNK); - if (IsWPI(kChunks[idx].id)) { // An image chunk. + if (IsWPI(kChunks[idx].id)) { // An image chunk. return WEBP_MUX_INVALID_ARGUMENT; } else if (idx != IDX_UNKNOWN) { // A known chunk type. return MuxGet(mux, idx, 1, chunk_data); - } else { // An unknown chunk type. + } else { // An unknown chunk type. const WebPChunk* const chunk = ChunkSearchList(mux->unknown, 1, ChunkGetTagFromFourCC(fourcc)); if (chunk == NULL) return WEBP_MUX_NOT_FOUND; @@ -491,8 +492,8 @@ static WebPMuxError MuxGetFrameInternal(const WebPMuxImage* const wpi, return SynthesizeBitstream(wpi, &frame->bitstream); } -WebPMuxError WebPMuxGetFrame( - const WebPMux* mux, uint32_t nth, WebPMuxFrameInfo* frame) { +WebPMuxError WebPMuxGetFrame(const WebPMux* mux, uint32_t nth, + WebPMuxFrameInfo* frame) { WebPMuxError err; WebPMuxImage* wpi; @@ -550,8 +551,8 @@ static int CountChunks(const WebPChunk* const chunk_list, uint32_t tag) { return count; } -WebPMuxError WebPMuxNumChunks(const WebPMux* mux, - WebPChunkId id, int* num_elements) { +WebPMuxError WebPMuxNumChunks(const WebPMux* mux, WebPChunkId id, + int* num_elements) { if (mux == NULL || num_elements == NULL) { return WEBP_MUX_INVALID_ARGUMENT; } diff --git a/src/utils/bit_reader_inl_utils.h b/src/utils/bit_reader_inl_utils.h index 8179c2fa..4374538e 100644 --- a/src/utils/bit_reader_inl_utils.h +++ b/src/utils/bit_reader_inl_utils.h @@ -37,11 +37,11 @@ extern "C" { //------------------------------------------------------------------------------ // Derived type lbit_t = natural type for memory I/O -#if (BITS > 32) +#if (BITS > 32) typedef uint64_t lbit_t; #elif (BITS > 16) typedef uint32_t lbit_t; -#elif (BITS > 8) +#elif (BITS > 8) typedef uint16_t lbit_t; #else typedef uint8_t lbit_t; @@ -57,8 +57,8 @@ void VP8LoadFinalBytes(VP8BitReader* const br); // Inlined critical functions // makes sure br->value has at least BITS bits worth of data -static WEBP_UBSAN_IGNORE_UNDEF WEBP_INLINE -void VP8LoadNewBytes(VP8BitReader* WEBP_RESTRICT const br) { +static WEBP_UBSAN_IGNORE_UNDEF WEBP_INLINE void VP8LoadNewBytes( + VP8BitReader* WEBP_RESTRICT const br) { assert(br != NULL && br->buf != NULL); // Read 'BITS' bits at a time if possible. if (br->buf < br->buf_max) { @@ -69,15 +69,14 @@ void VP8LoadNewBytes(VP8BitReader* WEBP_RESTRICT const br) { lbit_t in_bits; lbit_t* p_buf = (lbit_t*)br->buf; __asm__ volatile( - ".set push \n\t" - ".set at \n\t" - ".set macro \n\t" - "ulw %[in_bits], 0(%[p_buf]) \n\t" - ".set pop \n\t" - : [in_bits]"=r"(in_bits) - : [p_buf]"r"(p_buf) - : "memory", "at" - ); + ".set push \n\t" + ".set at \n\t" + ".set macro \n\t" + "ulw %[in_bits], 0(%[p_buf]) \n\t" + ".set pop \n\t" + : [in_bits] "=r"(in_bits) + : [p_buf] "r"(p_buf) + : "memory", "at"); #else lbit_t in_bits; memcpy(&in_bits, br->buf, sizeof(in_bits)); @@ -95,20 +94,20 @@ void VP8LoadNewBytes(VP8BitReader* WEBP_RESTRICT const br) { #else // BITS == 8 bits = (bit_t)in_bits; #endif // BITS > 32 -#else // WORDS_BIGENDIAN +#else // WORDS_BIGENDIAN bits = (bit_t)in_bits; if (BITS != 8 * sizeof(bit_t)) bits >>= (8 * sizeof(bit_t) - BITS); #endif br->value = bits | (br->value << BITS); br->bits += BITS; } else { - VP8LoadFinalBytes(br); // no need to be inlined + VP8LoadFinalBytes(br); // no need to be inlined } } // Read a bit with proba 'prob'. Speed-critical function! -static WEBP_INLINE int VP8GetBit(VP8BitReader* WEBP_RESTRICT const br, - int prob, const char label[]) { +static WEBP_INLINE int VP8GetBit(VP8BitReader* WEBP_RESTRICT const br, int prob, + const char label[]) { // Don't move this declaration! It makes a big speed difference to store // 'range' *before* calling VP8LoadNewBytes(), even if this function doesn't // alter br->range value. @@ -139,9 +138,8 @@ static WEBP_INLINE int VP8GetBit(VP8BitReader* WEBP_RESTRICT const br, } // simplified version of VP8GetBit() for prob=0x80 (note shift is always 1 here) -static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE -int VP8GetSigned(VP8BitReader* WEBP_RESTRICT const br, int v, - const char label[]) { +static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE int VP8GetSigned( + VP8BitReader* WEBP_RESTRICT const br, int v, const char label[]) { if (br->bits < 0) { VP8LoadNewBytes(br); } @@ -193,7 +191,7 @@ static WEBP_INLINE int VP8GetBitAlt(VP8BitReader* WEBP_RESTRICT const br, } #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_UTILS_BIT_READER_INL_UTILS_H_ diff --git a/src/utils/bit_reader_utils.c b/src/utils/bit_reader_utils.c index 5e3a8b37..f1042304 100644 --- a/src/utils/bit_reader_utils.c +++ b/src/utils/bit_reader_utils.c @@ -18,18 +18,17 @@ #include #include -#include "src/webp/types.h" #include "src/dsp/cpu.h" #include "src/utils/bit_reader_inl_utils.h" #include "src/utils/bit_reader_utils.h" #include "src/utils/endian_inl_utils.h" #include "src/utils/utils.h" +#include "src/webp/types.h" //------------------------------------------------------------------------------ // VP8BitReader -void VP8BitReaderSetBuffer(VP8BitReader* const br, - const uint8_t* const start, +void VP8BitReaderSetBuffer(VP8BitReader* const br, const uint8_t* const start, size_t size) { assert(start != NULL); br->buf = start; @@ -38,15 +37,15 @@ void VP8BitReaderSetBuffer(VP8BitReader* const br, (size >= sizeof(lbit_t)) ? start + size - sizeof(lbit_t) + 1 : start; } -void VP8InitBitReader(VP8BitReader* const br, - const uint8_t* const start, size_t size) { +void VP8InitBitReader(VP8BitReader* const br, const uint8_t* const start, + size_t size) { assert(br != NULL); assert(start != NULL); - assert(size < (1u << 31)); // limit ensured by format and upstream checks - br->range = 255 - 1; - br->value = 0; - br->bits = -8; // to load the very first 8bits - br->eof = 0; + assert(size < (1u << 31)); // limit ensured by format and upstream checks + br->range = 255 - 1; + br->value = 0; + br->bits = -8; // to load the very first 8bits + br->eof = 0; VP8BitReaderSetBuffer(br, start, size); VP8LoadNewBytes(br); } @@ -60,36 +59,24 @@ void VP8RemapBitReader(VP8BitReader* const br, ptrdiff_t offset) { } const uint8_t kVP8Log2Range[128] = { - 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0 -}; + 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}; // range = ((range - 1) << kVP8Log2Range[range]) + 1 const uint8_t kVP8NewRange[128] = { - 127, 127, 191, 127, 159, 191, 223, 127, - 143, 159, 175, 191, 207, 223, 239, 127, - 135, 143, 151, 159, 167, 175, 183, 191, - 199, 207, 215, 223, 231, 239, 247, 127, - 131, 135, 139, 143, 147, 151, 155, 159, - 163, 167, 171, 175, 179, 183, 187, 191, - 195, 199, 203, 207, 211, 215, 219, 223, - 227, 231, 235, 239, 243, 247, 251, 127, - 129, 131, 133, 135, 137, 139, 141, 143, - 145, 147, 149, 151, 153, 155, 157, 159, - 161, 163, 165, 167, 169, 171, 173, 175, - 177, 179, 181, 183, 185, 187, 189, 191, - 193, 195, 197, 199, 201, 203, 205, 207, - 209, 211, 213, 215, 217, 219, 221, 223, - 225, 227, 229, 231, 233, 235, 237, 239, - 241, 243, 245, 247, 249, 251, 253, 127 -}; + 127, 127, 191, 127, 159, 191, 223, 127, 143, 159, 175, 191, 207, 223, 239, + 127, 135, 143, 151, 159, 167, 175, 183, 191, 199, 207, 215, 223, 231, 239, + 247, 127, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, + 183, 187, 191, 195, 199, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239, + 243, 247, 251, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, + 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, + 181, 183, 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, 205, 207, 209, + 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, + 241, 243, 245, 247, 249, 251, 253, 127}; void VP8LoadFinalBytes(VP8BitReader* const br) { assert(br != NULL && br->buf != NULL); @@ -128,22 +115,17 @@ int32_t VP8GetSignedValue(VP8BitReader* const br, int bits, #define VP8L_LOG8_WBITS 4 // Number of bytes needed to store VP8L_WBITS bits. -#if defined(__arm__) || defined(_M_ARM) || WEBP_AARCH64 || \ - defined(__i386__) || defined(_M_IX86) || \ - defined(__x86_64__) || defined(_M_X64) || \ - defined(__wasm__) +#if defined(__arm__) || defined(_M_ARM) || WEBP_AARCH64 || \ + defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || \ + defined(_M_X64) || defined(__wasm__) #define VP8L_USE_FAST_LOAD #endif static const uint32_t kBitMask[VP8L_MAX_NUM_BIT_READ + 1] = { - 0, - 0x000001, 0x000003, 0x000007, 0x00000f, - 0x00001f, 0x00003f, 0x00007f, 0x0000ff, - 0x0001ff, 0x0003ff, 0x0007ff, 0x000fff, - 0x001fff, 0x003fff, 0x007fff, 0x00ffff, - 0x01ffff, 0x03ffff, 0x07ffff, 0x0fffff, - 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff -}; + 0, 0x000001, 0x000003, 0x000007, 0x00000f, 0x00001f, 0x00003f, + 0x00007f, 0x0000ff, 0x0001ff, 0x0003ff, 0x0007ff, 0x000fff, 0x001fff, + 0x003fff, 0x007fff, 0x00ffff, 0x01ffff, 0x03ffff, 0x07ffff, 0x0fffff, + 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff}; void VP8LInitBitReader(VP8LBitReader* const br, const uint8_t* const start, size_t length) { @@ -151,7 +133,7 @@ void VP8LInitBitReader(VP8LBitReader* const br, const uint8_t* const start, vp8l_val_t value = 0; assert(br != NULL); assert(start != NULL); - assert(length < 0xfffffff8u); // can't happen with a RIFF chunk. + assert(length < 0xfffffff8u); // can't happen with a RIFF chunk. br->len = length; br->val = 0; @@ -169,11 +151,11 @@ void VP8LInitBitReader(VP8LBitReader* const br, const uint8_t* const start, br->buf = start; } -void VP8LBitReaderSetBuffer(VP8LBitReader* const br, - const uint8_t* const buf, size_t len) { +void VP8LBitReaderSetBuffer(VP8LBitReader* const br, const uint8_t* const buf, + size_t len) { assert(br != NULL); assert(buf != NULL); - assert(len < 0xfffffff8u); // can't happen with a RIFF chunk. + assert(len < 0xfffffff8u); // can't happen with a RIFF chunk. br->buf = buf; br->len = len; // 'pos' > 'len' should be considered a param error. @@ -204,13 +186,13 @@ void VP8LDoFillBitWindow(VP8LBitReader* const br) { if (br->pos + sizeof(br->val) < br->len) { br->val >>= VP8L_WBITS; br->bit_pos -= VP8L_WBITS; - br->val |= (vp8l_val_t)HToLE32(WebPMemToUint32(br->buf + br->pos)) << - (VP8L_LBITS - VP8L_WBITS); + br->val |= (vp8l_val_t)HToLE32(WebPMemToUint32(br->buf + br->pos)) + << (VP8L_LBITS - VP8L_WBITS); br->pos += VP8L_LOG8_WBITS; return; } #endif - ShiftBytes(br); // Slow path. + ShiftBytes(br); // Slow path. } uint32_t VP8LReadBits(VP8LBitReader* const br, int n_bits) { @@ -233,8 +215,8 @@ uint32_t VP8LReadBits(VP8LBitReader* const br, int n_bits) { #if (BITTRACE > 0) -#include // for atexit() #include +#include // for atexit() #include #define MAX_NUM_LABELS 32 @@ -259,15 +241,14 @@ static void PrintBitTraces(void) { units = "bytes"; #endif for (i = 0; i < last_label; ++i) total += kLabels[i].size; - if (total < 1) total = 1; // avoid rounding errors + if (total < 1) total = 1; // avoid rounding errors printf("=== Bit traces ===\n"); for (i = 0; i < last_label; ++i) { const int skip = 16 - (int)strlen(kLabels[i].label); const int value = (kLabels[i].size + scale - 1) / scale; assert(skip > 0); - printf("%s \%*s: %6d %s \t[%5.2f%%] [count: %7d]\n", - kLabels[i].label, skip, "", value, units, - 100.f * kLabels[i].size / total, + printf("%s \%*s: %6d %s \t[%5.2f%%] [count: %7d]\n", kLabels[i].label, + skip, "", value, units, 100.f * kLabels[i].size / total, kLabels[i].count); } total = (total + scale - 1) / scale; @@ -293,7 +274,7 @@ void BitTrace(const struct VP8BitReader* const br, const char label[]) { for (i = 0; i < last_label; ++i) { if (!strcmp(label, kLabels[i].label)) break; } - if (i == MAX_NUM_LABELS) abort(); // overflow! + if (i == MAX_NUM_LABELS) abort(); // overflow! kLabels[i].label = label; kLabels[i].size += pos - last_pos; kLabels[i].count += 1; diff --git a/src/utils/bit_reader_utils.h b/src/utils/bit_reader_utils.h index ddce8606..9c5d849f 100644 --- a/src/utils/bit_reader_utils.h +++ b/src/utils/bit_reader_utils.h @@ -26,7 +26,7 @@ // Warning! This macro triggers quite some MACRO wizardry around func signature! #if !defined(BITTRACE) -#define BITTRACE 0 // 0 = off, 1 = print bits, 2 = print bytes +#define BITTRACE 0 // 0 = off, 1 = print bits, 2 = print bytes #endif #if (BITTRACE > 0) @@ -61,19 +61,19 @@ extern "C" { // BITS can be any multiple of 8 from 8 to 56 (inclusive). // Pick values that fit natural register size. -#if defined(__i386__) || defined(_M_IX86) // x86 32bit +#if defined(__i386__) || defined(_M_IX86) // x86 32bit #define BITS 24 -#elif defined(__x86_64__) || defined(_M_X64) // x86 64bit +#elif defined(__x86_64__) || defined(_M_X64) // x86 64bit #define BITS 56 -#elif defined(__arm__) || defined(_M_ARM) // ARM +#elif defined(__arm__) || defined(_M_ARM) // ARM #define BITS 24 -#elif WEBP_AARCH64 // ARM 64bit +#elif WEBP_AARCH64 // ARM 64bit #define BITS 56 -#elif defined(__mips__) // MIPS +#elif defined(__mips__) // MIPS #define BITS 24 -#elif defined(__wasm__) // WASM +#elif defined(__wasm__) // WASM #define BITS 56 -#else // reasonable default +#else // reasonable default #define BITS 24 #endif @@ -96,22 +96,22 @@ typedef uint32_t range_t; typedef struct VP8BitReader VP8BitReader; struct VP8BitReader { // boolean decoder (keep the field ordering as is!) - bit_t value; // current value - range_t range; // current range minus 1. In [127, 254] interval. - int bits; // number of valid bits left + bit_t value; // current value + range_t range; // current range minus 1. In [127, 254] interval. + int bits; // number of valid bits left // read buffer - const uint8_t* buf; // next byte to be read - const uint8_t* buf_end; // end of read buffer - const uint8_t* buf_max; // max packed-read position on buffer - int eof; // true if input is exhausted + const uint8_t* buf; // next byte to be read + const uint8_t* buf_end; // end of read buffer + const uint8_t* buf_max; // max packed-read position on buffer + int eof; // true if input is exhausted }; // Initialize the bit reader and the boolean decoder. -void VP8InitBitReader(VP8BitReader* const br, - const uint8_t* const start, size_t size); +void VP8InitBitReader(VP8BitReader* const br, const uint8_t* const start, + size_t size); // Sets the working read buffer. -void VP8BitReaderSetBuffer(VP8BitReader* const br, - const uint8_t* const start, size_t size); +void VP8BitReaderSetBuffer(VP8BitReader* const br, const uint8_t* const start, + size_t size); // Update internal pointers to displace the byte buffer by the // relative offset 'offset'. @@ -143,16 +143,15 @@ int32_t VP8GetSignedValue(VP8BitReader* const br, int num_bits, typedef uint64_t vp8l_val_t; // right now, this bit-reader can only use 64bit. typedef struct { - vp8l_val_t val; // pre-fetched bits - const uint8_t* buf; // input byte buffer - size_t len; // buffer length - size_t pos; // byte position in buf - int bit_pos; // current bit-reading position in val - int eos; // true if a bit was read past the end of buffer + vp8l_val_t val; // pre-fetched bits + const uint8_t* buf; // input byte buffer + size_t len; // buffer length + size_t pos; // byte position in buf + int bit_pos; // current bit-reading position in val + int eos; // true if a bit was read past the end of buffer } VP8LBitReader; -void VP8LInitBitReader(VP8LBitReader* const br, - const uint8_t* const start, +void VP8LInitBitReader(VP8LBitReader* const br, const uint8_t* const start, size_t length); // Sets a new data buffer. @@ -193,7 +192,7 @@ static WEBP_INLINE void VP8LFillBitWindow(VP8LBitReader* const br) { } #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_UTILS_BIT_READER_UTILS_H_ diff --git a/src/utils/bit_writer_utils.c b/src/utils/bit_writer_utils.c index 12cee6e8..54076cb1 100644 --- a/src/utils/bit_writer_utils.c +++ b/src/utils/bit_writer_utils.c @@ -12,14 +12,15 @@ // Author: Skal (pascal.massimino@gmail.com) // Vikas Arora (vikaas.arora@gmail.com) +#include "src/utils/bit_writer_utils.h" + #include #include -#include // for memcpy() +#include // for memcpy() -#include "src/utils/bit_writer_utils.h" -#include "src/webp/types.h" #include "src/utils/endian_inl_utils.h" #include "src/utils/utils.h" +#include "src/webp/types.h" //------------------------------------------------------------------------------ // VP8BitWriter @@ -74,7 +75,7 @@ static void Flush(VP8BitWriter* const bw) { bw->buf[pos++] = bits & 0xff; bw->pos = pos; } else { - bw->run++; // delay writing of bytes 0xff, pending eventual carry. + bw->run++; // delay writing of bytes 0xff, pending eventual carry. } } @@ -82,29 +83,24 @@ static void Flush(VP8BitWriter* const bw) { // renormalization static const uint8_t kNorm[128] = { // renorm_sizes[i] = 8 - log2(i) - 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0 -}; + 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}; // range = ((range + 1) << kVP8Log2Range[range]) - 1 static const uint8_t kNewRange[128] = { - 127, 127, 191, 127, 159, 191, 223, 127, 143, 159, 175, 191, 207, 223, 239, - 127, 135, 143, 151, 159, 167, 175, 183, 191, 199, 207, 215, 223, 231, 239, - 247, 127, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, - 183, 187, 191, 195, 199, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239, - 243, 247, 251, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, - 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, - 181, 183, 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, 205, 207, 209, - 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, - 241, 243, 245, 247, 249, 251, 253, 127 -}; + 127, 127, 191, 127, 159, 191, 223, 127, 143, 159, 175, 191, 207, 223, 239, + 127, 135, 143, 151, 159, 167, 175, 183, 191, 199, 207, 215, 223, 231, 239, + 247, 127, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, + 183, 187, 191, 195, 199, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239, + 243, 247, 251, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, + 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, + 181, 183, 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, 205, 207, 209, + 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, + 241, 243, 245, 247, 249, 251, 253, 127}; int VP8PutBit(VP8BitWriter* const bw, int bit, int prob) { const int split = (bw->range * prob) >> 8; @@ -114,7 +110,7 @@ int VP8PutBit(VP8BitWriter* const bw, int bit, int prob) { } else { bw->range = split; } - if (bw->range < 127) { // emit 'shift' bits out and renormalize + if (bw->range < 127) { // emit 'shift' bits out and renormalize const int shift = kNorm[bw->range]; bw->range = kNewRange[bw->range]; bw->value <<= shift; @@ -161,28 +157,28 @@ void VP8PutSignedBits(VP8BitWriter* const bw, int value, int nb_bits) { //------------------------------------------------------------------------------ int VP8BitWriterInit(VP8BitWriter* const bw, size_t expected_size) { - bw->range = 255 - 1; - bw->value = 0; - bw->run = 0; + bw->range = 255 - 1; + bw->value = 0; + bw->run = 0; bw->nb_bits = -8; - bw->pos = 0; + bw->pos = 0; bw->max_pos = 0; - bw->error = 0; - bw->buf = NULL; + bw->error = 0; + bw->buf = NULL; return (expected_size > 0) ? BitWriterResize(bw, expected_size) : 1; } uint8_t* VP8BitWriterFinish(VP8BitWriter* const bw) { VP8PutBits(bw, 0, 9 - bw->nb_bits); - bw->nb_bits = 0; // pad with zeroes + bw->nb_bits = 0; // pad with zeroes Flush(bw); return bw->buf; } -int VP8BitWriterAppend(VP8BitWriter* const bw, - const uint8_t* data, size_t size) { +int VP8BitWriterAppend(VP8BitWriter* const bw, const uint8_t* data, + size_t size) { assert(data != NULL); - if (bw->nb_bits != -8) return 0; // Flush() must have been called + if (bw->nb_bits != -8) return 0; // Flush() must have been called if (!BitWriterResize(bw, size)) return 0; memcpy(bw->buf + bw->pos, data, size); bw->pos += size; @@ -201,7 +197,7 @@ void VP8BitWriterWipeOut(VP8BitWriter* const bw) { // This is the minimum amount of size the memory buffer is guaranteed to grow // when extra space is needed. -#define MIN_EXTRA_SIZE (32768ULL) +#define MIN_EXTRA_SIZE (32768ULL) // Returns 1 on success. static int VP8LBitWriterResize(VP8LBitWriter* const bw, size_t extra_size) { diff --git a/src/utils/bit_writer_utils.h b/src/utils/bit_writer_utils.h index 48a7bdbf..4a4bdb05 100644 --- a/src/utils/bit_writer_utils.h +++ b/src/utils/bit_writer_utils.h @@ -27,14 +27,14 @@ extern "C" { typedef struct VP8BitWriter VP8BitWriter; struct VP8BitWriter { - int32_t range; // range-1 - int32_t value; - int run; // number of outstanding bits - int nb_bits; // number of pending bits - uint8_t* buf; // internal buffer. Re-allocated regularly. Not owned. - size_t pos; - size_t max_pos; - int error; // true in case of error + int32_t range; // range-1 + int32_t value; + int run; // number of outstanding bits + int nb_bits; // number of pending bits + uint8_t* buf; // internal buffer. Re-allocated regularly. Not owned. + size_t pos; + size_t max_pos; + int error; // true in case of error }; // Initialize the object. Allocates some initial memory based on expected_size. @@ -51,12 +51,12 @@ void VP8PutBits(VP8BitWriter* const bw, uint32_t value, int nb_bits); void VP8PutSignedBits(VP8BitWriter* const bw, int value, int nb_bits); // Appends some bytes to the internal buffer. Data is copied. -int VP8BitWriterAppend(VP8BitWriter* const bw, - const uint8_t* data, size_t size); +int VP8BitWriterAppend(VP8BitWriter* const bw, const uint8_t* data, + size_t size); // return approximate write position (in bits) static WEBP_INLINE uint64_t VP8BitWriterPos(const VP8BitWriter* const bw) { - const uint64_t nb_bits = 8 + bw->nb_bits; // bw->nb_bits is <= 0, note + const uint64_t nb_bits = 8 + bw->nb_bits; // bw->nb_bits is <= 0, note return (bw->pos + bw->run) * 8 + nb_bits; } @@ -72,28 +72,28 @@ static WEBP_INLINE size_t VP8BitWriterSize(const VP8BitWriter* const bw) { //------------------------------------------------------------------------------ // VP8LBitWriter -#if defined(__x86_64__) || defined(_M_X64) // 64bit -typedef uint64_t vp8l_atype_t; // accumulator type -typedef uint32_t vp8l_wtype_t; // writing type +#if defined(__x86_64__) || defined(_M_X64) // 64bit +typedef uint64_t vp8l_atype_t; // accumulator type +typedef uint32_t vp8l_wtype_t; // writing type #define WSWAP HToLE32 -#define VP8L_WRITER_BYTES 4 // sizeof(vp8l_wtype_t) -#define VP8L_WRITER_BITS 32 // 8 * sizeof(vp8l_wtype_t) +#define VP8L_WRITER_BYTES 4 // sizeof(vp8l_wtype_t) +#define VP8L_WRITER_BITS 32 // 8 * sizeof(vp8l_wtype_t) #define VP8L_WRITER_MAX_BITS 64 // 8 * sizeof(vp8l_atype_t) #else typedef uint32_t vp8l_atype_t; typedef uint16_t vp8l_wtype_t; #define WSWAP HToLE16 -#define VP8L_WRITER_BYTES 2 -#define VP8L_WRITER_BITS 16 +#define VP8L_WRITER_BYTES 2 +#define VP8L_WRITER_BITS 16 #define VP8L_WRITER_MAX_BITS 32 #endif typedef struct { - vp8l_atype_t bits; // bit accumulator - int used; // number of bits used in accumulator - uint8_t* buf; // start of buffer - uint8_t* cur; // current write position - uint8_t* end; // end of buffer + vp8l_atype_t bits; // bit accumulator + int used; // number of bits used in accumulator + uint8_t* buf; // start of buffer + uint8_t* cur; // current write position + uint8_t* end; // end of buffer // After all bits are written (VP8LBitWriterFinish()), the caller must observe // the state of 'error'. A value of 1 indicates that a memory allocation @@ -132,8 +132,8 @@ void VP8LPutBitsInternal(VP8LBitWriter* const bw, uint32_t bits, int n_bits); // This function can write up to 32 bits in one go, but VP8LBitReader can only // read 24 bits max (VP8L_MAX_NUM_BIT_READ). // VP8LBitWriter's 'error' flag is set in case of memory allocation error. -static WEBP_INLINE void VP8LPutBits(VP8LBitWriter* const bw, - uint32_t bits, int n_bits) { +static WEBP_INLINE void VP8LPutBits(VP8LBitWriter* const bw, uint32_t bits, + int n_bits) { if (sizeof(vp8l_wtype_t) == 4) { if (n_bits > 0) { if (bw->used >= 32) { @@ -150,7 +150,7 @@ static WEBP_INLINE void VP8LPutBits(VP8LBitWriter* const bw, //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_UTILS_BIT_WRITER_UTILS_H_ diff --git a/src/utils/bounds_safety.h b/src/utils/bounds_safety.h index fd7742d0..893cfab9 100644 --- a/src/utils/bounds_safety.h +++ b/src/utils/bounds_safety.h @@ -12,7 +12,7 @@ #ifndef WEBP_UTILS_BOUNDS_SAFETY_H_ #define WEBP_UTILS_BOUNDS_SAFETY_H_ -#include // For memcpy and friends +#include // For memcpy and friends // There's some inherent complexity here due to the way -fbounds-safety works. // Some annotations (notably __indexable and __bidi_indexable) change the ABI @@ -64,30 +64,30 @@ #define WEBP_INDEXABLE __indexable #define WEBP_BIDI_INDEXABLE __bidi_indexable -#define WEBP_UNSAFE_FORGE_SINGLE(typ, ptr) \ - __unsafe_forge_single(typ, ptr) +#define WEBP_UNSAFE_FORGE_SINGLE(typ, ptr) __unsafe_forge_single(typ, ptr) #define WEBP_UNSAFE_FORGE_BIDI_INDEXABLE(typ, ptr, size) \ __unsafe_forge_bidi_indexable(typ, ptr, size) // Provide memcpy/memset/memmove wrappers to make migration easier. -#define WEBP_UNSAFE_MEMCPY(dst, src, size) do { \ - memcpy(WEBP_UNSAFE_FORGE_BIDI_INDEXABLE(uint8_t*, dst, size), \ - WEBP_UNSAFE_FORGE_BIDI_INDEXABLE(uint8_t*, src, size), \ - size); \ +#define WEBP_UNSAFE_MEMCPY(dst, src, size) \ + do { \ + memcpy(WEBP_UNSAFE_FORGE_BIDI_INDEXABLE(uint8_t*, dst, size), \ + WEBP_UNSAFE_FORGE_BIDI_INDEXABLE(uint8_t*, src, size), size); \ } while (0) -#define WEBP_UNSAFE_MEMSET(dst, c, size) do { \ +#define WEBP_UNSAFE_MEMSET(dst, c, size) \ + do { \ memset(WEBP_UNSAFE_FORGE_BIDI_INDEXABLE(uint8_t*, dst, size), c, size); \ } while (0) -#define WEBP_UNSAFE_MEMMOVE(dst, src, size) do { \ - memmove(WEBP_UNSAFE_FORGE_BIDI_INDEXABLE(uint8_t*, dst, size), \ - WEBP_UNSAFE_FORGE_BIDI_INDEXABLE(uint8_t*, src, size), \ - size); \ +#define WEBP_UNSAFE_MEMMOVE(dst, src, size) \ + do { \ + memmove(WEBP_UNSAFE_FORGE_BIDI_INDEXABLE(uint8_t*, dst, size), \ + WEBP_UNSAFE_FORGE_BIDI_INDEXABLE(uint8_t*, src, size), size); \ } while (0) -#else // WEBP_SUPPORT_FBOUNDS_SAFETY +#else // WEBP_SUPPORT_FBOUNDS_SAFETY #define WEBP_ASSUME_UNSAFE_INDEXABLE_ABI @@ -109,5 +109,5 @@ #define WEBP_UNSAFE_FORGE_SINGLE(typ, ptr) ((typ)(ptr)) #define WEBP_UNSAFE_FORGE_BIDI_INDEXABLE(typ, ptr, size) ((typ)(ptr)) -#endif // WEBP_SUPPORT_FBOUNDS_SAFETY -#endif // WEBP_UTILS_BOUNDS_SAFETY_H_ +#endif // WEBP_SUPPORT_FBOUNDS_SAFETY +#endif // WEBP_UTILS_BOUNDS_SAFETY_H_ diff --git a/src/utils/color_cache_utils.c b/src/utils/color_cache_utils.c index cd8be1f7..eef08067 100644 --- a/src/utils/color_cache_utils.c +++ b/src/utils/color_cache_utils.c @@ -11,13 +11,14 @@ // // Author: Jyrki Alakuijala (jyrki@google.com) +#include "src/utils/color_cache_utils.h" + #include #include #include -#include "src/utils/color_cache_utils.h" -#include "src/webp/types.h" #include "src/utils/utils.h" +#include "src/webp/types.h" //------------------------------------------------------------------------------ // VP8LColorCache. @@ -26,8 +27,8 @@ int VP8LColorCacheInit(VP8LColorCache* const color_cache, int hash_bits) { const int hash_size = 1 << hash_bits; assert(color_cache != NULL); assert(hash_bits > 0); - color_cache->colors = (uint32_t*)WebPSafeCalloc( - (uint64_t)hash_size, sizeof(*color_cache->colors)); + color_cache->colors = (uint32_t*)WebPSafeCalloc((uint64_t)hash_size, + sizeof(*color_cache->colors)); if (color_cache->colors == NULL) return 0; color_cache->hash_shift = 32 - hash_bits; color_cache->hash_bits = hash_bits; diff --git a/src/utils/color_cache_utils.h b/src/utils/color_cache_utils.h index ac8d9815..efcab340 100644 --- a/src/utils/color_cache_utils.h +++ b/src/utils/color_cache_utils.h @@ -34,13 +34,13 @@ typedef struct { static const uint32_t kHashMul = 0x1e35a7bdu; -static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE -int VP8LHashPix(uint32_t argb, int shift) { +static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE int VP8LHashPix( + uint32_t argb, int shift) { return (int)((argb * kHashMul) >> shift); } -static WEBP_INLINE uint32_t VP8LColorCacheLookup( - const VP8LColorCache* const cc, uint32_t key) { +static WEBP_INLINE uint32_t VP8LColorCacheLookup(const VP8LColorCache* const cc, + uint32_t key) { assert((key >> cc->hash_bits) == 0u); return cc->colors[key]; } diff --git a/src/utils/endian_inl_utils.h b/src/utils/endian_inl_utils.h index 3630a293..9983e3eb 100644 --- a/src/utils/endian_inl_utils.h +++ b/src/utils/endian_inl_utils.h @@ -28,13 +28,13 @@ #endif #if !defined(HAVE_CONFIG_H) -#if LOCAL_GCC_PREREQ(4,8) || __has_builtin(__builtin_bswap16) +#if LOCAL_GCC_PREREQ(4, 8) || __has_builtin(__builtin_bswap16) #define HAVE_BUILTIN_BSWAP16 #endif -#if LOCAL_GCC_PREREQ(4,3) || __has_builtin(__builtin_bswap32) +#if LOCAL_GCC_PREREQ(4, 3) || __has_builtin(__builtin_bswap32) #define HAVE_BUILTIN_BSWAP32 #endif -#if LOCAL_GCC_PREREQ(4,3) || __has_builtin(__builtin_bswap64) +#if LOCAL_GCC_PREREQ(4, 3) || __has_builtin(__builtin_bswap64) #define HAVE_BUILTIN_BSWAP64 #endif #endif // !HAVE_CONFIG_H @@ -53,12 +53,11 @@ static WEBP_INLINE uint16_t BSwap16(uint16_t x) { static WEBP_INLINE uint32_t BSwap32(uint32_t x) { #if defined(WEBP_USE_MIPS32_R2) uint32_t ret; - __asm__ volatile ( - "wsbh %[ret], %[x] \n\t" - "rotr %[ret], %[ret], 16 \n\t" - : [ret]"=r"(ret) - : [x]"r"(x) - ); + __asm__ volatile( + "wsbh %[ret], %[x] \n\t" + "rotr %[ret], %[ret], 16 \n\t" + : [ret] "=r"(ret) + : [x] "r"(x)); return ret; #elif defined(HAVE_BUILTIN_BSWAP32) return __builtin_bswap32(x); @@ -82,10 +81,10 @@ static WEBP_INLINE uint64_t BSwap64(uint64_t x) { return swapped_bytes; #elif defined(_MSC_VER) return (uint64_t)_byteswap_uint64(x); -#else // generic code for swapping 64-bit values (suggested by bdb@) +#else // generic code for swapping 64-bit values (suggested by bdb@) x = ((x & 0xffffffff00000000ull) >> 32) | ((x & 0x00000000ffffffffull) << 32); x = ((x & 0xffff0000ffff0000ull) >> 16) | ((x & 0x0000ffff0000ffffull) << 16); - x = ((x & 0xff00ff00ff00ff00ull) >> 8) | ((x & 0x00ff00ff00ff00ffull) << 8); + x = ((x & 0xff00ff00ff00ff00ull) >> 8) | ((x & 0x00ff00ff00ff00ffull) << 8); return x; #endif // HAVE_BUILTIN_BSWAP64 } diff --git a/src/utils/filters_utils.c b/src/utils/filters_utils.c index 9286d371..9f93cbb0 100644 --- a/src/utils/filters_utils.c +++ b/src/utils/filters_utils.c @@ -11,26 +11,27 @@ // // Author: Urvang (urvang@google.com) +#include "src/utils/filters_utils.h" + #include #include #include "src/dsp/dsp.h" #include "src/webp/types.h" -#include "src/utils/filters_utils.h" // ----------------------------------------------------------------------------- // Quick estimate of a potentially interesting filter mode to try. #define SMAX 16 -#define SDIFF(a, b) (abs((a) - (b)) >> 4) // Scoring diff, in [0..SMAX) +#define SDIFF(a, b) (abs((a) - (b)) >> 4) // Scoring diff, in [0..SMAX) static WEBP_INLINE int GradientPredictor(uint8_t a, uint8_t b, uint8_t c) { const int g = a + b - c; return ((g & ~0xff) == 0) ? g : (g < 0) ? 0 : 255; // clip to 8bit } -WEBP_FILTER_TYPE WebPEstimateBestFilter(const uint8_t* data, - int width, int height, int stride) { +WEBP_FILTER_TYPE WebPEstimateBestFilter(const uint8_t* data, int width, + int height, int stride) { int i, j; int bins[WEBP_FILTER_LAST][SMAX]; memset(bins, 0, sizeof(bins)); diff --git a/src/utils/filters_utils.h b/src/utils/filters_utils.h index 8e9418df..70687540 100644 --- a/src/utils/filters_utils.h +++ b/src/utils/filters_utils.h @@ -22,11 +22,11 @@ extern "C" { #endif // Fast estimate of a potentially good filter. -WEBP_FILTER_TYPE WebPEstimateBestFilter(const uint8_t* data, - int width, int height, int stride); +WEBP_FILTER_TYPE WebPEstimateBestFilter(const uint8_t* data, int width, + int height, int stride); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_UTILS_FILTERS_UTILS_H_ diff --git a/src/utils/huffman_encode_utils.c b/src/utils/huffman_encode_utils.c index 1710063f..5ce542b1 100644 --- a/src/utils/huffman_encode_utils.c +++ b/src/utils/huffman_encode_utils.c @@ -11,14 +11,15 @@ // // Entropy encoding (Huffman) for webp lossless. +#include "src/utils/huffman_encode_utils.h" + #include #include #include -#include "src/utils/huffman_encode_utils.h" -#include "src/webp/types.h" #include "src/utils/utils.h" #include "src/webp/format_constants.h" +#include "src/webp/types.h" // ----------------------------------------------------------------------------- // Util function to optimize the symbol map for RLE coding @@ -53,8 +54,7 @@ static void OptimizeHuffmanForRle(int length, uint8_t* const good_for_rle, int stride = 0; for (i = 0; i < length + 1; ++i) { if (i == length || counts[i] != symbol) { - if ((symbol == 0 && stride >= 5) || - (symbol != 0 && stride >= 7)) { + if ((symbol == 0 && stride >= 5) || (symbol != 0 && stride >= 7)) { int k; for (k = 0; k < stride; ++k) { good_for_rle[i - k - 1] = 1; @@ -75,8 +75,7 @@ static void OptimizeHuffmanForRle(int length, uint8_t* const good_for_rle, uint32_t limit = counts[0]; uint32_t sum = 0; for (i = 0; i < length + 1; ++i) { - if (i == length || good_for_rle[i] || - (i != 0 && good_for_rle[i - 1]) || + if (i == length || good_for_rle[i] || (i != 0 && good_for_rle[i - 1]) || !ValuesShouldBeCollapsedToStrideAverage(counts[i], limit)) { if (stride >= 4 || (stride >= 3 && sum == 0)) { uint32_t k; @@ -100,8 +99,9 @@ static void OptimizeHuffmanForRle(int length, uint8_t* const good_for_rle, if (i < length - 3) { // All interesting strides have a count of at least 4, // at least when non-zeros. - limit = (counts[i] + counts[i + 1] + - counts[i + 2] + counts[i + 3] + 2) / 4; + limit = + (counts[i] + counts[i + 1] + counts[i + 2] + counts[i + 3] + 2) / + 4; } else if (i < length) { limit = counts[i]; } else { @@ -165,8 +165,8 @@ static void SetBitDepths(const HuffmanTree* const tree, // // See https://en.wikipedia.org/wiki/Huffman_coding static void GenerateOptimalTree(const uint32_t* const histogram, - int histogram_size, - HuffmanTree* tree, int tree_depth_limit, + int histogram_size, HuffmanTree* tree, + int tree_depth_limit, uint8_t* const bit_depths) { uint32_t count_min; HuffmanTree* tree_pool; @@ -179,7 +179,7 @@ static void GenerateOptimalTree(const uint32_t* const histogram, } } - if (tree_size_orig == 0) { // pretty optimal already! + if (tree_size_orig == 0) { // pretty optimal already! return; } @@ -190,7 +190,7 @@ static void GenerateOptimalTree(const uint32_t* const histogram, // If we actually start running inside this loop a lot, we would perhaps // be better off with the Katajainen algorithm. assert(tree_size_orig <= (1 << (tree_depth_limit - 1))); - for (count_min = 1; ; count_min *= 2) { + for (count_min = 1;; count_min *= 2) { int tree_size = tree_size_orig; // We need to pack the Huffman tree in tree_depth_limit bits. // So, we try by faking histogram entries to be at least 'count_min'. @@ -261,8 +261,8 @@ static void GenerateOptimalTree(const uint32_t* const histogram, // Coding of the Huffman tree values static HuffmanTreeToken* CodeRepeatedValues(int repetitions, - HuffmanTreeToken* tokens, - int value, int prev_value) { + HuffmanTreeToken* tokens, int value, + int prev_value) { assert(value <= MAX_ALLOWED_CODE_LENGTH); if (value != prev_value) { tokens->code = value; @@ -300,7 +300,7 @@ static HuffmanTreeToken* CodeRepeatedZeros(int repetitions, if (repetitions < 3) { int i; for (i = 0; i < repetitions; ++i) { - tokens->code = 0; // 0-value + tokens->code = 0; // 0-value tokens->extra_bits = 0; ++tokens; } @@ -348,17 +348,16 @@ int VP8LCreateCompressedHuffmanTree(const HuffmanTreeCode* const tree, i += runs; assert(tokens <= ending_token); } - (void)ending_token; // suppress 'unused variable' warning + (void)ending_token; // suppress 'unused variable' warning return (int)(tokens - starting_token); } // ----------------------------------------------------------------------------- // Pre-reversed 4-bit values. -static const uint8_t kReversedBits[16] = { - 0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe, - 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf -}; +static const uint8_t kReversedBits[16] = {0x0, 0x8, 0x4, 0xc, 0x2, 0xa, + 0x6, 0xe, 0x1, 0x9, 0x5, 0xd, + 0x3, 0xb, 0x7, 0xf}; static uint32_t ReverseBits(int num_bits, uint32_t bits) { uint32_t retval = 0; @@ -378,7 +377,7 @@ static void ConvertBitDepthsToSymbols(HuffmanTreeCode* const tree) { int i; int len; uint32_t next_code[MAX_ALLOWED_CODE_LENGTH + 1]; - int depth_count[MAX_ALLOWED_CODE_LENGTH + 1] = { 0 }; + int depth_count[MAX_ALLOWED_CODE_LENGTH + 1] = {0}; assert(tree != NULL); len = tree->num_symbols; diff --git a/src/utils/huffman_encode_utils.h b/src/utils/huffman_encode_utils.h index 4252e823..c1280476 100644 --- a/src/utils/huffman_encode_utils.h +++ b/src/utils/huffman_encode_utils.h @@ -22,23 +22,23 @@ extern "C" { // Struct for holding the tree header in coded form. typedef struct { - uint8_t code; // value (0..15) or escape code (16,17,18) - uint8_t extra_bits; // extra bits for escape codes + uint8_t code; // value (0..15) or escape code (16,17,18) + uint8_t extra_bits; // extra bits for escape codes } HuffmanTreeToken; // Struct to represent the tree codes (depth and bits array). typedef struct { - int num_symbols; // Number of symbols. - uint8_t* code_lengths; // Code lengths of the symbols. - uint16_t* codes; // Symbol Codes. + int num_symbols; // Number of symbols. + uint8_t* code_lengths; // Code lengths of the symbols. + uint16_t* codes; // Symbol Codes. } HuffmanTreeCode; // Struct to represent the Huffman tree. typedef struct { - uint32_t total_count; // Symbol frequency. - int value; // Symbol value. - int pool_index_left; // Index for the left sub-tree. - int pool_index_right; // Index for the right sub-tree. + uint32_t total_count; // Symbol frequency. + int value; // Symbol value. + int pool_index_left; // Index for the left sub-tree. + int pool_index_right; // Index for the right sub-tree. } HuffmanTree; // Turn the Huffman tree into a token sequence. diff --git a/src/utils/huffman_utils.c b/src/utils/huffman_utils.c index ca7bafd5..ee90a6d4 100644 --- a/src/utils/huffman_utils.c +++ b/src/utils/huffman_utils.c @@ -11,18 +11,19 @@ // // Author: Urvang Joshi (urvang@google.com) +#include "src/utils/huffman_utils.h" + #include #include #include -#include "src/utils/huffman_utils.h" #include "src/utils/utils.h" #include "src/webp/format_constants.h" #include "src/webp/types.h" // Huffman data read via DecodeImageStream is represented in two (red and green) // bytes. -#define MAX_HTREE_GROUPS 0x10000 +#define MAX_HTREE_GROUPS 0x10000 HTreeGroup* VP8LHtreeGroupsNew(int num_htree_groups) { HTreeGroup* const htree_groups = @@ -52,8 +53,7 @@ static WEBP_INLINE uint32_t GetNextKey(uint32_t key, int len) { // Stores code in table[0], table[step], table[2*step], ..., table[end]. // Assumes that end is an integer multiple of step. -static WEBP_INLINE void ReplicateValue(HuffmanCode* table, - int step, int end, +static WEBP_INLINE void ReplicateValue(HuffmanCode* table, int step, int end, HuffmanCode code) { assert(end % step == 0); do { @@ -65,8 +65,8 @@ static WEBP_INLINE void ReplicateValue(HuffmanCode* table, // Returns the table width of the next 2nd level table. count is the histogram // of bit lengths for the remaining symbols, len is the code length of the next // processed symbol -static WEBP_INLINE int NextTableBitSize(const int* const count, - int len, int root_bits) { +static WEBP_INLINE int NextTableBitSize(const int* const count, int len, + int root_bits) { int left = 1 << (len - root_bits); while (len < MAX_ALLOWED_CODE_LENGTH) { left -= count[len]; @@ -87,7 +87,7 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits, int len; // current code length int symbol; // symbol index in original or sorted table // number of codes of each length: - int count[MAX_ALLOWED_CODE_LENGTH + 1] = { 0 }; + int count[MAX_ALLOWED_CODE_LENGTH + 1] = {0}; // offsets in sorted table for each length: int offset[MAX_ALLOWED_CODE_LENGTH + 1]; @@ -150,12 +150,12 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits, } { - int step; // step size to replicate values in current table - uint32_t low = 0xffffffffu; // low bits for current root entry - uint32_t mask = total_size - 1; // mask for low bits - uint32_t key = 0; // reversed prefix code - int num_nodes = 1; // number of Huffman tree nodes - int num_open = 1; // number of open branches in current tree level + int step; // step size to replicate values in current table + uint32_t low = 0xffffffffu; // low bits for current root entry + uint32_t mask = total_size - 1; // mask for low bits + uint32_t key = 0; // reversed prefix code + int num_nodes = 1; // number of Huffman tree nodes + int num_open = 1; // number of open branches in current tree level int table_bits = root_bits; // key length of current table int table_size = 1 << table_bits; // size of current table symbol = 0; diff --git a/src/utils/huffman_utils.h b/src/utils/huffman_utils.h index 5e19a7e2..b8c71cde 100644 --- a/src/utils/huffman_utils.h +++ b/src/utils/huffman_utils.h @@ -23,25 +23,24 @@ extern "C" { #endif -#define HUFFMAN_TABLE_BITS 8 -#define HUFFMAN_TABLE_MASK ((1 << HUFFMAN_TABLE_BITS) - 1) - -#define LENGTHS_TABLE_BITS 7 -#define LENGTHS_TABLE_MASK ((1 << LENGTHS_TABLE_BITS) - 1) +#define HUFFMAN_TABLE_BITS 8 +#define HUFFMAN_TABLE_MASK ((1 << HUFFMAN_TABLE_BITS) - 1) +#define LENGTHS_TABLE_BITS 7 +#define LENGTHS_TABLE_MASK ((1 << LENGTHS_TABLE_BITS) - 1) // Huffman lookup table entry typedef struct { - uint8_t bits; // number of bits used for this symbol - uint16_t value; // symbol value or table offset + uint8_t bits; // number of bits used for this symbol + uint16_t value; // symbol value or table offset } HuffmanCode; // long version for holding 32b values typedef struct { - int bits; // number of bits used for this symbol, - // or an impossible value if not a literal code. - uint32_t value; // 32b packed ARGB value if literal, - // or non-literal symbol otherwise + int bits; // number of bits used for this symbol, + // or an impossible value if not a literal code. + uint32_t value; // 32b packed ARGB value if literal, + // or non-literal symbol otherwise } HuffmanCode32; // Contiguous memory segment of HuffmanCodes. @@ -81,13 +80,13 @@ void VP8LHuffmanTablesDeallocate(HuffmanTables* const huffman_tables); typedef struct HTreeGroup HTreeGroup; struct HTreeGroup { HuffmanCode* htrees[HUFFMAN_CODES_PER_META_CODE]; - int is_trivial_literal; // True, if huffman trees for Red, Blue & Alpha - // Symbols are trivial (have a single code). - uint32_t literal_arb; // If is_trivial_literal is true, this is the - // ARGB value of the pixel, with Green channel - // being set to zero. - int is_trivial_code; // true if is_trivial_literal with only one code - int use_packed_table; // use packed table below for short literal code + int is_trivial_literal; // True, if huffman trees for Red, Blue & Alpha + // Symbols are trivial (have a single code). + uint32_t literal_arb; // If is_trivial_literal is true, this is the + // ARGB value of the pixel, with Green channel + // being set to zero. + int is_trivial_code; // true if is_trivial_literal with only one code + int use_packed_table; // use packed table below for short literal code // table mapping input bits to a packed values, or escape case to literal code HuffmanCode32 packed_table[HUFFMAN_PACKED_TABLE_SIZE]; }; @@ -109,7 +108,7 @@ WEBP_NODISCARD int VP8LBuildHuffmanTable(HuffmanTables* const root_table, int code_lengths_size); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_UTILS_HUFFMAN_UTILS_H_ diff --git a/src/utils/quant_levels_dec_utils.c b/src/utils/quant_levels_dec_utils.c index b42aa1b3..2d14eb9a 100644 --- a/src/utils/quant_levels_dec_utils.c +++ b/src/utils/quant_levels_dec_utils.c @@ -16,44 +16,43 @@ #include "src/utils/quant_levels_dec_utils.h" -#include // for memset +#include // for memset #include "src/utils/utils.h" #include "src/webp/types.h" // #define USE_DITHERING // uncomment to enable ordered dithering (not vital) -#define FIX 16 // fix-point precision for averaging -#define LFIX 2 // extra precision for look-up table +#define FIX 16 // fix-point precision for averaging +#define LFIX 2 // extra precision for look-up table #define LUT_SIZE ((1 << (8 + LFIX)) - 1) // look-up table size #if defined(USE_DITHERING) -#define DFIX 4 // extra precision for ordered dithering -#define DSIZE 4 // dithering size (must be a power of two) +#define DFIX 4 // extra precision for ordered dithering +#define DSIZE 4 // dithering size (must be a power of two) // cf. https://en.wikipedia.org/wiki/Ordered_dithering static const uint8_t kOrderedDither[DSIZE][DSIZE] = { - { 0, 8, 2, 10 }, // coefficients are in DFIX fixed-point precision - { 12, 4, 14, 6 }, - { 3, 11, 1, 9 }, - { 15, 7, 13, 5 } -}; + {0, 8, 2, 10}, // coefficients are in DFIX fixed-point precision + {12, 4, 14, 6}, + {3, 11, 1, 9}, + {15, 7, 13, 5}}; #else #define DFIX 0 #endif typedef struct { - int width, height; // dimension - int stride; // stride in bytes - int row; // current input row being processed - uint8_t* src; // input pointer - uint8_t* dst; // output pointer + int width, height; // dimension + int stride; // stride in bytes + int row; // current input row being processed + uint8_t* src; // input pointer + uint8_t* dst; // output pointer - int radius; // filter radius (=delay) - int scale; // normalization factor, in FIX bits precision + int radius; // filter radius (=delay) + int scale; // normalization factor, in FIX bits precision - void* mem; // all memory + void* mem; // all memory // various scratch buffers uint16_t* start; @@ -63,9 +62,9 @@ typedef struct { uint16_t* average; // input levels distribution - int num_levels; // number of quantized levels - int min, max; // min and max level values - int min_level_dist; // smallest distance between two consecutive levels + int num_levels; // number of quantized levels + int min, max; // min and max level values + int min_level_dist; // smallest distance between two consecutive levels int16_t* correction; // size = 1 + 2*LUT_SIZE -> ~4k memory } SmoothParams; @@ -85,7 +84,7 @@ static void VFilter(SmoothParams* const p) { uint16_t* const cur = p->cur; const uint16_t* const top = p->top; uint16_t* const out = p->end; - uint16_t sum = 0; // all arithmetic is modulo 16bit + uint16_t sum = 0; // all arithmetic is modulo 16bit int x; for (x = 0; x < w; ++x) { @@ -116,15 +115,15 @@ static void HFilter(SmoothParams* const p) { const int r = p->radius; int x; - for (x = 0; x <= r; ++x) { // left mirroring + for (x = 0; x <= r; ++x) { // left mirroring const uint16_t delta = in[x + r - 1] + in[r - x]; out[x] = (delta * scale) >> FIX; } - for (; x < w - r; ++x) { // bulk middle run + for (; x < w - r; ++x) { // bulk middle run const uint16_t delta = in[x + r] - in[x - r - 1]; out[x] = (delta * scale) >> FIX; } - for (; x < w; ++x) { // right mirroring + for (; x < w; ++x) { // right mirroring const uint16_t delta = 2 * in[w - 1] - in[2 * w - 2 - r - x] - in[x - r - 1]; out[x] = (delta * scale) >> FIX; @@ -171,9 +170,9 @@ static void InitCorrectionLUT(int16_t* const lut, int min_dist) { const int delta = threshold1 - threshold2; int i; for (i = 1; i <= LUT_SIZE; ++i) { - int c = (i <= threshold2) ? (i << DFIX) - : (i < threshold1) ? max_threshold * (threshold1 - i) / delta - : 0; + int c = (i <= threshold2) ? (i << DFIX) + : (i < threshold1) ? max_threshold * (threshold1 - i) / delta + : 0; c >>= LFIX; lut[+i] = +c; lut[-i] = -c; @@ -183,7 +182,7 @@ static void InitCorrectionLUT(int16_t* const lut, int min_dist) { static void CountLevels(SmoothParams* const p) { int i, j, last_level; - uint8_t used_levels[256] = { 0 }; + uint8_t used_levels[256] = {0}; const uint8_t* data = p->src; p->min = 255; p->max = 0; @@ -219,7 +218,7 @@ static int InitParams(uint8_t* const data, int width, int height, int stride, const int R = 2 * radius + 1; // total size of the kernel const size_t size_scratch_m = (R + 1) * width * sizeof(*p->start); - const size_t size_m = width * sizeof(*p->average); + const size_t size_m = width * sizeof(*p->average); const size_t size_lut = (1 + 2 * LUT_SIZE) * sizeof(*p->correction); const size_t total_size = size_scratch_m + size_m + size_lut; uint8_t* mem = (uint8_t*)WebPSafeMalloc(1U, total_size); @@ -256,9 +255,7 @@ static int InitParams(uint8_t* const data, int width, int height, int stride, return 1; } -static void CleanupParams(SmoothParams* const p) { - WebPSafeFree(p->mem); -} +static void CleanupParams(SmoothParams* const p) { WebPSafeFree(p->mem); } int WebPDequantizeLevels(uint8_t* const data, int width, int height, int stride, int strength) { diff --git a/src/utils/quant_levels_dec_utils.h b/src/utils/quant_levels_dec_utils.h index 327f19f3..ba4af446 100644 --- a/src/utils/quant_levels_dec_utils.h +++ b/src/utils/quant_levels_dec_utils.h @@ -29,7 +29,7 @@ int WebPDequantizeLevels(uint8_t* const data, int width, int height, int stride, int strength); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_UTILS_QUANT_LEVELS_DEC_UTILS_H_ diff --git a/src/utils/quant_levels_utils.c b/src/utils/quant_levels_utils.c index 549417e0..3e4311f4 100644 --- a/src/utils/quant_levels_utils.c +++ b/src/utils/quant_levels_utils.c @@ -12,25 +12,26 @@ // // Author: Skal (pascal.massimino@gmail.com) +#include "src/utils/quant_levels_utils.h" + #include #include #include "src/webp/types.h" -#include "src/utils/quant_levels_utils.h" -#define NUM_SYMBOLS 256 +#define NUM_SYMBOLS 256 -#define MAX_ITER 6 // Maximum number of convergence steps. -#define ERROR_THRESHOLD 1e-4 // MSE stopping criterion. +#define MAX_ITER 6 // Maximum number of convergence steps. +#define ERROR_THRESHOLD 1e-4 // MSE stopping criterion. // ----------------------------------------------------------------------------- // Quantize levels. -int QuantizeLevels(uint8_t* const data, int width, int height, - int num_levels, uint64_t* const sse) { - int freq[NUM_SYMBOLS] = { 0 }; - int q_level[NUM_SYMBOLS] = { 0 }; - double inv_q_level[NUM_SYMBOLS] = { 0 }; +int QuantizeLevels(uint8_t* const data, int width, int height, int num_levels, + uint64_t* const sse) { + int freq[NUM_SYMBOLS] = {0}; + int q_level[NUM_SYMBOLS] = {0}; + double inv_q_level[NUM_SYMBOLS] = {0}; int min_s = 255, max_s = 0; const size_t data_size = height * width; int i, num_levels_in, iter; @@ -75,8 +76,8 @@ int QuantizeLevels(uint8_t* const data, int width, int height, // k-Means iterations. for (iter = 0; iter < MAX_ITER; ++iter) { - double q_sum[NUM_SYMBOLS] = { 0 }; - double q_count[NUM_SYMBOLS] = { 0 }; + double q_sum[NUM_SYMBOLS] = {0}; + double q_count[NUM_SYMBOLS] = {0}; int s, slot = 0; // Assign classes to representatives. @@ -133,7 +134,7 @@ int QuantizeLevels(uint8_t* const data, int width, int height, data[n] = map[data[n]]; } } - End: +End: // Store sum of squared error if needed. if (sse != NULL) *sse = (uint64_t)err; diff --git a/src/utils/quant_levels_utils.h b/src/utils/quant_levels_utils.h index 9ee3ea00..688f8546 100644 --- a/src/utils/quant_levels_utils.h +++ b/src/utils/quant_levels_utils.h @@ -30,7 +30,7 @@ int QuantizeLevels(uint8_t* const data, int width, int height, int num_levels, uint64_t* const sse); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_UTILS_QUANT_LEVELS_UTILS_H_ diff --git a/src/utils/random_utils.c b/src/utils/random_utils.c index 56380610..63359873 100644 --- a/src/utils/random_utils.c +++ b/src/utils/random_utils.c @@ -11,34 +11,35 @@ // // Author: Skal (pascal.massimino@gmail.com) +#include "src/utils/random_utils.h" + #include #include "src/webp/types.h" -#include "src/utils/random_utils.h" //------------------------------------------------------------------------------ // 31b-range values static const uint32_t kRandomTable[VP8_RANDOM_TABLE_SIZE] = { - 0x0de15230, 0x03b31886, 0x775faccb, 0x1c88626a, 0x68385c55, 0x14b3b828, - 0x4a85fef8, 0x49ddb84b, 0x64fcf397, 0x5c550289, 0x4a290000, 0x0d7ec1da, - 0x5940b7ab, 0x5492577d, 0x4e19ca72, 0x38d38c69, 0x0c01ee65, 0x32a1755f, - 0x5437f652, 0x5abb2c32, 0x0faa57b1, 0x73f533e7, 0x685feeda, 0x7563cce2, - 0x6e990e83, 0x4730a7ed, 0x4fc0d9c6, 0x496b153c, 0x4f1403fa, 0x541afb0c, - 0x73990b32, 0x26d7cb1c, 0x6fcc3706, 0x2cbb77d8, 0x75762f2a, 0x6425ccdd, - 0x24b35461, 0x0a7d8715, 0x220414a8, 0x141ebf67, 0x56b41583, 0x73e502e3, - 0x44cab16f, 0x28264d42, 0x73baaefb, 0x0a50ebed, 0x1d6ab6fb, 0x0d3ad40b, - 0x35db3b68, 0x2b081e83, 0x77ce6b95, 0x5181e5f0, 0x78853bbc, 0x009f9494, - 0x27e5ed3c -}; + 0x0de15230, 0x03b31886, 0x775faccb, 0x1c88626a, 0x68385c55, 0x14b3b828, + 0x4a85fef8, 0x49ddb84b, 0x64fcf397, 0x5c550289, 0x4a290000, 0x0d7ec1da, + 0x5940b7ab, 0x5492577d, 0x4e19ca72, 0x38d38c69, 0x0c01ee65, 0x32a1755f, + 0x5437f652, 0x5abb2c32, 0x0faa57b1, 0x73f533e7, 0x685feeda, 0x7563cce2, + 0x6e990e83, 0x4730a7ed, 0x4fc0d9c6, 0x496b153c, 0x4f1403fa, 0x541afb0c, + 0x73990b32, 0x26d7cb1c, 0x6fcc3706, 0x2cbb77d8, 0x75762f2a, 0x6425ccdd, + 0x24b35461, 0x0a7d8715, 0x220414a8, 0x141ebf67, 0x56b41583, 0x73e502e3, + 0x44cab16f, 0x28264d42, 0x73baaefb, 0x0a50ebed, 0x1d6ab6fb, 0x0d3ad40b, + 0x35db3b68, 0x2b081e83, 0x77ce6b95, 0x5181e5f0, 0x78853bbc, 0x009f9494, + 0x27e5ed3c}; void VP8InitRandom(VP8Random* const rg, float dithering) { memcpy(rg->tab, kRandomTable, sizeof(rg->tab)); rg->index1 = 0; rg->index2 = 31; rg->amp = (dithering < 0.0) ? 0 - : (dithering > 1.0) ? (1 << VP8_RANDOM_DITHER_FIX) - : (uint32_t)((1 << VP8_RANDOM_DITHER_FIX) * dithering); + : (dithering > 1.0) + ? (1 << VP8_RANDOM_DITHER_FIX) + : (uint32_t)((1 << VP8_RANDOM_DITHER_FIX) * dithering); } //------------------------------------------------------------------------------ diff --git a/src/utils/random_utils.h b/src/utils/random_utils.h index 2fbb2002..203723a9 100644 --- a/src/utils/random_utils.h +++ b/src/utils/random_utils.h @@ -22,7 +22,7 @@ extern "C" { #endif -#define VP8_RANDOM_DITHER_FIX 8 // fixed-point precision for dithering +#define VP8_RANDOM_DITHER_FIX 8 // fixed-point precision for dithering #define VP8_RANDOM_TABLE_SIZE 55 typedef struct { @@ -58,7 +58,7 @@ static WEBP_INLINE int VP8RandomBits(VP8Random* const rg, int num_bits) { } #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_UTILS_RANDOM_UTILS_H_ diff --git a/src/utils/rescaler_utils.c b/src/utils/rescaler_utils.c index 32dd0af2..114fa2ec 100644 --- a/src/utils/rescaler_utils.c +++ b/src/utils/rescaler_utils.c @@ -11,23 +11,23 @@ // // Author: Skal (pascal.massimino@gmail.com) +#include "src/utils/rescaler_utils.h" + #include #include #include #include #include "src/dsp/dsp.h" -#include "src/webp/types.h" -#include "src/utils/rescaler_utils.h" #include "src/utils/utils.h" +#include "src/webp/types.h" //------------------------------------------------------------------------------ -int WebPRescalerInit(WebPRescaler* const rescaler, - int src_width, int src_height, - uint8_t* const dst, - int dst_width, int dst_height, int dst_stride, - int num_channels, rescaler_t* const work) { +int WebPRescalerInit(WebPRescaler* const rescaler, int src_width, + int src_height, uint8_t* const dst, int dst_width, + int dst_height, int dst_stride, int num_channels, + rescaler_t* const work) { const int x_add = src_width, x_sub = dst_width; const int y_add = src_height, y_sub = dst_height; const uint64_t total_size = 2ull * dst_width * num_channels * sizeof(*work); @@ -136,7 +136,7 @@ int WebPRescalerImport(WebPRescaler* const rescaler, int num_lines, rescaler->frow = tmp; } WebPRescalerImportRow(rescaler, src); - if (!rescaler->y_expand) { // Accumulate the contribution of the new row. + if (!rescaler->y_expand) { // Accumulate the contribution of the new row. int x; for (x = 0; x < rescaler->num_channels * rescaler->dst_width; ++x) { rescaler->irow[x] += rescaler->frow[x]; diff --git a/src/utils/rescaler_utils.h b/src/utils/rescaler_utils.h index ef201ef8..d484d13a 100644 --- a/src/utils/rescaler_utils.h +++ b/src/utils/rescaler_utils.h @@ -20,13 +20,13 @@ extern "C" { #include "src/webp/types.h" -#define WEBP_RESCALER_RFIX 32 // fixed-point precision for multiplies +#define WEBP_RESCALER_RFIX 32 // fixed-point precision for multiplies #define WEBP_RESCALER_ONE (1ull << WEBP_RESCALER_RFIX) #define WEBP_RESCALER_FRAC(x, y) \ - ((uint32_t)(((uint64_t)(x) << WEBP_RESCALER_RFIX) / (y))) + ((uint32_t)(((uint64_t)(x) << WEBP_RESCALER_RFIX) / (y))) // Structure used for on-the-fly rescaling -typedef uint32_t rescaler_t; // type for side-buffer +typedef uint32_t rescaler_t; // type for side-buffer typedef struct WebPRescaler WebPRescaler; struct WebPRescaler { int x_expand; // true if we're expanding in the x direction @@ -43,16 +43,14 @@ struct WebPRescaler { int src_y, dst_y; // row counters for input and output uint8_t* dst; int dst_stride; - rescaler_t* irow, *frow; // work buffer + rescaler_t *irow, *frow; // work buffer }; // Initialize a rescaler given scratch area 'work' and dimensions of src & dst. // Returns false in case of error. -int WebPRescalerInit(WebPRescaler* const rescaler, - int src_width, int src_height, - uint8_t* const dst, - int dst_width, int dst_height, int dst_stride, - int num_channels, +int WebPRescalerInit(WebPRescaler* const rescaler, int src_width, + int src_height, uint8_t* const dst, int dst_width, + int dst_height, int dst_stride, int num_channels, rescaler_t* const work); // If either 'scaled_width' or 'scaled_height' (but not both) is 0 the value @@ -77,26 +75,26 @@ int WebPRescalerImport(WebPRescaler* const rescaler, int num_rows, int WebPRescalerExport(WebPRescaler* const rescaler); // Return true if input is finished -static WEBP_INLINE -int WebPRescalerInputDone(const WebPRescaler* const rescaler) { +static WEBP_INLINE int WebPRescalerInputDone( + const WebPRescaler* const rescaler) { return (rescaler->src_y >= rescaler->src_height); } // Return true if output is finished -static WEBP_INLINE -int WebPRescalerOutputDone(const WebPRescaler* const rescaler) { +static WEBP_INLINE int WebPRescalerOutputDone( + const WebPRescaler* const rescaler) { return (rescaler->dst_y >= rescaler->dst_height); } // Return true if there are pending output rows ready. -static WEBP_INLINE -int WebPRescalerHasPendingOutput(const WebPRescaler* const rescaler) { +static WEBP_INLINE int WebPRescalerHasPendingOutput( + const WebPRescaler* const rescaler) { return !WebPRescalerOutputDone(rescaler) && (rescaler->y_accum <= 0); } //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_UTILS_RESCALER_UTILS_H_ diff --git a/src/utils/thread_utils.c b/src/utils/thread_utils.c index d61a0bb7..184751f9 100644 --- a/src/utils/thread_utils.c +++ b/src/utils/thread_utils.c @@ -11,10 +11,11 @@ // // Author: Skal (pascal.massimino@gmail.com) -#include -#include // for memset() - #include "src/utils/thread_utils.h" + +#include +#include // for memset() + #include "src/utils/utils.h" #ifdef WEBP_USE_THREAD @@ -53,8 +54,8 @@ typedef struct { typedef struct { pthread_mutex_t mutex; - pthread_cond_t condition; - pthread_t thread; + pthread_cond_t condition; + pthread_t thread; } WebPWorkerImpl; #if defined(_WIN32) @@ -70,26 +71,21 @@ typedef struct { #if _WIN32_WINNT >= 0x0501 // Windows XP or greater #define WaitForSingleObject(obj, timeout) \ - WaitForSingleObjectEx(obj, timeout, FALSE /*bAlertable*/) + WaitForSingleObjectEx(obj, timeout, /*bAlertable=*/FALSE) #endif static int pthread_create(pthread_t* const thread, const void* attr, - unsigned int (__stdcall* start)(void*), void* arg) { + unsigned int(__stdcall* start)(void*), void* arg) { (void)attr; #ifdef USE_CREATE_THREAD - *thread = CreateThread(NULL, /* lpThreadAttributes */ - 0, /* dwStackSize */ - start, - arg, - 0, /* dwStackSize */ - NULL); /* lpThreadId */ + *thread = CreateThread(/*lpThreadAttributes=*/NULL, + /*dwStackSize=*/0, start, arg, /*dwStackSize=*/0, + /*lpThreadId=*/NULL); #else - *thread = (pthread_t)_beginthreadex(NULL, /* void *security */ - 0, /* unsigned stack_size */ - start, - arg, - 0, /* unsigned initflag */ - NULL); /* unsigned *thrdaddr */ + *thread = + (pthread_t)_beginthreadex(/*security=*/NULL, + /*stack_size=*/0, start, arg, /*initflag=*/0, + /*thrdaddr=*/NULL); #endif if (*thread == NULL) return 1; SetThreadPriority(*thread, THREAD_PRIORITY_ABOVE_NORMAL); @@ -106,7 +102,7 @@ static int pthread_join(pthread_t thread, void** value_ptr) { static int pthread_mutex_init(pthread_mutex_t* const mutex, void* mutexattr) { (void)mutexattr; #if _WIN32_WINNT >= 0x0600 // Windows Vista / Server 2008 or greater - InitializeCriticalSectionEx(mutex, 0 /*dwSpinCount*/, 0 /*Flags*/); + InitializeCriticalSectionEx(mutex, /*dwSpinCount=*/0, /*Flags=*/0); #else InitializeCriticalSection(mutex); #endif @@ -149,8 +145,7 @@ static int pthread_cond_init(pthread_cond_t* const condition, void* cond_attr) { condition->waiting_sem = CreateSemaphore(NULL, 0, 1, NULL); condition->received_sem = CreateSemaphore(NULL, 0, 1, NULL); condition->signal_event = CreateEvent(NULL, FALSE, FALSE, NULL); - if (condition->waiting_sem == NULL || - condition->received_sem == NULL || + if (condition->waiting_sem == NULL || condition->received_sem == NULL || condition->signal_event == NULL) { pthread_cond_destroy(condition); return 1; @@ -187,8 +182,8 @@ static int pthread_cond_wait(pthread_cond_t* const condition, if (!ReleaseSemaphore(condition->waiting_sem, 1, NULL)) return 1; // now unlock the mutex so pthread_cond_signal may be issued pthread_mutex_unlock(mutex); - ok = (WaitForSingleObject(condition->signal_event, INFINITE) == - WAIT_OBJECT_0); + ok = + (WaitForSingleObject(condition->signal_event, INFINITE) == WAIT_OBJECT_0); ok &= ReleaseSemaphore(condition->received_sem, 1, NULL); pthread_mutex_lock(mutex); #endif @@ -196,8 +191,8 @@ static int pthread_cond_wait(pthread_cond_t* const condition, } #else // !_WIN32 -# define THREADFN void* -# define THREAD_RETURN(val) val +#define THREADFN void* +#define THREAD_RETURN(val) val #endif // _WIN32 //------------------------------------------------------------------------------ @@ -208,13 +203,13 @@ static THREADFN ThreadLoop(void* ptr) { int done = 0; while (!done) { pthread_mutex_lock(&impl->mutex); - while (worker->status == OK) { // wait in idling mode + while (worker->status == OK) { // wait in idling mode pthread_cond_wait(&impl->condition, &impl->mutex); } if (worker->status == WORK) { WebPGetWorkerInterface()->Execute(worker); worker->status = OK; - } else if (worker->status == NOT_OK) { // finish the worker + } else if (worker->status == NOT_OK) { // finish the worker done = 1; } // signal to the main thread that we're done (for Sync()) @@ -225,7 +220,7 @@ static THREADFN ThreadLoop(void* ptr) { pthread_mutex_unlock(&impl->mutex); pthread_cond_signal(&impl->condition); } - return THREAD_RETURN(NULL); // Thread is finished + return THREAD_RETURN(NULL); // Thread is finished } // main thread state control @@ -299,7 +294,7 @@ static int Reset(WebPWorker* const worker) { if (!ok) { pthread_mutex_destroy(&impl->mutex); pthread_cond_destroy(&impl->condition); - Error: + Error: WebPSafeFree(impl); worker->impl = NULL; return 0; @@ -348,15 +343,14 @@ static void End(WebPWorker* const worker) { //------------------------------------------------------------------------------ -static WebPWorkerInterface g_worker_interface = { - Init, Reset, Sync, Launch, Execute, End -}; +static WebPWorkerInterface g_worker_interface = {Init, Reset, Sync, + Launch, Execute, End}; int WebPSetWorkerInterface(const WebPWorkerInterface* const winterface) { - if (winterface == NULL || - winterface->Init == NULL || winterface->Reset == NULL || - winterface->Sync == NULL || winterface->Launch == NULL || - winterface->Execute == NULL || winterface->End == NULL) { + if (winterface == NULL || winterface->Init == NULL || + winterface->Reset == NULL || winterface->Sync == NULL || + winterface->Launch == NULL || winterface->Execute == NULL || + winterface->End == NULL) { return 0; } g_worker_interface = *winterface; diff --git a/src/utils/thread_utils.h b/src/utils/thread_utils.h index 3575815d..815c944f 100644 --- a/src/utils/thread_utils.h +++ b/src/utils/thread_utils.h @@ -26,9 +26,9 @@ extern "C" { // State of the worker thread object typedef enum { - NOT_OK = 0, // object is unusable - OK, // ready to work - WORK // busy finishing the current task + NOT_OK = 0, // object is unusable + OK, // ready to work + WORK // busy finishing the current task } WebPWorkerStatus; // Function to be called by the worker thread. Takes two opaque pointers as @@ -37,12 +37,12 @@ typedef int (*WebPWorkerHook)(void*, void*); // Synchronization object used to launch job in the worker thread typedef struct { - void* impl; // platform-dependent implementation worker details + void* impl; // platform-dependent implementation worker details WebPWorkerStatus status; - WebPWorkerHook hook; // hook to call - void* data1; // first argument passed to 'hook' - void* data2; // second argument passed to 'hook' - int had_error; // return value of the last call to 'hook' + WebPWorkerHook hook; // hook to call + void* data1; // first argument passed to 'hook' + void* data2; // second argument passed to 'hook' + int had_error; // return value of the last call to 'hook' } WebPWorker; // The interface for all thread-worker related functions. All these functions @@ -84,7 +84,7 @@ WEBP_EXTERN const WebPWorkerInterface* WebPGetWorkerInterface(void); //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_UTILS_THREAD_UTILS_H_ diff --git a/src/utils/utils.c b/src/utils/utils.c index b80bae01..04223e2c 100644 --- a/src/utils/utils.c +++ b/src/utils/utils.c @@ -17,9 +17,9 @@ #include #include // for memcpy() -#include "src/webp/types.h" #include "src/utils/palette.h" #include "src/webp/encode.h" +#include "src/webp/types.h" // If PRINT_MEM_INFO is defined, extra info (like total memory used, number of // alloc/free etc) is printed. For debugging/tuning purpose only (it's slow, @@ -58,7 +58,7 @@ static int num_malloc_calls = 0; static int num_calloc_calls = 0; static int num_free_calls = 0; -static int countdown_to_fail = 0; // 0 = off +static int countdown_to_fail = 0; // 0 = off typedef struct MemBlock MemBlock; struct MemBlock { @@ -155,8 +155,8 @@ static void SubMem(void* ptr) { *b = block->next; total_mem -= block->size; #if defined(PRINT_MEM_TRAFFIC) - fprintf(stderr, "Mem: %u (-%u)\n", - (uint32_t)total_mem, (uint32_t)block->size); + fprintf(stderr, "Mem: %u (-%u)\n", (uint32_t)total_mem, + (uint32_t)block->size); #endif free(block); } @@ -164,9 +164,15 @@ static void SubMem(void* ptr) { } #else -#define Increment(v) do {} while (0) -#define AddMem(p, s) do {} while (0) -#define SubMem(p) do {} while (0) +#define Increment(v) \ + do { \ + } while (0) +#define AddMem(p, s) \ + do { \ + } while (0) +#define SubMem(p) \ + do { \ + } while (0) #endif // Returns 0 in case of overflow of nmemb * size. @@ -177,15 +183,14 @@ static int CheckSizeArgumentsOverflow(uint64_t nmemb, size_t size) { if (!CheckSizeOverflow(total_size)) return 0; #if defined(PRINT_MEM_INFO) && defined(MALLOC_FAIL_AT) if (countdown_to_fail > 0 && --countdown_to_fail == 0) { - return 0; // fake fail! + return 0; // fake fail! } #endif #if defined(PRINT_MEM_INFO) && defined(MALLOC_LIMIT) if (mem_limit > 0) { const uint64_t new_total_mem = (uint64_t)total_mem + total_size; - if (!CheckSizeOverflow(new_total_mem) || - new_total_mem > mem_limit) { - return 0; // fake fail! + if (!CheckSizeOverflow(new_total_mem) || new_total_mem > mem_limit) { + return 0; // fake fail! } } #endif @@ -223,18 +228,14 @@ void WebPSafeFree(void* const ptr) { // Public API functions. -void* WebPMalloc(size_t size) { - return WebPSafeMalloc(1, size); -} +void* WebPMalloc(size_t size) { return WebPSafeMalloc(1, size); } -void WebPFree(void* ptr) { - WebPSafeFree(ptr); -} +void WebPFree(void* ptr) { WebPSafeFree(ptr); } //------------------------------------------------------------------------------ -void WebPCopyPlane(const uint8_t* src, int src_stride, - uint8_t* dst, int dst_stride, int width, int height) { +void WebPCopyPlane(const uint8_t* src, int src_stride, uint8_t* dst, + int dst_stride, int width, int height) { assert(src != NULL && dst != NULL); assert(abs(src_stride) >= width && abs(dst_stride) >= width); while (height-- > 0) { @@ -261,24 +262,18 @@ int WebPGetColorPalette(const WebPPicture* const pic, uint32_t* const palette) { //------------------------------------------------------------------------------ #if defined(WEBP_NEED_LOG_TABLE_8BIT) -const uint8_t WebPLogTable8bit[256] = { // 31 ^ clz(i) - 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6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7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}; #endif //------------------------------------------------------------------------------ diff --git a/src/utils/utils.h b/src/utils/utils.h index b2241fbf..55c250df 100644 --- a/src/utils/utils.h +++ b/src/utils/utils.h @@ -62,8 +62,8 @@ WEBP_EXTERN void WebPSafeFree(void* const ptr); // Alignment #define WEBP_ALIGN_CST 31 -#define WEBP_ALIGN(PTR) (((uintptr_t)(PTR) + WEBP_ALIGN_CST) & \ - ~(uintptr_t)WEBP_ALIGN_CST) +#define WEBP_ALIGN(PTR) \ + (((uintptr_t)(PTR) + WEBP_ALIGN_CST) & ~(uintptr_t)WEBP_ALIGN_CST) #include // memcpy() is the safe way of moving potentially unaligned 32b memory. @@ -129,7 +129,7 @@ static WEBP_INLINE int BitsLog2Floor(uint32_t n) { // counts the number of trailing zero static WEBP_INLINE int BitsCtz(uint32_t n) { return __builtin_ctz(n); } #elif defined(_MSC_VER) && _MSC_VER > 1310 && \ - (defined(_M_X64) || defined(_M_IX86)) + (defined(_M_X64) || defined(_M_IX86)) #include #pragma intrinsic(_BitScanReverse) #pragma intrinsic(_BitScanForward) @@ -144,8 +144,8 @@ static WEBP_INLINE int BitsCtz(uint32_t n) { _BitScanForward(&first_set_bit, n); return first_set_bit; } -#else // default: use the (slow) C-version. -#define WEBP_HAVE_SLOW_CLZ_CTZ // signal that the Clz/Ctz function are slow +#else // default: use the (slow) C-version. +#define WEBP_HAVE_SLOW_CLZ_CTZ // signal that the Clz/Ctz function are slow // Returns 31 ^ clz(n) = log2(n). This is the default C-implementation, either // based on table or not. Can be used as fallback if clz() is not available. #define WEBP_NEED_LOG_TABLE_8BIT @@ -177,9 +177,8 @@ static WEBP_INLINE int BitsCtz(uint32_t n) { struct WebPPicture; // Copy width x height pixels from 'src' to 'dst' honoring the strides. -WEBP_EXTERN void WebPCopyPlane(const uint8_t* src, int src_stride, - uint8_t* dst, int dst_stride, - int width, int height); +WEBP_EXTERN void WebPCopyPlane(const uint8_t* src, int src_stride, uint8_t* dst, + int dst_stride, int width, int height); // Copy ARGB pixels from 'src' to 'dst' honoring strides. 'src' and 'dst' are // assumed to be already allocated and using ARGB data. @@ -203,7 +202,7 @@ WEBP_EXTERN int WebPGetColorPalette(const struct WebPPicture* const pic, //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_UTILS_UTILS_H_ diff --git a/src/webp/decode.h b/src/webp/decode.h index 1f0d0c22..0cd36655 100644 --- a/src/webp/decode.h +++ b/src/webp/decode.h @@ -22,7 +22,7 @@ extern "C" { #endif -#define WEBP_DECODER_ABI_VERSION 0x0210 // MAJOR(8b) + MINOR(8b) +#define WEBP_DECODER_ABI_VERSION 0x0210 // MAJOR(8b) + MINOR(8b) // Note: forward declaring enumerations is not allowed in (strict) C and C++, // the types are left here for reference. @@ -50,33 +50,39 @@ WEBP_EXTERN int WebPGetDecoderVersion(void); // RIFF + VP8X + (optional chunks) + VP8(L) // ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose. // VP8(L) <-- Not a valid WebP format: only allowed for internal purpose. -WEBP_NODISCARD WEBP_EXTERN int WebPGetInfo( - const uint8_t* data, size_t data_size, int* width, int* height); +WEBP_NODISCARD WEBP_EXTERN int WebPGetInfo(const uint8_t* data, + size_t data_size, int* width, + int* height); // Decodes WebP images pointed to by 'data' and returns RGBA samples, along // with the dimensions in *width and *height. The ordering of samples in // memory is R, G, B, A, R, G, B, A... in scan order (endian-independent). // The returned pointer should be deleted calling WebPFree(). // Returns NULL in case of error. -WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeRGBA( - const uint8_t* data, size_t data_size, int* width, int* height); +WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeRGBA(const uint8_t* data, + size_t data_size, int* width, + int* height); // Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data. -WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeARGB( - const uint8_t* data, size_t data_size, int* width, int* height); +WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeARGB(const uint8_t* data, + size_t data_size, int* width, + int* height); // Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data. -WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeBGRA( - const uint8_t* data, size_t data_size, int* width, int* height); +WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeBGRA(const uint8_t* data, + size_t data_size, int* width, + int* height); // Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data. // If the bitstream contains transparency, it is ignored. -WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeRGB( - const uint8_t* data, size_t data_size, int* width, int* height); +WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeRGB(const uint8_t* data, + size_t data_size, int* width, + int* height); // Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data. -WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeBGR( - const uint8_t* data, size_t data_size, int* width, int* height); +WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeBGR(const uint8_t* data, + size_t data_size, int* width, + int* height); // Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer // returned is the Y samples buffer. Upon return, *u and *v will point to @@ -88,9 +94,11 @@ WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeBGR( // 'width' and 'height' may be NULL, the other pointers must not be. // Returns NULL in case of error. // (*) Also named Y'CbCr. See: https://en.wikipedia.org/wiki/YCbCr -WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeYUV( - const uint8_t* data, size_t data_size, int* width, int* height, - uint8_t** u, uint8_t** v, int* stride, int* uv_stride); +WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeYUV(const uint8_t* data, + size_t data_size, int* width, + int* height, uint8_t** u, + uint8_t** v, int* stride, + int* uv_stride); // These five functions are variants of the above ones, that decode the image // directly into a pre-allocated buffer 'output_buffer'. The maximum storage @@ -101,23 +109,27 @@ WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeYUV( // between scanlines. Hence, output_buffer_size is expected to be at least // output_stride x picture-height. WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeRGBAInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + const uint8_t* data, size_t data_size, uint8_t* output_buffer, + size_t output_buffer_size, int output_stride); WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeARGBInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + const uint8_t* data, size_t data_size, uint8_t* output_buffer, + size_t output_buffer_size, int output_stride); WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeBGRAInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + const uint8_t* data, size_t data_size, uint8_t* output_buffer, + size_t output_buffer_size, int output_stride); // RGB and BGR variants. Here too the transparency information, if present, // will be dropped and ignored. -WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeRGBInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); -WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeBGRInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); +WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeRGBInto(const uint8_t* data, + size_t data_size, + uint8_t* output_buffer, + size_t output_buffer_size, + int output_stride); +WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeBGRInto(const uint8_t* data, + size_t data_size, + uint8_t* output_buffer, + size_t output_buffer_size, + int output_stride); // WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly // into pre-allocated luma/chroma plane buffers. This function requires the @@ -127,10 +139,9 @@ WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeBGRInto( // Pointer to the luma plane ('*luma') is returned or NULL if an error occurred // during decoding (or because some buffers were found to be too small). WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeYUVInto( - const uint8_t* data, size_t data_size, - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride); + const uint8_t* data, size_t data_size, uint8_t* luma, size_t luma_size, + int luma_stride, uint8_t* u, size_t u_size, int u_stride, uint8_t* v, + size_t v_size, int v_stride); //------------------------------------------------------------------------------ // Output colorspaces and buffer @@ -148,9 +159,12 @@ WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPDecodeYUVInto( // RGB-565: [g2 g1 g0 b4 b3 b2 b1 b0], [r4 r3 r2 r1 r0 g5 g4 g3], ... typedef enum WEBP_CSP_MODE { - MODE_RGB = 0, MODE_RGBA = 1, - MODE_BGR = 2, MODE_BGRA = 3, - MODE_ARGB = 4, MODE_RGBA_4444 = 5, + MODE_RGB = 0, + MODE_RGBA = 1, + MODE_BGR = 2, + MODE_BGRA = 3, + MODE_ARGB = 4, + MODE_RGBA_4444 = 5, MODE_RGB_565 = 6, // RGB-premultiplied transparent modes (alpha value is preserved) MODE_rgbA = 7, @@ -158,7 +172,8 @@ typedef enum WEBP_CSP_MODE { MODE_Argb = 9, MODE_rgbA_4444 = 10, // YUV modes must come after RGB ones. - MODE_YUV = 11, MODE_YUVA = 12, // yuv 4:2:0 + MODE_YUV = 11, + MODE_YUVA = 12, // yuv 4:2:0 MODE_LAST = 13 } WEBP_CSP_MODE; @@ -181,20 +196,20 @@ static WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) { //------------------------------------------------------------------------------ // WebPDecBuffer: Generic structure for describing the output sample buffer. -struct WebPRGBABuffer { // view as RGBA - uint8_t* rgba; // pointer to RGBA samples - int stride; // stride in bytes from one scanline to the next. - size_t size; // total size of the *rgba buffer. +struct WebPRGBABuffer { // view as RGBA + uint8_t* rgba; // pointer to RGBA samples + int stride; // stride in bytes from one scanline to the next. + size_t size; // total size of the *rgba buffer. }; -struct WebPYUVABuffer { // view as YUVA - uint8_t* y, *u, *v, *a; // pointer to luma, chroma U/V, alpha samples - int y_stride; // luma stride - int u_stride, v_stride; // chroma strides - int a_stride; // alpha stride - size_t y_size; // luma plane size - size_t u_size, v_size; // chroma planes size - size_t a_size; // alpha-plane size +struct WebPYUVABuffer { // view as YUVA + uint8_t *y, *u, *v, *a; // pointer to luma, chroma U/V, alpha samples + int y_stride; // luma stride + int u_stride, v_stride; // chroma strides + int a_stride; // alpha stride + size_t y_size; // luma plane size + size_t u_size, v_size; // chroma planes size + size_t a_size; // alpha-plane size }; // Output buffer @@ -208,12 +223,12 @@ struct WebPDecBuffer { union { WebPRGBABuffer RGBA; WebPYUVABuffer YUVA; - } u; // Nameless union of buffer parameters. - uint32_t pad[4]; // padding for later use + } u; // Nameless union of buffer parameters. + uint32_t pad[4]; // padding for later use - uint8_t* private_memory; // Internally allocated memory (only when - // is_external_memory is 0). Should not be used - // externally, but accessed via the buffer union. + uint8_t* private_memory; // Internally allocated memory (only when + // is_external_memory is 0). Should not be used + // externally, but accessed via the buffer union. }; // Internal, version-checked, entry point @@ -295,9 +310,10 @@ WEBP_NODISCARD WEBP_EXTERN WebPIDecoder* WebPINewDecoder( // colorspace 'csp' is taken into account for allocating this buffer. All other // parameters are ignored. // Returns NULL if the allocation failed, or if some parameters are invalid. -WEBP_NODISCARD WEBP_EXTERN WebPIDecoder* WebPINewRGB( - WEBP_CSP_MODE csp, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); +WEBP_NODISCARD WEBP_EXTERN WebPIDecoder* WebPINewRGB(WEBP_CSP_MODE csp, + uint8_t* output_buffer, + size_t output_buffer_size, + int output_stride); // This function allocates and initializes an incremental-decoder object, which // will output the raw luma/chroma samples into a preallocated planes if @@ -311,17 +327,15 @@ WEBP_NODISCARD WEBP_EXTERN WebPIDecoder* WebPINewRGB( // MODE_YUVA) when decoding starts. All parameters are then ignored. // Returns NULL if the allocation failed or if a parameter is invalid. WEBP_NODISCARD WEBP_EXTERN WebPIDecoder* WebPINewYUVA( - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride, - uint8_t* a, size_t a_size, int a_stride); + uint8_t* luma, size_t luma_size, int luma_stride, uint8_t* u, size_t u_size, + int u_stride, uint8_t* v, size_t v_size, int v_stride, uint8_t* a, + size_t a_size, int a_stride); // Deprecated version of the above, without the alpha plane. // Kept for backward compatibility. WEBP_NODISCARD WEBP_EXTERN WebPIDecoder* WebPINewYUV( - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride); + uint8_t* luma, size_t luma_size, int luma_stride, uint8_t* u, size_t u_size, + int u_stride, uint8_t* v, size_t v_size, int v_stride); // Deletes the WebPIDecoder object and associated memory. Must always be called // if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded. @@ -330,16 +344,16 @@ WEBP_EXTERN void WebPIDelete(WebPIDecoder* idec); // Copies and decodes the next available data. Returns VP8_STATUS_OK when // the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more // data is expected. Returns error in other cases. -WEBP_EXTERN VP8StatusCode WebPIAppend( - WebPIDecoder* idec, const uint8_t* data, size_t data_size); +WEBP_EXTERN VP8StatusCode WebPIAppend(WebPIDecoder* idec, const uint8_t* data, + size_t data_size); // A variant of the above function to be used when data buffer contains // partial data from the beginning. In this case data buffer is not copied // to the internal memory. // Note that the value of the 'data' pointer can change between calls to // WebPIUpdate, for instance when the data buffer is resized to fit larger data. -WEBP_EXTERN VP8StatusCode WebPIUpdate( - WebPIDecoder* idec, const uint8_t* data, size_t data_size); +WEBP_EXTERN VP8StatusCode WebPIUpdate(WebPIDecoder* idec, const uint8_t* data, + size_t data_size); // Returns the RGB/A image decoded so far. Returns NULL if output params // are not initialized yet. The RGB/A output type corresponds to the colorspace @@ -348,25 +362,27 @@ WEBP_EXTERN VP8StatusCode WebPIUpdate( // (*last_y, *width etc.) can be NULL if corresponding information is not // needed. The values in these pointers are only valid on successful (non-NULL) // return. -WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPIDecGetRGB( - const WebPIDecoder* idec, int* last_y, - int* width, int* height, int* stride); +WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPIDecGetRGB(const WebPIDecoder* idec, + int* last_y, int* width, + int* height, int* stride); // Same as above function to get a YUVA image. Returns pointer to the luma // plane or NULL in case of error. If there is no alpha information // the alpha pointer '*a' will be returned NULL. -WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPIDecGetYUVA( - const WebPIDecoder* idec, int* last_y, - uint8_t** u, uint8_t** v, uint8_t** a, - int* width, int* height, int* stride, int* uv_stride, int* a_stride); +WEBP_NODISCARD WEBP_EXTERN uint8_t* WebPIDecGetYUVA(const WebPIDecoder* idec, + int* last_y, uint8_t** u, + uint8_t** v, uint8_t** a, + int* width, int* height, + int* stride, int* uv_stride, + int* a_stride); // Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the // alpha information (if present). Kept for backward compatibility. WEBP_NODISCARD static WEBP_INLINE uint8_t* WebPIDecGetYUV( - const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v, - int* width, int* height, int* stride, int* uv_stride) { - return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height, - stride, uv_stride, NULL); + const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v, int* width, + int* height, int* stride, int* uv_stride) { + return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height, stride, + uv_stride, NULL); } // Generic call to retrieve information about the displayable area. @@ -419,12 +435,12 @@ struct WebPBitstreamFeatures { int has_animation; // True if the bitstream is an animation. int format; // 0 = undefined (/mixed), 1 = lossy, 2 = lossless - uint32_t pad[5]; // padding for later use + uint32_t pad[5]; // padding for later use }; // Internal, version-checked, entry point -WEBP_EXTERN VP8StatusCode WebPGetFeaturesInternal( - const uint8_t*, size_t, WebPBitstreamFeatures*, int); +WEBP_EXTERN VP8StatusCode WebPGetFeaturesInternal(const uint8_t*, size_t, + WebPBitstreamFeatures*, int); // Retrieve features from the bitstream. The *features structure is filled // with information gathered from the bitstream. @@ -438,30 +454,29 @@ WEBP_EXTERN VP8StatusCode WebPGetFeaturesInternal( // ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose. // VP8(L) <-- Not a valid WebP format: only allowed for internal purpose. static WEBP_INLINE VP8StatusCode WebPGetFeatures( - const uint8_t* data, size_t data_size, - WebPBitstreamFeatures* features) { + const uint8_t* data, size_t data_size, WebPBitstreamFeatures* features) { return WebPGetFeaturesInternal(data, data_size, features, WEBP_DECODER_ABI_VERSION); } // Decoding options struct WebPDecoderOptions { - int bypass_filtering; // if true, skip the in-loop filtering - int no_fancy_upsampling; // if true, use faster pointwise upsampler - int use_cropping; // if true, cropping is applied _first_ - int crop_left, crop_top; // top-left position for cropping. - // Will be snapped to even values. - int crop_width, crop_height; // dimension of the cropping area - int use_scaling; // if true, scaling is applied _afterward_ - int scaled_width, scaled_height; // final resolution. if one is 0, it is - // guessed from the other one to keep the - // original ratio. - int use_threads; // if true, use multi-threaded decoding - int dithering_strength; // dithering strength (0=Off, 100=full) - int flip; // if true, flip output vertically - int alpha_dithering_strength; // alpha dithering strength in [0..100] + int bypass_filtering; // if true, skip the in-loop filtering + int no_fancy_upsampling; // if true, use faster pointwise upsampler + int use_cropping; // if true, cropping is applied _first_ + int crop_left, crop_top; // top-left position for cropping. + // Will be snapped to even values. + int crop_width, crop_height; // dimension of the cropping area + int use_scaling; // if true, scaling is applied _afterward_ + int scaled_width, scaled_height; // final resolution. if one is 0, it is + // guessed from the other one to keep the + // original ratio. + int use_threads; // if true, use multi-threaded decoding + int dithering_strength; // dithering strength (0=Off, 100=full) + int flip; // if true, flip output vertically + int alpha_dithering_strength; // alpha dithering strength in [0..100] - uint32_t pad[5]; // padding for later use + uint32_t pad[5]; // padding for later use }; // Main object storing the configuration for advanced decoding. @@ -499,8 +514,9 @@ WEBP_NODISCARD WEBP_EXTERN int WebPValidateDecoderConfig( // The return WebPIDecoder object must always be deleted calling WebPIDelete(). // Returns NULL in case of error (and config->status will then reflect // the error condition, if available). -WEBP_NODISCARD WEBP_EXTERN WebPIDecoder* WebPIDecode( - const uint8_t* data, size_t data_size, WebPDecoderConfig* config); +WEBP_NODISCARD WEBP_EXTERN WebPIDecoder* WebPIDecode(const uint8_t* data, + size_t data_size, + WebPDecoderConfig* config); // Non-incremental version. This version decodes the full data at once, taking // 'config' into account. Returns decoding status (which should be VP8_STATUS_OK @@ -509,7 +525,7 @@ WEBP_EXTERN VP8StatusCode WebPDecode(const uint8_t* data, size_t data_size, WebPDecoderConfig* config); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_WEBP_DECODE_H_ diff --git a/src/webp/demux.h b/src/webp/demux.h index 0f5bc2b8..513c7442 100644 --- a/src/webp/demux.h +++ b/src/webp/demux.h @@ -50,7 +50,7 @@ #include -#include "./decode.h" // for WEBP_CSP_MODE +#include "./decode.h" // for WEBP_CSP_MODE #include "./mux_types.h" #include "./types.h" @@ -58,7 +58,7 @@ extern "C" { #endif -#define WEBP_DEMUX_ABI_VERSION 0x0107 // MAJOR(8b) + MINOR(8b) +#define WEBP_DEMUX_ABI_VERSION 0x0107 // MAJOR(8b) + MINOR(8b) // Note: forward declaring enumerations is not allowed in (strict) C and C++, // the types are left here for reference. @@ -80,16 +80,16 @@ WEBP_EXTERN int WebPGetDemuxVersion(void); // Life of a Demux object typedef enum WebPDemuxState { - WEBP_DEMUX_PARSE_ERROR = -1, // An error occurred while parsing. - WEBP_DEMUX_PARSING_HEADER = 0, // Not enough data to parse full header. - WEBP_DEMUX_PARSED_HEADER = 1, // Header parsing complete, - // data may be available. - WEBP_DEMUX_DONE = 2 // Entire file has been parsed. + WEBP_DEMUX_PARSE_ERROR = -1, // An error occurred while parsing. + WEBP_DEMUX_PARSING_HEADER = 0, // Not enough data to parse full header. + WEBP_DEMUX_PARSED_HEADER = 1, // Header parsing complete, + // data may be available. + WEBP_DEMUX_DONE = 2 // Entire file has been parsed. } WebPDemuxState; // Internal, version-checked, entry point -WEBP_NODISCARD WEBP_EXTERN WebPDemuxer* WebPDemuxInternal( - const WebPData*, int, WebPDemuxState*, int); +WEBP_NODISCARD WEBP_EXTERN WebPDemuxer* WebPDemuxInternal(const WebPData*, int, + WebPDemuxState*, int); // Parses the full WebP file given by 'data'. For single images the WebP file // header alone or the file header and the chunk header may be absent. @@ -118,8 +118,8 @@ WEBP_EXTERN void WebPDemuxDelete(WebPDemuxer* dmux); // Data/information extraction. typedef enum WebPFormatFeature { - WEBP_FF_FORMAT_FLAGS, // bit-wise combination of WebPFeatureFlags - // corresponding to the 'VP8X' chunk (if present). + WEBP_FF_FORMAT_FLAGS, // bit-wise combination of WebPFeatureFlags + // corresponding to the 'VP8X' chunk (if present). WEBP_FF_CANVAS_WIDTH, WEBP_FF_CANVAS_HEIGHT, WEBP_FF_LOOP_COUNT, // only relevant for animated file @@ -137,28 +137,28 @@ typedef enum WebPFormatFeature { // combination of WebPFeatureFlags values. // If 'feature' is WEBP_FF_LOOP_COUNT, WEBP_FF_BACKGROUND_COLOR, the returned // value is only meaningful if the bitstream is animated. -WEBP_EXTERN uint32_t WebPDemuxGetI( - const WebPDemuxer* dmux, WebPFormatFeature feature); +WEBP_EXTERN uint32_t WebPDemuxGetI(const WebPDemuxer* dmux, + WebPFormatFeature feature); //------------------------------------------------------------------------------ // Frame iteration. struct WebPIterator { int frame_num; - int num_frames; // equivalent to WEBP_FF_FRAME_COUNT. - int x_offset, y_offset; // offset relative to the canvas. - int width, height; // dimensions of this frame. - int duration; // display duration in milliseconds. + int num_frames; // equivalent to WEBP_FF_FRAME_COUNT. + int x_offset, y_offset; // offset relative to the canvas. + int width, height; // dimensions of this frame. + int duration; // display duration in milliseconds. WebPMuxAnimDispose dispose_method; // dispose method for the frame. - int complete; // true if 'fragment' contains a full frame. partial images - // may still be decoded with the WebP incremental decoder. + int complete; // true if 'fragment' contains a full frame. partial images + // may still be decoded with the WebP incremental decoder. WebPData fragment; // The frame given by 'frame_num'. Note for historical // reasons this is called a fragment. int has_alpha; // True if the frame contains transparency. WebPMuxAnimBlend blend_method; // Blend operation for the frame. - uint32_t pad[2]; // padding for later use. - void* private_; // for internal use only. + uint32_t pad[2]; // padding for later use. + void* private_; // for internal use only. }; // Retrieves frame 'frame_number' from 'dmux'. @@ -167,8 +167,9 @@ struct WebPIterator { // Returns false if 'dmux' is NULL or frame 'frame_number' is not present. // Call WebPDemuxReleaseIterator() when use of the iterator is complete. // NOTE: 'dmux' must persist for the lifetime of 'iter'. -WEBP_NODISCARD WEBP_EXTERN int WebPDemuxGetFrame( - const WebPDemuxer* dmux, int frame_number, WebPIterator* iter); +WEBP_NODISCARD WEBP_EXTERN int WebPDemuxGetFrame(const WebPDemuxer* dmux, + int frame_number, + WebPIterator* iter); // Sets 'iter->fragment' to point to the next ('iter->frame_num' + 1) or // previous ('iter->frame_num' - 1) frame. These functions do not loop. @@ -190,9 +191,9 @@ struct WebPChunkIterator { // WebPDemuxGetChunk(). int chunk_num; int num_chunks; - WebPData chunk; // The payload of the chunk. + WebPData chunk; // The payload of the chunk. - uint32_t pad[6]; // padding for later use + uint32_t pad[6]; // padding for later use void* private_; }; @@ -256,8 +257,8 @@ struct WebPAnimDecoderOptions { // Output colorspace. Only the following modes are supported: // MODE_RGBA, MODE_BGRA, MODE_rgbA and MODE_bgrA. WEBP_CSP_MODE color_mode; - int use_threads; // If true, use multi-threaded decoding. - uint32_t padding[7]; // Padding for later use. + int use_threads; // If true, use multi-threaded decoding. + uint32_t padding[7]; // Padding for later use. }; // Internal, version-checked, entry point. @@ -301,7 +302,7 @@ struct WebPAnimInfo { uint32_t loop_count; uint32_t bgcolor; uint32_t frame_count; - uint32_t pad[4]; // padding for later use + uint32_t pad[4]; // padding for later use }; // Get global information about the animation. @@ -363,7 +364,7 @@ WEBP_NODISCARD WEBP_EXTERN const WebPDemuxer* WebPAnimDecoderGetDemuxer( WEBP_EXTERN void WebPAnimDecoderDelete(WebPAnimDecoder* dec); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_WEBP_DEMUX_H_ diff --git a/src/webp/encode.h b/src/webp/encode.h index ed493932..fd9fc4f1 100644 --- a/src/webp/encode.h +++ b/src/webp/encode.h @@ -31,7 +31,7 @@ extern "C" { // typedef enum WebPPreset WebPPreset; // typedef enum WebPEncodingError WebPEncodingError; typedef struct WebPConfig WebPConfig; -typedef struct WebPPicture WebPPicture; // main structure for I/O +typedef struct WebPPicture WebPPicture; // main structure for I/O typedef struct WebPAuxStats WebPAuxStats; typedef struct WebPMemoryWriter WebPMemoryWriter; @@ -48,18 +48,18 @@ WEBP_EXTERN int WebPGetEncoderVersion(void); // These functions compress using the lossy format, and the quality_factor // can go from 0 (smaller output, lower quality) to 100 (best quality, // larger output). -WEBP_EXTERN size_t WebPEncodeRGB(const uint8_t* rgb, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN size_t WebPEncodeBGR(const uint8_t* bgr, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN size_t WebPEncodeRGBA(const uint8_t* rgba, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN size_t WebPEncodeBGRA(const uint8_t* bgra, - int width, int height, int stride, - float quality_factor, uint8_t** output); +WEBP_EXTERN size_t WebPEncodeRGB(const uint8_t* rgb, int width, int height, + int stride, float quality_factor, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeBGR(const uint8_t* bgr, int width, int height, + int stride, float quality_factor, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeRGBA(const uint8_t* rgba, int width, int height, + int stride, float quality_factor, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeBGRA(const uint8_t* bgra, int width, int height, + int stride, float quality_factor, + uint8_t** output); // These functions are the equivalent of the above, but compressing in a // lossless manner. Files are usually larger than lossy format, but will @@ -68,17 +68,17 @@ WEBP_EXTERN size_t WebPEncodeBGRA(const uint8_t* bgra, // settings. For lossless this means 'exact' is disabled. RGB values in // transparent areas will be modified to improve compression. To avoid this, // use WebPEncode() and set WebPConfig::exact to 1. -WEBP_EXTERN size_t WebPEncodeLosslessRGB(const uint8_t* rgb, - int width, int height, int stride, +WEBP_EXTERN size_t WebPEncodeLosslessRGB(const uint8_t* rgb, int width, + int height, int stride, uint8_t** output); -WEBP_EXTERN size_t WebPEncodeLosslessBGR(const uint8_t* bgr, - int width, int height, int stride, +WEBP_EXTERN size_t WebPEncodeLosslessBGR(const uint8_t* bgr, int width, + int height, int stride, uint8_t** output); -WEBP_EXTERN size_t WebPEncodeLosslessRGBA(const uint8_t* rgba, - int width, int height, int stride, +WEBP_EXTERN size_t WebPEncodeLosslessRGBA(const uint8_t* rgba, int width, + int height, int stride, uint8_t** output); -WEBP_EXTERN size_t WebPEncodeLosslessBGRA(const uint8_t* bgra, - int width, int height, int stride, +WEBP_EXTERN size_t WebPEncodeLosslessBGRA(const uint8_t* bgra, int width, + int height, int stride, uint8_t** output); //------------------------------------------------------------------------------ @@ -95,13 +95,13 @@ typedef enum WebPImageHint { // Compression parameters. struct WebPConfig { - int lossless; // Lossless encoding (0=lossy(default), 1=lossless). - float quality; // between 0 and 100. For lossy, 0 gives the smallest - // size and 100 the largest. For lossless, this - // parameter is the amount of effort put into the - // compression: 0 is the fastest but gives larger - // files compared to the slowest, but best, 100. - int method; // quality/speed trade-off (0=fast, 6=slower-better) + int lossless; // Lossless encoding (0=lossy(default), 1=lossless). + float quality; // between 0 and 100. For lossy, 0 gives the smallest + // size and 100 the largest. For lossless, this + // parameter is the amount of effort put into the + // compression: 0 is the fastest but gives larger + // files compared to the slowest, but best, 100. + int method; // quality/speed trade-off (0=fast, 6=slower-better) WebPImageHint image_hint; // Hint for image type (lossless only for now). @@ -140,18 +140,18 @@ struct WebPConfig { int thread_level; // If non-zero, try and use multi-threaded encoding. int low_memory; // If set, reduce memory usage (but increase CPU use). - int near_lossless; // Near lossless encoding [0 = max loss .. 100 = off - // (default)]. - int exact; // if non-zero, preserve the exact RGB values under - // transparent area. Otherwise, discard this invisible - // RGB information for better compression. The default - // value is 0. + int near_lossless; // Near lossless encoding [0 = max loss .. 100 = off + // (default)]. + int exact; // if non-zero, preserve the exact RGB values under + // transparent area. Otherwise, discard this invisible + // RGB information for better compression. The default + // value is 0. int use_delta_palette; // reserved int use_sharp_yuv; // if needed, use sharp (and slow) RGB->YUV conversion - int qmin; // minimum permissible quality factor - int qmax; // maximum permissible quality factor + int qmin; // minimum permissible quality factor + int qmax; // maximum permissible quality factor }; // Enumerate some predefined settings for WebPConfig, depending on the type @@ -207,20 +207,20 @@ WEBP_NODISCARD WEBP_EXTERN int WebPValidateConfig(const WebPConfig* config); // Structure for storing auxiliary statistics. struct WebPAuxStats { - int coded_size; // final size + int coded_size; // final size - float PSNR[5]; // peak-signal-to-noise ratio for Y/U/V/All/Alpha - int block_count[3]; // number of intra4/intra16/skipped macroblocks - int header_bytes[2]; // approximate number of bytes spent for header - // and mode-partition #0 + float PSNR[5]; // peak-signal-to-noise ratio for Y/U/V/All/Alpha + int block_count[3]; // number of intra4/intra16/skipped macroblocks + int header_bytes[2]; // approximate number of bytes spent for header + // and mode-partition #0 int residual_bytes[3][4]; // approximate number of bytes spent for // DC/AC/uv coefficients for each (0..3) segments. - int segment_size[4]; // number of macroblocks in each segments - int segment_quant[4]; // quantizer values for each segments - int segment_level[4]; // filtering strength for each segments [0..63] + int segment_size[4]; // number of macroblocks in each segments + int segment_quant[4]; // quantizer values for each segments + int segment_level[4]; // filtering strength for each segments [0..63] - int alpha_data_size; // size of the transparency data - int layer_data_size; // size of the enhancement layer data + int alpha_data_size; // size of the transparency data + int layer_data_size; // size of the enhancement layer data // lossless encoder statistics uint32_t lossless_features; // bit0:predictor bit1:cross-color transform @@ -246,10 +246,10 @@ typedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size, // WebPMemoryWrite: a special WebPWriterFunction that writes to memory using // the following WebPMemoryWriter object (to be set as a custom_ptr). struct WebPMemoryWriter { - uint8_t* mem; // final buffer (of size 'max_size', larger than 'size'). - size_t size; // final size - size_t max_size; // total capacity - uint32_t pad[1]; // padding for later use + uint8_t* mem; // final buffer (of size 'max_size', larger than 'size'). + size_t size; // final size + size_t max_size; // total capacity + uint32_t pad[1]; // padding for later use }; // The following must be called first before any use. @@ -261,8 +261,9 @@ WEBP_EXTERN void WebPMemoryWriterClear(WebPMemoryWriter* writer); // The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon // completion, writer.mem and writer.size will hold the coded data. // writer.mem must be freed by calling WebPMemoryWriterClear. -WEBP_NODISCARD WEBP_EXTERN int WebPMemoryWrite( - const uint8_t* data, size_t data_size, const WebPPicture* picture); +WEBP_NODISCARD WEBP_EXTERN int WebPMemoryWrite(const uint8_t* data, + size_t data_size, + const WebPPicture* picture); // Progress hook, called from time to time to report progress. It can return // false to request an abort of the encoding process, or true otherwise if @@ -272,10 +273,10 @@ typedef int (*WebPProgressHook)(int percent, const WebPPicture* picture); // Color spaces. typedef enum WebPEncCSP { // chroma sampling - WEBP_YUV420 = 0, // 4:2:0 - WEBP_YUV420A = 4, // alpha channel variant - WEBP_CSP_UV_MASK = 3, // bit-mask to get the UV sampling factors - WEBP_CSP_ALPHA_BIT = 4 // bit that is set if alpha is present + WEBP_YUV420 = 0, // 4:2:0 + WEBP_YUV420A = 4, // alpha channel variant + WEBP_CSP_UV_MASK = 3, // bit-mask to get the UV sampling factors + WEBP_CSP_ALPHA_BIT = 4 // bit that is set if alpha is present } WebPEncCSP; // Encoding error conditions. @@ -313,18 +314,18 @@ struct WebPPicture { int use_argb; // YUV input (mostly used for input to lossy compression) - WebPEncCSP colorspace; // colorspace: should be YUV420 for now (=Y'CbCr). - int width, height; // dimensions (less or equal to WEBP_MAX_DIMENSION) - uint8_t* y, *u, *v; // pointers to luma/chroma planes. - int y_stride, uv_stride; // luma/chroma strides. - uint8_t* a; // pointer to the alpha plane - int a_stride; // stride of the alpha plane - uint32_t pad1[2]; // padding for later use + WebPEncCSP colorspace; // colorspace: should be YUV420 for now (=Y'CbCr). + int width, height; // dimensions (less or equal to WEBP_MAX_DIMENSION) + uint8_t *y, *u, *v; // pointers to luma/chroma planes. + int y_stride, uv_stride; // luma/chroma strides. + uint8_t* a; // pointer to the alpha plane + int a_stride; // stride of the alpha plane + uint32_t pad1[2]; // padding for later use // ARGB input (mostly used for input to lossless compression) - uint32_t* argb; // Pointer to argb (32 bit) plane. - int argb_stride; // This is stride in pixels units, not bytes. - uint32_t pad2[3]; // padding for later use + uint32_t* argb; // Pointer to argb (32 bit) plane. + int argb_stride; // This is stride in pixels units, not bytes. + uint32_t pad2[3]; // padding for later use // OUTPUT /////////////// @@ -333,14 +334,14 @@ struct WebPPicture { void* custom_ptr; // can be used by the writer. // map for extra information (only for lossy compression mode) - int extra_info_type; // 1: intra type, 2: segment, 3: quant - // 4: intra-16 prediction mode, - // 5: chroma prediction mode, - // 6: bit cost, 7: distortion - uint8_t* extra_info; // if not NULL, points to an array of size - // ((width + 15) / 16) * ((height + 15) / 16) that - // will be filled with a macroblock map, depending - // on extra_info_type. + int extra_info_type; // 1: intra type, 2: segment, 3: quant + // 4: intra-16 prediction mode, + // 5: chroma prediction mode, + // 6: bit cost, 7: distortion + uint8_t* extra_info; // if not NULL, points to an array of size + // ((width + 15) / 16) * ((height + 15) / 16) that + // will be filled with a macroblock map, depending + // on extra_info_type. // STATS AND REPORTS /////////////////////////// @@ -353,20 +354,20 @@ struct WebPPicture { // If not NULL, report progress during encoding. WebPProgressHook progress_hook; - void* user_data; // this field is free to be set to any value and - // used during callbacks (like progress-report e.g.). + void* user_data; // this field is free to be set to any value and + // used during callbacks (like progress-report e.g.). - uint32_t pad3[3]; // padding for later use + uint32_t pad3[3]; // padding for later use // Unused for now - uint8_t* pad4, *pad5; - uint32_t pad6[8]; // padding for later use + uint8_t *pad4, *pad5; + uint32_t pad6[8]; // padding for later use // PRIVATE FIELDS //////////////////// - void* memory_; // row chunk of memory for yuva planes - void* memory_argb_; // and for argb too. - void* pad7[2]; // padding for later use + void* memory_; // row chunk of memory for yuva planes + void* memory_argb_; // and for argb too. + void* pad7[2]; // padding for later use }; // Internal, version-checked, entry point @@ -411,8 +412,8 @@ WEBP_NODISCARD WEBP_EXTERN int WebPPictureCopy(const WebPPicture* src, // 'src/ref_stride' is the byte distance between rows. // Returns false in case of error (bad parameter, memory allocation error, ...). WEBP_NODISCARD WEBP_EXTERN int WebPPlaneDistortion( - const uint8_t* src, size_t src_stride, - const uint8_t* ref, size_t ref_stride, int width, int height, size_t x_step, + const uint8_t* src, size_t src_stride, const uint8_t* ref, + size_t ref_stride, int width, int height, size_t x_step, int type, // 0 = PSNR, 1 = SSIM, 2 = LSIM float* distortion, float* result); @@ -423,7 +424,7 @@ WEBP_NODISCARD WEBP_EXTERN int WebPPlaneDistortion( // Warning: this function is rather CPU-intensive. WEBP_NODISCARD WEBP_EXTERN int WebPPictureDistortion( const WebPPicture* src, const WebPPicture* ref, - int metric_type, // 0 = PSNR, 1 = SSIM, 2 = LSIM + int metric_type, // 0 = PSNR, 1 = SSIM, 2 = LSIM float result[5]); // self-crops a picture to the rectangle defined by top/left/width/height. @@ -434,8 +435,8 @@ WEBP_NODISCARD WEBP_EXTERN int WebPPictureDistortion( // must be fully be comprised inside the 'src' source picture. If the source // picture uses the YUV420 colorspace, the top and left coordinates will be // snapped to even values. -WEBP_NODISCARD WEBP_EXTERN int WebPPictureCrop( - WebPPicture* picture, int left, int top, int width, int height); +WEBP_NODISCARD WEBP_EXTERN int WebPPictureCrop(WebPPicture* picture, int left, + int top, int width, int height); // Extracts a view from 'src' picture into 'dst'. The rectangle for the view // is defined by the top-left corner pixel coordinates (left, top) as well @@ -448,9 +449,9 @@ WEBP_NODISCARD WEBP_EXTERN int WebPPictureCrop( // with WebPPictureInit() if it is different from 'src', since its content will // be overwritten. // Returns false in case of invalid parameters. -WEBP_NODISCARD WEBP_EXTERN int WebPPictureView( - const WebPPicture* src, int left, int top, int width, int height, - WebPPicture* dst); +WEBP_NODISCARD WEBP_EXTERN int WebPPictureView(const WebPPicture* src, int left, + int top, int width, int height, + WebPPicture* dst); // Returns true if the 'picture' is actually a view and therefore does // not own the memory for pixels. @@ -468,24 +469,30 @@ WEBP_NODISCARD WEBP_EXTERN int WebPPictureRescale(WebPPicture* picture, // Previous buffer will be free'd, if any. // *rgb buffer should have a size of at least height * rgb_stride. // Returns false in case of memory error. -WEBP_NODISCARD WEBP_EXTERN int WebPPictureImportRGB( - WebPPicture* picture, const uint8_t* rgb, int rgb_stride); +WEBP_NODISCARD WEBP_EXTERN int WebPPictureImportRGB(WebPPicture* picture, + const uint8_t* rgb, + int rgb_stride); // Same, but for RGBA buffer. -WEBP_NODISCARD WEBP_EXTERN int WebPPictureImportRGBA( - WebPPicture* picture, const uint8_t* rgba, int rgba_stride); +WEBP_NODISCARD WEBP_EXTERN int WebPPictureImportRGBA(WebPPicture* picture, + const uint8_t* rgba, + int rgba_stride); // Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format // input buffer ignoring the alpha channel. Avoids needing to copy the data // to a temporary 24-bit RGB buffer to import the RGB only. -WEBP_NODISCARD WEBP_EXTERN int WebPPictureImportRGBX( - WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride); +WEBP_NODISCARD WEBP_EXTERN int WebPPictureImportRGBX(WebPPicture* picture, + const uint8_t* rgbx, + int rgbx_stride); // Variants of the above, but taking BGR(A|X) input. -WEBP_NODISCARD WEBP_EXTERN int WebPPictureImportBGR( - WebPPicture* picture, const uint8_t* bgr, int bgr_stride); -WEBP_NODISCARD WEBP_EXTERN int WebPPictureImportBGRA( - WebPPicture* picture, const uint8_t* bgra, int bgra_stride); -WEBP_NODISCARD WEBP_EXTERN int WebPPictureImportBGRX( - WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride); +WEBP_NODISCARD WEBP_EXTERN int WebPPictureImportBGR(WebPPicture* picture, + const uint8_t* bgr, + int bgr_stride); +WEBP_NODISCARD WEBP_EXTERN int WebPPictureImportBGRA(WebPPicture* picture, + const uint8_t* bgra, + int bgra_stride); +WEBP_NODISCARD WEBP_EXTERN int WebPPictureImportBGRX(WebPPicture* picture, + const uint8_t* bgrx, + int bgrx_stride); // Converts picture->argb data to the YUV420A format. The 'colorspace' // parameter is deprecated and should be equal to WEBP_YUV420. @@ -554,7 +561,7 @@ WEBP_NODISCARD WEBP_EXTERN int WebPEncode(const WebPConfig* config, //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_WEBP_ENCODE_H_ diff --git a/src/webp/format_constants.h b/src/webp/format_constants.h index 9b007c8a..3655a12e 100644 --- a/src/webp/format_constants.h +++ b/src/webp/format_constants.h @@ -18,72 +18,71 @@ #define MKFOURCC(a, b, c, d) ((a) | (b) << 8 | (c) << 16 | (uint32_t)(d) << 24) // VP8 related constants. -#define VP8_SIGNATURE 0x9d012a // Signature in VP8 data. -#define VP8_MAX_PARTITION0_SIZE (1 << 19) // max size of mode partition -#define VP8_MAX_PARTITION_SIZE (1 << 24) // max size for token partition +#define VP8_SIGNATURE 0x9d012a // Signature in VP8 data. +#define VP8_MAX_PARTITION0_SIZE (1 << 19) // max size of mode partition +#define VP8_MAX_PARTITION_SIZE (1 << 24) // max size for token partition #define VP8_FRAME_HEADER_SIZE 10 // Size of the frame header within VP8 data. // VP8L related constants. -#define VP8L_SIGNATURE_SIZE 1 // VP8L signature size. -#define VP8L_MAGIC_BYTE 0x2f // VP8L signature byte. -#define VP8L_IMAGE_SIZE_BITS 14 // Number of bits used to store - // width and height. -#define VP8L_VERSION_BITS 3 // 3 bits reserved for version. -#define VP8L_VERSION 0 // version 0 -#define VP8L_FRAME_HEADER_SIZE 5 // Size of the VP8L frame header. +#define VP8L_SIGNATURE_SIZE 1 // VP8L signature size. +#define VP8L_MAGIC_BYTE 0x2f // VP8L signature byte. +#define VP8L_IMAGE_SIZE_BITS \ + 14 // Number of bits used to store width and height. +#define VP8L_VERSION_BITS 3 // 3 bits reserved for version. +#define VP8L_VERSION 0 // version 0 +#define VP8L_FRAME_HEADER_SIZE 5 // Size of the VP8L frame header. -#define MAX_PALETTE_SIZE 256 -#define MAX_CACHE_BITS 11 -#define HUFFMAN_CODES_PER_META_CODE 5 -#define ARGB_BLACK 0xff000000 +#define MAX_PALETTE_SIZE 256 +#define MAX_CACHE_BITS 11 +#define HUFFMAN_CODES_PER_META_CODE 5 +#define ARGB_BLACK 0xff000000 -#define DEFAULT_CODE_LENGTH 8 -#define MAX_ALLOWED_CODE_LENGTH 15 +#define DEFAULT_CODE_LENGTH 8 +#define MAX_ALLOWED_CODE_LENGTH 15 -#define NUM_LITERAL_CODES 256 -#define NUM_LENGTH_CODES 24 -#define NUM_DISTANCE_CODES 40 -#define CODE_LENGTH_CODES 19 +#define NUM_LITERAL_CODES 256 +#define NUM_LENGTH_CODES 24 +#define NUM_DISTANCE_CODES 40 +#define CODE_LENGTH_CODES 19 -#define MIN_HUFFMAN_BITS 2 // min number of Huffman bits -#define NUM_HUFFMAN_BITS 3 +#define MIN_HUFFMAN_BITS 2 // min number of Huffman bits +#define NUM_HUFFMAN_BITS 3 // the maximum number of bits defining a transform is // MIN_TRANSFORM_BITS + (1 << NUM_TRANSFORM_BITS) - 1 -#define MIN_TRANSFORM_BITS 2 -#define NUM_TRANSFORM_BITS 3 +#define MIN_TRANSFORM_BITS 2 +#define NUM_TRANSFORM_BITS 3 -#define TRANSFORM_PRESENT 1 // The bit to be written when next data - // to be read is a transform. -#define NUM_TRANSFORMS 4 // Maximum number of allowed transform - // in a bitstream. +#define TRANSFORM_PRESENT \ + 1 // The bit to be written when next data to be read is a transform. +#define NUM_TRANSFORMS 4 // Maximum number of allowed transform in a bitstream. typedef enum { - PREDICTOR_TRANSFORM = 0, - CROSS_COLOR_TRANSFORM = 1, + PREDICTOR_TRANSFORM = 0, + CROSS_COLOR_TRANSFORM = 1, SUBTRACT_GREEN_TRANSFORM = 2, COLOR_INDEXING_TRANSFORM = 3 } VP8LImageTransformType; // Alpha related constants. -#define ALPHA_HEADER_LEN 1 -#define ALPHA_NO_COMPRESSION 0 -#define ALPHA_LOSSLESS_COMPRESSION 1 -#define ALPHA_PREPROCESSED_LEVELS 1 +#define ALPHA_HEADER_LEN 1 +#define ALPHA_NO_COMPRESSION 0 +#define ALPHA_LOSSLESS_COMPRESSION 1 +#define ALPHA_PREPROCESSED_LEVELS 1 // Mux related constants. -#define TAG_SIZE 4 // Size of a chunk tag (e.g. "VP8L"). -#define CHUNK_SIZE_BYTES 4 // Size needed to store chunk's size. -#define CHUNK_HEADER_SIZE 8 // Size of a chunk header. -#define RIFF_HEADER_SIZE 12 // Size of the RIFF header ("RIFFnnnnWEBP"). -#define ANMF_CHUNK_SIZE 16 // Size of an ANMF chunk. -#define ANIM_CHUNK_SIZE 6 // Size of an ANIM chunk. -#define VP8X_CHUNK_SIZE 10 // Size of a VP8X chunk. +#define TAG_SIZE 4 // Size of a chunk tag (e.g. "VP8L"). +#define CHUNK_SIZE_BYTES 4 // Size needed to store chunk's size. +#define CHUNK_HEADER_SIZE 8 // Size of a chunk header. +#define RIFF_HEADER_SIZE 12 // Size of the RIFF header ("RIFFnnnnWEBP"). +#define ANMF_CHUNK_SIZE 16 // Size of an ANMF chunk. +#define ANIM_CHUNK_SIZE 6 // Size of an ANIM chunk. +#define VP8X_CHUNK_SIZE 10 // Size of a VP8X chunk. -#define MAX_CANVAS_SIZE (1 << 24) // 24-bit max for VP8X width/height. -#define MAX_IMAGE_AREA (1ULL << 32) // 32-bit max for width x height. -#define MAX_LOOP_COUNT (1 << 16) // maximum value for loop-count -#define MAX_DURATION (1 << 24) // maximum duration -#define MAX_POSITION_OFFSET (1 << 24) // maximum frame x/y offset +#define MAX_CANVAS_SIZE (1 << 24) // 24-bit max for VP8X width/height. +#define MAX_IMAGE_AREA (1ULL << 32) // 32-bit max for width x height. +#define MAX_LOOP_COUNT (1 << 16) // maximum value for loop-count +#define MAX_DURATION (1 << 24) // maximum duration +#define MAX_POSITION_OFFSET (1 << 24) // maximum frame x/y offset // Maximum chunk payload is such that adding the header and padding won't // overflow a uint32_t. diff --git a/src/webp/mux.h b/src/webp/mux.h index 8fb067e4..4718a364 100644 --- a/src/webp/mux.h +++ b/src/webp/mux.h @@ -22,7 +22,7 @@ extern "C" { #endif -#define WEBP_MUX_ABI_VERSION 0x0109 // MAJOR(8b) + MINOR(8b) +#define WEBP_MUX_ABI_VERSION 0x0109 // MAJOR(8b) + MINOR(8b) //------------------------------------------------------------------------------ // Mux API @@ -65,19 +65,19 @@ extern "C" { // the types are left here for reference. // typedef enum WebPMuxError WebPMuxError; // typedef enum WebPChunkId WebPChunkId; -typedef struct WebPMux WebPMux; // main opaque object. +typedef struct WebPMux WebPMux; // main opaque object. typedef struct WebPMuxFrameInfo WebPMuxFrameInfo; typedef struct WebPMuxAnimParams WebPMuxAnimParams; typedef struct WebPAnimEncoderOptions WebPAnimEncoderOptions; // Error codes typedef enum WEBP_NODISCARD WebPMuxError { - WEBP_MUX_OK = 1, - WEBP_MUX_NOT_FOUND = 0, - WEBP_MUX_INVALID_ARGUMENT = -1, - WEBP_MUX_BAD_DATA = -2, - WEBP_MUX_MEMORY_ERROR = -3, - WEBP_MUX_NOT_ENOUGH_DATA = -4 + WEBP_MUX_OK = 1, + WEBP_MUX_NOT_FOUND = 0, + WEBP_MUX_INVALID_ARGUMENT = -1, + WEBP_MUX_BAD_DATA = -2, + WEBP_MUX_MEMORY_ERROR = -3, + WEBP_MUX_NOT_ENOUGH_DATA = -4 } WebPMuxError; // IDs for different types of chunks. @@ -166,9 +166,9 @@ WEBP_NODISCARD static WEBP_INLINE WebPMux* WebPMuxCreate( // or if fourcc corresponds to an image chunk. // WEBP_MUX_MEMORY_ERROR - on memory allocation error. // WEBP_MUX_OK - on success. -WEBP_EXTERN WebPMuxError WebPMuxSetChunk( - WebPMux* mux, const char fourcc[4], const WebPData* chunk_data, - int copy_data); +WEBP_EXTERN WebPMuxError WebPMuxSetChunk(WebPMux* mux, const char fourcc[4], + const WebPData* chunk_data, + int copy_data); // Gets a reference to the data of the chunk with id 'fourcc' in the mux object. // The caller should NOT free the returned data. @@ -182,8 +182,9 @@ WEBP_EXTERN WebPMuxError WebPMuxSetChunk( // or if fourcc corresponds to an image chunk. // WEBP_MUX_NOT_FOUND - If mux does not contain a chunk with the given id. // WEBP_MUX_OK - on success. -WEBP_EXTERN WebPMuxError WebPMuxGetChunk( - const WebPMux* mux, const char fourcc[4], WebPData* chunk_data); +WEBP_EXTERN WebPMuxError WebPMuxGetChunk(const WebPMux* mux, + const char fourcc[4], + WebPData* chunk_data); // Deletes the chunk with the given 'fourcc' from the mux object. // Parameters: @@ -195,25 +196,24 @@ WEBP_EXTERN WebPMuxError WebPMuxGetChunk( // or if fourcc corresponds to an image chunk. // WEBP_MUX_NOT_FOUND - If mux does not contain a chunk with the given fourcc. // WEBP_MUX_OK - on success. -WEBP_EXTERN WebPMuxError WebPMuxDeleteChunk( - WebPMux* mux, const char fourcc[4]); +WEBP_EXTERN WebPMuxError WebPMuxDeleteChunk(WebPMux* mux, const char fourcc[4]); //------------------------------------------------------------------------------ // Images. // Encapsulates data about a single frame. struct WebPMuxFrameInfo { - WebPData bitstream; // image data: can be a raw VP8/VP8L bitstream - // or a single-image WebP file. - int x_offset; // x-offset of the frame. - int y_offset; // y-offset of the frame. - int duration; // duration of the frame (in milliseconds). + WebPData bitstream; // image data: can be a raw VP8/VP8L bitstream + // or a single-image WebP file. + int x_offset; // x-offset of the frame. + int y_offset; // y-offset of the frame. + int duration; // duration of the frame (in milliseconds). - WebPChunkId id; // frame type: should be one of WEBP_CHUNK_ANMF - // or WEBP_CHUNK_IMAGE + WebPChunkId id; // frame type: should be one of WEBP_CHUNK_ANMF + // or WEBP_CHUNK_IMAGE WebPMuxAnimDispose dispose_method; // Disposal method for the frame. - WebPMuxAnimBlend blend_method; // Blend operation for the frame. - uint32_t pad[1]; // padding for later use + WebPMuxAnimBlend blend_method; // Blend operation for the frame. + uint32_t pad[1]; // padding for later use }; // Sets the (non-animated) image in the mux object. @@ -230,8 +230,9 @@ struct WebPMuxFrameInfo { // WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or bitstream is NULL. // WEBP_MUX_MEMORY_ERROR - on memory allocation error. // WEBP_MUX_OK - on success. -WEBP_EXTERN WebPMuxError WebPMuxSetImage( - WebPMux* mux, const WebPData* bitstream, int copy_data); +WEBP_EXTERN WebPMuxError WebPMuxSetImage(WebPMux* mux, + const WebPData* bitstream, + int copy_data); // Adds a frame at the end of the mux object. // Notes: (1) frame.id should be WEBP_CHUNK_ANMF @@ -251,8 +252,9 @@ WEBP_EXTERN WebPMuxError WebPMuxSetImage( // or if content of 'frame' is invalid. // WEBP_MUX_MEMORY_ERROR - on memory allocation error. // WEBP_MUX_OK - on success. -WEBP_EXTERN WebPMuxError WebPMuxPushFrame( - WebPMux* mux, const WebPMuxFrameInfo* frame, int copy_data); +WEBP_EXTERN WebPMuxError WebPMuxPushFrame(WebPMux* mux, + const WebPMuxFrameInfo* frame, + int copy_data); // Gets the nth frame from the mux object. // The content of 'frame->bitstream' is allocated using WebPMalloc(), and NOT @@ -269,8 +271,8 @@ WEBP_EXTERN WebPMuxError WebPMuxPushFrame( // WEBP_MUX_BAD_DATA - if nth frame chunk in mux is invalid. // WEBP_MUX_MEMORY_ERROR - on memory allocation error. // WEBP_MUX_OK - on success. -WEBP_EXTERN WebPMuxError WebPMuxGetFrame( - const WebPMux* mux, uint32_t nth, WebPMuxFrameInfo* frame); +WEBP_EXTERN WebPMuxError WebPMuxGetFrame(const WebPMux* mux, uint32_t nth, + WebPMuxFrameInfo* frame); // Deletes a frame from the mux object. // nth=0 has a special meaning - last position. @@ -306,8 +308,8 @@ struct WebPMuxAnimParams { // WEBP_MUX_INVALID_ARGUMENT - if mux or params is NULL. // WEBP_MUX_MEMORY_ERROR - on memory allocation error. // WEBP_MUX_OK - on success. -WEBP_EXTERN WebPMuxError WebPMuxSetAnimationParams( - WebPMux* mux, const WebPMuxAnimParams* params); +WEBP_EXTERN WebPMuxError +WebPMuxSetAnimationParams(WebPMux* mux, const WebPMuxAnimParams* params); // Gets the animation parameters from the mux object. // Parameters: @@ -317,8 +319,8 @@ WEBP_EXTERN WebPMuxError WebPMuxSetAnimationParams( // WEBP_MUX_INVALID_ARGUMENT - if mux or params is NULL. // WEBP_MUX_NOT_FOUND - if ANIM chunk is not present in mux object. // WEBP_MUX_OK - on success. -WEBP_EXTERN WebPMuxError WebPMuxGetAnimationParams( - const WebPMux* mux, WebPMuxAnimParams* params); +WEBP_EXTERN WebPMuxError WebPMuxGetAnimationParams(const WebPMux* mux, + WebPMuxAnimParams* params); //------------------------------------------------------------------------------ // Misc Utilities. @@ -338,8 +340,8 @@ WEBP_EXTERN WebPMuxError WebPMuxGetAnimationParams( // WEBP_MUX_INVALID_ARGUMENT - if mux is NULL; or // width or height are invalid or out of bounds // WEBP_MUX_OK - on success. -WEBP_EXTERN WebPMuxError WebPMuxSetCanvasSize(WebPMux* mux, - int width, int height); +WEBP_EXTERN WebPMuxError WebPMuxSetCanvasSize(WebPMux* mux, int width, + int height); // Gets the canvas size from the mux object. // Note: This method assumes that the VP8X chunk, if present, is up-to-date. @@ -353,8 +355,8 @@ WEBP_EXTERN WebPMuxError WebPMuxSetCanvasSize(WebPMux* mux, // WEBP_MUX_INVALID_ARGUMENT - if mux, width or height is NULL. // WEBP_MUX_BAD_DATA - if VP8X/VP8/VP8L chunk or canvas size is invalid. // WEBP_MUX_OK - on success. -WEBP_EXTERN WebPMuxError WebPMuxGetCanvasSize(const WebPMux* mux, - int* width, int* height); +WEBP_EXTERN WebPMuxError WebPMuxGetCanvasSize(const WebPMux* mux, int* width, + int* height); // Gets the feature flags from the mux object. // Note: This method assumes that the VP8X chunk, if present, is up-to-date. @@ -380,8 +382,8 @@ WEBP_EXTERN WebPMuxError WebPMuxGetFeatures(const WebPMux* mux, // Returns: // WEBP_MUX_INVALID_ARGUMENT - if mux, or num_elements is NULL. // WEBP_MUX_OK - on success. -WEBP_EXTERN WebPMuxError WebPMuxNumChunks(const WebPMux* mux, - WebPChunkId id, int* num_elements); +WEBP_EXTERN WebPMuxError WebPMuxNumChunks(const WebPMux* mux, WebPChunkId id, + int* num_elements); // Assembles all chunks in WebP RIFF format and returns in 'assembled_data'. // This function also validates the mux object. @@ -433,27 +435,27 @@ struct WebPConfig; // Global options. struct WebPAnimEncoderOptions { WebPMuxAnimParams anim_params; // Animation parameters. - int minimize_size; // If true, minimize the output size (slow). Implicitly - // disables key-frame insertion. + int minimize_size; // If true, minimize the output size (slow). Implicitly + // disables key-frame insertion. int kmin; - int kmax; // Minimum and maximum distance between consecutive key - // frames in the output. The library may insert some key - // frames as needed to satisfy this criteria. - // Note that these conditions should hold: kmax > kmin - // and kmin >= kmax / 2 + 1. Also, if kmax <= 0, then - // key-frame insertion is disabled; and if kmax == 1, - // then all frames will be key-frames (kmin value does - // not matter for these special cases). - int allow_mixed; // If true, use mixed compression mode; may choose - // either lossy and lossless for each frame. - int verbose; // If true, print info and warning messages to stderr. + int kmax; // Minimum and maximum distance between consecutive key + // frames in the output. The library may insert some key + // frames as needed to satisfy this criteria. + // Note that these conditions should hold: kmax > kmin + // and kmin >= kmax / 2 + 1. Also, if kmax <= 0, then + // key-frame insertion is disabled; and if kmax == 1, + // then all frames will be key-frames (kmin value does + // not matter for these special cases). + int allow_mixed; // If true, use mixed compression mode; may choose + // either lossy and lossless for each frame. + int verbose; // If true, print info and warning messages to stderr. uint32_t padding[4]; // Padding for later use. }; // Internal, version-checked, entry point. -WEBP_EXTERN int WebPAnimEncoderOptionsInitInternal( - WebPAnimEncoderOptions*, int); +WEBP_EXTERN int WebPAnimEncoderOptionsInitInternal(WebPAnimEncoderOptions*, + int); // Should always be called, to initialize a fresh WebPAnimEncoderOptions // structure before modification. Returns false in case of version mismatch. @@ -552,9 +554,10 @@ WEBP_EXTERN void WebPAnimEncoderDelete(WebPAnimEncoder* enc); // WEBP_MUX_INVALID_ARGUMENT - if enc, fourcc or chunk_data is NULL. // WEBP_MUX_MEMORY_ERROR - on memory allocation error. // WEBP_MUX_OK - on success. -WEBP_EXTERN WebPMuxError WebPAnimEncoderSetChunk( - WebPAnimEncoder* enc, const char fourcc[4], const WebPData* chunk_data, - int copy_data); +WEBP_EXTERN WebPMuxError WebPAnimEncoderSetChunk(WebPAnimEncoder* enc, + const char fourcc[4], + const WebPData* chunk_data, + int copy_data); // Gets a reference to the data of the chunk with id 'fourcc' in the enc object. // The caller should NOT free the returned data. @@ -567,8 +570,9 @@ WEBP_EXTERN WebPMuxError WebPAnimEncoderSetChunk( // WEBP_MUX_INVALID_ARGUMENT - if enc, fourcc or chunk_data is NULL. // WEBP_MUX_NOT_FOUND - If enc does not contain a chunk with the given id. // WEBP_MUX_OK - on success. -WEBP_EXTERN WebPMuxError WebPAnimEncoderGetChunk( - const WebPAnimEncoder* enc, const char fourcc[4], WebPData* chunk_data); +WEBP_EXTERN WebPMuxError WebPAnimEncoderGetChunk(const WebPAnimEncoder* enc, + const char fourcc[4], + WebPData* chunk_data); // Deletes the chunk with the given 'fourcc' from the enc object. // Parameters: @@ -579,13 +583,13 @@ WEBP_EXTERN WebPMuxError WebPAnimEncoderGetChunk( // WEBP_MUX_INVALID_ARGUMENT - if enc or fourcc is NULL. // WEBP_MUX_NOT_FOUND - If enc does not contain a chunk with the given fourcc. // WEBP_MUX_OK - on success. -WEBP_EXTERN WebPMuxError WebPAnimEncoderDeleteChunk( - WebPAnimEncoder* enc, const char fourcc[4]); +WEBP_EXTERN WebPMuxError WebPAnimEncoderDeleteChunk(WebPAnimEncoder* enc, + const char fourcc[4]); //------------------------------------------------------------------------------ #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_WEBP_MUX_H_ diff --git a/src/webp/mux_types.h b/src/webp/mux_types.h index c1bbad39..4f8df6dc 100644 --- a/src/webp/mux_types.h +++ b/src/webp/mux_types.h @@ -31,11 +31,11 @@ typedef struct WebPData WebPData; // VP8X Feature Flags. typedef enum WebPFeatureFlags { - ANIMATION_FLAG = 0x00000002, - XMP_FLAG = 0x00000004, - EXIF_FLAG = 0x00000008, - ALPHA_FLAG = 0x00000010, - ICCP_FLAG = 0x00000020, + ANIMATION_FLAG = 0x00000002, + XMP_FLAG = 0x00000004, + EXIF_FLAG = 0x00000008, + ALPHA_FLAG = 0x00000010, + ICCP_FLAG = 0x00000020, ALL_VALID_FLAGS = 0x0000003e } WebPFeatureFlags; @@ -50,8 +50,8 @@ typedef enum WebPMuxAnimDispose { // Blend operation (animation only). Indicates how transparent pixels of the // current frame are blended with those of the previous canvas. typedef enum WebPMuxAnimBlend { - WEBP_MUX_BLEND, // Blend. - WEBP_MUX_NO_BLEND // Do not blend. + WEBP_MUX_BLEND, // Blend. + WEBP_MUX_NO_BLEND // Do not blend. } WebPMuxAnimBlend; // Data type used to describe 'raw' data, e.g., chunk data @@ -94,7 +94,7 @@ WEBP_NODISCARD static WEBP_INLINE int WebPDataCopy(const WebPData* src, } #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_WEBP_MUX_TYPES_H_ diff --git a/src/webp/types.h b/src/webp/types.h index 549a0a7d..ab0c32aa 100644 --- a/src/webp/types.h +++ b/src/webp/types.h @@ -25,16 +25,16 @@ #define WEBP_INLINE #endif #else -typedef signed char int8_t; +typedef signed char int8_t; typedef unsigned char uint8_t; -typedef signed short int16_t; +typedef signed short int16_t; typedef unsigned short uint16_t; -typedef signed int int32_t; +typedef signed int int32_t; typedef unsigned int uint32_t; typedef unsigned long long int uint64_t; typedef long long int int64_t; #define WEBP_INLINE __forceinline -#endif /* _MSC_VER */ +#endif /* _MSC_VER */ #ifndef WEBP_NODISCARD #if defined(WEBP_ENABLE_NODISCARD) && WEBP_ENABLE_NODISCARD @@ -48,28 +48,28 @@ typedef long long int int64_t; #define WEBP_NODISCARD __attribute__((warn_unused_result)) #else #define WEBP_NODISCARD -#endif /* __has_attribute(warn_unused_result) */ +#endif /* __has_attribute(warn_unused_result) */ #else #define WEBP_NODISCARD -#endif /* defined(__clang__) && defined(__has_attribute) */ -#endif /* (defined(__cplusplus) && __cplusplus >= 201700L) || - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) */ +#endif /* defined(__clang__) && defined(__has_attribute) */ +#endif /* (defined(__cplusplus) && __cplusplus >= 201700L) || \ + (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) */ #else #define WEBP_NODISCARD -#endif /* defined(WEBP_ENABLE_NODISCARD) && WEBP_ENABLE_NODISCARD */ -#endif /* WEBP_NODISCARD */ +#endif /* defined(WEBP_ENABLE_NODISCARD) && WEBP_ENABLE_NODISCARD */ +#endif /* WEBP_NODISCARD */ #ifndef WEBP_EXTERN // This explicitly marks library functions and allows for changing the // signature for e.g., Windows DLL builds. -# if defined(_WIN32) && defined(WEBP_DLL) -# define WEBP_EXTERN __declspec(dllexport) -# elif defined(__GNUC__) && __GNUC__ >= 4 -# define WEBP_EXTERN extern __attribute__ ((visibility ("default"))) -# else -# define WEBP_EXTERN extern -# endif /* defined(_WIN32) && defined(WEBP_DLL) */ -#endif /* WEBP_EXTERN */ +#if defined(_WIN32) && defined(WEBP_DLL) +#define WEBP_EXTERN __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +#define WEBP_EXTERN extern __attribute__((visibility("default"))) +#else +#define WEBP_EXTERN extern +#endif /* defined(_WIN32) && defined(WEBP_DLL) */ +#endif /* WEBP_EXTERN */ // Macro to check ABI compatibility (same major revision number) #define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8)) @@ -87,7 +87,7 @@ WEBP_NODISCARD WEBP_EXTERN void* WebPMalloc(size_t size); WEBP_EXTERN void WebPFree(void* ptr); #ifdef __cplusplus -} // extern "C" +} // extern "C" #endif #endif // WEBP_WEBP_TYPES_H_ diff --git a/tests/fuzzer/advanced_api_fuzzer.cc b/tests/fuzzer/advanced_api_fuzzer.cc index a4f8045a..cec5dbf9 100644 --- a/tests/fuzzer/advanced_api_fuzzer.cc +++ b/tests/fuzzer/advanced_api_fuzzer.cc @@ -159,23 +159,22 @@ void AdvancedApiTest(std::string_view blob, uint8_t factor_u8, bool flip, } // namespace FUZZ_TEST(AdvancedApi, AdvancedApiTest) - .WithDomains( - fuzztest::String() - .WithMaxSize(fuzz_utils::kMaxWebPFileSize + 1), - /*factor_u8=*/fuzztest::Arbitrary(), - /*flip=*/fuzztest::Arbitrary(), - /*bypass_filtering=*/fuzztest::Arbitrary(), - /*no_fancy_upsampling=*/fuzztest::Arbitrary(), - /*use_threads=*/fuzztest::Arbitrary(), - /*use_cropping=*/fuzztest::Arbitrary(), - /*use_scaling=*/fuzztest::Arbitrary(), - /*use_dithering=*/fuzztest::Arbitrary(), + .WithDomains(fuzztest::String().WithMaxSize(fuzz_utils::kMaxWebPFileSize + + 1), + /*factor_u8=*/fuzztest::Arbitrary(), + /*flip=*/fuzztest::Arbitrary(), + /*bypass_filtering=*/fuzztest::Arbitrary(), + /*no_fancy_upsampling=*/fuzztest::Arbitrary(), + /*use_threads=*/fuzztest::Arbitrary(), + /*use_cropping=*/fuzztest::Arbitrary(), + /*use_scaling=*/fuzztest::Arbitrary(), + /*use_dithering=*/fuzztest::Arbitrary(), #if defined(WEBP_REDUCE_CSP) - fuzztest::ElementOf({static_cast(MODE_RGBA), - static_cast(MODE_BGRA), - static_cast(MODE_rgbA), - static_cast(MODE_bgrA)}), + fuzztest::ElementOf({static_cast(MODE_RGBA), + static_cast(MODE_BGRA), + static_cast(MODE_rgbA), + static_cast(MODE_bgrA)}), #else - fuzztest::InRange(0, static_cast(MODE_LAST) - 1), + fuzztest::InRange(0, static_cast(MODE_LAST) - 1), #endif - /*incremental=*/fuzztest::Arbitrary()); + /*incremental=*/fuzztest::Arbitrary()); diff --git a/tests/fuzzer/animation_api_fuzzer.cc b/tests/fuzzer/animation_api_fuzzer.cc index efe0e1db..f26b2e70 100644 --- a/tests/fuzzer/animation_api_fuzzer.cc +++ b/tests/fuzzer/animation_api_fuzzer.cc @@ -82,10 +82,9 @@ void AnimationApiTest(std::string_view blob, bool use_threads, } // namespace FUZZ_TEST(AnimationApi, AnimationApiTest) - .WithDomains( - fuzztest::String() - .WithMaxSize(fuzz_utils::kMaxWebPFileSize + 1), - /*use_threads=*/fuzztest::Arbitrary(), - // Animations only support 4 (out of 12) modes. - fuzztest::ElementOf({MODE_RGBA, MODE_BGRA, MODE_rgbA, - MODE_bgrA})); + .WithDomains(fuzztest::String().WithMaxSize(fuzz_utils::kMaxWebPFileSize + + 1), + /*use_threads=*/fuzztest::Arbitrary(), + // Animations only support 4 (out of 12) modes. + fuzztest::ElementOf({MODE_RGBA, MODE_BGRA, + MODE_rgbA, MODE_bgrA})); diff --git a/tests/fuzzer/animdecoder_fuzzer.cc b/tests/fuzzer/animdecoder_fuzzer.cc index 9826a644..1e495c02 100644 --- a/tests/fuzzer/animdecoder_fuzzer.cc +++ b/tests/fuzzer/animdecoder_fuzzer.cc @@ -69,6 +69,5 @@ End: } // namespace FUZZ_TEST(AnimDecoder, AnimDecoderTest) - .WithDomains( - fuzztest::String() - .WithMaxSize(fuzz_utils::kMaxWebPFileSize + 1)); + .WithDomains(fuzztest::String().WithMaxSize(fuzz_utils::kMaxWebPFileSize + + 1)); diff --git a/tests/fuzzer/dec_fuzzer.cc b/tests/fuzzer/dec_fuzzer.cc index 4adbdfa3..e8b93041 100644 --- a/tests/fuzzer/dec_fuzzer.cc +++ b/tests/fuzzer/dec_fuzzer.cc @@ -42,8 +42,7 @@ void DecodeWebP(std::string_view arbitrary_bytes) { } FUZZ_TEST(WebPSuite, DecodeWebP) - .WithDomains( - fuzztest::String() - .WithMaxSize(fuzz_utils::kMaxWebPFileSize + 1)); + .WithDomains(fuzztest::String().WithMaxSize(fuzz_utils::kMaxWebPFileSize + + 1)); } // namespace diff --git a/tests/fuzzer/enc_fuzzer.cc b/tests/fuzzer/enc_fuzzer.cc index c292c441..d76f543f 100644 --- a/tests/fuzzer/enc_fuzzer.cc +++ b/tests/fuzzer/enc_fuzzer.cc @@ -131,10 +131,10 @@ void EncTest(std::string_view file, uint32_t optimization_index, bool use_argb, } // namespace FUZZ_TEST(Enc, EncTest) - .WithDomains( - fuzztest::Arbitrary(), - /*optimization_index=*/ - fuzztest::InRange(0, fuzz_utils::kMaxOptimizationIndex), - /*use_argb=*/fuzztest::Arbitrary(), - fuzz_utils::ArbitraryWebPConfig(), - fuzz_utils::ArbitraryCropOrScaleParams()); + .WithDomains(fuzztest::Arbitrary(), + /*optimization_index=*/ + fuzztest::InRange(0, + fuzz_utils::kMaxOptimizationIndex), + /*use_argb=*/fuzztest::Arbitrary(), + fuzz_utils::ArbitraryWebPConfig(), + fuzz_utils::ArbitraryCropOrScaleParams()); diff --git a/tests/fuzzer/imageio_fuzzer.cc b/tests/fuzzer/imageio_fuzzer.cc index edb67d13..5c93e56d 100644 --- a/tests/fuzzer/imageio_fuzzer.cc +++ b/tests/fuzzer/imageio_fuzzer.cc @@ -64,13 +64,12 @@ void Decode(std::string_view arbitrary_bytes, WebPInputFileFormat format, } FUZZ_TEST(ImageIOSuite, Decode) - .WithDomains( - fuzztest::String() - .WithMaxSize(fuzz_utils::kMaxWebPFileSize + 1), - fuzztest::ElementOf( - {WEBP_PNG_FORMAT, WEBP_JPEG_FORMAT, WEBP_TIFF_FORMAT, - WEBP_WEBP_FORMAT, WEBP_PNM_FORMAT, kUnknown}), - /*keep_alpha=*/fuzztest::Arbitrary(), - /*use_argb=*/fuzztest::Arbitrary()); + .WithDomains(fuzztest::String().WithMaxSize(fuzz_utils::kMaxWebPFileSize + + 1), + fuzztest::ElementOf( + {WEBP_PNG_FORMAT, WEBP_JPEG_FORMAT, WEBP_TIFF_FORMAT, + WEBP_WEBP_FORMAT, WEBP_PNM_FORMAT, kUnknown}), + /*keep_alpha=*/fuzztest::Arbitrary(), + /*use_argb=*/fuzztest::Arbitrary()); } // namespace diff --git a/tests/fuzzer/img_alpha.h b/tests/fuzzer/img_alpha.h index fac63feb..97746a27 100644 --- a/tests/fuzzer/img_alpha.h +++ b/tests/fuzzer/img_alpha.h @@ -34,29 +34,28 @@ static const uint8_t kImgAlphaData[] = { 0xfe, 0xfc, 0xf9, 0xff, 0xfe, 0xfb, 0xf8, 0xff, 0xfe, 0xfb, 0xf7, 0xff, 0xfe, 0xfb, 0xf7, 0xff, 0xfe, 0xfa, 0xf6, 0xff, 0xfe, 0xf9, 0xf5, 0xff, 0xfd, 0xf9, 0xf3, 0xff, 0xfd, 0xf8, 0xf2, 0xff, 0xfd, 0xf7, 0xf1, 0xff, - 0xfc, 0xf7, 0xf0, 0xff, 0xfc, 0xf6, 0xef, 0xff, + 0xfc, 0xf7, 0xf0, 0xff, 0xfc, 0xf6, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xff, - 0xfe, 0xfe, 0xfd, 0xff, 0xfe, 0xfd, 0xfc, 0xff, 0xfe, 0xfd, 0xfb, 0xff, - 0xfe, 0xfc, 0xfa, 0xff, 0xfe, 0xfc, 0xfa, 0xff, 0xfe, 0xfb, 0xf9, 0xff, - 0xfe, 0xfb, 0xf8, 0xff, 0xfe, 0xfb, 0xf7, 0xff, 0xfe, 0xfa, 0xf7, 0xff, - 0xfe, 0xfa, 0xf5, 0xff, 0xfe, 0xfa, 0xf5, 0xff, 0xfd, 0xf9, 0xf4, 0xff, - 0xfd, 0xf8, 0xf2, 0xff, 0xfc, 0xf7, 0xf1, 0xff, 0xfc, 0xf7, 0xf0, 0xff, - 0xfc, 0xf7, 0xef, 0xff, 0xfc, 0xf6, 0xee, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xfe, 0xfe, 0xfe, 0xff, 0xfe, 0xfe, 0xfd, 0xff, 0xfe, 0xfd, 0xfd, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xfe, 0xfe, 0xfd, 0xff, 0xfe, 0xfd, 0xfc, 0xff, 0xfe, 0xfd, 0xfb, 0xff, 0xfe, 0xfc, 0xfa, 0xff, - 0xfe, 0xfc, 0xfa, 0xff, 0xfe, 0xfc, 0xf9, 0xff, 0xfe, 0xfb, 0xf8, 0xff, - 0xfe, 0xfb, 0xf7, 0xff, 0xfe, 0xfb, 0xf6, 0xff, 0xfe, 0xfa, 0xf5, 0xff, - 0xfe, 0xfa, 0xf5, 0xff, 0xfe, 0xf9, 0xf4, 0xff, 0xfe, 0xf8, 0xf3, 0xff, - 0xfd, 0xf8, 0xf2, 0xff, 0xfc, 0xf7, 0xf1, 0xff, 0xfc, 0xf5, 0xf0, 0xff, - 0xfc, 0xf6, 0xee, 0xff, 0xfc, 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, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -67,29 +66,28 @@ static const uint8_t kImgAlphaData[] = { 0xfe, 0xfb, 0xf6, 0xff, 0xfe, 0xfa, 0xf5, 0xff, 0xfe, 0xfa, 0xf5, 0xff, 0xfe, 0xf9, 0xf4, 0xff, 0xfe, 0xf9, 0xf3, 0xff, 0xfe, 0xf8, 0xf2, 0xff, 0xfd, 0xf7, 0xf1, 0xff, 0xfc, 0xf6, 0xf0, 0xff, 0xfc, 0xf6, 0xee, 0xff, - 0xfc, 0xf5, 0xec, 0xff, 0xfb, 0xf5, 0xec, 0xff, + 0xfc, 0xf5, 0xec, 0xff, 0xfb, 0xf5, 0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xfc, 0xfc, 0xfc, 0xff, 0xfb, 0xfb, 0xfb, 0xff, - 0xfa, 0xf9, 0xf9, 0xff, 0xf7, 0xf6, 0xf6, 0xff, 0xfd, 0xfc, 0xfa, 0xff, - 0xfe, 0xfc, 0xfa, 0xff, 0xfe, 0xfc, 0xf9, 0xff, 0xfe, 0xfb, 0xf9, 0xff, - 0xfe, 0xfb, 0xf7, 0xff, 0xfe, 0xfb, 0xf7, 0xff, 0xfe, 0xfb, 0xf6, 0xff, - 0xfe, 0xfa, 0xf5, 0xff, 0xfe, 0xfa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xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xfc, 0xfc, 0xff, 0xfa, 0xf9, 0xf9, 0xff, @@ -100,29 +98,28 @@ static const uint8_t kImgAlphaData[] = { 0xfe, 0xfb, 0xf5, 0xf3, 0xff, 0xfe, 0xfe, 0xb4, 0xff, 0xff, 0xff, 0xac, 0xff, 0xff, 0xff, 0xa7, 0xff, 0xff, 0xff, 0xa3, 0xff, 0xff, 0xff, 0x9c, 0xff, 0xff, 0xff, 0x98, 0xff, 0xff, 0xff, 0x93, 0xff, 0xff, 0xff, 0x8f, - 0xff, 0xff, 0xff, 0x88, 0xff, 0xff, 0xff, 0x84, + 0xff, 0xff, 0xff, 0x88, 0xff, 0xff, 0xff, 0x84, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xff, - 0xfc, 0xfb, 0xfb, 0xff, 0xf9, 0xf8, 0xf8, 0xff, 0xf6, 0xf5, 0xf4, 0xff, - 0xf3, 0xf1, 0xf1, 0xff, 0xf0, 0xed, 0xed, 0xff, 0xef, 0xec, 0xeb, 0xff, - 0xee, 0xeb, 0xeb, 0xff, 0xf0, 0xee, 0xee, 0xff, 0xea, 0xe7, 0xe7, 0xff, - 0xec, 0xe9, 0xe9, 0xff, 0xf5, 0xf2, 0xf0, 0xff, 0xfe, 0xfb, 0xf6, 0xff, - 0xfe, 0xfb, 0xf5, 0xff, 0xfe, 0xfa, 0xf4, 0xff, 0xfe, 0xfb, 0xf6, 0xeb, - 0xff, 0xff, 0xff, 0xaf, 0xff, 0xff, 0xff, 0xab, 0xff, 0xff, 0xff, 0xa4, - 0xff, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0x9b, 0xff, 0xff, 0xff, 0x97, - 0xff, 0xff, 0xff, 0x90, 0xff, 0xff, 0xff, 0x8c, 0xff, 0xff, 0xff, 0x87, - 0xff, 0xff, 0xff, 0x83, 0xff, 0xff, 0xff, 0x7c, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xfd, 0xfc, 0xfc, 0xff, 0xfb, 0xfb, 0xfa, 0xff, - 0xf8, 0xf6, 0xf6, 0xff, 0xf4, 0xf3, 0xf2, 0xff, 0xf2, 0xf0, 0xf0, 0xff, - 0xef, 0xec, 0xeb, 0xff, 0xef, 0xec, 0xeb, 0xff, 0xeb, 0xe7, 0xe6, 0xff, - 0xea, 0xe6, 0xe5, 0xff, 0xeb, 0xe8, 0xe8, 0xff, 0xe9, 0xe6, 0xe7, 0xff, - 0xe5, 0xe2, 0xe2, 0xff, 0xed, 0xeb, 0xeb, 0xff, 0xf7, 0xf5, 0xf2, 0xff, - 0xfe, 0xfa, 0xf5, 0xff, 0xfe, 0xfb, 0xf5, 0xf8, 0xff, 0xff, 0xff, 0xac, - 0xff, 0xff, 0xff, 0xa8, 0xff, 0xff, 0xff, 0xa3, 0xff, 0xff, 0xff, 0x9f, - 0xff, 0xff, 0xff, 0x98, 0xff, 0xff, 0xff, 0x94, 0xff, 0xff, 0xff, 0x8f, - 0xff, 0xff, 0xff, 0x8b, 0xff, 0xff, 0xff, 0x84, 0xff, 0xff, 0xff, 0x80, - 0xff, 0xff, 0xff, 0x7c, 0xff, 0xff, 0xff, 0x77, + 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xfc, 0xfb, 0xfb, 0xff, + 0xf9, 0xf8, 0xf8, 0xff, 0xf6, 0xf5, 0xf4, 0xff, 0xf3, 0xf1, 0xf1, 0xff, + 0xf0, 0xed, 0xed, 0xff, 0xef, 0xec, 0xeb, 0xff, 0xee, 0xeb, 0xeb, 0xff, + 0xf0, 0xee, 0xee, 0xff, 0xea, 0xe7, 0xe7, 0xff, 0xec, 0xe9, 0xe9, 0xff, + 0xf5, 0xf2, 0xf0, 0xff, 0xfe, 0xfb, 0xf6, 0xff, 0xfe, 0xfb, 0xf5, 0xff, + 0xfe, 0xfa, 0xf4, 0xff, 0xfe, 0xfb, 0xf6, 0xeb, 0xff, 0xff, 0xff, 0xaf, + 0xff, 0xff, 0xff, 0xab, 0xff, 0xff, 0xff, 0xa4, 0xff, 0xff, 0xff, 0xa0, + 0xff, 0xff, 0xff, 0x9b, 0xff, 0xff, 0xff, 0x97, 0xff, 0xff, 0xff, 0x90, + 0xff, 0xff, 0xff, 0x8c, 0xff, 0xff, 0xff, 0x87, 0xff, 0xff, 0xff, 0x83, + 0xff, 0xff, 0xff, 0x7c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xfc, 0xfc, 0xff, + 0xfb, 0xfb, 0xfa, 0xff, 0xf8, 0xf6, 0xf6, 0xff, 0xf4, 0xf3, 0xf2, 0xff, + 0xf2, 0xf0, 0xf0, 0xff, 0xef, 0xec, 0xeb, 0xff, 0xef, 0xec, 0xeb, 0xff, + 0xeb, 0xe7, 0xe6, 0xff, 0xea, 0xe6, 0xe5, 0xff, 0xeb, 0xe8, 0xe8, 0xff, + 0xe9, 0xe6, 0xe7, 0xff, 0xe5, 0xe2, 0xe2, 0xff, 0xed, 0xeb, 0xeb, 0xff, + 0xf7, 0xf5, 0xf2, 0xff, 0xfe, 0xfa, 0xf5, 0xff, 0xfe, 0xfb, 0xf5, 0xf8, + 0xff, 0xff, 0xff, 0xac, 0xff, 0xff, 0xff, 0xa8, 0xff, 0xff, 0xff, 0xa3, + 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0x98, 0xff, 0xff, 0xff, 0x94, + 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0x8b, 0xff, 0xff, 0xff, 0x84, + 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0x7c, 0xff, 0xff, 0xff, 0x77, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xfc, 0xfc, 0xff, 0xf8, 0xf7, 0xf7, 0xff, 0xf6, 0xf5, 0xf4, 0xff, 0xf3, 0xf1, 0xf0, 0xff, 0xf1, 0xef, 0xef, 0xff, 0xef, 0xed, 0xec, 0xff, @@ -133,29 +130,28 @@ static const uint8_t kImgAlphaData[] = { 0xff, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0x9c, 0xff, 0xff, 0xff, 0x97, 0xff, 0xff, 0xff, 0x93, 0xff, 0xff, 0xff, 0x8c, 0xfe, 0xfc, 0xf9, 0xa3, 0xfc, 0xfb, 0xf5, 0xb0, 0xfc, 0xf9, 0xf1, 0xbb, 0xfb, 0xf8, 0xf1, 0xb8, - 0xfb, 0xf8, 0xef, 0xb4, 0xfb, 0xf9, 0xf2, 0xa4, - 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xfc, 0xfc, 0xfc, 0xff, - 0xf8, 0xf7, 0xf7, 0xff, 0xf5, 0xf3, 0xf3, 0xff, 0xf1, 0xef, 0xef, 0xff, - 0xef, 0xec, 0xeb, 0xff, 0xeb, 0xe7, 0xe7, 0xff, 0xea, 0xe7, 0xe6, 0xff, - 0xe7, 0xe3, 0xe2, 0xff, 0xe4, 0xdf, 0xde, 0xff, 0xe6, 0xe2, 0xe2, 0xff, - 0xe4, 0xe1, 0xe0, 0xff, 0xe6, 0xe3, 0xe2, 0xff, 0xe0, 0xdc, 0xdc, 0xff, - 0xe3, 0xdf, 0xdf, 0xff, 0xe8, 0xe5, 0xe5, 0xff, 0xe4, 0xe1, 0x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xe2, 0xde, 0xdd, 0xff, + 0xe5, 0xe1, 0xe1, 0xff, 0xde, 0xda, 0xda, 0xff, 0xe0, 0xdd, 0xdc, 0xff, + 0xe1, 0xdd, 0xdd, 0xff, 0xe3, 0xe0, 0xdf, 0xff, 0xe4, 0xe1, 0xe1, 0xff, + 0xe3, 0xe0, 0xe0, 0xff, 0xec, 0xea, 0xea, 0xe8, 0xff, 0xff, 0xff, 0x9f, + 0xff, 0xff, 0xff, 0x98, 0xff, 0xff, 0xff, 0x93, 0xff, 0xff, 0xff, 0x8f, + 0xfe, 0xfe, 0xfe, 0x8c, 0xfd, 0xfb, 0xef, 0xff, 0xfd, 0xfb, 0xed, 0xff, + 0xfd, 0xf8, 0xec, 0xff, 0xfc, 0xf8, 0xeb, 0xff, 0xfc, 0xf7, 0xea, 0xff, + 0xfb, 0xf6, 0xe9, 0xff, 0xfa, 0xf6, 0xe7, 0xff, 0xfa, 0xf5, 0xe5, 0xff, 0xfa, 0xfa, 0xfa, 0xff, 0xf8, 0xf7, 0xf8, 0xff, 0xf6, 0xf6, 0xf6, 0xff, 0xf1, 0xf0, 0xf0, 0xff, 0xed, 0xec, 0xec, 0xff, 0xe9, 0xe6, 0xe5, 0xff, 0xe6, 0xe1, 0xe0, 0xff, 0xe2, 0xde, 0xdc, 0xff, 0xe0, 0xda, 0xd8, 0xff, @@ -166,29 +162,28 @@ static const uint8_t kImgAlphaData[] = { 0xff, 0xff, 0xff, 0x8c, 0xff, 0xff, 0xff, 0x88, 0xfe, 0xfe, 0xfa, 0x9b, 0xfc, 0xfb, 0xee, 0xff, 0xfc, 0xfa, 0xed, 0xff, 0xfb, 0xfa, 0xeb, 0xff, 0xfb, 0xf8, 0xeb, 0xff, 0xfb, 0xf7, 0xea, 0xff, 0xfa, 0xf6, 0xe8, 0xff, - 0xf8, 0xf6, 0xe6, 0xff, 0xf7, 0xf5, 0xe3, 0xff, - 0xf9, 0xf9, 0xf9, 0xff, 0xf7, 0xf6, 0xf7, 0xff, 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0xcf, 0xcd, 0xff, 0xd4, 0xcc, 0xca, 0xff, @@ -199,29 +194,28 @@ static const uint8_t kImgAlphaData[] = { 0xff, 0xff, 0xff, 0x78, 0xff, 0xff, 0xff, 0x73, 0xff, 0xff, 0xff, 0x6f, 0xfb, 0xfc, 0xed, 0xff, 0xfa, 0xfb, 0xed, 0xff, 0xfb, 0xfa, 0xeb, 0xff, 0xfa, 0xf9, 0xe9, 0xff, 0xfa, 0xf9, 0xe7, 0xff, 0xf8, 0xf9, 0xe7, 0xff, - 0xf7, 0xf5, 0xe3, 0xff, 0xf7, 0xf4, 0xe1, 0xff, - 0xf2, 0xf2, 0xf2, 0xff, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xf0, 0xef, 0xff, - 0xe5, 0xe3, 0xe3, 0xff, 0xdd, 0xd9, 0xd9, 0xff, 0xdf, 0xdc, 0xdc, 0xff, - 0xe6, 0xe3, 0xe3, 0xff, 0xe1, 0xda, 0xdb, 0xff, 0xd2, 0xca, 0xc7, 0xff, - 0xca, 0xc2, 0xc0, 0xff, 0xc7, 0xbe, 0xbc, 0xff, 0xc8, 0xc2, 0xc0, 0xff, - 0xd2, 0xcf, 0xce, 0xff, 0xd5, 0xcf, 0xd0, 0xff, 0xd5, 0xd1, 0xd1, 0xff, - 0xda, 0xd6, 0xd7, 0xff, 0xde, 0xdc, 0xdd, 0xff, 0xde, 0xdd, 0xdc, 0xff, - 0xe2, 0xe0, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x7c, 0xff, 0xff, 0xff, 0x77, - 0xff, 0xff, 0xff, 0x70, 0xff, 0xff, 0xff, 0x6c, 0xff, 0xff, 0xff, 0x67, - 0xfa, 0xfd, 0xed, 0xf8, 0xf9, 0xfc, 0xeb, 0xff, 0xf9, 0xfb, 0xea, 0xff, - 0xf8, 0xf9, 0xe8, 0xff, 0xf7, 0xf9, 0xe6, 0xff, 0xf7, 0xf8, 0xe6, 0xff, - 0xf6, 0xf5, 0xe4, 0xff, 0xf6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 0xbb, 0xbd, 0xbc, 0xff, + 0xb7, 0xb9, 0xb8, 0xff, 0xb6, 0xb7, 0xb7, 0xff, 0xb4, 0xb7, 0xb6, 0xff, + 0xaf, 0xaf, 0xaf, 0xff, 0xb0, 0xb2, 0xb2, 0xff, 0xb5, 0xb5, 0xb5, 0xff, + 0xc1, 0xc0, 0xc0, 0xff, 0xc9, 0xc6, 0xc7, 0xff, 0xb3, 0xad, 0xae, 0xff, + 0xcf, 0xcd, 0xce, 0xff, 0xe3, 0xe2, 0xe2, 0xff, 0xe4, 0xe2, 0xe2, 0xff, + 0xfd, 0xfd, 0xfd, 0x60, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0x50, + 0xff, 0xff, 0xff, 0x4c, 0xff, 0xff, 0xff, 0x47, 0xfa, 0xfb, 0xef, 0xa8, + 0xf8, 0xfc, 0xed, 0xff, 0xf7, 0xf9, 0xea, 0xff, 0xf6, 0xf7, 0xe7, 0xff, + 0xf6, 0xf4, 0xe7, 0xff, 0xf5, 0xf4, 0xe5, 0xff, 0xf4, 0xf3, 0xe3, 0xff, 0xce, 0xcf, 0xcf, 0xff, 0xc8, 0xc9, 0xc9, 0xff, 0xc6, 0xc8, 0xc8, 0xff, 0xc4, 0xc6, 0xc6, 0xff, 0xc2, 0xc3, 0xc3, 0xff, 0xba, 0xbd, 0xbc, 0xff, 0xbc, 0xbe, 0xbe, 0xff, 0xb5, 0xb8, 0xb7, 0xff, 0xb4, 0xb6, 0xb5, 0xff, @@ -265,29 +258,28 @@ static const uint8_t kImgAlphaData[] = { 0xff, 0xff, 0xff, 0x4f, 0xff, 0xff, 0xff, 0x4b, 0xff, 0xff, 0xff, 0x44, 0xff, 0xff, 0xff, 0x40, 0xed, 0xe7, 0xe6, 0x48, 0xba, 0xad, 0xa1, 0xff, 0xd6, 0xcf, 0xc1, 0xff, 0xf4, 0xf3, 0xe4, 0xff, 0xf5, 0xf4, 0xe5, 0xff, - 0xf5, 0xf3, 0xe5, 0xff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0xff, - 0x96, 0x99, 0x99, 0xff, 0x9b, 0x9d, 0x9d, 0xff, 0x97, 0x99, 0x98, 0xff, - 0x8e, 0x91, 0x91, 0xff, 0x98, 0x9b, 0x9b, 0xff, 0x89, 0x8c, 0x8b, 0xff, - 0x87, 0x8b, 0x89, 0xff, 0x84, 0x7f, 0x81, 0xff, 0x82, 0x82, 0x83, 0xff, - 0xc0, 0xbe, 0xbf, 0x67, 0xff, 0xff, 0xff, 0x3c, 0xff, 0xff, 0xff, 0x37, - 0xff, 0xff, 0xff, 0x33, 0xff, 0xff, 0xff, 0x2f, 0xc6, 0xbb, 0xb9, 0x50, - 0xac, 0x9c, 0x99, 0xff, 0xa8, 0x98, 0x91, 0xff, 0xbd, 0xb0, 0xa5, 0xff, - 0xf6, 0xf5, 0xe6, 0xff, 0xf4, 0xf3, 0xe4, 0xff, + 0xf5, 0xf3, 0xe5, 0xff, 0xf5, 0xf5, 0xe5, 0xff, 0xc7, 0xc9, 0xc8, 0xff, + 0xc5, 0xc6, 0xc6, 0xff, 0xc1, 0xc2, 0xc2, 0xff, 0xbd, 0xbe, 0xbe, 0xff, + 0xba, 0xbc, 0xbb, 0xff, 0xb3, 0xb4, 0xb4, 0xff, 0xb2, 0xb5, 0xb4, 0xff, + 0xb1, 0xb4, 0xb3, 0xff, 0xac, 0xaf, 0xae, 0xff, 0xa8, 0xaa, 0xa9, 0xff, + 0xa8, 0xab, 0xaa, 0xff, 0xa1, 0xa4, 0xa3, 0xff, 0xa1, 0xa4, 0xa3, 0xff, + 0xa3, 0xa5, 0xa4, 0xff, 0x9f, 0xa1, 0xa0, 0xff, 0x99, 0x9b, 0x9a, 0xff, + 0x98, 0x9a, 0x9a, 0xff, 0x97, 0x9a, 0x99, 0xff, 0xa0, 0xa0, 0xa0, 0xff, + 0x9b, 0x9b, 0x9b, 0xff, 0x9f, 0xa0, 0x9f, 0xe8, 0xff, 0xff, 0xff, 0x48, + 0xff, 0xff, 0xff, 0x44, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3b, + 0xff, 0xff, 0xff, 0x34, 0xbb, 0xa7, 0xa5, 0xd8, 0xb9, 0xa9, 0xa6, 0xff, + 0xb9, 0xac, 0xa0, 0xff, 0xf8, 0xfa, 0xe7, 0xff, 0xf5, 0xf4, 0xe6, 0xff, + 0xf4, 0xf3, 0xe4, 0xff, 0xc0, 0xc0, 0xbf, 0xff, 0xbb, 0xbb, 0xbb, 0xff, + 0xbb, 0xbc, 0xbb, 0xff, 0xb6, 0xb6, 0xb6, 0xff, 0xb0, 0xb1, 0xb1, 0xff, + 0xad, 0xad, 0xad, 0xff, 0xa8, 0xa7, 0xa7, 0xff, 0xa8, 0xa9, 0xa9, 0xff, + 0xa5, 0xa6, 0xa6, 0xff, 0xa4, 0xa6, 0xa5, 0xff, 0xa3, 0xa6, 0xa6, 0xff, + 0x9b, 0x9d, 0x9c, 0xff, 0x96, 0x99, 0x99, 0xff, 0x9b, 0x9d, 0x9d, 0xff, + 0x97, 0x99, 0x98, 0xff, 0x8e, 0x91, 0x91, 0xff, 0x98, 0x9b, 0x9b, 0xff, + 0x89, 0x8c, 0x8b, 0xff, 0x87, 0x8b, 0x89, 0xff, 0x84, 0x7f, 0x81, 0xff, + 0x82, 0x82, 0x83, 0xff, 0xc0, 0xbe, 0xbf, 0x67, 0xff, 0xff, 0xff, 0x3c, + 0xff, 0xff, 0xff, 0x37, 0xff, 0xff, 0xff, 0x33, 0xff, 0xff, 0xff, 0x2f, + 0xc6, 0xbb, 0xb9, 0x50, 0xac, 0x9c, 0x99, 0xff, 0xa8, 0x98, 0x91, 0xff, + 0xbd, 0xb0, 0xa5, 0xff, 0xf6, 0xf5, 0xe6, 0xff, 0xf4, 0xf3, 0xe4, 0xff, 0xbb, 0xbb, 0xba, 0xff, 0xb3, 0xb3, 0xb3, 0xff, 0xb3, 0xb4, 0xb4, 0xff, 0xae, 0xaf, 0xae, 0xff, 0xad, 0xae, 0xae, 0xff, 0xb2, 0xb4, 0xb4, 0xfc, 0xa8, 0xa8, 0xa9, 0xf3, 0xa7, 0xa7, 0xa7, 0xf3, 0x9e, 0x9f, 0x9d, 0xfc, @@ -298,29 +290,28 @@ static const uint8_t kImgAlphaData[] = { 0x95, 0x93, 0x92, 0x97, 0xff, 0xff, 0xff, 0x34, 0xff, 0xff, 0xff, 0x30, 0xff, 0xff, 0xff, 0x2c, 0xff, 0xff, 0xff, 0x27, 0xff, 0xff, 0xff, 0x23, 0xa2, 0x93, 0x94, 0xe7, 0x96, 0x83, 0x81, 0xff, 0xa8, 0x91, 0x8b, 0xff, - 0xc4, 0xbc, 0xb2, 0xff, 0xf5, 0xf5, 0xe4, 0xff, - 0xb7, 0xb9, 0xb8, 0xff, 0xaf, 0xaf, 0xae, 0xff, 0xaf, 0xaf, 0xaf, 0xff, - 0xac, 0xad, 0xae, 0xff, 0xa8, 0xaa, 0xa9, 0xff, 0xae, 0xaf, 0xaf, 0xec, - 0xc6, 0xc7, 0xc7, 0xb4, 0xc5, 0xc6, 0xc6, 0xb3, 0x9a, 0x99, 0x99, 0xeb, - 0x91, 0x91, 0x90, 0xff, 0x94, 0x95, 0x95, 0xff, 0x95, 0x96, 0x96, 0xff, - 0x8c, 0x8e, 0x8e, 0xff, 0x86, 0x88, 0x87, 0xff, 0x83, 0x82, 0x82, 0xff, - 0x80, 0x81, 0x81, 0xff, 0x82, 0x84, 0x84, 0xff, 0x7b, 0x79, 0x7a, 0xff, - 0x73, 0x74, 0x73, 0xff, 0x79, 0x7a, 0x7b, 0xff, 0x75, 0x73, 0x72, 0xff, - 0x6f, 0x70, 0x6e, 0xfc, 0xe8, 0xe7, 0xe7, 0x37, 0xff, 0xff, 0xff, 0x2b, - 0xff, 0xff, 0xff, 0x24, 0xff, 0xff, 0xff, 0x20, 0xff, 0xff, 0xff, 0x1c, - 0x70, 0x6e, 0x6d, 0xeb, 0x6c, 0x69, 0x66, 0xff, 0x83, 0x78, 0x7b, 0xff, - 0x83, 0x7f, 0x78, 0xff, 0xdc, 0xd5, 0xcd, 0xff, - 0xb3, 0xb5, 0xb4, 0xff, 0xa9, 0xa9, 0xaa, 0xff, 0xa7, 0xa8, 0xa7, 0xff, - 0xa7, 0xa8, 0xa7, 0xff, 0xa6, 0xa8, 0xa8, 0xff, 0xab, 0xac, 0xab, 0xe3, - 0xdb, 0xdc, 0xdc, 0x97, 0xd9, 0xda, 0xda, 0x93, 0x99, 0x99, 0x98, 0xe0, - 0x94, 0x95, 0x95, 0xff, 0x8e, 0x8f, 0x8e, 0xff, 0x8f, 0x93, 0x92, 0xff, - 0x88, 0x8a, 0x89, 0xff, 0x79, 0x78, 0x78, 0xff, 0x80, 0x82, 0x82, 0xff, - 0x7f, 0x81, 0x81, 0xff, 0x7f, 0x7d, 0x7e, 0xff, 0x76, 0x72, 0x72, 0xff, - 0x70, 0x70, 0x70, 0xff, 0x73, 0x73, 0x73, 0xff, 0x67, 0x66, 0x64, 0xff, - 0x6b, 0x6b, 0x6a, 0xff, 0x70, 0x73, 0x72, 0xd4, 0xff, 0xff, 0xff, 0x23, - 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0x1b, 0x79, 0x74, 0x72, 0x67, - 0x63, 0x61, 0x61, 0xff, 0x63, 0x62, 0x60, 0xff, 0x5e, 0x5c, 0x5a, 0xff, - 0x61, 0x5f, 0x5c, 0xff, 0x6b, 0x63, 0x5e, 0xff, + 0xc4, 0xbc, 0xb2, 0xff, 0xf5, 0xf5, 0xe4, 0xff, 0xb7, 0xb9, 0xb8, 0xff, + 0xaf, 0xaf, 0xae, 0xff, 0xaf, 0xaf, 0xaf, 0xff, 0xac, 0xad, 0xae, 0xff, + 0xa8, 0xaa, 0xa9, 0xff, 0xae, 0xaf, 0xaf, 0xec, 0xc6, 0xc7, 0xc7, 0xb4, + 0xc5, 0xc6, 0xc6, 0xb3, 0x9a, 0x99, 0x99, 0xeb, 0x91, 0x91, 0x90, 0xff, + 0x94, 0x95, 0x95, 0xff, 0x95, 0x96, 0x96, 0xff, 0x8c, 0x8e, 0x8e, 0xff, + 0x86, 0x88, 0x87, 0xff, 0x83, 0x82, 0x82, 0xff, 0x80, 0x81, 0x81, 0xff, + 0x82, 0x84, 0x84, 0xff, 0x7b, 0x79, 0x7a, 0xff, 0x73, 0x74, 0x73, 0xff, + 0x79, 0x7a, 0x7b, 0xff, 0x75, 0x73, 0x72, 0xff, 0x6f, 0x70, 0x6e, 0xfc, + 0xe8, 0xe7, 0xe7, 0x37, 0xff, 0xff, 0xff, 0x2b, 0xff, 0xff, 0xff, 0x24, + 0xff, 0xff, 0xff, 0x20, 0xff, 0xff, 0xff, 0x1c, 0x70, 0x6e, 0x6d, 0xeb, + 0x6c, 0x69, 0x66, 0xff, 0x83, 0x78, 0x7b, 0xff, 0x83, 0x7f, 0x78, 0xff, + 0xdc, 0xd5, 0xcd, 0xff, 0xb3, 0xb5, 0xb4, 0xff, 0xa9, 0xa9, 0xaa, 0xff, + 0xa7, 0xa8, 0xa7, 0xff, 0xa7, 0xa8, 0xa7, 0xff, 0xa6, 0xa8, 0xa8, 0xff, + 0xab, 0xac, 0xab, 0xe3, 0xdb, 0xdc, 0xdc, 0x97, 0xd9, 0xda, 0xda, 0x93, + 0x99, 0x99, 0x98, 0xe0, 0x94, 0x95, 0x95, 0xff, 0x8e, 0x8f, 0x8e, 0xff, + 0x8f, 0x93, 0x92, 0xff, 0x88, 0x8a, 0x89, 0xff, 0x79, 0x78, 0x78, 0xff, + 0x80, 0x82, 0x82, 0xff, 0x7f, 0x81, 0x81, 0xff, 0x7f, 0x7d, 0x7e, 0xff, + 0x76, 0x72, 0x72, 0xff, 0x70, 0x70, 0x70, 0xff, 0x73, 0x73, 0x73, 0xff, + 0x67, 0x66, 0x64, 0xff, 0x6b, 0x6b, 0x6a, 0xff, 0x70, 0x73, 0x72, 0xd4, + 0xff, 0xff, 0xff, 0x23, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0x1b, + 0x79, 0x74, 0x72, 0x67, 0x63, 0x61, 0x61, 0xff, 0x63, 0x62, 0x60, 0xff, + 0x5e, 0x5c, 0x5a, 0xff, 0x61, 0x5f, 0x5c, 0xff, 0x6b, 0x63, 0x5e, 0xff, 0xae, 0xaf, 0xaf, 0xff, 0xa9, 0xa9, 0xa9, 0xff, 0x9c, 0x9b, 0x99, 0xff, 0x9d, 0x9c, 0x9b, 0xff, 0x9c, 0x9c, 0x9c, 0xff, 0x9c, 0x9c, 0x9d, 0xf7, 0xaa, 0xac, 0xac, 0xd4, 0xa5, 0xa7, 0xa6, 0xd3, 0x98, 0x9a, 0x9a, 0xf4, @@ -331,29 +322,28 @@ static const uint8_t kImgAlphaData[] = { 0x5d, 0x5d, 0x5b, 0xff, 0x64, 0x60, 0x61, 0xff, 0x5e, 0x5d, 0x5d, 0xec, 0x6a, 0x69, 0x67, 0xa0, 0x67, 0x66, 0x64, 0xbc, 0x59, 0x56, 0x55, 0xff, 0x54, 0x51, 0x4e, 0xff, 0x56, 0x52, 0x51, 0xff, 0x55, 0x52, 0x4f, 0xff, - 0x52, 0x4e, 0x49, 0xff, 0x54, 0x54, 0x52, 0xff, - 0xa9, 0xac, 0xab, 0xff, 0xa1, 0xa0, 0xa0, 0xff, 0x9a, 0x99, 0x98, 0xff, - 0x97, 0x97, 0x96, 0xff, 0x95, 0x94, 0x94, 0xff, 0x8e, 0x8c, 0x8c, 0xff, - 0x95, 0x98, 0x97, 0xfc, 0x90, 0x91, 0x91, 0xfc, 0x95, 0x96, 0x96, 0xff, - 0x86, 0x86, 0x86, 0xff, 0x81, 0x82, 0x80, 0xff, 0x7d, 0x7e, 0x7b, 0xff, - 0x78, 0x79, 0x78, 0xff, 0x71, 0x70, 0x6e, 0xff, 0x72, 0x71, 0x70, 0xff, - 0x72, 0x73, 0x72, 0xff, 0x70, 0x70, 0x6e, 0xff, 0x6d, 0x6a, 0x6a, 0xff, - 0x64, 0x64, 0x63, 0xff, 0x69, 0x68, 0x67, 0xff, 0x61, 0x5f, 0x5e, 0xff, - 0x59, 0x57, 0x57, 0xff, 0x5f, 0x5f, 0x5e, 0xff, 0x55, 0x55, 0x53, 0xff, - 0x57, 0x58, 0x57, 0xff, 0x51, 0x53, 0x50, 0xff, 0x54, 0x51, 0x51, 0xff, - 0x4c, 0x4b, 0x4a, 0xff, 0x49, 0x4a, 0x47, 0xff, 0x4f, 0x51, 0x4e, 0xff, - 0x4f, 0x4d, 0x49, 0xff, 0x4c, 0x4b, 0x46, 0xff, - 0xa7, 0xaa, 0xaa, 0xff, 0x99, 0x98, 0x98, 0xff, 0x95, 0x92, 0x92, 0xff, - 0x94, 0x93, 0x92, 0xff, 0x8a, 0x87, 0x84, 0xff, 0x85, 0x80, 0x7f, 0xff, - 0x8d, 0x90, 0x8f, 0xff, 0x85, 0x85, 0x85, 0xff, 0x8e, 0x8e, 0x8e, 0xff, - 0x80, 0x80, 0x81, 0xff, 0x7c, 0x7d, 0x7b, 0xff, 0x79, 0x79, 0x78, 0xff, - 0x78, 0x79, 0x78, 0xff, 0x6e, 0x6c, 0x6b, 0xff, 0x68, 0x66, 0x66, 0xff, - 0x69, 0x6a, 0x67, 0xff, 0x60, 0x5e, 0x5d, 0xff, 0x5b, 0x58, 0x57, 0xff, - 0x58, 0x56, 0x55, 0xff, 0x61, 0x5e, 0x5d, 0xff, 0x54, 0x53, 0x52, 0xff, - 0x60, 0x5d, 0x5c, 0xff, 0x5b, 0x5b, 0x5a, 0xff, 0x59, 0x5a, 0x58, 0xff, - 0x48, 0x43, 0x42, 0xff, 0x44, 0x40, 0x40, 0xff, 0x48, 0x46, 0x44, 0xff, - 0x4a, 0x46, 0x46, 0xff, 0x4c, 0x4f, 0x4c, 0xff, 0x49, 0x4a, 0x48, 0xff, - 0x47, 0x46, 0x41, 0xff, 0x44, 0x43, 0x3f, 0xff, + 0x52, 0x4e, 0x49, 0xff, 0x54, 0x54, 0x52, 0xff, 0xa9, 0xac, 0xab, 0xff, + 0xa1, 0xa0, 0xa0, 0xff, 0x9a, 0x99, 0x98, 0xff, 0x97, 0x97, 0x96, 0xff, + 0x95, 0x94, 0x94, 0xff, 0x8e, 0x8c, 0x8c, 0xff, 0x95, 0x98, 0x97, 0xfc, + 0x90, 0x91, 0x91, 0xfc, 0x95, 0x96, 0x96, 0xff, 0x86, 0x86, 0x86, 0xff, + 0x81, 0x82, 0x80, 0xff, 0x7d, 0x7e, 0x7b, 0xff, 0x78, 0x79, 0x78, 0xff, + 0x71, 0x70, 0x6e, 0xff, 0x72, 0x71, 0x70, 0xff, 0x72, 0x73, 0x72, 0xff, + 0x70, 0x70, 0x6e, 0xff, 0x6d, 0x6a, 0x6a, 0xff, 0x64, 0x64, 0x63, 0xff, + 0x69, 0x68, 0x67, 0xff, 0x61, 0x5f, 0x5e, 0xff, 0x59, 0x57, 0x57, 0xff, + 0x5f, 0x5f, 0x5e, 0xff, 0x55, 0x55, 0x53, 0xff, 0x57, 0x58, 0x57, 0xff, + 0x51, 0x53, 0x50, 0xff, 0x54, 0x51, 0x51, 0xff, 0x4c, 0x4b, 0x4a, 0xff, + 0x49, 0x4a, 0x47, 0xff, 0x4f, 0x51, 0x4e, 0xff, 0x4f, 0x4d, 0x49, 0xff, + 0x4c, 0x4b, 0x46, 0xff, 0xa7, 0xaa, 0xaa, 0xff, 0x99, 0x98, 0x98, 0xff, + 0x95, 0x92, 0x92, 0xff, 0x94, 0x93, 0x92, 0xff, 0x8a, 0x87, 0x84, 0xff, + 0x85, 0x80, 0x7f, 0xff, 0x8d, 0x90, 0x8f, 0xff, 0x85, 0x85, 0x85, 0xff, + 0x8e, 0x8e, 0x8e, 0xff, 0x80, 0x80, 0x81, 0xff, 0x7c, 0x7d, 0x7b, 0xff, + 0x79, 0x79, 0x78, 0xff, 0x78, 0x79, 0x78, 0xff, 0x6e, 0x6c, 0x6b, 0xff, + 0x68, 0x66, 0x66, 0xff, 0x69, 0x6a, 0x67, 0xff, 0x60, 0x5e, 0x5d, 0xff, + 0x5b, 0x58, 0x57, 0xff, 0x58, 0x56, 0x55, 0xff, 0x61, 0x5e, 0x5d, 0xff, + 0x54, 0x53, 0x52, 0xff, 0x60, 0x5d, 0x5c, 0xff, 0x5b, 0x5b, 0x5a, 0xff, + 0x59, 0x5a, 0x58, 0xff, 0x48, 0x43, 0x42, 0xff, 0x44, 0x40, 0x40, 0xff, + 0x48, 0x46, 0x44, 0xff, 0x4a, 0x46, 0x46, 0xff, 0x4c, 0x4f, 0x4c, 0xff, + 0x49, 0x4a, 0x48, 0xff, 0x47, 0x46, 0x41, 0xff, 0x44, 0x43, 0x3f, 0xff, 0xa2, 0xa4, 0xa4, 0xff, 0x96, 0x95, 0x96, 0xff, 0x8e, 0x8c, 0x8a, 0xff, 0x89, 0x86, 0x86, 0xff, 0x82, 0x7c, 0x7c, 0xff, 0x83, 0x80, 0x7f, 0xff, 0x82, 0x82, 0x80, 0xff, 0x82, 0x83, 0x81, 0xff, 0x82, 0x85, 0x85, 0xff, @@ -364,18 +354,18 @@ static const uint8_t kImgAlphaData[] = { 0x57, 0x54, 0x53, 0xff, 0x4f, 0x4f, 0x4e, 0xff, 0x53, 0x57, 0x55, 0xff, 0x48, 0x45, 0x44, 0xff, 0x3c, 0x33, 0x33, 0xff, 0x49, 0x45, 0x43, 0xff, 0x41, 0x3f, 0x3d, 0xff, 0x49, 0x46, 0x44, 0xff, 0x4a, 0x48, 0x47, 0xff, - 0x3f, 0x3c, 0x3a, 0xff, 0x43, 0x41, 0x3e, 0xff, - 0x99, 0x9c, 0x9a, 0xff, 0x90, 0x8e, 0x8f, 0xff, 0x8c, 0x8b, 0x89, 0xff, - 0x81, 0x7c, 0x7c, 0xff, 0x7d, 0x78, 0x78, 0xff, 0x82, 0x82, 0x80, 0xff, - 0x77, 0x74, 0x73, 0xff, 0x75, 0x73, 0x73, 0xff, 0x78, 0x76, 0x76, 0xff, - 0x70, 0x6f, 0x6f, 0xff, 0x6d, 0x6c, 0x6b, 0xff, 0x6e, 0x6f, 0x6d, 0xff, - 0x68, 0x68, 0x66, 0xff, 0x5f, 0x5b, 0x5b, 0xff, 0x5b, 0x56, 0x56, 0xff, - 0x5a, 0x58, 0x57, 0xff, 0x53, 0x49, 0x47, 0xff, 0x4e, 0x45, 0x43, 0xff, - 0x49, 0x43, 0x41, 0xff, 0x5f, 0x5b, 0x5a, 0xff, 0x46, 0x3f, 0x3e, 0xff, - 0x4b, 0x48, 0x47, 0xff, 0x42, 0x3f, 0x3f, 0xff, 0x4d, 0x50, 0x50, 0xff, - 0x52, 0x52, 0x51, 0xff, 0x37, 0x31, 0x30, 0xff, 0x3d, 0x38, 0x37, 0xff, - 0x3f, 0x39, 0x38, 0xff, 0x40, 0x3c, 0x3b, 0xff, 0x4a, 0x48, 0x47, 0xff, - 0x3f, 0x3d, 0x3b, 0xff, 0x46, 0x45, 0x43, 0xff, + 0x3f, 0x3c, 0x3a, 0xff, 0x43, 0x41, 0x3e, 0xff, 0x99, 0x9c, 0x9a, 0xff, + 0x90, 0x8e, 0x8f, 0xff, 0x8c, 0x8b, 0x89, 0xff, 0x81, 0x7c, 0x7c, 0xff, + 0x7d, 0x78, 0x78, 0xff, 0x82, 0x82, 0x80, 0xff, 0x77, 0x74, 0x73, 0xff, + 0x75, 0x73, 0x73, 0xff, 0x78, 0x76, 0x76, 0xff, 0x70, 0x6f, 0x6f, 0xff, + 0x6d, 0x6c, 0x6b, 0xff, 0x6e, 0x6f, 0x6d, 0xff, 0x68, 0x68, 0x66, 0xff, + 0x5f, 0x5b, 0x5b, 0xff, 0x5b, 0x56, 0x56, 0xff, 0x5a, 0x58, 0x57, 0xff, + 0x53, 0x49, 0x47, 0xff, 0x4e, 0x45, 0x43, 0xff, 0x49, 0x43, 0x41, 0xff, + 0x5f, 0x5b, 0x5a, 0xff, 0x46, 0x3f, 0x3e, 0xff, 0x4b, 0x48, 0x47, 0xff, + 0x42, 0x3f, 0x3f, 0xff, 0x4d, 0x50, 0x50, 0xff, 0x52, 0x52, 0x51, 0xff, + 0x37, 0x31, 0x30, 0xff, 0x3d, 0x38, 0x37, 0xff, 0x3f, 0x39, 0x38, 0xff, + 0x40, 0x3c, 0x3b, 0xff, 0x4a, 0x48, 0x47, 0xff, 0x3f, 0x3d, 0x3b, 0xff, + 0x46, 0x45, 0x43, 0xff, }; #endif // WEBP_TESTS_FUZZER_IMG_ALPHA_H_ diff --git a/tests/fuzzer/img_grid.h b/tests/fuzzer/img_grid.h index f269bbd6..c965ae28 100644 --- a/tests/fuzzer/img_grid.h +++ b/tests/fuzzer/img_grid.h @@ -29,91 +29,81 @@ static const uint8_t kImgGridData[] = { 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, - 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, - 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, - 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, - 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, - 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, - 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, - 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, diff --git a/tests/fuzzer/img_peak.h b/tests/fuzzer/img_peak.h index d17ba1ed..c4c87b32 100644 --- a/tests/fuzzer/img_peak.h +++ b/tests/fuzzer/img_peak.h @@ -66,7 +66,7 @@ static const uint8_t kImgPeakData[] = { 0xfc, 0xe2, 0xcc, 0xff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xae, 0xa4, 0xa4, 0xff, - 0xbc, 0xb0, 0xac, 0xff, 0xee, 0xdd, 0xd4, 0xff, 0xf2, 0xe9, 0xdc, 0xff, + 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, + 0xfc, 0xe2, 0xcc, 0xff, 0xf9, 0xe6, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, + 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, + 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xe7, 0xce, 0xbc, 0xff, + 0x9c, 0x7e, 0x6c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x75, 0x56, 0x54, 0xff, + 0x8d, 0x72, 0x6b, 0xff, 0xd4, 0xc6, 0xc4, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0xef, 0xe2, 0xdc, 0xff, 0xc4, 0xba, 0xbc, 0xff, 0x96, 0x85, 0x84, 0xff, + 0xad, 0x9e, 0x9e, 0xff, 0xe4, 0xce, 0xcc, 0xff, 0xec, 0xde, 0xdc, 0xff, + 0xf8, 0xea, 0xec, 0xff, 0xc5, 0xb7, 0xb4, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0x84, 0x77, 0x74, 0xff, 0xa6, 0x95, 0x94, 0xff, 0xbc, 0xb1, 0xb4, 0xff, + 0xc4, 0xba, 0xbc, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0x9a, 0x94, 0x94, 0xff, + 0xa1, 0x9e, 0x9c, 0xff, 0xb3, 0xae, 0xac, 0xff, 0xa8, 0x9b, 0x94, 0xff, + 0x89, 0x86, 0x84, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xbc, 0xb0, 0xac, 0xff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0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, - 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe8, 0xd4, 0xff, - 0xc7, 0xb2, 0xa4, 0xff, 0x7e, 0x67, 0x54, 0xff, 0x6f, 0x56, 0x44, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x7c, 0x5c, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x74, 0x4e, 0x44, 0xff, - 0x78, 0x66, 0x64, 0xff, 0x9c, 0x80, 0x7c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x84, 0x77, 0x74, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x81, 0x7e, 0x7c, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x9c, 0x80, 0x7c, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0x6f, 0x6c, 0x6c, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0x78, 0x66, 0x64, 0xff, - 0x72, 0x62, 0x5c, 0xff, 0x84, 0x77, 0x74, 0xff, 0x9d, 0x8d, 0x8c, 0xff, - 0x8c, 0x81, 0x84, 0xff, 0x9e, 0x8b, 0x84, 0xff, 0x84, 0x77, 0x74, 0xff, - 0x71, 0x6a, 0x64, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0x94, 0x8b, 0x84, 0xff, 0xa1, 0x9e, 0x9c, 0xff, - 0xe6, 0xd6, 0xcc, 0xff, 0xef, 0xe2, 0xdc, 0xff, 0xfc, 0xea, 0xdc, 0xff, - 0xfc, 0xea, 0xdc, 0xff, 0xfc, 0xea, 0xdc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, - 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xea, 0xdc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, + 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, + 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xc7, 0xb2, 0xa4, 0xff, + 0x7e, 0x67, 0x54, 0xff, 0x6f, 0x56, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x7c, 0x5c, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x74, 0x4e, 0x44, 0xff, 0x78, 0x66, 0x64, 0xff, + 0x9c, 0x80, 0x7c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x84, 0x77, 0x74, 0xff, + 0x81, 0x7e, 0x7c, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x70, 0x5e, 0x5c, 0xff, + 0x9c, 0x80, 0x7c, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0x6f, 0x6c, 0x6c, 0xff, + 0x7f, 0x6a, 0x64, 0xff, 0x78, 0x66, 0x64, 0xff, 0x72, 0x62, 0x5c, 0xff, + 0x84, 0x77, 0x74, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0x8c, 0x81, 0x84, 0xff, + 0x9e, 0x8b, 0x84, 0xff, 0x84, 0x77, 0x74, 0xff, 0x71, 0x6a, 0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 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, + 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, + 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xec, 0xdb, 0xcc, 0xff, + 0x9c, 0x7e, 0x6c, 0xff, 0x74, 0x5b, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x74, 0x5b, 0x4c, 0xff, 0x7c, 0x5c, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x74, 0x5b, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x69, 0x4e, 0x44, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x9c, 0x7a, 0x74, 0xff, 0x8d, 0x72, 0x6b, 0xff, + 0x70, 0x5e, 0x5c, 0xff, 0x8a, 0x76, 0x6c, 0xff, 0x71, 0x6a, 0x64, 0xff, + 0x96, 0x85, 0x84, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0x94, 0x8c, 0x8c, 0xff, + 0x94, 0x8b, 0x84, 0xff, 0x84, 0x77, 0x74, 0xff, 0x9e, 0x8b, 0x84, 0xff, + 0x8f, 0x7f, 0x7c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x78, 0x66, 0x64, 0xff, + 0x70, 0x5e, 0x5c, 0xff, 0x84, 0x77, 0x74, 0xff, 0x9e, 0x8b, 0x84, 0xff, + 0x78, 0x66, 0x64, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x8c, 0x81, 0x84, 0xff, + 0xc4, 0xb2, 0xac, 0xff, 0xcc, 0xbd, 0xbc, 0xff, 0xbc, 0xb6, 0xac, 0xff, + 0xd7, 0xcc, 0xc4, 0xff, 0xc9, 0xc0, 0xb4, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0xc5, 0xb7, 0xb4, 0xff, 0xc5, 0xb7, 0xb4, 0xff, 0xd9, 0xc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fc, 0xe2, 0xcc, 0xff, - 0xfc, 0xe8, 0xd4, 0xff, 0xec, 0xdb, 0xcc, 0xff, 0x9c, 0x7e, 0x6c, 0xff, - 0x74, 0x5b, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x74, 0x5b, 0x4c, 0xff, - 0x7c, 0x5c, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x74, 0x5b, 0x4c, 0xff, - 0x7c, 0x5d, 0x54, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x7c, 0x5d, 0x54, 0xff, - 0x9c, 0x7a, 0x74, 0xff, 0x8d, 0x72, 0x6b, 0xff, 0x70, 0x5e, 0x5c, 0xff, - 0x8a, 0x76, 0x6c, 0xff, 0x71, 0x6a, 0x64, 0xff, 0x96, 0x85, 0x84, 0xff, - 0x7f, 0x6a, 0x64, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0x94, 0x8b, 0x84, 0xff, - 0x84, 0x77, 0x74, 0xff, 0x9e, 0x8b, 0x84, 0xff, 0x8f, 0x7f, 0x7c, 0xff, - 0x7e, 0x6d, 0x6c, 0xff, 0x78, 0x66, 0x64, 0xff, 0x70, 0x5e, 0x5c, 0xff, - 0x84, 0x77, 0x74, 0xff, 0x9e, 0x8b, 0x84, 0xff, 0x78, 0x66, 0x64, 0xff, - 0x6c, 0x61, 0x64, 0xff, 0x8c, 0x81, 0x84, 0xff, 0xc4, 0xb2, 0xac, 0xff, - 0xcc, 0xbd, 0xbc, 0xff, 0xbc, 0xb6, 0xac, 0xff, 0xd7, 0xcc, 0xc4, 0xff, - 0xc9, 0xc0, 0xb4, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xc5, 0xb7, 0xb4, 0xff, - 0xc5, 0xb7, 0xb4, 0xff, 0xd9, 0xcc, 0xbc, 0xff, 0xef, 0xe2, 0xdc, 0xff, - 0xf4, 0xe9, 0xd4, 0xff, 0xfc, 0xea, 0xdc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, - 0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8, 0xd4, 0xff, + 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, + 0xfc, 0xe8, 0xd4, 0xff, 0xd9, 0xc6, 0xb4, 0xff, 0x7e, 0x67, 0x54, 0xff, + 0x6f, 0x56, 0x44, 0xff, 0x74, 0x5b, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, + 0x7e, 0x67, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x74, 0x4e, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x7d, 0x62, 0x5c, 0xff, 0x80, 0x67, 0x5c, 0xff, 0x75, 0x56, 0x54, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x7c, 0x5d, 0x54, 0xff, + 0x78, 0x66, 0x64, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, + 0x72, 0x5b, 0x54, 0xff, 0x72, 0x62, 0x5c, 0xff, 0x72, 0x5b, 0x54, 0xff, + 0x7d, 0x62, 0x5c, 0xff, 0x7f, 0x72, 0x6c, 0xff, 0x7c, 0x72, 0x64, 0xff, + 0x72, 0x5b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, + 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xd9, 0xc6, 0xb4, 0xff, - 0x7e, 0x67, 0x54, 0xff, 0x6f, 0x56, 0x44, 0xff, 0x74, 0x5b, 0x4c, 0xff, - 0x69, 0x4e, 0x44, 0xff, 0x7e, 0x67, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x74, 0x4e, 0x4c, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x7d, 0x62, 0x5c, 0xff, 0x80, 0x67, 0x5c, 0xff, - 0x75, 0x56, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, - 0x69, 0x4e, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x7c, 0x5d, 0x54, 0xff, 0x78, 0x66, 0x64, 0xff, 0x72, 0x5b, 0x54, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x72, 0x62, 0x5c, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x7d, 0x62, 0x5c, 0xff, 0x7f, 0x72, 0x6c, 0xff, - 0x7c, 0x72, 0x64, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x81, 0x72, 0x74, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xb4, 0xaa, 0xac, 0xff, - 0xa6, 0x95, 0x94, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0x94, 0x8c, 0x8c, 0xff, - 0x94, 0x8b, 0x84, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xba, 0xb6, 0xb4, 0xff, - 0xcc, 0xcc, 0xcc, 0xff, 0xe4, 0xde, 0xdc, 0xff, 0xcc, 0xc2, 0xbc, 0xff, - 0xcc, 0xc2, 0xbc, 0xff, 0xf9, 0xe2, 0xd4, 0xff, 0xfc, 0xea, 0xdc, 0xff, + 0x74, 0x5b, 0x4c, 0xff, 0x74, 0x5b, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x6f, 0x56, 0x44, 0xff, 0x7c, 0x62, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x7c, 0x5c, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x75, 0x56, 0x54, 0xff, 0x75, 0x56, 0x54, 0xff, 0x8f, 0x7f, 0x7c, 0xff, + 0x7d, 0x62, 0x5c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x6b, 0x56, 0x5c, 0xff, + 0x8d, 0x72, 0x6b, 0xff, 0x75, 0x56, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x8d, 0x72, 0x6b, 0xff, 0x8e, 0x79, 0x74, 0xff, 0x75, 0x62, 0x64, 0xff, + 0x72, 0x5b, 0x54, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0xad, 0x9a, 0x9c, 0xff, + 0x9e, 0x8e, 0x94, 0xff, 0x9a, 0x94, 0x94, 0xff, 0x8f, 0x7f, 0x7c, 0xff, + 0x94, 0x8b, 0x84, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x7b, 0x7a, 0x7c, 0xff, + 0x94, 0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xfc, 0xe8, 0xd4, 0xff, 0xd9, 0xc6, 0xb4, 0xff, 0x74, 0x5b, 0x4c, 0xff, - 0x74, 0x5b, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x6f, 0x56, 0x44, 0xff, - 0x7c, 0x62, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, - 0x7c, 0x5c, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, - 0x7c, 0x5d, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, - 0x7c, 0x5d, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x75, 0x56, 0x54, 0xff, - 0x75, 0x56, 0x54, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x7d, 0x62, 0x5c, 0xff, - 0x69, 0x55, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x6b, 0x56, 0x5c, 0xff, 0x8d, 0x72, 0x6b, 0xff, - 0x75, 0x56, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x8d, 0x72, 0x6b, 0xff, - 0x8e, 0x79, 0x74, 0xff, 0x75, 0x62, 0x64, 0xff, 0x72, 0x5b, 0x54, 0xff, - 0x8f, 0x7f, 0x7c, 0xff, 0xad, 0x9a, 0x9c, 0xff, 0x9e, 0x8e, 0x94, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x94, 0x8b, 0x84, 0xff, - 0x81, 0x7e, 0x7c, 0xff, 0x7b, 0x7a, 0x7c, 0xff, 0x94, 0x8c, 0x8c, 0xff, - 0xc4, 0xc3, 0xc4, 0xff, 0xd5, 0xcd, 0xcc, 0xff, 0xb1, 0xaa, 0xa4, 0xff, - 0xc7, 0xb8, 0xac, 0xff, 0xda, 0xd4, 0xc4,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 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x74, 0x5b, 0x4c, 0xff, 0x74, 0x5b, 0x4c, 0xff, + 0x74, 0x5b, 0x4c, 0xff, 0x6f, 0x56, 0x44, 0xff, 0x74, 0x5b, 0x4c, 0xff, + 0x6f, 0x56, 0x44, 0xff, 0x7c, 0x62, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, + 0x7d, 0x62, 0x5c, 0xff, 0x7d, 0x62, 0x5c, 0xff, 0x8c, 0x6e, 0x64, 0xff, + 0x6b, 0x56, 0x5c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, + 0x70, 0x5e, 0x5c, 0xff, 0x75, 0x56, 0x54, 0xff, 0x75, 0x56, 0x54, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x7d, 0x62, 0x5c, 0xff, + 0x7d, 0x62, 0x5c, 0xff, 0xb4, 0x9b, 0x94, 0xff, 0x96, 0x85, 0x84, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x75, 0x56, 0x54, 0xff, 0x7c, 0x72, 0x64, 0xff, + 0x9d, 0x8d, 0x8c, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xbc, 0xb0, 0xac, 0xff, + 0x84, 0x77, 0x74, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0x96, 0x85, 0x84, 0xff, + 0xad, 0x9a, 0x9c, 0xff, 0x96, 0x86, 0x8c, 0xff, 0x81, 0x72, 0x74, 0xff, + 0xa1, 0x99, 0x9c, 0xff, 0xcc, 0xbd, 0xbc, 0xff, 0x88, 0x8a, 0x84, 0xff, + 0xae, 0xa4, 0xa4, 0xff, 0xc2, 0xc2, 0xbc, 0xff, 0xd5,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6, 0xcc, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, + 0xf9, 0xe6, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xf9, 0xe6, 0xcc, 0xff, + 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe8, 0xd4, 0xff, + 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe8, 0xd4, 0xff, + 0xfc, 0xe8, 0xd4, 0xff, 0xf9, 0xe2, 0xd4, 0xff, 0xfc, 0xe8, 0xd4, 0xff, + 0xf9, 0xe2, 0xd4, 0xff, 0xfc, 0xea, 0xdc, 0xff, 0xa4, 0x86, 0x74, 0xff, + 0x74, 0x5b, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x74, 0x5b, 0x4c, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, + 0x74, 0x5b, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x74, 0x5b, 0x4c, 0xff, + 0x69, 0x4e, 0x44, 0xff, 0x74, 0x5b, 0x4c, 0xff, 0x7c, 0x5c, 0x4c, 0xff, + 0x7c, 0x62, 0x54, 0xff, 0x7d, 0x62, 0x5c, 0xff, 0x8d, 0x72, 0x6b, 0xff, + 0x7d, 0x62, 0x5c, 0xff, 0x8e, 0x72, 0x74, 0xff, 0x9c, 0x80, 0x7c, 0xff, + 0x7d, 0x62, 0x5c, 0xff, 0x75, 0x56, 0x54, 0xff, 0x7d, 0x62, 0x5c, 0xff, + 0x72, 0x5b, 0x54, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x58, 0x49, 0x4c, 0xff, + 0x74, 0x4e, 0x4c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x50, 0x4e, 0x44, 0xff, + 0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0xe8, 0xd4, 0xff, + 0xf9, 0xe6, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe8, 0xd4, 0xff, + 0xf9, 0xe2, 0xd4, 0xff, 0xfc, 0xea, 0xdc, 0xff, 0xf7, 0xdd, 0xcc, 0xff, + 0xf7, 0xdd, 0xcc, 0xff, 0x94, 0x79, 0x6c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x6f, 0x56, 0x44, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, - 0x64, 0x5a, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, - 0x75, 0x62, 0x64, 0xff, 0x8d, 0x72, 0x6b, 0xff, 0x8c, 0x6d, 0x6c, 0xff, - 0x8c, 0x6d, 0x6c, 0xff, 0x9c, 0x80, 0x7c, 0xff, 0x8c, 0x6d, 0x6c, 0xff, - 0x7c, 0x5e, 0x5c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, - 0x75, 0x56, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x70, 0x5e, 0x5c, 0xff, - 0x69, 0x4e, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x7c, 0x5d, 0x54, 0xff, 0x78, 0x66, 0x64, 0xff, 0x72, 0x5b, 0x54, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x7c, 0x5d, 0x54, 0xff, - 0x72, 0x62, 0x5c, 0xff, 0x7d, 0x62, 0x5c, 0xff, 0x78, 0x66, 0x64, 0xff, - 0x78, 0x66, 0x64, 0xff, 0x78, 0x66, 0x64, 0xff, 0xa4, 0x9e, 0xa4, 0xff, - 0xae, 0xa4, 0xa4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 0xf1, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x64, 0x5a, 0x4c, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x75, 0x62, 0x64, 0xff, + 0x8d, 0x72, 0x6b, 0xff, 0x8c, 0x6d, 0x6c, 0xff, 0x8c, 0x6d, 0x6c, 0xff, + 0x9c, 0x80, 0x7c, 0xff, 0x8c, 0x6d, 0x6c, 0xff, 0x7c, 0x5e, 0x5c, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x75, 0x56, 0x54, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, + 0x78, 0x66, 0x64, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, + 0x7e, 0x6d, 0x6c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x72, 0x62, 0x5c, 0xff, + 0x7d, 0x62, 0x5c, 0xff, 0x78, 0x66, 0x64, 0xff, 0x78, 0x66, 0x64, 0xff, + 0x78, 0x66, 0x64, 0xff, 0xa4, 0x9e, 0xa4, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0xad, 0x9e, 0x9e, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, + 0x78, 0x66, 0x64, 0xff, 0x84, 0x77, 0x74, 0xff, 0x8f, 0x7f, 0x7c, 0xff, + 0x94, 0x8c, 0x8c, 0xff, 0x9d, 0x8d, 0x8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0xf9, 0xe2, 0xd4, 0xff, - 0xf7, 0xdd, 0xcc, 0xff, 0x94, 0x76, 0x64, 0xff, 0x69, 0x4e, 0x44, 0xff, - 0x74, 0x5b, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x6f, 0x56, 0x44, 0xff, - 0x74, 0x5b, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, - 0x69, 0x4e, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x74, 0x4e, 0x4c, 0xff, - 0x7c, 0x5d, 0x54, 0xff, 0x7d, 0x62, 0x5c, 0xff, 0x8e, 0x79, 0x74, 0xff, - 0x7c, 0x5e, 0x5c, 0xff, 0x72, 0x62, 0x5c, 0xff, 0x7d, 0x62, 0x5c, 0xff, - 0x8c, 0x6e, 0x64, 0xff, 0x78, 0x66, 0x64, 0xff, 0x7f, 0x6a, 0x64, 0xff, - 0x78, 0x66, 0x64, 0xff, 0x7d, 0x62, 0x5c, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x6a, 0x53, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x7d, 0x62, 0x5c, 0xff, - 0x7c, 0x5e, 0x5c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x80, 0x67, 0x5c, 0xff, 0x75, 0x56, 0x54, 0xff, 0x50, 0x4e, 0x44, 0xff, - 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, - 0x7f, 0x6a, 0x64, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x8c, 0x81, 0x84, 0xff, - 0x9d, 0x8d, 0x8c, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x96, 0x85, 0x84, 0xff, - 0xb4, 0xaa, 0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0xff, + 0x69, 0x4e, 0x44, 0xff, 0x74, 0x5b, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, + 0x6f, 0x56, 0x44, 0xff, 0x74, 0x5b, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x74, 0x4e, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x7d, 0x62, 0x5c, 0xff, + 0x8e, 0x79, 0x74, 0xff, 0x7c, 0x5e, 0x5c, 0xff, 0x72, 0x62, 0x5c, 0xff, + 0x7d, 0x62, 0x5c, 0xff, 0x8c, 0x6e, 0x64, 0xff, 0x78, 0x66, 0x64, 0xff, + 0x7f, 0x6a, 0x64, 0xff, 0x78, 0x66, 0x64, 0xff, 0x7d, 0x62, 0x5c, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, + 0x7d, 0x62, 0x5c, 0xff, 0x7c, 0x5e, 0x5c, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x80, 0x67, 0x5c, 0xff, 0x75, 0x56, 0x54, 0xff, + 0x50, 0x4e, 0x44, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0x8f, 0x7f, 0x7c, 0xff, + 0x7e, 0x6d, 0x6c, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x7e, 0x6d, 0x6c, 0xff, + 0x8c, 0x81, 0x84, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0x8c, 0x81, 0x84, 0xff, + 0x96, 0x85, 0x84, 0xff, 0xb4, 0xaa, 0xac, 0xff, 0xad, 0x9e, 0x9e, 0xff, + 0x8e, 0x7a, 0x7c, 0xff, 0x96, 0x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, 0x5b, 0x4c, 0xff, 0x74, 0x4e, 0x44, 0xff, - 0x69, 0x4e, 0x4c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, - 0x78, 0x66, 0x64, 0xff, 0xac, 0x8d, 0x8c, 0xff, 0xbf, 0xaa, 0xa4, 0xff, - 0xad, 0x9e, 0x9e, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x9c, 0x80, 0x7c, 0xff, - 0x7e, 0x6d, 0x6c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x6a, 0x53, 0x4c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x6a, 0x53, 0x4c, 0xff, - 0x80, 0x67, 0x5c, 0xff, 0x8a, 0x76, 0x6c, 0xff, 0x7c, 0x5d, 0x54, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x80, 0x67, 0x5c, 0xff, 0x6a, 0x53, 0x4c, 0xff, - 0x69, 0x4e, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, - 0x69, 0x4e, 0x44, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, - 0x8e, 0x79, 0x74, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, - 0x64, 0x4e, 0x54, 0xff, 0x9c, 0x7a, 0x74, 0xff, 0xad, 0x9a, 0x9c, 0xff, - 0x96, 0x85, 0x84, 0xff, 0x96, 0x85, 0x84, 0xff, 0x9d, 0x8d, 0x8c, 0xff, - 0xc4, 0xba, 0xbc, 0xff, 0x9a, 0x94, 0x94, 0xff, 0x8c, 0x81, 0x84, 0xff, - 0x94, 0x8b, 0x84, 0xff, 0x96, 0x85, 0x84, 0xff, 0x84, 0x79, 0x7c, 0xff, - 0x81, 0x72, 0x74, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0xad, 0x9e, 0x9e, 0xff, - 0xbc, 0xb1, 0xb4, 0xff, 0xbc, 0xb0, 0xac, 0xff, 0xa8, 0x9b, 0x94, 0xff, - 0xbc, 0xb0, 0xac, 0xff, 0xe2, 0xdc, 0xcc, 0xff, 0xf2, 0xe9, 0xdc, 0xff, - 0xf2, 0xe9, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, + 0xf4, 0xe9, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, 0xf9, 0xe2, 0xd4, 0xff, + 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe2, 0xcc, 0xff, 0xfc, 0xe8, 0xd4, 0xff, + 0xf9, 0xe2, 0xd4, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xf9, 0xe2, 0xd4, 0xff, + 0xfc, 0xe8, 0xd4, 0xff, 0xac, 0x8e, 0x7c, 0xff, 0x69, 0x4e, 0x44, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x74, 0x5b, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, + 0x74, 0x5b, 0x4c, 0xff, 0x74, 0x4e, 0x44, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x6c, 0x4a, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x78, 0x66, 0x64, 0xff, + 0xac, 0x8d, 0x8c, 0xff, 0xbf, 0xaa, 0xa4, 0xff, 0xad, 0x9e, 0x9e, 0xff, + 0x70, 0x5e, 0x5c, 0xff, 0x9c, 0x80, 0x7c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x80, 0x67, 0x5c, 0xff, + 0x8a, 0x76, 0x6c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, + 0x80, 0x67, 0x5c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x8e, 0x79, 0x74, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x64, 0x4e, 0x54, 0xff, + 0x9c, 0x7a, 0x74, 0xff, 0xad, 0x9a, 0x9c, 0xff, 0x96, 0x85, 0x84, 0xff, + 0x96, 0x85, 0x84, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0xc4, 0xba, 0xbc, 0xff, + 0x9a, 0x94, 0x94, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x94, 0x8b, 0x84, 0xff, + 0x96, 0x85, 0x84, 0xff, 0x84, 0x79, 0x7c, 0xff, 0x81, 0x72, 0x74, 0xff, + 0x9d, 0x8d, 0x8c, 0xff, 0xad, 0x9e, 0x9e, 0xff, 0xbc, 0xb1, 0xb4, 0xff, + 0xbc, 0xb0, 0xac, 0xff, 0xa8, 0x9b, 0x94, 0xff, 0xbc, 0xb0, 0xac, 0xff, + 0xe2, 0xdc, 0xcc, 0xff, 0xf2, 0xe9, 0xdc, 0xff, 0xf2, 0xe9, 0xdc, 0xff, + 0xfc, 0xf1, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, - 0xfc, 0xf1, 0xdc, 0xff, 0xfc, 0xee, 0xd4, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xfc, 0xee, 0xd4, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xfc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 0xdc, 0xff, 0xfc, 0xee, 0xd4, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xfc, 0xee, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, + 0xfc, 0xee, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, 0xfc, 0xee, 0xd4, 0xff, + 0xf4, 0xe9, 0xd4, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, + 0xfc, 0xe8, 0xd4, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xf9, 0xe6, 0xcc, 0xff, + 0xf9, 0xe2, 0xd4, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0xf9, 0xe2, 0xd4, 0xff, + 0xf9, 0xe2, 0xd4, 0xff, 0xfc, 0xe8, 0xd4, 0xff, 0x94, 0x79, 0x6c, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x7d, 0x62, 0x5c, 0xff, + 0x7c, 0x62, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x74, 0x4e, 0x44, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x75, 0x56, 0x54, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0xbc, 0xa4, 0x9c, 0xff, + 0xc5, 0xb7, 0xb4, 0xff, 0xac, 0x8d, 0x8c, 0xff, 0x7f, 0x6a, 0x64, 0xff, + 0x7e, 0x6d, 0x6c, 0xff, 0x7d, 0x62, 0x5c, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x72, 0x5b, 0x54, 0xff, 0x75, 0x62, 0x64, 0xff, 0x78, 0x66, 0x64, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x69, 0x4e, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x7d, 0x62, 0x5c, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x75, 0x56, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x75, 0x56, 0x54, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x9c, 0x80, 0x7c, 0xff, + 0x8e, 0x7a, 0x7c, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x75, 0x62, 0x64, 0xff, + 0x78, 0x66, 0x64, 0xff, 0xa6, 0x95, 0x94, 0xff, 0x9e, 0x8e, 0x94, 0xff, + 0x94, 0x8c, 0x8c, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0xad, 0x9a, 0x9c, 0xff, + 0x70, 0x5e, 0x5c, 0xff, 0x75, 0x62, 0x64, 0xff, 0x96, 0x86, 0x8c, 0xff, + 0xad, 0x9e, 0x9e, 0xff, 0xd4, 0xc6, 0xc4, 0xff, 0xc4, 0xba, 0xbc, 0xff, + 0xae, 0xa4, 0xa4, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xba, 0xb0, 0xa4, 0xff, + 0xd9, 0xd4, 0xcc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xfc, 0xf1, 0xdc, 0xff, 0xfc, 0xea, 0xdc, 0xff, 0xfc, 0xea, 0xdc, 0xff, + 0xfc, 0xf1, 0xdc, 0xff, 0xfc, 0xea, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, + 0xfc, 0xf1, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, + 0xfc, 0xf1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f, 0x6a, 0x64, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x7d, 0x62, 0x5c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, - 0x69, 0x55, 0x54, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, - 0x75, 0x62, 0x64, 0xff, 0x78, 0x66, 0x64, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x7d, 0x62, 0x5c, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x75, 0x56, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x75, 0x56, 0x54, 0xff, - 0x7f, 0x6a, 0x64, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, - 0x7c, 0x5d, 0x54, 0xff, 0x9c, 0x80, 0x7c, 0xff, 0x8e, 0x7a, 0x7c, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x75, 0x62, 0x64, 0xff, 0x78, 0x66, 0x64, 0xff, - 0xa6, 0x95, 0x94, 0xff, 0x9e, 0x8e, 0x94, 0xff, 0x94, 0x8c, 0x8c, 0xff, - 0x9d, 0x8d, 0x8c, 0xff, 0xad, 0x9a, 0x9c, 0xff, 0x70, 0x5e, 0x5c, 0xff, - 0x75, 0x62, 0x64, 0xff, 0x96, 0x86, 0x8c, 0xff, 0xad, 0x9e, 0x9e, 0xff, - 0xd4, 0xc6, 0xc4, 0xff, 0xc4, 0xba, 0xbc, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0xae, 0xa4, 0xa4, 0xff, 0xba, 0xb0, 0xa4, 0xff, 0xd9, 0xd4, 0xcc, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0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72, 0x5b, 0x54, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x7c, 0x5c, 0x4c, 0xff, - 0x7c, 0x5d, 0x54, 0xff, 0x75, 0x56, 0x54, 0xff, 0x74, 0x4e, 0x44, 0xff, - 0x74, 0x4e, 0x44, 0xff, 0x75, 0x56, 0x54, 0xff, 0x74, 0x4e, 0x4c, 0xff, - 0x61, 0x48, 0x44, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, - 0x8a, 0x76, 0x6c, 0xff, 0xc5, 0xb7, 0xb4, 0xff, 0x8a, 0x76, 0x6c, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x78, 0x66, 0x64, 0xff, 0x7c, 0x5e, 0x5c, 0xff, - 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x78, 0x66, 0x64, 0xff, 0x72, 0x62, 0x5c, 0xff, - 0x7e, 0x6d, 0x6c, 0xff, 0x7d, 0x62, 0x5c, 0xff, 0x6c, 0x4a, 0x44, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x84, 0x77, 0x74, 0xff, - 0xbd, 0xa6, 0xa4, 0xff, 0x84, 0x77, 0x74, 0xff, 0x7c, 0x5d, 0x54, 0xff, - 0x7e, 0x6d, 0x6c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x75, 0x56, 0x54, 0xff, - 0x8d, 0x72, 0x6b, 0xff, 0x96, 0x85, 0x84, 0xff, 0x69, 0x4e, 0x4c, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x84, 0x77, 0x74, 0xff, 0x96, 0x86, 0x8c, 0xff, - 0xae, 0xa4, 0xa4, 0xff, 0x9d, 0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c, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, + 0x75, 0x56, 0x54, 0xff, 0x74, 0x4e, 0x44, 0xff, 0x74, 0x4e, 0x44, 0xff, + 0x75, 0x56, 0x54, 0xff, 0x74, 0x4e, 0x4c, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x8a, 0x76, 0x6c, 0xff, + 0xc5, 0xb7, 0xb4, 0xff, 0x8a, 0x76, 0x6c, 0xff, 0x70, 0x5e, 0x5c, 0xff, + 0x78, 0x66, 0x64, 0xff, 0x7c, 0x5e, 0x5c, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x78, 0x66, 0x64, 0xff, 0x72, 0x62, 0x5c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, + 0x7d, 0x62, 0x5c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x72, 0x5b, 0x54, 0xff, 0x84, 0x77, 0x74, 0xff, 0xbd, 0xa6, 0xa4, 0xff, + 0x84, 0x77, 0x74, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x7e, 0x6d, 0x6c, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x75, 0x56, 0x54, 0xff, 0x8d, 0x72, 0x6b, 0xff, + 0x96, 0x85, 0x84, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x70, 0x5e, 0x5c, 0xff, + 0x84, 0x77, 0x74, 0xff, 0x96, 0x86, 0x8c, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0x9d, 0x8d, 0x8c, 0xff, 0xad, 0x9a, 0x9c, 0xff, 0x96, 0x86, 0x8c, 0xff, + 0x81, 0x72, 0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0x7c, 0xff, 0x7d, 0x62, 0x5c, 0xff, - 0x7c, 0x5d, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x78, 0x66, 0x64, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x84, 0x77, 0x74, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x7f, 0x6a, 0x64, 0xff, 0x69, 0x55, 0x54, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, - 0x69, 0x4e, 0x44, 0xff, 0x58, 0x49, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, - 0x7e, 0x6d, 0x6c, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0x9c, 0x80, 0x7c, 0xff, - 0x9c, 0x80, 0x7c, 0xff, 0x74, 0x4e, 0x4c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x8e, 0x79, 0x74, 0xff, 0x8c, 0x6d, 0x6c, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x7d, 0x62, 0x5c, 0xff, 0x8e, 0x7a, 0x7c, 0xff, 0x9d, 0x8d, 0x8c, 0xff, - 0xad, 0x9a, 0x9c, 0xff, 0x9e, 0x8e, 0x94, 0xff, 0xa4, 0x9e, 0xa4, 0xff, - 0x9e, 0x8e, 0x94, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0x9e, 0x8e, 0x94, 0xff, - 0x81, 0x72, 0x74, 0xff, 0x6b, 0x56, 0x5c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0xae, 0xa4, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xc4, 0xba, 0xbc, 0xff, - 0xd5, 0xcd, 0xcc, 0xff, 0xa1, 0x9e, 0x9c, 0xff, 0xb0, 0xa3, 0x9c, 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 0xf4, 0xe9, 0xd4, 0xff, + 0xf4, 0xe9, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, + 0xf4, 0xe9, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, + 0xf9, 0xe2, 0xd4, 0xff, 0xfc, 0xea, 0xdc, 0xff, 0xb4, 0x9a, 0x8c, 0xff, + 0x72, 0x5b, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x69, 0x4e, 0x44, 0xff, 0x74, 0x4e, 0x44, 0xff, 0x75, 0x56, 0x54, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x69, 0x4e, 0x44, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x9c, 0x80, 0x7c, 0xff, + 0x7d, 0x62, 0x5c, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x78, 0x66, 0x64, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x84, 0x77, 0x74, 0xff, + 0x7e, 0x6d, 0x6c, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x58, 0x49, 0x4c, 0xff, + 0x7c, 0x5d, 0x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, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xf4, 0xe9, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, - 0x7c, 0x72, 0x64, 0xff, 0x7f, 0x72, 0x6c, 0xff, 0x64, 0x5a, 0x4c, 0xff, - 0x6a, 0x53, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x7c, 0x5e, 0x5c, 0xff, 0x75, 0x56, 0x54, 0xff, - 0x75, 0x56, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x7c, 0x5c, 0x4c, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x75, 0x56, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, - 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x6a, 0x53, 0x4c, 0xff, - 0x50, 0x4e, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x69, 0x4e, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x8c, 0x6d, 0x6c, 0xff, 0x84, 0x77, 0x74, 0xff, 0x7f, 0x6a, 0x64, 0xff, - 0x7f, 0x6a, 0x64, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x71, 0x6a, 0x64, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x75, 0x56, 0x54, 0xff, - 0x7c, 0x5d, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x7f, 0x6a, 0x64, 0xff, 0x81, 0x72, 0x74, 0xff, 0x7d, 0x62, 0x5c, 0xff, - 0x81, 0x72, 0x74, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0x8e, 0x79, 0x74, 0xff, - 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, - 0x7e, 0x6d, 0x6c, 0xff, 0x9e, 0x8e, 0x94, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0xad, 0x9a, 0x9c, 0xff, 0xa4, 0x9e, 0xa4, 0xff, 0xc6, 0xb1, 0xb4, 0xff, - 0xa4, 0x9e, 0xa4, 0xff, 0x9e, 0x8e, 0x94, 0xff, 0x96, 0x86, 0x8c, 0xff, - 0x9e, 0x8e, 0x94, 0xff, 0xad, 0x9a, 0x9c, 0xff, 0xa6, 0x95, 0x94, 0xff, - 0x9d, 0x8d, 0x8c, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0x94, 0x8c, 0x8c, 0xff, - 0xc5, 0xb7, 0xb4, 0xff, 0xcc, 0xc5, 0xc4, 0xff, 0xb4, 0xaa, 0xac, 0xff, - 0xbc, 0xb6, 0xac, 0xff, 0xbf, 0xaa, 0xa4, 0xff, 0xc9, 0xc0, 0xb4, 0xff, - 0xfc, 0xf2, 0xe4, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xfc, 0xf7, 0xdc, 0xff, - 0xfc, 0xf2, 0xe4, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, + 0xf4, 0xe9, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, 0x7c, 0x72, 0x64, 0xff, + 0x7f, 0x72, 0x6c, 0xff, 0x64, 0x5a, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x72, 0x5b, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x70, 0x5e, 0x5c, 0xff, + 0x7c, 0x5e, 0x5c, 0xff, 0x75, 0x56, 0x54, 0xff, 0x75, 0x56, 0x54, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x7c, 0x5c, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x75, 0x56, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x50, 0x4e, 0x44, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x8c, 0x6d, 0x6c, 0xff, + 0x84, 0x77, 0x74, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0x7f, 0x6a, 0x64, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x71, 0x6a, 0x64, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, + 0x72, 0x5b, 0x54, 0xff, 0x75, 0x56, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, + 0x72, 0x5b, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x7f, 0x6a, 0x64, 0xff, + 0x81, 0x72, 0x74, 0xff, 0x7d, 0x62, 0x5c, 0xff, 0x81, 0x72, 0x74, 0xff, + 0x9d, 0x8d, 0x8c, 0xff, 0x8e, 0x79, 0x74, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x7e, 0x6d, 0x6c, 0xff, + 0x9e, 0x8e, 0x94, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xad, 0x9a, 0x9c, 0xff, + 0xa4, 0x9e, 0xa4, 0xff, 0xc6, 0xb1, 0xb4, 0xff, 0xa4, 0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x74, 0x4e, 0x4c, 0xff, 0x5c, 0x3e, 0x34, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x7c, 0x5d, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x7f, 0x6a, 0x64, 0xff, - 0x9d, 0x8d, 0x8c, 0xff, 0x50, 0x4e, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x6a, 0x53, 0x4c, 0xff, 0x78, 0x66, 0x64, 0xff, 0x80, 0x67, 0x5c, 0xff, - 0x6a, 0x53, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x7c, 0x5d, 0x54, 0xff, - 0x7f, 0x6a, 0x64, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x77, 0x66, 0x6c, 0xff, - 0x81, 0x72, 0x74, 0xff, 0x78, 0x66, 0x64, 0xff, 0x77, 0x66, 0x6c, 0xff, - 0x7e, 0x6d, 0x6c, 0xff, 0xad, 0x9a, 0x9c, 0xff, 0xad, 0x9e, 0x9e, 0xff, - 0x84, 0x77, 0x74, 0xff, 0x7d, 0x62, 0x5c, 0xff, 0x78, 0x66, 0x64, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0xad, 0x9a, 0x9c, 0xff, 0xad, 0x9a, 0x9c, 0xff, 0xbc, 0xaa, 0xac, 0xff, - 0x9e, 0x8e, 0x94, 0xff, 0x9c, 0x7a, 0x7c, 0xff, 0x84, 0x79, 0x7c, 0xff, - 0x8e, 0x7a, 0x7c, 0xff, 0x96, 0x85, 0x84, 0xff, 0xa6, 0x95, 0x94, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0x8b, 0x8b, 0x8c, 0xff, - 0xb4, 0xaa, 0xac, 0xff, 0xcc, 0xc2, 0x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, 0x5b, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, + 0x72, 0x5b, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x7c, 0x5d, 0x54, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x50, 0x4e, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x69, 0x4e, 0x44, 0xff, 0x74, 0x4e, 0x4c, 0xff, 0x5c, 0x3e, 0x34, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x7c, 0x5d, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x7f, 0x6a, 0x64, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0x50, 0x4e, 0x44, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x78, 0x66, 0x64, 0xff, + 0x80, 0x67, 0x5c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x7c, 0x5d, 0x54, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0x70, 0x5e, 0x5c, 0xff, + 0x77, 0x66, 0x6c, 0xff, 0x81, 0x72, 0x74, 0xff, 0x78, 0x66, 0x64, 0xff, + 0x77, 0x66, 0x6c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0xad, 0x9a, 0x9c, 0xff, + 0xad, 0x9e, 0x9e, 0xff, 0x84, 0x77, 0x74, 0xff, 0x7d, 0x62, 0x5c, 0xff, + 0x78, 0x66, 0x64, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, + 0xae, 0xa4, 0xa4, 0xff, 0xad, 0x9a, 0x9c, 0xff, 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 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, 0x94, 0x8b, 0x84, 0xff, 0x90, 0x7f, 0x74, 0xff, 0x78, 0x77, 0x74, 0xff, 0x7f, 0x72, 0x6c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0x69, 0x55, 0x54, 0xff, 0x72, 0x62, 0x5c, 0xff, 0x70, 0x5e, 0x5c, 0xff, @@ -1743,93 +1730,92 @@ static const uint8_t kImgPeakData[] = { 0xfc, 0xee, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xf4, 0xe9, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0xf4, 0xe9, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0x9c, 0x93, 0x8c, 0xff, 0xa6, 0x95, 0x94, 0xff, 0x94, 0x8b, 0x84, 0xff, - 0x9d, 0x8d, 0x8c, 0xff, 0xd7, 0xcc, 0xc4, 0xff, 0xbc, 0xb1, 0xb4, 0xff, - 0xa1, 0x99, 0x9c, 0xff, 0xad, 0x9a, 0x9c, 0xff, 0x84, 0x77, 0x74, 0xff, - 0x71, 0x6a, 0x64, 0xff, 0x81, 0x72, 0x74, 0xff, 0x72, 0x5b, 0x54, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, - 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x69, 0x4e, 0x4c, 0xff, - 0x5c, 0x42, 0x44, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x5c, 0x42, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x69, 0x4e, 0x4c, 0xff, - 0x6c, 0x4a, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x61, 0x48, 0x44, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x72, 0x62, 0x5c, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x70, 0x66, 0x5c, 0xff, 0x7f, 0x6a, 0x64, 0xff, - 0x7c, 0x5d, 0x54, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, - 0x69, 0x4e, 0x4c, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x75, 0x62, 0x64, 0xff, - 0x8e, 0x79, 0x74, 0xff, 0xbc, 0xb1, 0xb4, 0xff, 0x96, 0x85, 0x84, 0xff, - 0x7f, 0x72, 0x6c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0xa6, 0x95, 0x94, 0xff, - 0xb0, 0xa3, 0x9c, 0xff, 0xa6, 0x95, 0x94, 0xff, 0x96, 0x85, 0x84, 0xff, - 0x8f, 0x7f, 0x7c, 0xff, 0x78, 0x77, 0x74, 0xff, 0x8c, 0x81, 0x84, 0xff, - 0x81, 0x72, 0x74, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0x9d, 0x8d, 0x8c, 0xff, - 0x8c, 0x81, 0x84, 0xff, 0x8c, 0x81, 0x84, 0xff, 0xa6, 0x95, 0x94, 0xff, - 0xad, 0x9a, 0x9c, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0xbc, 0xaa, 0xac, 0xff, - 0xc4, 0xba, 0xbc, 0xff, 0xc2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, 0xd4, 0xff, 0x9c, 0x93, 0x8c, 0xff, + 0xa6, 0x95, 0x94, 0xff, 0x94, 0x8b, 0x84, 0xff, 0x9d, 0x8d, 0x8c, 0xff, + 0xd7, 0xcc, 0xc4, 0xff, 0xbc, 0xb1, 0xb4, 0xff, 0xa1, 0x99, 0x9c, 0xff, + 0xad, 0x9a, 0x9c, 0xff, 0x84, 0x77, 0x74, 0xff, 0x71, 0x6a, 0x64, 0xff, + 0x81, 0x72, 0x74, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x72, 0x5b, 0x54, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x5c, 0x42, 0x44, 0xff, + 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x44, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x50, 0x4e, 0x44, 0xff, - 0x61, 0x48, 0x44, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x7f, 0x6a, 0x64, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x74, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, - 0x75, 0x56, 0x54, 0xff, 0x7c, 0x5e, 0x5c, 0xff, 0x70, 0x5e, 0x5c, 0xff, - 0x7f, 0x72, 0x6c,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 0xf7, 0xdc, 0xff, 0xfc, 0xf7, 0xdc, 0xff, - 0xfc, 0xf7, 0xdc, 0xff, 0xfc, 0xf7, 0xdc, 0xff, 0xfc, 0xf7, 0xdc, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xfc, 0xf7, 0xdc, 0xff, 0xfc, 0xf7, 0xdc, 0xff, - 0xfc, 0xf7, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xf4, 0xf7, 0xdc, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x72, 0x62, 0x5c, 0xff, 0x72, 0x5b, 0x54, 0xff, + 0x70, 0x66, 0x5c, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0x7c, 0x5d, 0x54, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x70, 0x5e, 0x5c, 0xff, 0x75, 0x62, 0x64, 0xff, 0x8e, 0x79, 0x74, 0xff, + 0xbc, 0xb1, 0xb4, 0xff, 0x96, 0x85, 0x84, 0xff, 0x7f, 0x72, 0x6c, 0xff, + 0x8f, 0x7f, 0x7c, 0xff, 0xa6, 0x95, 0x94, 0xff, 0xb0, 0xa3, 0x9c, 0xff, + 0xa6, 0x95, 0x94, 0xff, 0x96, 0x85, 0x84, 0xff, 0x8f, 0x7f, 0x7c, 0xff, + 0x78, 0x77, 0x74, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x81, 0x72, 0x74, 0xff, + 0x9d, 0x8d, 0x8c, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0x8c, 0x81, 0x84, 0xff, + 0x8c, 0x81, 0x84, 0xff, 0xa6, 0x95, 0x94, 0xff, 0xad, 0x9a, 0x9c, 0xff, + 0xa1, 0x99, 0x9c, 0xff, 0xbc, 0xaa, 0xac, 0xff, 0xc4, 0x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xff, 0xb3, 0xae, 0xac, 0xff, + 0xc2, 0xbe, 0xbc, 0xff, 0xc5, 0xb7, 0xb4, 0xff, 0xb1, 0xaa, 0xa4, 0xff, + 0x70, 0x5e, 0x5c, 0xff, 0x75, 0x62, 0x64, 0xff, 0x78, 0x66, 0x64, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x74, 0x4e, 0x4c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x6c, 0x4a, 0x44, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x69, 0x4e, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x69, 0x4e, 0x44, 0xff, + 0x50, 0x4e, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x69, 0x4e, 0x44, 0xff, + 0x7f, 0x6a, 0x64, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x69, 0x4e, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x74, 0x4e, 0x4c, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x75, 0x56, 0x54, 0xff, 0x7c, 0x5e, 0x5c, 0xff, + 0x70, 0x5e, 0x5c, 0xff, 0x7f, 0x72, 0x6c, 0xff, 0x96, 0x85, 0x84, 0xff, + 0x8e, 0x7a, 0x7c, 0xff, 0x96, 0x85, 0x84, 0xff, 0x8f, 0x7f, 0x7c, 0xff, + 0x84, 0x77, 0x74, 0xff, 0x94, 0x8b, 0x84, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0xae, 0xa4, 0xa4, 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, 0xff, 0xfc, 0xee, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, - 0xcc, 0xcc, 0xcc, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xb1, 0xaa, 0xa4, 0xff, - 0x9c, 0x93, 0x8c, 0xff, 0x8b, 0x8b, 0x8c, 0xff, 0xbc, 0xb9, 0xbc, 0xff, - 0xe4, 0xde, 0xdc, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0xba, 0xb6, 0xb4, 0xff, - 0xbc, 0xb1, 0xb4, 0xff, 0xcc, 0xc5, 0xc4, 0xff, 0xbd, 0xa6, 0xa4, 0xff, - 0x9c, 0x7a, 0x7c, 0xff, 0x75, 0x62, 0x64, 0xff, 0x7c, 0x5e, 0x5c, 0xff, - 0x74, 0x4e, 0x4c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x5c, 0x42, 0x44, 0xff, - 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x5c, 0x42, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x6c, 0x4a, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x69, 0x4e, 0x44, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x72, 0x62, 0x5c, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x72, 0x62, 0x5c, 0xff, - 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x8e, 0x72, 0x74, 0xff, 0x84, 0x77, 0x74, 0xff, - 0x9c, 0x80, 0x7c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x71, 0x6a, 0x64, 0xff, 0x84, 0x79, 0x7c, 0xff, 0x94, 0x8b, 0x84, 0xff, - 0x96, 0x85, 0x84, 0xff, 0xa6, 0x95, 0x94, 0xff, 0x9c, 0x93, 0x8c, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x84, 0x77, 0x74, 0xff, 0x8c, 0x81, 0x84, 0xff, - 0x96, 0x86, 0x8c, 0xff, 0x96, 0x85, 0x84, 0xff, 0x9e, 0x8e, 0x94, 0xff, - 0xa6, 0x95, 0x94, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0xad, 0x9e, 0x9e, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0x96, 0x85, 0x84, 0xff, - 0xae, 0xa4, 0xa4, 0xff, 0xa4, 0x9e, 0xa4, 0xff, 0xa1, 0xa2, 0x9c, 0xff, - 0xc5, 0xb7, 0xb4, 0xff, 0xbc, 0xb0, 0xac, 0xff, 0x9c, 0x93, 0x8c, 0xff, - 0xef, 0xe2, 0xdc, 0xff, 0xfc, 0xf2, 0xe4, 0xff, 0xfc, 0xf2, 0xe4, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xe9, 0xd4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, + 0xba, 0xb6, 0xb4, 0xff, 0xb1, 0xaa, 0xa4, 0xff, 0x9c, 0x93, 0x8c, 0xff, + 0x8b, 0x8b, 0x8c, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xe4, 0xde, 0xdc, 0xff, + 0xdc, 0xdc, 0xdc, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xbc, 0xb1, 0xb4, 0xff, + 0xcc, 0xc5, 0xc4, 0xff, 0xbd, 0xa6, 0xa4, 0xff, 0x9c, 0x7a, 0x7c, 0xff, + 0x75, 0x62, 0x64, 0xff, 0x7c, 0x5e, 0x5c, 0xff, 0x74, 0x4e, 0x4c, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x44, 0xff, + 0x5c, 0x42, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x44, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x72, 0x62, 0x5c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x72, 0x62, 0x5c, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x70, 0x5e, 0x5c, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x70, 0x5e, 0x5c, 0xff, + 0x8e, 0x72, 0x74, 0xff, 0x84, 0x77, 0x74, 0xff, 0x9c, 0x80, 0x7c, 0xff, + 0x7e, 0x6d, 0x6c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x71, 0x6a, 0x64, 0xff, + 0x84, 0x79, 0x7c, 0xff, 0x94, 0x8b, 0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 0xd6, 0xdc, 0xff, - 0xd6, 0xd2, 0xd4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xcc, 0xbe, 0xc4, 0xff, - 0xc6, 0xb1, 0xb4, 0xff, 0xb4, 0x96, 0x94, 0xff, 0x75, 0x62, 0x64, 0xff, - 0x64, 0x4e, 0x54, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x69, 0x4e, 0x4c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x44, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x6c, 0x4a, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x74, 0x55, 0x4c, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, - 0x6a, 0x53, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x7d, 0x62, 0x5c, 0xff, - 0x69, 0x4e, 0x4c, 0xff, 0x78, 0x66, 0x64, 0xff, 0x70, 0x5e, 0x5c, 0xff, - 0x7e, 0x6d, 0x6c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x8c, 0x81, 0x84, 0xff, - 0x8e, 0x7a, 0x7c, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x5d, 0x5a, 0x54, 0xff, - 0x84, 0x77, 0x74, 0xff, 0x7f, 0x72, 0x6c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, - 0xa6, 0x95, 0x94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 0x81, 0x7e, 0x7c, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xe4, 0xe2, 0xd8, 0xff, + 0xdc, 0xd6, 0xdc, 0xff, 0xd6, 0xd2, 0xd4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, + 0xcc, 0xbe, 0xc4, 0xff, 0xc6, 0xb1, 0xb4, 0xff, 0xb4, 0x96, 0x94, 0xff, + 0x75, 0x62, 0x64, 0xff, 0x64, 0x4e, 0x54, 0xff, 0x6c, 0x4a, 0x44, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x6c, 0x4a, 0x44, 0xff, + 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x69, 0x4e, 0x44, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x72, 0x5b, 0x54, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x7d, 0x62, 0x5c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x78, 0x66, 0x64, 0xff, + 0x70, 0x5e, 0x5c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, + 0x8c, 0x81, 0x84, 0xff, 0x8e, 0x7a, 0x7c, 0xff, 0x72, 0x5b, 0x54, 0xff, + 0x5d, 0x5a, 0x54, 0xff, 0x84, 0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, 0xff, 0xf4, 0xf0, 0xd4, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, + 0xfc, 0xee, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0xbc, 0xb6, 0xac, 0xff, 0x8b, 0x8b, 0x8c, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x92, 0x92, 0x8c, 0xff, 0xb3, 0xae, 0xac, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xbc, 0xb9, 0xbc, 0xff, @@ -2001,93 +1986,92 @@ static const uint8_t kImgPeakData[] = { 0xf3, 0xf2, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xfc, 0xf1, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xa3, 0xa3, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, 0x89, 0x86, 0x84, 0xff, - 0x81, 0x7e, 0x7c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x89, 0x86, 0x84, 0xff, - 0xa1, 0x99, 0x9c, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0xa1, 0x99, 0x9c, 0xff, - 0xc4, 0xc3, 0xc4, 0xff, 0xdc, 0xd6, 0xdc, 0xff, 0xd6, 0xd2, 0xd4, 0xff, - 0xcc, 0xcc, 0xcc, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xbc, 0xb0, 0xac, 0xff, - 0x71, 0x6a, 0x64, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x69, 0x55, 0x54, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x44, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x69, 0x4e, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, - 0x69, 0x4e, 0x44, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0x9c, 0x80, 0x7c, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x71, 0x6a, 0x64, 0xff, 0x84, 0x77, 0x74, 0xff, - 0x8e, 0x79, 0x74, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x72, 0x5b, 0x54, 0xff, 0x8e, 0x7a, 0x7c, 0xff, 0x84, 0x77, 0x74, 0xff, - 0x84, 0x77, 0x74, 0xff, 0x8f, 0x86, 0x7c, 0xff, 0xa6, 0x95, 0x94, 0xff, - 0x71, 0x6a, 0x64, 0xff, 0x78, 0x66, 0x64, 0xff, 0x9d, 0x8d, 0x8c, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0x84, 0x77, 0x74, 0xff, 0x96, 0x85, 0x84, 0xff, - 0xae, 0xa4, 0xa4, 0xff, 0xcc, 0xbe, 0xc4, 0xff, 0xa6, 0x95, 0x94, 0xff, - 0xad, 0x9a, 0x9c, 0xff, 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, 0xff, 0xa3, 0xa3, 0xa4, 0xff, + 0x9a, 0x94, 0x94, 0xff, 0x89, 0x86, 0x84, 0xff, 0x81, 0x7e, 0x7c, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x89, 0x86, 0x84, 0xff, 0xa1, 0x99, 0x9c, 0xff, + 0xa1, 0x99, 0x9c, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0xc4, 0xc3, 0xc4, 0xff, + 0xdc, 0xd6, 0xdc, 0xff, 0xd6, 0xd2, 0xd4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, + 0xc4, 0xc3, 0xc4, 0xff, 0xbc, 0xb0, 0xac, 0xff, 0x71, 0x6a, 0x64, 0xff, + 0x5d, 0x5a, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x69, 0x4e, 0x44, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x53, 0x41, 0x3c, 0xff, 0x6a, 0x53, 0x4c, 0xff, - 0x69, 0x4e, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x53, 0x41, 0x3c, 0xff, - 0x61, 0x48, 0x44, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x78, 0x66, 0x64, 0xff, - 0x72, 0x62, 0x5c, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0x8f, 0x7f, 0x7c, 0xff, - 0x9c, 0x80, 0x7c, 0xff, 0xad, 0x9a, 0x9c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x84, 0x79, 0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, 0xff, 0x5c, 0x42, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x69, 0x4e, 0x44, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, + 0x7f, 0x6a, 0x64, 0xff, 0x9c, 0x80, 0x7c, 0xff, 0x72, 0x5b, 0x54, 0xff, + 0x71, 0x6a, 0x64, 0xff, 0x84, 0x77, 0x74, 0xff, 0x8e, 0x79, 0x74, 0xff, + 0xae, 0xa4, 0xa4, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x72, 0x5b, 0x54, 0xff, + 0x8e, 0x7a, 0x7c, 0xff, 0x84, 0x77, 0x74, 0xff, 0x84, 0x77, 0x74, 0xff, + 0x8f, 0x86, 0x7c, 0xff, 0xa6, 0x95, 0x94, 0xff, 0x71, 0x6a, 0x64, 0xff, + 0x78, 0x66, 0x64, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0x9a, 0x94, 0x94, 0xff, + 0x84, 0x77, 0x74, 0xff, 0x96, 0x85, 0x84, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0xcc, 0xbe, 0xc4, 0xff, 0xa6, 0x95, 0x94, 0xff, 0xad, 0x9a, 0x9c, 0xff, + 0xa1, 0x99, 0x9c, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0xbc, 0xb0, 0xac, 0xff, + 0xc4, 0xbe, 0xc4, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xbc, 0xb1, 0xb4, 0xff, + 0xb4, 0xaa, 0xac, 0xff, 0xb3, 0xae, 0xac, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0xd5, 0xcd, 0xcc, 0xff, 0xc2, 0xbe, 0xbc, 0xff, 0xb0, 0xa3, 0x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c, 0xff, 0xf4, 0xf0, 0xd4, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xfc, 0xee, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xbc, 0xb0, 0xac, 0xff, 0xb4, 0xb2, 0xb4, 0xff, + 0xa3, 0xa3, 0xa4, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0x81, 0x7e, 0x7c, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x71, 0x72, 0x6c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0xb3, 0xae, 0xac, 0xff, 0xd6, 0xd2, 0xd4, 0xff, 0x9a, 0x94, 0x94, 0xff, + 0xa3, 0xa3, 0xa4, 0xff, 0x94, 0x8e, 0x94, 0xff, 0x94, 0x8c, 0x8c, 0xff, + 0x9a, 0x94, 0x94, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0x75, 0x62, 0x64, 0xff, + 0x5d, 0x5a, 0x54, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x44, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x69, 0x4e, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x53, 0x41, 0x3c, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff,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, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0x71, 0x72, 0x74, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0xa1, 0x99, 0x9c, 0xff, - 0xa1, 0x99, 0x9c, 0xff, 0x7b, 0x7a, 0x7c, 0xff, 0x94, 0x8e, 0x94, 0xff, - 0x8c, 0x81, 0x84, 0xff, 0x7b, 0x7a, 0x7c, 0xff, 0x81, 0x7e, 0x7c, 0xff, - 0xae, 0xa4, 0xa4, 0xff, 0xc4, 0xba, 0xbc, 0xff, 0xa1, 0x99, 0x9c, 0xff, - 0x6c, 0x61, 0x64, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x6c, 0x61, 0x64, 0xff, - 0x75, 0x62, 0x64, 0xff, 0x81, 0x72, 0x74, 0xff, 0x70, 0x5e, 0x5c, 0xff, - 0x55, 0x52, 0x4c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x6c, 0x4a, 0x44, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x5c, 0x42, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x69, 0x4e, 0x44, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x72, 0x62, 0x5c, 0xff, 0x8f, 0x86, 0x7c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0xf1, 0xdc, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0x71, 0x72, 0x74, 0xff, + 0xa3, 0xa3, 0xa4, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0xa1, 0x99, 0x9c, 0xff, + 0x7b, 0x7a, 0x7c, 0xff, 0x94, 0x8e, 0x94, 0xff, 0x8c, 0x81, 0x84, 0xff, + 0x7b, 0x7a, 0x7c, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0xc4, 0xba, 0xbc, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0x6c, 0x61, 0x64, 0xff, + 0x70, 0x5e, 0x5c, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x75, 0x62, 0x64, 0xff, + 0x81, 0x72, 0x74, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x55, 0x52, 0x4c, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x6c, 0x4a, 0x44, 0xff, + 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x44, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x69, 0x4e, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x69, 0x4e, 0x44, 0xff, + 0x72, 0x5b, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x72, 0x62, 0x5c, 0xff, + 0x8f, 0x86, 0x7c, 0xff, 0x8c, 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ff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf7, 0xdc, 0xff, - 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0x84, 0x79, 0x7c, 0xff, 0x78, 0x77, 0x74, 0xff, 0x71, 0x72, 0x74, 0xff, - 0x78, 0x77, 0x74, 0xff, 0x83, 0x82, 0x84, 0xff, 0xb3, 0xae, 0xac, 0xff, - 0xa4, 0x9e, 0xa4, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0x94, 0x8c, 0x8c, 0xff, - 0x8c, 0x86, 0x8c, 0xff, 0x96, 0x85, 0x84, 0xff, 0xa1, 0x99, 0x9c, 0xff, - 0x8c, 0x81, 0x84, 0xff, 0x96, 0x86, 0x8c, 0xff, 0x6c, 0x61, 0x64, 0xff, - 0x69, 0x55, 0x54, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x70, 0x5e, 0x5c, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x6a, 0x53, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0xf4, 0xf7, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xfc, 0xf1, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xfc, 0xf1, 0xdc, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0x84, 0x79, 0x7c, 0xff, 0x78, 0x77, 0x74, 0xff, + 0x71, 0x72, 0x74, 0xff, 0x78, 0x77, 0x74, 0xff, 0x83, 0x82, 0x84, 0xff, + 0xb3, 0xae, 0xac, 0xff, 0xa4, 0x9e, 0xa4, 0xff, 0x94, 0x8c, 0x8c, 0xff, + 0x94, 0x8c, 0x8c, 0xff, 0x8c, 0x86, 0x8c, 0xff, 0x96, 0x85, 0x84, 0xff, + 0xa1, 0x99, 0x9c, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x96, 0x86, 0x8c, 0xff, + 0x6c, 0x61, 0x64, 0xff, 0x69, 0x55, 0x54, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x70, 0x5e, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x70, 0x5e, 0x5c, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, - 0x61, 0x48, 0x44, 0xff, 0x7d, 0x62, 0x5c, 0xff, 0x6a, 0x53, 0x4c, 0xff, - 0x78, 0x66, 0x64, 0xff, 0x96, 0x85, 0x84, 0xff, 0x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, 0xe4, 0xff, - 0xfc, 0xf7, 0xdc, 0xff, 0xfc, 0xf9, 0xe4, 0xff, 0xfc, 0xf9, 0xe4, 0xff, - 0xfc, 0xf7, 0xdc, 0xff, 0xfc, 0xf9, 0xe4, 0xff, 0xfc, 0xf9, 0xe4, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x6c, 0x4a, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x7d, 0x62, 0x5c, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x78, 0x66, 0x64, 0xff, 0x96, 0x85, 0x84, 0xff, + 0x7c, 0x72, 0x64, 0xff, 0x6b, 0x56, 0x5c, 0xff, 0x8e, 0x7a, 0x7c, 0xff, + 0x70, 0x5e, 0x5c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x6c, 0x61, 0x64, 0xff, + 0x81, 0x72, 0x74, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x84, 0x79, 0x7c, 0xff, + 0x81, 0x72, 0x74, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0x94, 0x8c, 0x8c, 0xff, + 0xb4, 0xaa, 0xac, 0xff, 0xac, 0xa9, 0xac, 0xff, 0xb3, 0xae, 0xac, 0xff, + 0xa1, 0x99, 0x9c, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, + 0xb4, 0xaa, 0xac, 0xff, 0x9e, 0x8e, 0x94, 0xff, 0xb4, 0xaa, 0xac, 0xff, + 0x9e, 0x8e, 0x94, 0xff, 0xa1, 0x9e, 0x9c, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0xa1, 0x9e, 0x9c, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xf8, 0xea, 0xec, 0xff, + 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xc5, 0xc4, 0xff, 0xb4, 0xb2, 0xb4, 0xff, + 0xcc, 0xc5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, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0x9a, 0x94, 0x94, 0xff, 0x9a, 0x94, 0x94, 0xff, @@ -2259,93 +2242,92 @@ static const uint8_t kImgPeakData[] = { 0xfc, 0xf7, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xac, 0xa9, 0xac, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0x6c, 0x61, 0x64, 0xff, - 0x81, 0x7e, 0x7c, 0xff, 0xa4, 0x9e, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, - 0xb4, 0xaa, 0xac, 0xff, 0xac, 0xa9, 0xac, 0xff, 0xa1, 0x99, 0x9c, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0xa1, 0x9e, 0x9c, 0xff, 0x8e, 0x7a, 0x7c, 0xff, - 0x6b, 0x56, 0x5c, 0xff, 0xb4, 0xaa, 0xac, 0xff, 0xd5, 0xcd, 0xcc, 0xff, - 0x77, 0x66, 0x6c, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x7f, 0x72, 0x6c, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x72, 0x62, 0x5c, 0xff, - 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x3e, 0x34, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xac, 0xa9, 0xac, 0xff, + 0xb4, 0xb2, 0xb4, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x81, 0x7e, 0x7c, 0xff, + 0xa4, 0x9e, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xb4, 0xaa, 0xac, 0xff, + 0xac, 0xa9, 0xac, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0x9a, 0x94, 0x94, 0xff, + 0xa1, 0x9e, 0x9c, 0xff, 0x8e, 0x7a, 0x7c, 0xff, 0x6b, 0x56, 0x5c, 0xff, + 0xb4, 0xaa, 0xac, 0xff, 0xd5, 0xcd, 0xcc, 0xff, 0x77, 0x66, 0x6c, 0xff, + 0x6c, 0x61, 0x64, 0xff, 0x7f, 0x72, 0x6c, 0xff, 0x70, 0x5e, 0x5c, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x72, 0x62, 0x5c, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x3e, 0x34, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x69, 0x4e, 0x44, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x72, 0x62, 0x5c, 0xff, - 0x81, 0x7e, 0x7c, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x7e, 0x6d, 0x6c, 0xff, 0x81, 0x72, 0x74, 0xff, 0x8e, 0x7a, 0x7c, 0xff, - 0x84, 0x77, 0x74, 0xff, 0x81, 0x72, 0x74, 0xff, 0x84, 0x77, 0x74, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0xad, 0x9a, 0x9c, 0xff, 0xb4, 0xaa, 0xac, 0xff, - 0xac, 0xa9, 0xac, 0xff, 0xb4, 0xaa, 0xac, 0xff, 0xa1, 0x99, 0x9c, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0xad, 0x9a, 0x9c, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0xc4, 0xba, 0xbc, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xa1, 0x99, 0x9c, 0xff, - 0x94, 0x8c, 0x8c, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0xa1, 0x99, 0x9c, 0xff, - 0xa3, 0xa3, 0xa4, 0xff, 0xc2, 0xbe, 0xbc, 0xff, 0xcc, 0xc5, 0xc4, 0xff, - 0xc4, 0xbe, 0xc4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xc2, 0xbe, 0xbc, 0xff, - 0xd6, 0xd2, 0xd4, 0xff, 0xbc, 0xb1, 0xb4, 0xff, 0xc2, 0xbe, 0xbc, 0xff, - 0xcc, 0xc2, 0xbc, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0x9c, 0x92, 0x84, 0xff, - 0xe2, 0xdc, 0xcc, 0xff, 0xfc, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x69, 0x4e, 0x44, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x70, 0x5e, 0x5c, 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2, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xfc, 0xf1, 0xdc, 0xff, 0xf4, 0xf7, 0xdc, 0xff, - 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xc4, 0xba, 0xbc, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xa3, 0xa3, 0xa4, 0xff, - 0x94, 0x8c, 0x8c, 0xff, 0xac, 0xa9, 0xac, 0xff, 0xa3, 0xa3, 0xa4, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xb4, 0xaa, 0xac, 0xff, - 0xa1, 0x99, 0x9c, 0xff, 0xa4, 0x9e, 0xa4, 0xff, 0xb3, 0xae, 0xac, 0xff, - 0x83, 0x82, 0x84, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x6b, 0x56, 0x5c, 0xff, - 0xc5, 0xb7, 0xb4, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x72, 0x62, 0x5c, 0xff, 0x72, 0x62, 0x5c, 0xff, 0x7f, 0x72, 0x6c, 0xff, - 0x7f, 0x6a, 0x64, 0xff, 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x6c, 0x4a, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x69, 0x4e, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x69, 0x55, 0x54, 0xff, 0x7f, 0x72, 0x6c, 0xff, 0x84, 0x77, 0x74, 0xff, - 0x8e, 0x7a, 0x7c, 0xff, 0x75, 0x62, 0x64, 0xff, 0x75, 0x62, 0x64, 0xff, - 0x84, 0x77, 0x74, 0xff, 0x84, 0x77, 0x74, 0xff, 0x81, 0x72, 0x74, 0xff, - 0x8c, 0x81, 0x84, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0x81, 0x72, 0x74, 0xff, - 0x96, 0x85, 0x84, 0xff, 0xac, 0xa9, 0xac, 0xff, 0xcc, 0xc5, 0xc4, 0xff, - 0xc2, 0xbe, 0xbc, 0xff, 0xbc, 0xb0, 0xac, 0xff, 0xc4, 0xba, 0xbc, 0xff, - 0xad, 0x9e, 0x9e, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0x9e, 0x8e, 0x94, 0xff, - 0x84, 0x79, 0x7c, 0xff, 0x83, 0x82, 0x84, 0xff, 0x9d, 0x8d, 0x8c, 0xff, - 0xa4, 0x9e, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, 0x94, 0x8e, 0x94, 0xff, - 0xae, 0xa4, 0xa4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, - 0xcc, 0xc5, 0xc4, 0xff, 0xcf, 0xc6, 0xcc, 0xff, 0xc4, 0xc3, 0xc4, 0xff, - 0xcc, 0xbe, 0xc4, 0xff, 0xc4, 0xba, 0xbc, 0xff, 0xcc, 0xbd, 0xbc, 0xff, - 0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f4, 0xf0, 0xd4, 0xff, + 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xc4, 0xba, 0xbc, 0xff, 0xc4, 0xc3, 0xc4, 0xff, + 0xa3, 0xa3, 0xa4, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0xac, 0xa9, 0xac, 0xff, + 0xa3, 0xa3, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, 0x9a, 0x94, 0x94, 0xff, + 0xb4, 0xaa, 0xac, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0xa4, 0x9e, 0xa4, 0xff, + 0xb3, 0xae, 0xac, 0xff, 0x83, 0x82, 0x84, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x6b, 0x56, 0x5c, 0xff, 0xc5, 0xb7, 0xb4, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x72, 0x62, 0x5c, 0xff, 0x72, 0x62, 0x5c, 0xff, + 0x7f, 0x72, 0x6c, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x7f, 0x72, 0x6c, 0xff, + 0x84, 0x77, 0x74, 0xff, 0x8e, 0x7a, 0x7c, 0xff, 0x75, 0x62, 0x64, 0xff, + 0x75, 0x62, 0x64, 0xff, 0x84, 0x77, 0x74, 0xff, 0x84, 0x77, 0x74, 0xff, + 0x81, 0x72, 0x74, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x94, 0x8c, 0x8c, 0xff, + 0x81, 0x72, 0x74, 0xff, 0x96, 0x85, 0x84, 0xff, 0xac, 0xa9, 0xac, 0xff, + 0xcc, 0xc5, 0xc4, 0xff, 0xc2, 0xbe, 0xbc, 0xff, 0xbc, 0xb0, 0xac, 0xff, + 0xc4, 0xba, 0xbc, 0xff, 0xad, 0x9e, 0x9e, 0xff, 0x94, 0x8c, 0x8c, 0xff, + 0x9e, 0x8e, 0x94, 0xff, 0x84, 0x79, 0x7c, 0xff, 0x83, 0x82, 0x84, 0xff, + 0x9d, 0x8d, 0x8c, 0xff, 0xa4, 0x9e, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, + 0x94, 0x8e, 0x94, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, + 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xc5, 0xc4, 0xff, 0xcf, 0xc6, 0xcc, 0xff, + 0xc4, 0xc3, 0xc4, 0xff, 0xcc, 0xbe, 0xc4, 0xff, 0xc4, 0xba, 0xbc, 0xff, + 0xcc, 0xbd, 0xbc, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xbc, 0xb0, 0xac, 0xff, + 0x8f, 0x86, 0x7c, 0xff, 0xa8, 0x9b, 0x94, 0xff, 0xfc, 0xf1, 0xdc, 0xff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0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xd5, 0xcd, 0xcc, 0xff, 0xb3, 0xae, 0xac, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0xa1, 0x9e, 0x9c, 0xff, 0x94, 0x8e, 0x94, 0xff, 0x94, 0x8c, 0x8c, 0xff, @@ -2388,93 +2370,92 @@ static const uint8_t kImgPeakData[] = { 0xf4, 0xf7, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xcf, 0xc6, 0xcc, 0xff, 0xac, 0xa9, 0xac, 0xff, 0x9a, 0x94, 0x94, 0xff, - 0xb3, 0xae, 0xac, 0xff, 0xac, 0xa9, 0xac, 0xff, 0xa3, 0xa3, 0xa4, 0xff, - 0xb4, 0xb2, 0xb4, 0xff, 0xb3, 0xae, 0xac, 0xff, 0xa3, 0xa3, 0xa4, 0xff, - 0x7b, 0x7a, 0x7c, 0xff, 0x96, 0x85, 0x84, 0xff, 0xa1, 0x99, 0x9c, 0xff, - 0xa4, 0x9e, 0xa4, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x69, 0x55, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x70, 0x5e, 0x5c, 0xff, - 0x71, 0x6a, 0x64, 0xff, 0x78, 0x66, 0x64, 0xff, 0x71, 0x6a, 0x64, 0xff, - 0x7e, 0x6d, 0x6c, 0xff, 0x84, 0x77, 0x74, 0xff, 0x50, 0x4e, 0x44, 0xff, - 0x61, 0x48, 0x44, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x6c, 0x4a, 0x44, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xcf, 0xc6, 0xcc, 0xff, + 0xac, 0xa9, 0xac, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xb3, 0xae, 0xac, 0xff, + 0xac, 0xa9, 0xac, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0xb4, 0xb2, 0xb4, 0xff, + 0xb3, 0xae, 0xac, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0x7b, 0x7a, 0x7c, 0xff, + 0x96, 0x85, 0x84, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0xa4, 0x9e, 0xa4, 0xff, + 0x7e, 0x6d, 0x6c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x71, 0x6a, 0x64, 0xff, + 0x78, 0x66, 0x64, 0xff, 0x71, 0x6a, 0x64, 0xff, 0x7e, 0x6d, 0x6c, 0xff, + 0x84, 0x77, 0x74, 0xff, 0x50, 0x4e, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x6c, 0x4a, 0x44, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x3e, 0x34, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x3e, 0x34, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x5c, 0x3e, 0x34, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x61, 0x48, 0x44, 0xff, 0x81, 0x72, 0x74, 0xff, 0x9d, 0x8d, 0x8c, 0xff, - 0xad, 0x9e, 0x9e, 0xff, 0xa6, 0x95, 0x94, 0xff, 0x8c, 0x81, 0x84, 0xff, - 0x9c, 0x80, 0x7c, 0xff, 0x84, 0x79, 0x7c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, - 0x8c, 0x81, 0x84, 0xff, 0x96, 0x85, 0x84, 0xff, 0x96, 0x85, 0x84, 0xff, - 0x78, 0x77, 0x74, 0xff, 0x96, 0x85, 0x84, 0xff, 0xc2, 0xbe, 0xbc, 0xff, - 0xb4, 0xb2, 0xb4, 0xff, 0xac, 0xa9, 0xac, 0xff, 0x9a, 0x94, 0x94, 0xff, - 0x94, 0x8c, 0x8c, 0xff, 0xa4, 0x9e, 0xa4, 0xff, 0xc5, 0xb7, 0xb4, 0xff, - 0xb4, 0xaa, 0xac, 0xff, 0xc4, 0xba, 0xbc, 0xff, 0xb4, 0xaa, 0xac, 0xff, - 0xba, 0xb6, 0xb4, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, - 0xb4, 0xaa, 0xac, 0xff, 0xc2, 0xbe, 0xbc, 0xff, 0xc4, 0xc3, 0xc4, 0xff, - 0xcf, 0xc6, 0xcc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xba, 0xb6, 0xb4, 0xff, - 0xbc, 0xb9, 0xbc, 0xff, 0xbc, 0xb1, 0xb4, 0xff, 0xbc, 0xb1, 0xb4, 0xff, - 0xd4, 0xc6, 0xc4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xcc, 0xc2,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 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xcc, 0xc5, 0xc4, 0xff, 0xd6, 0xd2, 0xd4, 0xff, 0xc2, 0xbe, 0xbc, 0xff, - 0xa3, 0xa3, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xb1, 0xaa, 0xa4, 0xff, - 0xbc, 0xb9, 0xbc, 0xff, 0xb3, 0xae, 0xac, 0xff, 0xa1, 0x99, 0x9c, 0xff, - 0xa1, 0x9e, 0x9c, 0xff, 0x83, 0x82, 0x84, 0xff, 0x78, 0x77, 0x74, 0xff, - 0xa6, 0x95, 0x94, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x58, 0x49, 0x4c, 0xff, - 0x64, 0x4e, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x72, 0x62, 0x5c, 0xff, - 0x6f, 0x6c, 0x6c, 0xff, 0x78, 0x66, 0x64, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x81, 0x72, 0x74, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x7f, 0x6a, 0x64, 0xff, - 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x69, 0x4e, 0x4c, 0xff, - 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x61, 0x48, 0x44, 0xff, 0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44, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x81, 0x72, 0x74, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0xad, 0x9e, 0x9e, 0xff, + 0xa6, 0x95, 0x94, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x9c, 0x80, 0x7c, 0xff, + 0x84, 0x79, 0x7c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x8c, 0x81, 0x84, 0xff, + 0x96, 0x85, 0x84, 0xff, 0x96, 0x85, 0x84, 0xff, 0x78, 0x77, 0x74, 0xff, + 0x96, 0x85, 0x84, 0xff, 0xc2, 0xbe, 0xbc, 0xff, 0xb4, 0xb2, 0xb4, 0xff, + 0xac, 0xa9, 0xac, 0xff, 0x9a, 0x94, 0x94, 0xff, 0x94, 0x8c, 0x8c, 0xff, + 0xa4, 0x9e, 0xa4, 0xff, 0xc5, 0xb7, 0xb4, 0xff, 0xb4, 0xaa, 0xac, 0xff, + 0xc4, 0xba, 0xbc, 0xff, 0xb4, 0xaa, 0xac, 0xff, 0xba, 0xb6, 0xb4, 0xff, + 0xa3, 0xa3, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xb4, 0xaa, 0xac, 0xff, + 0xc2, 0xbe, 0xbc, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xcf, 0xc6, 0xcc, 0xff, + 0xcc, 0xcc, 0xcc, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, + 0xbc, 0xb1, 0xb4, 0xff, 0xbc, 0xb1, 0xb4, 0xff, 0xd4, 0xc6, 0xc4, 0xff, + 0xc4, 0xc3, 0xc4, 0xff, 0xcc, 0xc2, 0xbc, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0x9c, 0x88, 0x7c, 0xff, 0xe6, 0xd6, 0xcc, 0xff, 0xfc, 0xf2, 0xe4, 0xff, + 0xfb, 0xf9, 0xec, 0xff, 0xfc, 0xf7, 0xdc, 0xff, 0xfc, 0xf9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a3, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, + 0xb1, 0xaa, 0xa4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xb3, 0xae, 0xac, 0xff, + 0xa1, 0x99, 0x9c, 0xff, 0xa1, 0x9e, 0x9c, 0xff, 0x83, 0x82, 0x84, 0xff, + 0x78, 0x77, 0x74, 0xff, 0xa6, 0x95, 0x94, 0xff, 0x6f, 0x6c, 0x6c, 0xff, + 0x58, 0x49, 0x4c, 0xff, 0x64, 0x4e, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x72, 0x62, 0x5c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x78, 0x66, 0x64, 0xff, + 0x6f, 0x6c, 0x6c, 0xff, 0x81, 0x72, 0x74, 0xff, 0x8f, 0x7f, 0x7c, 0xff, + 0x7f, 0x6a, 0x64, 0xff, 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x7f, 0x72, 0x6c, 0xff, 0x9d, 0x8d, 0x8c, 0xff, + 0xad, 0x9a, 0x9c, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0x84, 0x79, 0x7c, 0xff, + 0x8f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, 0x99, 0x9c, 0xff, - 0xa1, 0x9e, 0x9c, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, - 0xb3, 0xae, 0xac, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xb3, 0xae, 0xac, 0xff, - 0xa3, 0xa3, 0xa4, 0xff, 0x9c, 0x9a, 0x94, 0xff, 0xbc, 0xb0, 0xac, 0xff, - 0x81, 0x7e, 0x7c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x69, 0x55, 0x54, 0xff, 0x8e, 0x79, 0x74, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x84, 0x79, 0x7c, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xd7, 0xcc, 0xc4, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x81, 0x72, 0x74, 0xff, - 0x8e, 0x7a, 0x7c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x5c, 0x42, 0x44, 0xff, - 0x69, 0x4e, 0x4c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x44, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xe4, 0xe2, 0xd8, 0xff, + 0xd6, 0xd2, 0xd4, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0xa1, 0x9e, 0x9c, 0xff, + 0xa3, 0xa3, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xb3, 0xae, 0xac, 0xff, + 0xba, 0xb6, 0xb4, 0xff, 0xb3, 0xae, 0xac, 0xff, 0xa3, 0xa3, 0xa4, 0xff, + 0x9c, 0x9a, 0x94, 0xff, 0xbc, 0xb0, 0xac, 0xff, 0x81, 0x7e, 0x7c, 0xff, + 0x7e, 0x6d, 0x6c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x8e, 0x79, 0x74, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x84, 0x79, 0x7c, 0xff, + 0x9a, 0x94, 0x94, 0xff, 0xd7, 0xcc, 0xc4, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x7e, 0x6d, 0x6c, 0xff, 0x81, 0x72, 0x74, 0xff, 0x8e, 0x7a, 0x7c, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x5c, 0x42, 0x44, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x3e, 0x34, 0xff, - 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x72, 0x62, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x8e, 0x7a, 0x7c, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x94, 0x8c, 0x8c, 0xff, - 0x84, 0x79, 0x7c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x84, 0x79, 0x7c, 0xff, - 0x96, 0x85, 0x84, 0xff, 0x9a, 0x94, 0x94, 0x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0xff, 0xfa, 0xfe, 0xe4, 0xff, - 0xf4, 0xf7, 0xdc, 0xff, 0xfc, 0xf9, 0xe4, 0xff, 0xf4, 0xf7, 0xdc, 0xff, - 0xfc, 0xf9, 0xe4, 0xff, 0xfc, 0xf7, 0xdc, 0xff, 0xf4, 0xf7, 0xdc, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x3e, 0x34, 0xff, 0x5c, 0x42, 0x44, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x72, 0x62, 0x5c, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x8e, 0x7a, 0x7c, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x7e, 0x6d, 0x6c, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0x84, 0x79, 0x7c, 0xff, + 0x6f, 0x6c, 0x6c, 0xff, 0x84, 0x79, 0x7c, 0xff, 0x96, 0x85, 0x84, 0xff, + 0x9a, 0x94, 0x94, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xb4, 0xb2, 0xb4, 0xff, + 0xba, 0xb6, 0xb4, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0x9a, 0x94, 0x94, 0xff, + 0x9a, 0x94, 0x94, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xb1, 0xaa, 0xa4, 0xff, + 0xbc, 0xb9, 0xbc, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0xb4, 0xaa, 0xac, 0xff, + 0xb3, 0xae, 0xac, 0xff, 0xc2, 0xbe, 0xbc, 0xff, 0xbc, 0xb9, 0xbc, 0xff, + 0xb3, 0xae, 0xac, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xc4, 0xbe, 0xc4, 0xff, + 0xcc, 0xc5, 0xc4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0x9a, 0x94, 0x94, 0xff, + 0xc4, 0xba, 0xbc, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xc4, 0xbe,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c, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xcc, 0xcc, 0xcc, 0xff, 0xd7, 0xd6, 0xd4, 0xff, 0xba, 0xb6, 0xb4, 0xff, - 0xac, 0xa9, 0xac, 0xff, 0xb3, 0xae, 0xac, 0xff, 0xb3, 0xae, 0xac, 0xff, - 0xa1, 0x9e, 0x9c, 0xff, 0x94, 0x8e, 0x94, 0xff, 0xa3, 0xa3, 0xa4, 0xff, - 0xa3, 0xa3, 0xa4, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0xa3, 0xa3, 0xa4, 0xff, - 0xa8, 0x9b, 0x94, 0xff, 0x89, 0x86, 0x84, 0xff, 0x72, 0x5b, 0x54, 0xff, - 0x69, 0x55, 0x54, 0xff, 0x81, 0x72, 0x74, 0xff, 0x70, 0x5e, 0x5c, 0xff, - 0x8f, 0x7f, 0x7c, 0xff, 0x78, 0x66, 0x64, 0xff, 0x9a, 0x94, 0x94, 0xff, - 0x6b, 0x56, 0x5c, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0xa4, 0x9e, 0xa4, 0xff, - 0xbd, 0xa6, 0xa4, 0xff, 0x84, 0x77, 0x74, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x61, 0x48, 0x44, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x74, 0x4e, 0x4c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x6a, 0x53, 0x4c, 0xff, - 0x78, 0x66, 0x64, 0xff, 0x96, 0x85, 0x84, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0x94, 0x8c, 0x8c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x78, 0x77, 0x74, 0xff, - 0x96, 0x85, 0x84, 0xff, 0x84, 0x79, 0x7c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0xa6, 0x95, 0x94, 0xff, - 0xba, 0xb6, 0xb4, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xba, 0xb6, 0xb4, 0xff, - 0xae, 0xa4, 0xa4, 0xff, 0x83, 0x82, 0x84, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0xa3, 0xa3, 0xa4, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0xb4, 0xb2, 0xb4, 0xff, - 0xb3, 0xae, 0xac, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, - 0xbc, 0xb9, 0xbc, 0xff, 0xc2, 0xbe, 0xbc, 0xff, 0xbc, 0xb9, 0xbc, 0xff, - 0xc2, 0xbe, 0xbc, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xcc, 0xc5, 0xc4, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xc4, 0xc3, 0xc4, 0xff, - 0xf8, 0xea, 0xec, 0xff, 0xec, 0xe2, 0xe4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, - 0xcf, 0xc6, 0xcc, 0xff, 0xc5, 0xb7, 0xb4, 0xff, 0xbc, 0xb1, 0xb4, 0xff, - 0x90, 0x7f, 0x74, 0xff, 0x9c, 0x93, 0x8c, 0xff, 0xfb, 0xf9, 0xec, 0xff, - 0xfc, 0xf2, 0xe4, 0xff, 0xfc, 0xf9, 0xe4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dc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xd7, 0xd6, 0xd4, 0xff, + 0xba, 0xb6, 0xb4, 0xff, 0xac, 0xa9, 0xac, 0xff, 0xb3, 0xae, 0xac, 0xff, + 0xb3, 0xae, 0xac, 0xff, 0xa1, 0x9e, 0x9c, 0xff, 0x94, 0x8e, 0x94, 0xff, + 0xa3, 0xa3, 0xa4, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0xa3, 0xa3, 0xa4, 0xff, + 0xa3, 0xa3, 0xa4, 0xff, 0xa8, 0x9b, 0x94, 0xff, 0x89, 0x86, 0x84, 0xff, + 0x72, 0x5b, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x81, 0x72, 0x74, 0xff, + 0x70, 0x5e, 0x5c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x78, 0x66, 0x64, 0xff, + 0x9a, 0x94, 0x94, 0xff, 0x6b, 0x56, 0x5c, 0xff, 0x9d, 0x8d, 0x8c, 0xff, + 0xa4, 0x9e, 0xa4, 0xff, 0xbd, 0xa6, 0xa4, 0xff, 0x84, 0x77, 0x74, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x74, 0x4e, 0x4c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x6a, 0x53, 0x4c, 0xff, 0x78, 0x66, 0x64, 0xff, 0x96, 0x85, 0x84, 0xff, + 0xae, 0xa4, 0xa4, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, + 0x78, 0x77, 0x74, 0xff, 0x96, 0x85, 0x84, 0xff, 0x84, 0x79, 0x7c, 0xff, + 0x8f, 0x7f, 0x7c, 0xff, 0x9a, 0x94, 0x94, 0xff, 0x9d, 0x8d, 0x8c, 0xff, + 0xa6, 0x95, 0x94, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xba, 0xb6, 0xb4, 0xff, + 0xba, 0xb6, 0xb4, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0x83, 0x82, 0x84, 0xff, + 0xae, 0xa4, 0xa4, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0xb4, 0xb2, 0xb4, 0xff, + 0xb4, 0xb2, 0xb4, 0xff, 0xb3, 0xae, 0xac, 0xff, 0xbc, 0xb9, 0xbc, 0xff, + 0xcc, 0xcc, 0xcc, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xc2, 0xbe, 0xbc, 0xff, + 0xbc, 0xb9, 0xbc, 0xff, 0xc2, 0xbe, 0xbc, 0xff, 0xbc, 0xb9, 0xbc, 0xff, + 0xcc, 0xc5, 0xc4, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xcc, 0xcc, 0xcc, 0xff, + 0xc4, 0xc3, 0xc4, 0xff, 0xf8, 0xea, 0xec, 0xff, 0xec, 0xe2, 0xe4, 0xff, + 0xc4, 0xc3, 0xc4, 0xff, 0xcf, 0xc6, 0xcc, 0xff, 0xc5, 0xb7, 0xb4, 0xff, + 0xbc, 0xb1, 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d4, 0xff, 0xcc, 0xc5, 0xc4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xd6, 0xd2, 0xd4, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xc2, 0xc2, 0xbc, 0xff, 0xb3, 0xae, 0xac, 0xff, 0x9c, 0x9a, 0x94, 0xff, @@ -2646,93 +2626,92 @@ static const uint8_t kImgPeakData[] = { 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0xc4, 0xbe, 0xc4, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, - 0xc2, 0xbe, 0xbc, 0xff, 0xac, 0xa9, 0xac, 0xff, 0xb4, 0xb2, 0xb4, 0xff, - 0xcc, 0xcc, 0xcc, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xb4, 0xb2, 0xb4, 0xff, - 0xac, 0xa9, 0xac, 0xff, 0xb3, 0xae, 0xac, 0xff, 0xa1, 0xa2, 0x9c, 0xff, - 0xa1, 0x99, 0x9c, 0xff, 0xad, 0x9e, 0x9e, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x78, 0x66, 0x64, 0xff, - 0x8c, 0x81, 0x84, 0xff, 0x6b, 0x56, 0x5c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x81, 0x72, 0x74, 0xff, - 0x9c, 0x93, 0x8c, 0xff, 0xc4, 0xb2, 0xac, 0xff, 0xa6, 0x95, 0x94, 0xff, - 0x58, 0x49, 0x4c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x69, 0x4e, 0x4c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x6c, 0x4a, 0x44, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x6c, 0x4a, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x72, 0x62, 0x5c, 0xff, 0x84, 0x77, 0x74, 0xff, 0x81, 0x7e, 0x7c, 0xff, - 0x8f, 0x7f, 0x7c, 0xff, 0x96, 0x85, 0x84, 0xff, 0x8c, 0x81, 0x84, 0xff, - 0x89, 0x86, 0x84, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0xa1, 0x99, 0x9c, 0xff, - 0xae, 0xa4, 0xa4, 0xff, 0xb0, 0xa3, 0x9c, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0xb3, 0xae, 0xac, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xba, 0xb6, 0xb4, 0xff, - 0xbc, 0xb0, 0xac, 0xff, 0xbc, 0xb1, 0xb4, 0xff, 0x89, 0x86, 0x84, 0xff, - 0xb3, 0xae, 0xac, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xd5, 0xcd, 0xcc, 0xff, - 0xc2, 0xbe, 0xbc, 0xff, 0xb4, 0xaa, 0xac, 0xff, 0xbc, 0xb9, 0xbc, 0xff, - 0xd5, 0xcd, 0xcc, 0xff, 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x44, 0xff, 0x6c, 0x4a, 0x44, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xc4, 0xbe, 0xc4, 0xff, + 0xba, 0xb6, 0xb4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xc2, 0xbe, 0xbc, 0xff, + 0xac, 0xa9, 0xac, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, + 0xc4, 0xc3, 0xc4, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0xac, 0xa9, 0xac, 0xff, + 0xb3, 0xae, 0xac, 0xff, 0xa1, 0xa2, 0x9c, 0xff, 0xa1, 0x99, 0x9c, 0xff, + 0xad, 0x9e, 0x9e, 0xff, 0x61, 0x48, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x78, 0x66, 0x64, 0xff, 0x8c, 0x81, 0x84, 0xff, + 0x6b, 0x56, 0x5c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x70, 0x5e, 0x5c, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x81, 0x72, 0x74, 0xff, 0x9c, 0x93, 0x8c, 0xff, + 0xc4, 0xb2, 0xac, 0xff, 0xa6, 0x95, 0x94, 0xff, 0x58, 0x49, 0x4c, 0xff, + 0x6c, 0x4a, 0x44, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x6c, 0x4a, 0x44, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0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5, 0xcd, 0xcc, 0xff, 0xfc, 0xf9, 0xe4, 0xff, 0xfc, 0xf9, 0xe4, 0xff, - 0xfa, 0xfe, 0xe4, 0xff, 0xfa, 0xfe, 0xdc, 0xff, 0xfa, 0xfe, 0xe4, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x72, 0x62, 0x5c, 0xff, + 0x84, 0x77, 0x74, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, + 0x96, 0x85, 0x84, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x89, 0x86, 0x84, 0xff, + 0x9d, 0x8d, 0x8c, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0xb0, 0xa3, 0x9c, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xb3, 0xae, 0xac, 0xff, + 0xbc, 0xb9, 0xbc, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xbc, 0xb0, 0xac, 0xff, + 0xbc, 0xb1, 0xb4, 0xff, 0x89, 0x86, 0x84, 0xff, 0xb3, 0xae, 0xac, 0xff, + 0xbc, 0xb9, 0xbc, 0xff, 0xd5, 0xcd, 0xcc, 0xff, 0xc2, 0xbe, 0xbc, 0xff, + 0xb4, 0xaa, 0xac, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xd5, 0xcd, 0xcc, 0xff, + 0xc4, 0xc3, 0xc4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xba, 0xb6, 0xb4, 0xff, + 0xc4, 0xba, 0xbc, 0xff, 0xc4, 0xba, 0xbc, 0xff, 0xb4, 0xb2, 0xb4, 0xff, + 0xc2, 0xbe, 0xbc, 0xff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xc4, 0xc3, 0xc4, 0xff, 0xc2, 0xbe, 0xbc, 0xff, 0xba, 0xb6, 0xb4, 0xff, + 0xb4, 0xb2, 0xb4, 0xff, 0xbc, 0xb0, 0xac, 0xff, 0xa6, 0x95, 0x94, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x70, 0x5e, 0x5c, 0xff, + 0x75, 0x62, 0x64, 0xff, 0x96, 0x85, 0x84, 0xff, 0x7e, 0x6d, 0x6c, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x78, 0x66, 0x64, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0xc4, 0xba, 0xbc, 0xff, + 0x80, 0x67, 0x5c, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x6c, 0x4a, 0x44, 0xff, + 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x6c, 0x4a, 0x44, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x58, 0x49, 0x4c, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, + 0x8f, 0x7f, 0x7c, 0xff, 0x81, 0x72, 0x74, 0xff, 0x89, 0x86, 0x84, 0xff, + 0x96, 0x85, 0x84, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x94, 0x8c, 0x8c, 0xff, + 0xa6, 0x95, 0x94, 0xff, 0x9a, 0x94, 0x94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xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0x94, 0x8e, 0x94, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xac, 0xa9, 0xac, 0xff, - 0xcc, 0xcc, 0xcc, 0xff, 0xc2, 0xbe, 0xbc, 0xff, 0xc4, 0xc3, 0xc4, 0xff, - 0xbc, 0xb9, 0xbc, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xc8, 0xca, 0xc4, 0xff, - 0xc2, 0xc2, 0xbc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xb3, 0xae, 0xac, 0xff, - 0xb4, 0xaa, 0xac, 0xff, 0xad, 0x9e, 0x9e, 0xff, 0x64, 0x4e, 0x54, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x81, 0x72, 0x74, 0xff, - 0x6b, 0x56, 0x5c, 0xff, 0x8e, 0x7a, 0x7c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x8f, 0x7f, 0x7c, 0xff, 0x8c, 0x81, 0x84, 0xff, 0xa8, 0x9b, 0x94, 0xff, - 0xbc, 0xaa, 0xac, 0xff, 0xad, 0x9a, 0x9c, 0xff, 0x69, 0x4e, 0x4c, 0xff, - 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, - 0x69, 0x4e, 0x44, 0xff, 0x69, 0x4e, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x5c, 0x42, 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cc, 0xcc, 0xcc, 0xff, 0xd7, 0xd6, 0xd4, 0xff, - 0xb4, 0xb2, 0xb4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xa1, 0x9e, 0x9c, 0xff, - 0x88, 0x8a, 0x84, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0xa3, 0xa3, 0xa4, 0xff, - 0xa3, 0xa3, 0xa4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xb4, 0xb2, 0xb4, 0xff, - 0xbc, 0xb1, 0xb4, 0xff, 0xa4, 0x9e, 0xa4, 0xff, 0x58, 0x49, 0x4c, 0xff, - 0x58, 0x49, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x75, 0x56, 0x54, 0xff, - 0x58, 0x49, 0x4c, 0xff, 0x78, 0x66, 0x64, 0xff, 0xa1, 0x99, 0x9c, 0xff, - 0x75, 0x62, 0x64, 0xff, 0xa1, 0x9e, 0x9c, 0xff, 0x81, 0x72, 0x74, 0xff, - 0x6c, 0x66, 0x6c, 0xff, 0x83, 0x82, 0x84, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0xc6, 0xb1, 0xb4, 0xff, 0xcf, 0xc6, 0xcc, 0xff, 0x96, 0x86, 0x8c, 0xff, - 0x64, 0x4e, 0x54, 0xff, 0x75, 0x56, 0x54, 0xff, 0x69, 0x4e, 0x44, 0xff, - 0x74, 0x5b, 0x4c, 0xff, 0x74, 0x4e, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0x94, 0x8e, 0x94, 0xff, + 0xc4, 0xc3, 0xc4, 0xff, 0xac, 0xa9, 0xac, 0xff, 0xcc, 0xcc, 0xcc, 0xff, + 0xc2, 0xbe, 0xbc, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, + 0xbc, 0xb9, 0xbc, 0xff, 0xc8, 0xca, 0xc4, 0xff, 0xc2, 0xc2, 0xbc, 0xff, + 0xcc, 0xcc, 0xcc, 0xff, 0xb3, 0xae, 0xac, 0xff, 0xb4, 0xaa, 0xac, 0xff, + 0xad, 0x9e, 0x9e, 0xff, 0x64, 0x4e, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x81, 0x72, 0x74, 0xff, 0x6b, 0x56, 0x5c, 0xff, + 0x8e, 0x7a, 0x7c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x8c, 0x81, 0x84, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, + 0x8c, 0x81, 0x84, 0xff, 0xa8, 0x9b, 0x94, 0xff, 0xbc, 0xaa, 0xac, 0xff, + 0xad, 0x9a, 0x9c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x6a, 0x53, 0x4c, 0xff, 0x69, 0x4e, 0x44, 0xff, + 0x69, 0x4e, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x72, 0x62, 0x5c, 0xff, 0x81, 0x7e, 0x7c, 0xff, - 0x84, 0x77, 0x74, 0xff, 0x81, 0x72, 0x74, 0xff, 0x96, 0x85, 0x84, 0xff, - 0x94, 0x8c, 0x8c, 0xff, 0xa6, 0x95, 0x94, 0xff, 0x94, 0x8c, 0x8c, 0xff, - 0x8e, 0x7a, 0x7c,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 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0x78, 0x77, 0x74, 0xff, 0xcc, 0xcc, 0xcc, 0xff, + 0xd7, 0xd6, 0xd4, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, + 0xa1, 0x9e, 0x9c, 0xff, 0x88, 0x8a, 0x84, 0xff, 0xb4, 0xb2, 0xb4, 0xff, + 0xa3, 0xa3, 0xa4, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, + 0xb4, 0xb2, 0xb4, 0xff, 0xbc, 0xb1, 0xb4, 0xff, 0xa4, 0x9e, 0xa4, 0xff, + 0x58, 0x49, 0x4c, 0xff, 0x58, 0x49, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x75, 0x56, 0x54, 0xff, 0x58, 0x49, 0x4c, 0xff, 0x78, 0x66, 0x64, 0xff, + 0xa1, 0x99, 0x9c, 0xff, 0x75, 0x62, 0x64, 0xff, 0xa1, 0x9e, 0x9c, 0xff, + 0x81, 0x72, 0x74, 0xff, 0x6c, 0x66, 0x6c, 0xff, 0x83, 0x82, 0x84, 0xff, + 0xae, 0xa4, 0xa4, 0xff, 0xc6, 0xb1, 0xb4, 0xff, 0xcf, 0xc6, 0xcc, 0xff, + 0x96, 0x86, 0x8c, 0xff, 0x64, 0x4e, 0x54, 0xff, 0x75, 0x56, 0x54, 0xff, + 0x69, 0x4e, 0x44, 0xff, 0x74, 0x5b, 0x4c, 0xff, 0x74, 0x4e, 0x44, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x72, 0x62, 0x5c, 0xff, + 0x81, 0x7e, 0x7c, 0xff, 0x84, 0x77, 0x74, 0xff, 0x81, 0x72, 0x74, 0xff, + 0x96, 0x85, 0x84, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0xa6, 0x95, 0x94, 0xff, + 0x94, 0x8c, 0x8c, 0xff, 0x8e, 0x7a, 0x7c, 0xff, 0x9a, 0x94, 0x94, 0xff, + 0x92, 0x92, 0x8c, 0xff, 0xa4, 0x9e, 0xa4, 0xff, 0x9a, 0x94, 0x94, 0xff, + 0x94, 0x8c, 0x8c, 0xff, 0x9a, 0x94, 0x94, 0xff, 0x94, 0x8c, 0x8c, 0xff, + 0xc6, 0xb1, 0xb4, 0xff, 0xc4, 0xba, 0xbc, 0xff, 0x9a, 0x94, 0x94, 0xff, + 0xb4, 0xb2, 0xb4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, + 0xc2, 0xc2, 0xbc, 0xff, 0xcc, 0xc5, 0xc4, 0xff, 0xb3, 0xae, 0xac, 0xff, + 0xa3, 0xa3, 0xa4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xcc, 0xc5, 0xc4, 0xff, + 0xc2, 0xbe, 0xbc, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xc2, 0xc2, 0xbc, 0xff, + 0xcf, 0xc6, 0xcc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xc5, 0xc4, 0xff, + 0xec, 0xe2, 0xe4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xd6, 0xd2, 0xd4, 0xff, + 0xba, 0xb6, 0xb4, 0xff, 0xc4, 0xbe, 0xc4, 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e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x64, 0x4e, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x6c, 0x61, 0x64, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x6f, 0x6c, 0x6c, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0xc4, 0xba, 0xbc, 0xff, - 0xae, 0xa4, 0xa4, 0xff, 0xcc, 0xbe, 0xc4, 0xff, 0xc4, 0xba, 0xbc, 0xff, - 0x8e, 0x72, 0x74, 0xff, 0x69, 0x55, 0x54, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x74, 0x55, 0x4c, 0xff, 0x74, 0x55, 0x4c, 0xff, 0x6c, 0x4a, 0x44, 0xff, - 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x78, 0x77, 0x74, 0xff, - 0x84, 0x77, 0x74, 0xff, 0x81, 0x72, 0x74, 0xff, 0x84, 0x79, 0x7c, 0xff, - 0xa8, 0x9b, 0x94, 0xff, 0x89, 0x86, 0x84, 0xff, 0x94, 0x8c, 0x8c, 0xff, - 0x9d, 0x8d, 0x8c, 0xff, 0xa6, 0x95, 0x94, 0xff, 0x81, 0x72, 0x74, 0xff, - 0x9d, 0x8d, 0x8c, 0xff, 0xae, 0xa4, 0xa4, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0xa1, 0x99, 0x9c, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0x92, 0x92, 0x8c, 0xff, - 0xbc, 0xb9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 0x8c, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0xa4, 0x9e, 0xa4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0x81, 0x72, 0x74, 0xff, 0x75, 0x62, 0x64, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x74, 0x55, 0x4c, 0xff, - 0x69, 0x4e, 0x4c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x3e, 0x34, 0xff, - 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x44, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x54, 0x46, 0x3c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, - 0x84, 0x77, 0x74, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x9d, 0x8d, 0x8c, 0xff, 0x9a, 0x94, 0x94, 0xff, 0x89, 0x86, 0x84, 0xff, - 0xa1, 0x9e, 0x9c, 0xff, 0x9a, 0x94, 0x94, 0xff, 0x9d, 0x8d, 0x8c, 0xff, - 0x81, 0x72, 0x74, 0xff, 0x94, 0x8e, 0x94, 0xff, 0xbc, 0xb1, 0xb4, 0xff, - 0xbc, 0xb0, 0xac, 0xff, 0xad, 0x9a, 0x9c, 0xff, 0x94, 0x8c, 0x8c, 0xff, - 0x94, 0x8e, 0x94, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, - 0xc4, 0xc3, 0xc4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xc8, 0xca, 0xc4, 0xff, - 0xc4, 0xc3, 0xc4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xcc, 0xcc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ae, 0xa4, 0xa4, 0xff, + 0xa1, 0x99, 0x9c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x49, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x64, 0x4e, 0x54, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, + 0xa1, 0x99, 0x9c, 0xff, 0xc4, 0xba, 0xbc, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0xcc, 0xbe, 0xc4, 0xff, 0xc4, 0xba, 0xbc, 0xff, 0x8e, 0x72, 0x74, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x61, 0x48, 0x44, 0xff, 0x74, 0x55, 0x4c, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x6c, 0x4a, 0x44, 0xff, + 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x78, 0x77, 0x74, 0xff, 0x84, 0x77, 0x74, 0xff, + 0x81, 0x72, 0x74, 0xff, 0x84, 0x79, 0x7c, 0xff, 0xa8, 0x9b, 0x94, 0xff, + 0x89, 0x86, 0x84, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0x9d, 0x8d, 0x8c, 0xff, + 0xa6, 0x95, 0x94, 0xff, 0x81, 0x72, 0x74, 0xff, 0x9d, 0x8d, 0x8c, 0xff, + 0xae, 0xa4, 0xa4, 0xff, 0xae, 0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, 0x4c, 0x53, 0x54, 0xff, 0x71, 0x72, 0x6c, 0xff, + 0xbc, 0xb9, 0xbc, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0x92, 0x92, 0x8c, 0xff, + 0x71, 0x72, 0x74, 0xff, 0x83, 0x82, 0x84, 0xff, 0x92, 0x92, 0x8c, 0xff, + 0x83, 0x82, 0x84, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0xb4, 0xb2, 0xb4, 0xff, + 0x83, 0x82, 0x84, 0xff, 0xa1, 0xa2, 0x9c, 0xff, 0x8b, 0x8b, 0x8c, 0xff, + 0xa6, 0x95, 0x94, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x75, 0x62, 0x64, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x6c, 0x61, 0x64, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x8b, 0x8b, 0x8c, 0xff, + 0xae, 0xa4, 0xa4, 0xff, 0xa4, 0x9e, 0xa4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, + 0xae, 0xa4, 0xa4, 0xff, 0x81, 0x72, 0x74, 0xff, 0x75, 0x62, 0x64, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x74, 0x55, 0x4c, 0xff, 0x69, 0x4e, 0x4c, 0xff, 0x6c, 0x4a, 0x44, 0xff, + 0x5c, 0x3e, 0x34, 0xff, 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x54, 0x46, 0x3c, 0xff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, 0xff, @@ -3033,93 +3010,92 @@ static const uint8_t kImgPeakData[] = { 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x63, 0x6a, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, - 0xac, 0xa9, 0xac, 0xff, 0x88, 0x8a, 0x84, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x83, 0x82, 0x84, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x63, 0x6a, 0x64, 0xff, - 0x71, 0x72, 0x74, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0xa1, 0x9e, 0x9c, 0xff, - 0x8b, 0x8b, 0x8c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x89, 0x86, 0x84, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x71, 0x72, 0x74, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0xa1, 0x9e, 0x9c, 0xff, - 0x8b, 0x8b, 0x8c, 0xff, 0x9c, 0x9a, 0x94, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x6c, 0x61, 0x64, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x81, 0x7e, 0x7c, 0xff, - 0x71, 0x6a, 0x64, 0xff, 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x6a, 0x53, 0x4c, 0xff, 0x75, 0x56, 0x54, 0xff, 0x6c, 0x4a, 0x44, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x4e, 0x42, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, - 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x90, 0x7f, 0x74, 0xff, 0x84, 0x79, 0x7c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x84, 0x77, 0x74, 0xff, 0x96, 0x85, 0x84, 0xff, 0x8c, 0x81, 0x84, 0xff, - 0x96, 0x85, 0x84, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0x94, 0x8c, 0x8c, 0xff, - 0xa1, 0x9e, 0x9c, 0xff, 0xa4, 0x9e, 0xa4, 0xff, 0x8c, 0x81, 0x84, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0xbc, 0xb1, 0xb4, 0xff, 0xa6, 0x95, 0x94, 0xff, - 0x94, 0x8c, 0x8c, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0xc2, 0xbe, 0xbc, 0xff, - 0xcc, 0xc5, 0xc4, 0xff, 0xd7, 0xd6, 0xd4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, - 0xcf, 0xc6, 0xcc, 0xff, 0xd7, 0xd6, 0xd4, 0xff, 0xc8, 0xca, 0xc4, 0xff, - 0xe4, 0xe1, 0xe4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, - 0xcc, 0xc5, 0xc4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, - 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xc5,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, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x63, 0x6a, 0x64, 0xff, - 0x64, 0x6a, 0x6c, 0xff, 0x63, 0x6a, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x63, 0x6a, 0x64, 0xff, 0x63, 0x6a, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x64, 0x6a, 0x6c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x8b, 0x8b, 0x8c, 0xff, - 0x71, 0x72, 0x74, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x81, 0x7e, 0x7c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x71, 0x72, 0x74, 0xff, 0x71, 0x6a, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0x7b, 0x7a, 0x7c, 0xff, 0x78, 0x77, 0x74, 0xff, - 0x78, 0x77, 0x74, 0xff, 0x7b, 0x7a, 0x7c, 0xff, 0x96, 0x86, 0x8c, 0xff, - 0x83, 0x82, 0x84, 0xff, 0x75, 0x62, 0x64, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x69, 0x4e, 0x4c, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x60, 0x46, 0x3c, 0xff, - 0x61, 0x48, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x44, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x7e, 0x6d, 0x6c, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x84, 0x79, 0x7c, 0xff, 0x96, 0x85, 0x84, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x81, 0x72, 0x74, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x94, 0x8c, 0x8c, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0xad, 0x9e, 0x9e, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0x84, 0x79, 0x7c, 0xff, 0x96, 0x85, 0x84, 0xff, 0x9e, 0x8e, 0x94, 0xff, - 0x8c, 0x81, 0x84, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xa3, 0xa3, 0xa4, 0xff, - 0xba, 0xb6, 0xb4, 0xff, 0xcc, 0xc5, 0xc4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, - 0xcc, 0xcc, 0xcc, 0xff, 0xd6, 0xd2, 0xd4, 0xff, 0xd7, 0xd6, 0xd4, 0xff, - 0xd6, 0xd2, 0xd4, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0xd9, 0xd4, 0xcc, 0xff, + 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x63, 0x6a, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0xac, 0xa9, 0xac, 0xff, + 0x88, 0x8a, 0x84, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x83, 0x82, 0x84, 0xff, + 0x64, 0x6a, 0x6c, 0xff, 0x63, 0x6a, 0x64, 0xff, 0x71, 0x72, 0x74, 0xff, + 0x64, 0x6a, 0x6c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0xa1, 0x9e, 0x9c, 0xff, 0x8b, 0x8b, 0x8c, 0xff, + 0x6f, 0x6c, 0x6c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x89, 0x86, 0x84, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x71, 0x72, 0x74, 0xff, + 0x6f, 0x6c, 0x6c, 0xff, 0xa1, 0x9e, 0x9c, 0xff, 0x8b, 0x8b, 0x8c, 0xff, + 0x9c, 0x9a, 0x94, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x6c, 0x61, 0x64, 0xff, + 0x8c, 0x81, 0x84, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x71, 0x6a, 0x64, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x6a, 0x53, 0x4c, 0xff, + 0x75, 0x56, 0x54, 0xff, 0x6c, 0x4a, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x4e, 0x42, 0x44, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, 0x90, 0x7f, 0x74, 0xff, + 0x84, 0x79, 0x7c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x84, 0x77, 0x74, 0xff, + 0x96, 0x85, 0x84, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x96, 0x85, 0x84, 0xff, + 0xa1, 0x99, 0x9c, 0xff, 0x94, 0x8c, 0x8c, 0xff, 0xa1, 0x9e, 0x9c, 0xff, + 0xa4, 0x9e, 0xa4, 0xff, 0x8c, 0x81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0xf7, 0xdc, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf7, 0xdc, 0xff, + 0xf4, 0xf7, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf7, 0xdc, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x63, 0x6a, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x63, 0x6a, 0x64, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x63, 0x6a, 0x64, 0xff, 0x63, 0x6a, 0x64, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x8b, 0x8b, 0x8c, 0xff, 0x71, 0x72, 0x74, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x6f, 0x6c, 0x6c, 0xff, 0x71, 0x72, 0x74, 0xff, 0x71, 0x6a, 0x64, 0xff, + 0x64, 0x6a, 0x6c, 0xff, 0x9a, 0x94, 0x94, 0xff, 0x7b, 0x7a, 0x7c, 0xff, + 0x78, 0x77, 0x74, 0xff, 0x78, 0x77, 0x74, 0xff, 0x7b, 0x7a, 0x7c, 0xff, + 0x96, 0x86, 0x8c, 0xff, 0x83, 0x82, 0x84, 0xff, 0x75, 0x62, 0x64, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x69, 0x4e, 0x4c, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x60, 0x46, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x81, 0x7e, 0x7c, 0xff, + 0x7e, 0x6d, 0x6c, 0xff, 0x84, 0x79, 0x7c, 0xff, 0x96, 0x85, 0x84, 0xff, + 0x7e, 0x6d, 0x6c, 0xff, 0x81, 0x72, 0x74, 0xff, 0x8c, 0x81, 0x84, 0xff, + 0x94, 0x8c, 0x8c, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xad, 0x9e, 0x9e, 0xff, + 0xae, 0xa4, 0xa4, 0xff, 0x84, 0x79, 0x7c, 0xff, 0x96, 0x85, 0x84, 0xff, + 0x9e, 0x8e, 0x94, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x9a, 0x94, 0x94, 0xff, + 0xa3, 0xa3, 0xa4, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xcc, 0xc5, 0xc4, 0xff, + 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xd6, 0xd2, 0xd4, 0xff, + 0xd7, 0xd6, 0xd4, 0xff, 0xd6, 0xd2, 0xd4, 0xff, 0xdc, 0xdc, 0xdc, 0xff, + 0xd9, 0xd4, 0xcc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, + 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, +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f2, 0xdc, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf0, 0xd4, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf4, 0xf0, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x88, 0x8a, 0x84, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x4c, 0x52, 0x4c, 0xff, @@ -3162,93 +3138,92 @@ static const uint8_t kImgPeakData[] = { 0xf4, 0xf8, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x64, 0x6a, 0x6c, 0xff, - 0x71, 0x72, 0x74, 0xff, 0x71, 0x72, 0x74, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x8b, 0x8b, 0x8c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x6c, 0x66, 0x6c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x71, 0x72, 0x74, 0xff, - 0x64, 0x6a, 0x6c, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x8c, 0x81, 0x84, 0xff, - 0x6c, 0x61, 0x64, 0xff, 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x69, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, - 0x5d, 0x5a, 0x54, 0xff, 0x61, 0x48, 0x44, 0xff, 0x5c, 0x42, 0x44, 0xff, - 0x5c, 0x42, 0x3c, 0xff, 0x53, 0x41, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x58, 0x49, 0x4c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x96, 0x85, 0x84, 0xff, - 0x8e, 0x7a, 0x7c, 0xff, 0x8c, 0x81, 0x84, 0xff, 0xb1, 0xaa, 0xa4, 0xff, - 0xae, 0xa4, 0xa4, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x70, 0x5e, 0x5c, 0xff, - 0x71, 0x72, 0x74, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x9a, 0x94, 0x94, 0xff, - 0xa6, 0x95, 0x94, 0xff, 0xa6, 0x95, 0x94, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0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, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x8b, 0x8b, 0x8c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x6c, 0x66, 0x6c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x64, 0x6a, 0x6c, 0xff, 0x71, 0x72, 0x74, 0xff, 0x64, 0x6a, 0x6c, 0xff, + 0x64, 0x6a, 0x6c, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x6c, 0x61, 0x64, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x72, 0x5b, 0x54, 0xff, 0x5d, 0x5a, 0x54, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x5c, 0x42, 0x44, 0xff, 0x5c, 0x42, 0x3c, 0xff, + 0x53, 0x41, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x58, 0x49, 0x4c, 0xff, + 0x6f, 0x6c, 0x6c, 0xff, 0x96, 0x85, 0x84, 0xff, 0x8e, 0x7a, 0x7c, 0xff, + 0x8c, 0x81, 0x84, 0xff, 0xb1, 0xaa, 0xa4, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0x8c, 0x81, 0x84, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x71, 0x72, 0x74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x5c, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, + 0x6f, 0x6c, 0x6c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x71, 0x72, 0x6c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x94, 0x8c, 0x8c, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x5d, 0x5a, 0x54, 0xff, + 0x72, 0x62, 0x5c, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x53, 0x41, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, + 0x61, 0x48, 0x44, 0xff, 0x69, 0x55, 0x54, 0xff, 0x6f, 0x6c, 0x6c, 0xff, + 0x8e, 0x7a, 0x7c, 0xff, 0x78, 0x77, 0x74, 0xff, 0x9d, 0x8d, 0x8c, 0xff, + 0xae, 0xa4, 0xa4, 0xff, 0xbc, 0xb1, 0xb4, 0xff, 0xcc, 0xc5, 0xc4, 0xff, + 0x94, 0x8c, 0x8c, 0xff, 0x75, 0x62, 0x64, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x8c, 0x81, 0x84, 0xff, 0x9a, 0x94, 0x94, 0xff, 0x94, 0x8c, 0x8c, 0xff, + 0x9a, 0x94, 0x94, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xba, 0xb6, 0xb4, 0xff, + 0xa1, 0x99, 0x9c, 0xff, 0xbc, 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x82, 0x84, 0xff, 0x81, 0x7e, 0x7c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x64, 0x6a, 0x6c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x6f, 0x6c, 0x6c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x71, 0x72, 0x6c, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x94, 0x8c, 0x8c, 0xff, - 0x81, 0x7e, 0x7c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x5d, 0x5a, 0x54, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x72, 0x62, 0x5c, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x53, 0x41, 0x3c, 0xff, 0x61, 0x48, 0x44, 0xff, 0x61, 0x48, 0x44, 0xff, - 0x69, 0x55, 0x54, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x8e, 0x7a, 0x7c, 0xff, - 0x78, 0x77, 0x74, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0xae, 0xa4, 0xa4, 0xff, - 0xbc, 0xb1, 0xb4, 0xff, 0xcc, 0xc5, 0xc4, 0xff, 0x94, 0x8c, 0x8c, 0xff, - 0x75, 0x62, 0x64, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x8c, 0x81, 0x84, 0xff, - 0x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c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x81, 0x7e, 0x7c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x5d, 0x5a, 0x54, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4e, 0x42, 0x44, 0xff, 0x69, 0x4e, 0x4c, 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5c, 0x5c, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x64, 0x6a, 0x6c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, 0x5d, 0x5a, 0x54, 0xff, - 0x5d, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x6c, 0x61, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x49, 0x4c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x6b, 0x56, 0x5c, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x81, 0x7e, 0x7c, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x81, 0x7e, 0x7c, 0xff, - 0xb1, 0xaa, 0xa4, 0xff, 0xbc, 0xb0, 0xac, 0xff, 0xc4, 0xc3, 0xc4, 0xff, - 0xe4, 0xce, 0xcc, 0xff, 0xd5, 0xcd, 0xcc, 0xff, 0x81, 0x72, 0x74, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0xa1, 0x99, 0x9c, 0xff, - 0xa3, 0xa3, 0xa4, 0xff, 0xa1, 0x99, 0x9c, 0xff, 0xc4, 0xbe, 0xc4, 0xff, - 0xb4, 0xb2, 0xb4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xba, 0xb6, 0xb4, 0xff, - 0xcc, 0xc5, 0xc4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, - 0xd6, 0xd2, 0xd4, 0xff, 0xd6, 0xd2, 0xd4, 0xff, 0xac, 0xa9, 0xac, 0xff, - 0xa3, 0xa3, 0xa4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, - 0xd6, 0xd2, 0xd4, 0xff, 0xd7, 0xd6, 0xd4, 0xff, 0xe4, 0xe1, 0xe4, 0xff, - 0xec, 0xea, 0xec, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xc4, 0xbe, 0xc4, 0xff, - 0xcc, 0xcc, 0xcc, 0xff, 0xbc, 0xb1, 0xb4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, - 0xb4, 0xaa, 0xac, 0xff, 0xbc, 0xaa, 0xac, 0xff, 0xcc, 0xbe, 0xc4, 0xff, - 0xd5, 0xcd, 0xcc, 0xff, 0xd8, 0xdc, 0xd4, 0xff, 0xe8, 0xe7, 0xe4, 0xff, - 0xfb, 0xf9, 0xec, 0xff, 0xfa, 0xfe, 0xe4, 0xff, 0xfa, 0xfe, 0xe4, 0xff, - 0xfb, 0xfe, 0xec, 0xff, 0xfa, 0xfe, 0xe4, 0xff, 0xfa, 0xfe, 0xe4, 0xff, - 0xfa, 0xfe, 0xe4, 0xff, 0xf4, 0xf8, 0xe4, 0xff, 0xfa, 0xfe, 0xe4, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x5a, 0x54, 0xff, + 0x5d, 0x62, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x6f, 0x6c, 0x6c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4e, 0x42, 0x44, 0xff, + 0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 0xf2, 0xdc, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x64, 0x6a, 0x6c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x5d, 0x5a, 0x54, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x6c, 0x61, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x6f, 0x6c, 0x6c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x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x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, @@ -3420,93 +3394,92 @@ static const uint8_t kImgPeakData[] = { 0xf4, 0xf8, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x5d, 0x62, 0x5c, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x6c, 0x61, 0x64, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55,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x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x6c, 0x61, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x6c, 0x61, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x6c, 0x66, 0x6c, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x7b, 0x7a, 0x7c, 0xff, - 0x89, 0x86, 0x84, 0xff, 0x83, 0x82, 0x84, 0xff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xff, 0xf4, 0xf8, 0xe4, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x71, 0x6a, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x63, 0x6a, 0x64, 0xff, 0x78, 0x77, 0x74, 0xff, 0x8b, 0x8b, 0x8c, 0xff, + 0x83, 0x82, 0x84, 0xff, 0x8b, 0x8b, 0x8c, 0xff, 0xcc, 0xc5, 0xc4, 0xff, + 0xd7, 0xd6, 0xd4, 0xff, 0xd6, 0xd2, 0xd4, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0x84, 0x79, 0x7c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x96, 0x85, 0x84, 0xff, + 0x8b, 0x8b, 0x8c, 0xff, 0x8b, 0x8b, 0x8c, 0xff, 0xe4, 0xe1, 0xe4, 0xff, + 0xa1, 0x99, 0x9c, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xc4, 0xc3, 0xc4, 0xff, + 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xcc, 0xc5, 0xc4, 0xff, + 0xd6, 0xd2, 0xd4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xe8, 0xe7, 0xe4, 0xff, + 0xd7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7, 0xdc, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x6c, 0x66, 0x6c, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x6f, 0x6c, 0x6c, 0xff, + 0x7b, 0x7a, 0x7c, 0xff, 0x89, 0x86, 0x84, 0xff, 0x83, 0x82, 0x84, 0xff, + 0x8b, 0x8b, 0x8c, 0xff, 0xc2, 0xbe, 0xbc, 0xff, 0xd6, 0xd2, 0xd4, 0xff, + 0xcc, 0xcc, 0xcc, 0xff, 0xbc, 0xb1, 0xb4, 0xff, 0xae, 0xa4, 0xa4, 0xff, + 0x84, 0x79, 0x7c, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x81, 0x72, 0x74, 0xff, + 0x96, 0x86, 0x8c, 0xff, 0xa1, 0x9e, 0x9c, 0xff, 0x9a, 0x94, 0x94, 0xff, + 0xa1, 0x9e, 0x9c, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0xd6, 0xd2, 0xd4, 0xff, + 0xcc, 0xcc, 0xcc, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xc8, 0xca, 0xc4, 0xff, + 0xe4, 0xe1, 0xe4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xd7, 0xd6, 0xd4, 0xff, + 0xd6, 0xd2, 0xd4, 0xff, 0xd6, 0xd2, 0xd4, 0xff, 0xdc, 0xdc, 0xdc, 0xff, + 0xdc, 0xdc, 0xdc, 0xff, 0xec, 0xea, 0xec, 0xff, 0xec, 0xea, 0xec, 0xff, + 0xd7, 0xd6, 0xd4, 0xff, 0xcc, 0xc5, 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0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf4, 0xf8, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf4, 0xf8, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, @@ -3549,93 +3522,92 @@ static const uint8_t kImgPeakData[] = { 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x5d, 0x62, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x64, 0x6a, 0x6c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x71, 0x72, 0x74, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x7b, 0x7a, 0x7c, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x78, 0x77, 0x74, 0xff, - 0x83, 0x82, 0x84, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0x8b, 0x8b, 0x8c, 0xff, - 0xa3, 0xa3, 0xa4, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x6c, 0x61, 0x64, 0xff, - 0x6f, 0x6c, 0x6c, 0xff, 0xc6, 0xb1, 0xb4, 0xff, 0xb4, 0xb2, 0xb4, 0xff, - 0xa1, 0x9e, 0x9c, 0xff, 0xb3, 0xae, 0xac, 0xff, 0x9a, 0x94, 0x94, 0xff, - 0xba, 0xb6, 0xb4, 0xff, 0xd7, 0xd6, 0xd4, 0xff, 0xdc, 0xdc, 0xdc, 0xff, - 0xdc, 0xdc, 0xdc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xd7, 0xd6, 0xd4, 0xff, - 0xcf, 0xc6, 0xcc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xd6, 0xd2, 0xd4, 0xff, - 0xd6, 0xd2, 0xd4, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0xd6, 0xd2, 0xd4, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x64, 0x6a, 0x6c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, 0x71, 0x72, 0x74, 0xff, + 0x64, 0x6a, 0x6c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x7b, 0x7a, 0x7c, 0xff, + 0x81, 0x7e, 0x7c, 0xff, 0x78, 0x77, 0x74, 0xff, 0x83, 0x82, 0x84, 0xff, + 0xa3, 0xa3, 0xa4, 0xff, 0x8b, 0x8b, 0x8c, 0xff, 0xa3, 0xa3, 0xa4, 0xff, + 0x6c, 0x61, 0x64, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x6f, 0x6c, 0x6c, 0xff, + 0xc6, 0xb1, 0xb4, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0xa1, 0x9e, 0x9c, 0xff, + 0xb3,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, - 0x5f, 0x62, 0x64, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x5d, 0x62, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x64, 0x6a, 0x6c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x63, 0x6a, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, - 0x71, 0x72, 0x74, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x71, 0x72, 0x74, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x7b, 0x7a, 0x7c, 0xff, - 0xc4, 0xc3, 0xc4, 0xff, 0x84, 0x79, 0x7c, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x6b, 0x56, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x8c, 0x86, 0x8c, 0xff, 0xac, 0xa9, 0xac, 0xff, 0x9a, 0x94, 0x94, 0xff, - 0xac, 0xa9, 0xac, 0xff, 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, 0x6c, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x63, 0x6a, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x5d, 0x62, 0x5c, 0xff, 0x71, 0x72, 0x74, 0xff, 0x6f, 0x6c, 0x6c, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x71, 0x72, 0x74, 0xff, 0x81, 0x7e, 0x7c, 0xff, + 0x7b, 0x7a, 0x7c, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0x84, 0x79, 0x7c, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x6b, 0x56, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x6f, 0x6c, 0x6c, 0xff, 0x8c, 0x86, 0x8c, 0xff, 0xac, 0xa9, 0xac, 0xff, + 0x9a, 0x94, 0x94, 0xff, 0xac, 0xa9, 0xac, 0xff, 0xcc, 0xcc, 0xcc, 0xff, + 0xcc, 0xc5, 0xc4, 0xff, 0xe4, 0xe1, 0xe4, 0xff, 0xd7, 0xd6, 0xd4, 0xff, + 0xd7, 0xd6, 0xd4, 0xff, 0xd7, 0xd6, 0xd4, 0xff, 0xd6, 0xd2, 0xd4, 0xff, + 0xdc, 0xdc, 0xdc, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0xdc, 0xdc, 0xdc, 0xff, + 0xe4, 0xe1, 0xe4, 0xff, 0xd7, 0xd6, 0xd4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, + 0xd7, 0xd6, 0xd4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xba, 0xb6, 0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ff, 0xf3, 0xf2, 0xdc, 0xff, - 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, @@ -3678,93 +3650,92 @@ static const uint8_t kImgPeakData[] = { 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x5d, 0x62, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x8b, 0x8b, 0x8c, 0xff, 0xa1, 0x9e, 0x9c, 0xff, 0xbc, 0xb1, 0xb4, 0xff, - 0xb4, 0xb2, 0xb4, 0xff, 0x8b, 0x8b, 0x8c, 0xff, 0x81, 0x7e, 0x7c, 0xff, - 0xa1, 0x9e, 0x9c, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0x64, 0x6a, 0x6c, 0xff, - 0x83, 0x82, 0x84, 0xff, 0x8b, 0x8b, 0x8c, 0xff, 0xa1, 0x99, 0x9c, 0xff, - 0xac, 0xa9, 0xac, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xb4, 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xff, 0xf4, 0xf2, 0xe4, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf8, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x6f, 0x6c, 0x6c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x81, 0x7e, 0x7c, 0xff, - 0xba, 0xb6, 0xb4, 0xff, 0xa4, 0x9e, 0xa4, 0xff, 0x89, 0x86, 0x84, 0xff, - 0xa1, 0x9e, 0x9c, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x88, 0x8a, 0x84, 0xff, 0xcc, 0xc5, 0xc4, 0xff, 0x9a, 0x94, 0x94, 0xff, - 0x89, 0x86, 0x84, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xbc, 0xb9, 0xbc, 0xff, - 0xbc, 0xb9, 0xbc, 0xff, 0x83, 0x82, 0x84, 0xff, 0x94, 0x8e, 0x94, 0xff, - 0xd7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5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c,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2, 0xf0, 0xec, 0xff, 0xd8, 0xdc, 0xd4, 0xff, + 0xd5, 0xcd, 0xcc, 0xff, 0xcc, 0xbd, 0xbc, 0xff, 0xef, 0xe2, 0xdc, 0xff, + 0xc6, 0xb1, 0xb4, 0xff, 0xac, 0x8d, 0x8c, 0xff, 0xac, 0x8d, 0x84, 0xff, + 0xa4, 0x89, 0x7c, 0xff, 0x9c, 0x88, 0x7c, 0xff, 0x9c, 0x8e, 0x7c, 0xff, + 0x9c, 0x8e, 0x7c, 0xff, 0xb1, 0xa3, 0x94, 0xff, 0xb1, 0xa3, 0x94, 0xff, + 0xb4, 0xae, 0x9c, 0xff, 0xd9, 0xcc, 0xbc, 0xff, 0xf2, 0xe9, 0xdc, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf7, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x44, 0x47, 0x44, 0xff, @@ -3807,93 +3778,92 @@ static const uint8_t kImgPeakData[] = { 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf8, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf8, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf8, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x64, 0x6a, 0x6c, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x64, 0x6a, 0x6c, 0xff, - 0x83, 0x82, 0x84, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x6f, 0x6c, 0x6c, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0x83, 0x82, 0x84, 0xff, - 0x8b, 0x8b, 0x8c, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xa1, 0x9e, 0x9c, 0xff, - 0x7b, 0x7a, 0x7c, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x94, 0x8e, 0x94, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, - 0xe8, 0xe7, 0xe4, 0xff, 0xd7, 0xd6, 0xd4, 0xff, 0xdc, 0xd6, 0xdc, 0xff, - 0xb3, 0xae, 0xac, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xba, 0xb6, 0xb4, 0xff, - 0xd9, 0xd4, 0xcc, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0xac, 0xa9, 0xac, 0xff, - 0xa1, 0x9e, 0x9c, 0xff, 0xa1, 0x9e, 0x9c, 0xff, 0xa3, 0xa3, 0xa4, 0xff, - 0xcc, 0xcc, 0xcc, 0xff, 0xf4, 0xea, 0xe4, 0xff, 0xbc, 0xb0, 0xac, 0xff, - 0xbc, 0xaa, 0xac, 0xff, 0xad, 0x9e, 0x9e, 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x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x64, 0x6a, 0x6c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x64, 0x6a, 0x6c, 0xff, + 0x81, 0x7e, 0x7c, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x83, 0x82, 0x84, 0xff, + 0x64, 0x6a, 0x6c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x6f, 0x6c, 0x6c, 0xff, + 0xa3, 0xa3, 0xa4, 0xff, 0x83, 0x82, 0x84, 0xff, 0x8b, 0x8b, 0x8c, 0xff, + 0x9a, 0x94, 0x94, 0xff, 0xa1, 0x9e, 0x9c, 0xff, 0x7b, 0x7a, 0x7c, 0xff, + 0x64, 0x6a, 0x6c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x94, 0x8e, 0x94, 0xff, + 0xba, 0xb6, 0xb4, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xe8, 0xe7, 0xe4, 0xff, + 0xd7, 0xd6, 0xd4, 0xff, 0xdc, 0xd6, 0xdc, 0xff, 0xb3, 0xae, 0xac, 0xff, + 0xcc, 0xcc, 0xcc, 0xff, 0xba, 0xb6, 0xb4, 0xff, 0xd9, 0xd4, 0xcc, 0xff, + 0xb4, 0xb2, 0xb4, 0xff, 0xac, 0xa9, 0xac, 0xff, 0xa1, 0x9e, 0x9c, 0xff, + 0xa1, 0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 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x7b, 0x7a, 0x7c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x71, 0x72, 0x74, 0xff, - 0x88, 0x8a, 0x84, 0xff, 0x89, 0x86, 0x84, 0xff, 0x7b, 0x7a, 0x7c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- 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x5d, 0x62, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x7b, 0x7a, 0x7c, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x81, 0x7e, 0x7c, 0xff, + 0x71, 0x72, 0x74, 0xff, 0x88, 0x8a, 0x84, 0xff, 0x89, 0x86, 0x84, 0xff, + 0x7b, 0x7a, 0x7c, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x78, 0x77, 0x74, 0xff, 0xa3, 0xa3, 0xa4, 0xff, + 0x8b, 0x8b, 0x8c, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0xac,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53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, @@ -3936,93 +3906,92 @@ static const uint8_t kImgPeakData[] = { 0xf4, 0xf8, 0xe4, 0xff, 0xf4, 0xf8, 0xe4, 0xff, 0xf4, 0xf8, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf8, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x50, 0x4e, 0x44, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, 0x63, 0x6a, 0x64, 0xff, - 0x83, 0x82, 0x84, 0xff, 0x63, 0x6a, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0xa1, 0xa2, 0x9c, 0xff, 0xb4, 0xb2, 0xb4, 0xff, - 0xbc, 0xb9, 0xbc, 0xff, 0xc2, 0xc2, 0xbc, 0xff, 0x83, 0x82, 0x84, 0xff, - 0x7b, 0x7a, 0x7c, 0xff, 0xa1, 0x9e, 0x9c, 0xff, 0xc4, 0xc3, 0xc4, 0xff, - 0xdc, 0xd6, 0xdc, 0xff, 0xd4, 0xc6, 0xc4, 0xff, 0xd4, 0xc6, 0xc4, 0xff, - 0xc6, 0xb1, 0xb4, 0xff, 0xe6, 0xd6, 0xd6, 0xff, 0xcc, 0xbe, 0xc4, 0xff, - 0xb4, 0x96, 0x94, 0xff, 0xa4, 0x85, 0x84, 0xff, 0x9c, 0x7a, 0x74, 0xff, - 0x9c, 0x7a, 0x7c, 0xff, 0x9c, 0x80, 0x7c, 0xff, 0x9c, 0x80, 0x7c, 0xff, - 0x9d, 0x8d, 0x8c, 0xff, 0xa6, 0x95, 0x94, 0xff, 0xb0, 0xa3, 0x9c, 0xff, - 0xad, 0x9e, 0x9e, 0xff, 0xa8, 0x93, 0x8c, 0xff, 0x90, 0x7f, 0x74, 0xff, - 0x9c, 0x81, 0x74, 0xff, 0xa9, 0x9b, 0x8c, 0xff, 0xd8, 0xdc, 0xd4, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf8, 0xe4, 0xff, - 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x50, 0x4e, 0x44, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x64, 0x4e, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x64, 0x6a, 0x6c, 0xff, 0x8b, 0x8b, 0x8c, 0xff, 0xc4, 0xc3, 0xc4, 0xff, - 0x9a, 0x94, 0x94, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0x71, 0x72, 0x74, 0xff, - 0x83, 0x82, 0x84, 0xff, 0x89, 0x86, 0x84, 0xff, 0xa1, 0x9e, 0x9c, 0xff, - 0xbc, 0xb9, 0xbc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0xc2, 0xbe, 0xbc, 0xff, - 0xa6, 0x95, 0x94, 0xff, 0xd4, 0xc6, 0xc4, 0xff, 0xe4, 0xd2, 0xd4, 0xff, - 0xb4, 0x9b, 0x94, 0xff, 0x96, 0x86, 0x8c, 0xff, 0x9c, 0x7a, 0x7c, 0xff, - 0x9c, 0x7a, 0x74, 0xff, 0x8e, 0x7a, 0x7c, 0xff, 0x9c, 0x80, 0x7c, 0xff, - 0x96, 0x85, 0x84, 0xff, 0xb4, 0x9b, 0x94, 0xff, 0xad, 0x9e, 0x9e, 0xff, - 0xba, 0xb0, 0xa4, 0xff, 0xbf, 0xaa, 0xa4, 0xff, 0xa8, 0x93, 0x8c, 0xff, - 0x84, 0x7e, 0x74, 0xff, 0x90, 0x7f, 0x74, 0xff, 0xa9, 0x9b, 0x8c, 0xff, - 0xd9, 0xc6, 0xb4, 0xff, 0xf2, 0xe9, 0xdc, 0xff, 0xf2, 0xe9, 0xdc, 0xff, - 0xf4, 0xf8, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf8, 0xe4, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x63, 0x6a, 0x64, 0xff, 0x83, 0x82, 0x84, 0xff, + 0x63, 0x6a, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0xa1, 0xa2, 0x9c, 0xff, 0xb4, 0xb2, 0xb4, 0xff, 0xbc, 0xb9, 0xbc, 0xff, + 0xc2, 0xc2, 0xbc, 0xff, 0x83, 0x82, 0x84, 0xff, 0x7b, 0x7a, 0x7c, 0xff, + 0xa1, 0x9e, 0x9c, 0xff, 0xc4, 0xc3, 0xc4, 0xff, 0xdc, 0xd6, 0xdc, 0xff, + 0xd4, 0xc6, 0xc4, 0xff, 0xd4, 0xc6, 0xc4, 0xff, 0xc6, 0xb1, 0xb4, 0xff, + 0xe6, 0xd6, 0xd6, 0xff, 0xcc, 0xbe, 0xc4, 0xff, 0xb4, 0x96, 0x94, 0xff, + 0xa4, 0x85, 0x84, 0xff, 0x9c, 0x7a, 0x74, 0xff, 0x9c, 0x7a, 0x7c, 0xff, + 0x9c, 0x80, 0x7c, 0xff, 0x9c, 0x80, 0x7c, 0xff, 0x9d, 0x8d, 0x8c, 0xff, + 0xa6, 0x95, 0x94, 0xff, 0xb0, 0xa3, 0x9c, 0xff, 0xad, 0x9e, 0x9e, 0xff, + 0xa8, 0x93, 0x8c, 0xff, 0x90, 0x7f, 0x74, 0xff, 0x9c, 0x81, 0x74, 0xff, + 0xa9, 0x9b, 0x8c, 0xff, 0xd8, 0xdc, 0xd4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf8, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x5d, 0x62, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x64, 0x4e, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x8b, 0x8b, 0x8c, 0xff, + 0xc4, 0xc3, 0xc4, 0xff, 0x9a, 0x94, 0x94, 0xff, 0xb4, 0xb2, 0xb4, 0xff, + 0x71, 0x72, 0x74, 0xff, 0x83, 0x82, 0x84, 0xff, 0x89, 0x86, 0x84, 0xff, + 0xa1, 0x9e, 0x9c, 0xff, 0xbc, 0xb9, 0xbc, 0xff, 0xcc, 0xcc, 0xcc, 0xff, + 0xc2, 0xbe, 0xbc, 0xff, 0xa6, 0x95, 0x94, 0xff, 0xd4, 0xc6, 0xc4, 0xff, + 0xe4, 0xd2, 0xd4, 0xff, 0xb4, 0x9b, 0x94, 0xff, 0x96, 0x86, 0x8c, 0xff, + 0x9c, 0x7a, 0x7c, 0xff, 0x9c, 0x7a, 0x74, 0xff, 0x8e, 0x7a, 0x7c, 0xff, + 0x9c, 0x80, 0x7c, 0xff, 0x96, 0x85, 0x84, 0xff, 0xb4, 0x9b, 0x94, 0xff, + 0xad, 0x9e, 0x9e, 0xff, 0xba, 0xb0, 0xa4, 0xff, 0xbf, 0xaa, 0xa4, 0xff, + 0xa8, 0x93, 0x8c, 0xff, 0x84, 0x7e, 0x74, 0xff, 0x90, 0x7f, 0x74, 0xff, + 0xa9, 0x9b, 0x8c, 0xff, 0xd9, 0xc6, 0xb4, 0xff, 0xf2, 0xe9, 0xdc, 0xff, + 0xf2, 0xe9, 0xdc, 0xff, 0xf4, 0xf8, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, + 0xf4, 0xf8, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, @@ -4065,93 +4034,92 @@ static const uint8_t kImgPeakData[] = { 0xa9, 0x9b, 0x8c, 0xff, 0xc9, 0xc0, 0xb4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf8, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, - 0x64, 0x6a, 0x6c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x64, 0x4e, 0x54, 0xff, 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x83, 0x82, 0x84, 0xff, - 0xb3, 0xae, 0xac, 0xff, 0x9c, 0x9a, 0x94, 0xff, 0xa3, 0xa3, 0xa4, 0xff, - 0x6f, 0x6c, 0x6c, 0xff, 0x9c, 0x93, 0x8c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, - 0x7e, 0x6d, 0x6c, 0xff, 0x81, 0x72, 0x74, 0xff, 0x7f, 0x72, 0x6c, 0xff, - 0x8f, 0x7f, 0x7c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x8e, 0x79, 0x74, 0xff, - 0x8e, 0x79, 0x74, 0xff, 0x96, 0x85, 0x84, 0xff, 0xa4, 0x85, 0x84, 0xff, - 0xa8, 0x93, 0x8c, 0xff, 0xb4, 0x9b, 0x94, 0xff, 0xa8, 0x93, 0x8c, 0xff, - 0x7f, 0x72, 0x6c, 0xff, 0x8c, 0x6e, 0x64, 0xff, 0x90, 0x7f, 0x74, 0xff, - 0xa7, 0x94, 0x84, 0xff, 0xb0, 0xa3, 0x9c, 0xff, 0xe4, 0xd2, 0xc4, 0xff, - 0xf2, 0xe9, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x5d, 0x62, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x64, 0x6a, 0x6c, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x64, 0x4e, 0x54, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x81, 0x7e, 0x7c, 0xff, 0x83, 0x82, 0x84, 0xff, 0xb3, 0xae, 0xac, 0xff, + 0x9c, 0x9a, 0x94, 0xff, 0xa3, 0xa3, 0xa4, 0xff, 0x6f, 0x6c, 0x6c, 0xff, + 0x9c, 0x93, 0x8c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, + 0x81, 0x72, 0x74, 0xff, 0x7f, 0x72, 0x6c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, + 0x8f, 0x7f, 0x7c, 0xff, 0x8e, 0x79, 0x74, 0xff, 0x8e, 0x79, 0x74, 0xff, + 0x96, 0x85, 0x84, 0xff, 0xa4, 0x85, 0x84, 0xff, 0xa8, 0x93, 0x8c, 0xff, + 0xb4, 0x9b, 0x94, 0xff, 0xa8, 0x93, 0x8c, 0xff, 0x7f, 0x72, 0x6c, 0xff, + 0x8c, 0x6e, 0x64, 0xff, 0x90, 0x7f, 0x74, 0xff, 0xa7, 0x94, 0x84, 0xff, + 0xb0, 0xa3, 0x9c, 0xff, 0xe4, 0xd2, 0xc4, 0xff, 0xf2, 0xe9, 0xdc, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0xf3, 0xf2, 0xdc, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x64, 0x4e, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x49, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x64, 0x4e, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x64, 0x6a, 0x6c, 0xff, 0x92, 0x92, 0x8c, 0xff, 0x64, 0x6a, 0x6c, 0xff, - 0x83, 0x82, 0x84, 0xff, 0x7b, 0x7a, 0x7c, 0xff, 0x8b, 0x8b, 0x8c, 0xff, - 0x71, 0x6a, 0x64, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x71, 0x6a, 0x64, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x7f, 0x72, 0x6c, 0xff, - 0x8e, 0x79, 0x74, 0xff, 0x8e, 0x72, 0x74, 0xff, 0x78, 0x66, 0x64, 0xff, - 0x8e, 0x79, 0x74, 0xff, 0x96, 0x85, 0x84, 0xff, 0x9c, 0x80, 0x7c, 0xff, - 0x96, 0x85, 0x84, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0x9e, 0x8b, 0x84, 0xff, - 0x8e, 0x79, 0x74, 0xff, 0x9c, 0x92, 0x84, 0xff, 0x8e, 0x79, 0x74, 0xff, - 0x8e, 0x79, 0x74, 0xff, 0xa7, 0x94, 0x84, 0xff, 0xb1, 0xa3, 0x94, 0xff, - 0xda, 0xd4, 0xc4, 0xff, 0xf2, 0xe9, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0xf4, 0xf8, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x64, 0x4e, 0x54, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x49, 0x4c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x64, 0x4e, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x92, 0x92, 0x8c, 0xff, + 0x64, 0x6a, 0x6c, 0xff, 0x83, 0x82, 0x84, 0xff, 0x7b, 0x7a, 0x7c, 0xff, + 0x8b, 0x8b, 0x8c, 0xff, 0x71, 0x6a, 0x64, 0xff, 0x81, 0x7e, 0x7c, 0xff, + 0x6f, 0x6c, 0x6c, 0xff, 0x71, 0x6a, 0x64, 0xff, 0x7e, 0x6d, 0x6c, 0xff, + 0x7f, 0x72, 0x6c, 0xff, 0x8e, 0x79, 0x74, 0xff, 0x8e, 0x72, 0x74, 0xff, + 0x78, 0x66, 0x64, 0xff, 0x8e, 0x79, 0x74, 0xff, 0x96, 0x85, 0x84, 0xff, + 0x9c, 0x80, 0x7c, 0xff, 0x96, 0x85, 0x84, 0xff, 0x9d, 0x8d, 0x8c, 0xff, + 0x9e, 0x8b, 0x84, 0xff, 0x8e, 0x79, 0x74, 0xff, 0x9c, 0x92, 0x84, 0xff, + 0x8e, 0x79, 0x74, 0xff, 0x8e, 0x79, 0x74, 0xff, 0xa7, 0x94, 0x84, 0xff, + 0xb1, 0xa3, 0x94, 0xff, 0xda, 0xd4, 0xc4, 0xff, 0xf2, 0xe9, 0xdc, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf8, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, @@ -4194,93 +4162,92 @@ static const uint8_t kImgPeakData[] = { 0x8e, 0x79, 0x74, 0xff, 0x9c, 0x7a, 0x74, 0xff, 0xa4, 0x89, 0x7c, 0xff, 0xa8, 0x9b, 0x94, 0xff, 0xe2, 0xdc, 0xcc, 0xff, 0xf2, 0xe9, 0xdc, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0xf4, 0xf8, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0xf4, 0xf8, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x64, 0x6a, 0x6c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x64, 0x6a, 0x6c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x64, 0x4e, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4e, 0x42, 0x44, 0xff, 0x58, 0x49, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x69, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x49, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x6c, 0x61, 0x64, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x6c, 0x61, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x6c, 0x61, 0x64, 0xff, - 0x5f, 0x62, 0x64, 0xff, 0x81, 0x7e, 0x7c, 0xff, 0x78, 0x66, 0x64, 0xff, - 0x84, 0x77, 0x74, 0xff, 0x9d, 0x8d, 0x8c, 0xff, 0xbc, 0xaa, 0xac, 0xff, - 0xac, 0x8d, 0x8c, 0xff, 0x96, 0x86, 0x8c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x75, 0x62, 0x64, 0xff, 0x84, 0x77, 0x74, 0xff, 0xbd, 0xa6, 0xa4, 0xff, - 0x9c, 0x80, 0x7c, 0xff, 0x8e, 0x79, 0x74, 0xff, 0x9c, 0x7a, 0x74, 0xff, - 0x9c, 0x88, 0x7c, 0xff, 0xa8, 0x9b, 0x94, 0xff, 0xe4, 0xe2, 0xd8, 0xff, - 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf8, 0xe4, 0xff, - 0xf2, 0xe9, 0xdc, 0xff, 0xf4, 0xf8, 0xe4, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x32, 0x2c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x6b, 0x56, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x5d, 0x5a, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x70, 0x66, 0x5c, 0xff, - 0x63, 0x66, 0x64, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x77, 0x66, 0x6c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x84, 0x79, 0x7c, 0xff, - 0x96, 0x86, 0x8c, 0xff, 0xac, 0x8d, 0x84, 0xff, 0x8e, 0x72, 0x74, 0xff, - 0x7f, 0x6a, 0x64, 0xff, 0xad, 0x9e, 0x9e, 0xff, 0xba, 0xb0, 0xa4, 0xff, - 0xb4, 0x9b, 0x94, 0xff, 0x8e, 0x72, 0x74, 0xff, 0x8e, 0x79, 0x74, 0xff, - 0x8e, 0x79, 0x74, 0xff, 0x84, 0x7e, 0x74, 0xff, 0xda, 0xd4, 0xc4, 0xff, - 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0xf4, 0xf8, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x64, 0x4e, 0x54, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4e, 0x42, 0x44, 0xff, + 0x58, 0x49, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x58, 0x49, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x6c, 0x61, 0x64, 0xff, + 0x5d, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x81, 0x7e, 0x7c, 0xff, 0x78, 0x66, 0x64, 0xff, 0x84, 0x77, 0x74, 0xff, + 0x9d, 0x8d, 0x8c, 0xff, 0xbc, 0xaa, 0xac, 0xff, 0xac, 0x8d, 0x8c, 0xff, + 0x96, 0x86, 0x8c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x75, 0x62, 0x64, 0xff, + 0x84, 0x77, 0x74, 0xff, 0xbd, 0xa6, 0xa4, 0xff, 0x9c, 0x80, 0x7c, 0xff, + 0x8e, 0x79, 0x74, 0xff, 0x9c, 0x7a, 0x74, 0xff, 0x9c, 0x88, 0x7c, 0xff, + 0xa8, 0x9b, 0x94, 0xff, 0xe4, 0xe2, 0xd8, 0xff, 0xf4, 0xf2, 0xe4, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf8, 0xe4, 0xff, 0xf2, 0xe9, 0xdc, 0xff, + 0xf4, 0xf8, 0xe4, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x34, 0x32, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x6b, 0x56, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, + 0x70, 0x66, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x6c, 0x61, 0x64, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x77, 0x66, 0x6c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, + 0x84, 0x79, 0x7c, 0xff, 0x96, 0x86, 0x8c, 0xff, 0xac, 0x8d, 0x84, 0xff, + 0x8e, 0x72, 0x74, 0xff, 0x7f, 0x6a, 0x64, 0xff, 0xad, 0x9e, 0x9e, 0xff, + 0xba, 0xb0, 0xa4, 0xff, 0xb4, 0x9b, 0x94, 0xff, 0x8e, 0x72, 0x74, 0xff, + 0x8e, 0x79, 0x74, 0xff, 0x8e, 0x79, 0x74, 0xff, 0x84, 0x7e, 0x74, 0xff, + 0xda, 0xd4, 0xc4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf8, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, @@ -4323,93 +4290,92 @@ static const uint8_t kImgPeakData[] = { 0xa8, 0x9b, 0x94, 0xff, 0x9c, 0x80, 0x7c, 0xff, 0x8e, 0x79, 0x74, 0xff, 0x7f, 0x72, 0x6c, 0xff, 0x8f, 0x86, 0x7c, 0xff, 0xb1, 0xaa, 0xa4, 0xff, 0xe4, 0xe2, 0xd8, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0xf3, 0xf2, 0xdc, 0xff, - 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x34, 0x32, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x64, 0x4e, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0xf4, 0xf2, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x32, 0x2c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x64, 0x4e, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x64, 0x4e, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x6b, 0x56, 0x5c, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x6b, 0x56, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x70, 0x5e, 0x5c, 0xff, + 0x5d, 0x62, 0x5c, 0xff, 0x77, 0x66, 0x6c, 0xff, 0x7e, 0x6d, 0x6c, 0xff, + 0x8f, 0x7f, 0x7c, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x71, 0x6a, 0x64, 0xff, 0x7e, 0x6d, 0x6c, 0xff, 0x9d, 0x8d, 0x8c, 0xff, + 0x84, 0x79, 0x7c, 0xff, 0x7f, 0x72, 0x6c, 0xff, 0x7f, 0x72, 0x6c, 0xff, + 0x7c, 0x72, 0x64, 0xff, 0x94, 0x8b, 0x84, 0xff, 0xda, 0xd4, 0xc4, 0xff, + 0xf4, 0xea, 0xe4, 0xff, 0xf2, 0xe9, 0xdc, 0xff, 0xf4, 0xea, 0xe4, 0xff, + 0xf4, 0xf8, 0xe4, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x64, 0x4e, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x6b, 0x56, 0x5c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x6b, 0x56, 0x5c, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x77, 0x66, 0x6c, 0xff, - 0x7e, 0x6d, 0x6c, 0xff, 0x8f, 0x7f, 0x7c, 0xff, 0x6c, 0x61, 0x64, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x71, 0x6a, 0x64, 0xff, 0x7e, 0x6d, 0x6c, 0xff, - 0x9d, 0x8d, 0x8c, 0xff, 0x84, 0x79, 0x7c, 0xff, 0x7f, 0x72, 0x6c, 0xff, - 0x7f, 0x72, 0x6c, 0xff, 0x7c, 0x72, 0x64, 0xff, 0x94, 0x8b, 0x84, 0xff, - 0xda, 0xd4, 0xc4, 0xff, 0xf4, 0xea, 0xe4, 0xff, 0xf2, 0xe9, 0xdc, 0xff, - 0xf4, 0xea, 0xe4, 0xff, 0xf4, 0xf8, 0xe4, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x42, 0x42, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x4e, 0x42, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x6f, 0x6c, 0x6c, 0xff, 0x78, 0x66, 0x64, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x5d, 0x5a, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, 0x81, 0x72, 0x74, 0xff, - 0x8c, 0x81, 0x84, 0xff, 0x81, 0x72, 0x74, 0xff, 0x81, 0x72, 0x74, 0xff, - 0x71, 0x6a, 0x64, 0xff, 0x63, 0x6a, 0x64, 0xff, 0x84, 0x7e, 0x74, 0xff, - 0xc2, 0xbe, 0xbc, 0xff, 0xe4, 0xe2, 0xd8, 0xff, 0xc9, 0xc0, 0xb4, 0xff, - 0xf4, 0xea, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x78, 0x66, 0x64, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x63, 0x66, 0x64, 0xff, + 0x81, 0x72, 0x74, 0xff, 0x8c, 0x81, 0x84, 0xff, 0x81, 0x72, 0x74, 0xff, + 0x81, 0x72, 0x74, 0xff, 0x71, 0x6a, 0x64, 0xff, 0x63, 0x6a, 0x64, 0xff, + 0x84, 0x7e, 0x74, 0xff, 0xc2, 0xbe, 0xbc, 0xff, 0xe4, 0xe2, 0xd8, 0xff, + 0xc9, 0xc0, 0xb4, 0xff, 0xf4, 0xea, 0xe4, 0xff, 0xf4, 0xf2, 0xe4, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, @@ -4452,93 +4418,92 @@ static const uint8_t kImgPeakData[] = { 0x81, 0x72, 0x74, 0xff, 0x84, 0x77, 0x74, 0xff, 0x77, 0x66, 0x6c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x71, 0x6a, 0x64, 0xff, 0x71, 0x72, 0x6c, 0xff, 0xb1, 0xaa, 0xa4, 0xff, 0xd6, 0xc5, 0xbc, 0xff, 0x9a, 0x94, 0x94, 0xff, - 0xd9, 0xd4, 0xcc, 0xff, 0xe4, 0xe2, 0xd8, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x32, 0x2c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x6b, 0x56, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x5d, 0x5a, 0x54, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x55, 0x52, 0x4c, 0xff, - 0x6c, 0x61, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x6c, 0x61, 0x64, 0xff, - 0x6c, 0x66, 0x6c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x71, 0x6a, 0x64, 0xff, 0x6f, 0x6c, 0x6c, 0xff, - 0x84, 0x77, 0x74, 0xff, 0x89, 0x86, 0x84, 0xff, 0x8f, 0x86, 0x7c, 0xff, - 0xcc, 0xc2, 0xbc, 0xff, 0xe4, 0xe2, 0xd8, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x34, 0x2e, 0x34, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0xd9, 0xd4, 0xcc, 0xff, 0xe4, 0xe2, 0xd8, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x6b, 0x56, 0x5c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x5d, 0x5a, 0x54, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x71, 0x6a, 0x64, 0xff, - 0x71, 0x6a, 0x64, 0xff, 0x70, 0x66, 0x5c, 0xff, 0x72, 0x62, 0x5c, 0xff, - 0x88, 0x8a, 0x84, 0xff, 0xa8, 0x9b, 0x94, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x6c, 0x61, 0x64, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x6c, 0x61, 0x64, 0xff, 0x6c, 0x66, 0x6c, 0xff, + 0x6f, 0x6c, 0x6c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x71, 0x6a, 0x64, 0xff, 0x6f, 0x6c, 0x6c, 0xff, 0x84, 0x77, 0x74, 0xff, + 0x89, 0x86, 0x84, 0xff, 0x8f, 0x86, 0x7c, 0xff, 0xcc, 0xc2, 0xbc, 0xff, + 0xe4, 0xe2, 0xd8, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x34, 0x2e, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x52, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x69, 0x55, 0x54, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x5d, 0x62, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x5d, 0x62, 0x5c, 0xff, 0x70, 0x5e, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x6f, 0x6c, 0x6c, 0xff, + 0x71, 0x6a, 0x64, 0xff, 0x71, 0x6a, 0x64, 0xff, 0x70, 0x66, 0x5c, 0xff, + 0x72, 0x62, 0x5c, 0xff, 0x88, 0x8a, 0x84, 0xff, 0xa8, 0x9b, 0x94, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x4c, 0x52, 0x4c, 0xff, @@ -4581,93 +4546,92 @@ static const uint8_t kImgPeakData[] = { 0x4c, 0x53, 0x54, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x5f, 0x62, 0x64, 0xff, 0x5d, 0x62, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x72, 0x5b, 0x54, 0xff, - 0x78, 0x77, 0x74, 0xff, 0x8f, 0x86, 0x7c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x34, 0x32, 0x2c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x5d, 0x5a, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x55, 0x52, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x5d, 0x5a, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x5d, 0x62, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x70, 0x5e, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, - 0x70, 0x66, 0x5c, 0xff, 0x63, 0x66, 0x64, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x78, 0x77, 0x74, 0xff, 0x8f, 0x86, 0x7c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x6b, 0x56, 0x5c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x34, 0x32, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x49, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x64, 0x5d, 0x5c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x55, 0x52, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x5d, 0x5a, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x52, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x64, 0x5d, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x5d, 0x5a, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x5d, 0x62, 0x5c, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x70, 0x5e, 0x5c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x70, 0x66, 0x5c, 0xff, + 0x63, 0x66, 0x64, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x6b, 0x56, 0x5c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4e, 0x42, 0x44, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x4e, 0x42, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x49, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x64, 0x5d, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, @@ -4710,93 +4674,92 @@ static const uint8_t kImgPeakData[] = { 0x64, 0x5d, 0x5c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x5d, 0x5a, 0x54, 0xff, - 0x5d, 0x5a, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x30, 0x2a, 0x24, 0xff, 0x2c, 0x26, 0x2c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x64, 0x4e, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x5d, 0x5a, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x34, 0x32, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x30, 0x2a, 0x24, 0xff, 0x2c, 0x26, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x58, 0x49, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x2c, 0x26, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x53, 0x41, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4e, 0x42, 0x44, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4e, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4e, 0x42, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x64, 0x4e, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x58, 0x49, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x2c, 0x26, 0x2c, 0xff, + 0x34, 0x32, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x53, 0x41, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x4e, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4e, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x55, 0x52, 0x4c, 0xff, + 0x5d, 0x5a, 0x54, 0xff, 0x50, 0x4e, 0x44, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x69, 0x55, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x5d, 0x5a, 0x54, 0xff, - 0x50, 0x4e, 0x44, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x32, 0x2c, 0xff, @@ -4839,93 +4802,92 @@ static const uint8_t kImgPeakData[] = { 0x55, 0x4e, 0x4c, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x44, 0x3a, 0x3c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x50, 0x4e, 0x44, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, + 0x50, 0x4e, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x34, 0x2e, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x44, 0x46, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x44, 0x3a, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x5d, 0x5a, 0x54, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x3a, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x55, 0x52, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x50, 0x4e, 0x44, 0xff, 0x55, 0x52, 0x4c, 0xff, - 0x55, 0x52, 0x4c, 0xff, 0x50, 0x4e, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x2e, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x46, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x55, 0x52, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x53, 0x41, 0x3c, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x5d, 0x5a, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x53, 0x41, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x44, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x5d, 0x5a, 0x54, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x55, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x55, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, @@ -4968,93 +4930,92 @@ static const uint8_t kImgPeakData[] = { 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x50, 0x4e, 0x44, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x50, 0x4e, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x34, 0x32, 0x2c, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x44, 0x46, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x34, 0x32, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x50, 0x4e, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x44, 0x3a, 0x3c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x44, 0x46, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x32, 0x2c, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x5d, 0x5a, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x50, 0x4e, 0x44, 0xff, + 0x44, 0x46, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x53, 0x5a, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x4e, 0x42, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x30, 0x2a, 0x24, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x32, 0x2c, 0xff, + 0x3c, 0x32, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x3a, 0x3c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4e, 0x42, 0x44, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x50, 0x4e, 0x44, 0xff, 0x44, 0x46, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4e, 0x42, 0x44, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x30, 0x2a, 0x24, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x32, 0x2c, 0xff, 0x3c, 0x32, 0x2c, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x32, 0x2c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x44, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x64, 0x5d, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x34, 0x2e, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x5f, 0x62, 0x64, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4e, 0x42, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x4e, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x44, 0x46, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x50, 0x4e, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x64, 0x5d, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x2e, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x5f, 0x62, 0x64, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x4e, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x46, 0x3c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x50, 0x4e, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x3a, 0x3c, 0xff, @@ -5097,93 +5058,92 @@ static const uint8_t kImgPeakData[] = { 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x2e, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x30, 0x2a, 0x24, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3c, 0x32, 0x2c, 0xff, 0x30, 0x2a, 0x24, 0xff, - 0x30, 0x2a, 0x24, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x34, 0x2e, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x34, 0x32, 0x2c, 0xff, 0x30, 0x2a, 0x24, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x3c, 0x32, 0x2c, 0xff, 0x30, 0x2a, 0x24, 0xff, 0x30, 0x2a, 0x24, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x42, 0x42, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x34, 0x32, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x49, 0x4c, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x44, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x4e, 0x42, 0x44, 0xff, - 0x44, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x44, 0x3a, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x53, 0x41, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x46, 0x3c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x46, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x30, 0x26, 0x24, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x34, 0x32, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x30, 0x26, 0x24, 0xff, - 0x30, 0x2a, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, - 0x30, 0x26, 0x24, 0xff, 0x30, 0x2a, 0x24, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x34, 0x32, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x46, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x34, 0x32, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x32, 0x2c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x49, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x3a, 0x3c, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x44, 0x3a, 0x3c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x53, 0x41, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x46, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x46, 0x3c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x30, 0x26, 0x24, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x30, 0x26, 0x24, 0xff, 0x30, 0x2a, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, + 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x2a, 0x24, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x46, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x49, 0x4c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x44, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x58, 0x49, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x44, 0x46, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x58, 0x49, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x44, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x58, 0x49, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x44, 0x46, 0x3c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, @@ -5226,93 +5186,92 @@ static const uint8_t kImgPeakData[] = { 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x4c, 0x52, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x34, 0x2e, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x2c, 0x26, 0x2c, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, - 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x2a, 0x24, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3c, 0x2e, 0x2c, 0xff, - 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x32, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x2e, 0x2c, 0xff, - 0x3c, 0x2e, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3c, 0x2e, 0x2c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x4e, 0x42, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x58, 0x49, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x53, 0x41, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x34, 0x2e, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x64, 0x4e, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x34, 0x32, 0x2c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x34, 0x2e, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x2c, 0x26, 0x2c, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, - 0x30, 0x26, 0x24, 0xff, 0x2c, 0x26, 0x2c, 0xff, 0x30, 0x26, 0x24, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x44, 0x46, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x2e, 0x2c, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x32, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x32, 0x2c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x55, 0x52, 0x4c, 0xff, - 0x4e, 0x42, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x44, 0x3a, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x5d, 0x5a, 0x54, 0xff, 0x6b, 0x56, 0x5c, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x30, 0x26, 0x24, 0xff, 0x30, 0x2a, 0x24, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, + 0x3c, 0x32, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x53, 0x41, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x4e, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4e, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x4e, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4e, 0x42, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x58, 0x49, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x53, 0x41, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x2e, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x64, 0x4e, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, + 0x34, 0x32, 0x2c, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, + 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x2c, 0x26, 0x2c, 0xff, + 0x30, 0x26, 0x24, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x44, 0x46, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x3c, 0x2e, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x32, 0x2c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x3c, 0x32, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3c, 0x2e, 0x2c, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x44, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x5d, 0x5a, 0x54, 0xff, 0x6b, 0x56, 0x5c, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x53, 0x41, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x44, 0x3a, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x52, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x3a, 0x3c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x4e, 0x42, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x30, 0x26, 0x24, 0xff, @@ -5355,93 +5314,92 @@ static const uint8_t kImgPeakData[] = { 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x53, 0x5a, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x34, 0x2e, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x2c, 0x26, 0x2c, 0xff, 0x30, 0x2a, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, - 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, - 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, - 0x2c, 0x26, 0x2c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x2c, 0x26, 0x2c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, - 0x3c, 0x2e, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4e, 0x42, 0x44, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x58, 0x5c, 0x5c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3c, 0x2e, 0x2c, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4e, 0x42, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x2c, 0x26, 0x2c, 0xff, 0x30, 0x2a, 0x24, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, 0x34, 0x32, 0x2c, 0xff, - 0x30, 0x2a, 0x24, 0xff, 0x2c, 0x26, 0x2c, 0xff, 0x30, 0x26, 0x24, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x34, 0x2e, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x2c, 0x26, 0x2c, 0xff, + 0x30, 0x2a, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, - 0x30, 0x26, 0x24, 0xff, 0x2c, 0x26, 0x2c, 0xff, 0x30, 0x2a, 0x24, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x44, 0x47, 0x44, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x34, 0x32, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x34, 0x32, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x30, 0x2a, 0x24, 0xff, + 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x2c, 0x26, 0x2c, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x2c, 0x26, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x34, 0x32, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x3c, 0x2e, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x30, 0x26, 0x24, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x55, 0x55, 0x54, 0xff, 0x58, 0x49, 0x4c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x55, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x44, 0x3a, 0x3c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x44, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x55, 0x4e, 0x4c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x44, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x58, 0x5c, 0x5c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x44, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, 0x2c, 0x26, 0x2c, 0xff, + 0x30, 0x2a, 0x24, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x34, 0x32, 0x2c, 0xff, 0x30, 0x2a, 0x24, 0xff, 0x2c, 0x26, 0x2c, 0xff, + 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, + 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x2c, 0x26, 0x2c, 0xff, + 0x30, 0x2a, 0x24, 0xff, 0x34, 0x33, 0x34, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x34, 0x32, 0x2c, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4c, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, + 0x30, 0x2a, 0x24, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, + 0x3c, 0x2e, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x30, 0x26, 0x24, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x58, 0x49, 0x4c, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x44, 0x3a, 0x3c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x4b, 0x4e, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x55, 0x4e, 0x4c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x44, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x53, 0x5a, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x34, 0x33, 0x34, 0xff, 0x30, 0x26, 0x24, 0xff, 0x33, 0x2c, 0x2c, 0xff, @@ -5484,50 +5442,50 @@ static const uint8_t kImgPeakData[] = { 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x30, 0x26, 0x24, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x4c, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x32, 0x2c, 0xff, - 0x3c, 0x2e, 0x2c, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, - 0x2c, 0x26, 0x2c, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x2c, 0x26, 0x2c, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x55, 0x55, 0x54, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x44, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x44, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x42, 0x42, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, - 0x30, 0x2a, 0x24, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, - 0x40, 0x3f, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, - 0x34, 0x33, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, - 0x3c, 0x2e, 0x2c, 0xff, 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, - 0x3c, 0x2e, 0x2c, 0xff, 0x30, 0x2a, 0x24, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x30, 0x2a, 0x24, 0xff, 0x33, 0x2c, 0x2c, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x55, 0x52, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, 0x4e, 0x42, 0x44, 0xff, - 0x3c, 0x32, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x44, 0x47, 0x44, 0xff, 0x42, 0x42, 0x44, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x30, 0x26, 0x24, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x4c, 0x53, 0x54, 0xff, 0x34, 0x33, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, + 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x2c, 0x26, 0x2c, 0xff, + 0x44, 0x3a, 0x3c, 0xff, 0x2c, 0x26, 0x2c, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x44, 0x3a, 0x3c, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, 0x44, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x42, 0x42, 0x44, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x30, 0x2a, 0x24, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x4c, 0x53, 0x54, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x34, 0x33, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x34, 0x32, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x34, 0x33, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, 0x3c, 0x2e, 0x2c, 0xff, + 0x30, 0x26, 0x24, 0xff, 0x30, 0x26, 0x24, 0xff, 0x3c, 0x2e, 0x2c, 0xff, + 0x30, 0x2a, 0x24, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x30, 0x2a, 0x24, 0xff, 0x33, 0x2c, 0x2c, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x55, 0x52, 0x4c, 0xff, + 0x55, 0x52, 0x4c, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x3c, 0x32, 0x2c, 0xff, + 0x33, 0x2c, 0x2c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x40, 0x3f, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x4c, 0x53, 0x54, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, - 0x4b, 0x4e, 0x4c, 0xff, 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, - 0x49, 0x4a, 0x4c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, - 0x33, 0x2c, 0x2c, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x4e, 0x42, 0x44, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x34, 0x2e, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x3b, 0x3a, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x4c, 0x53, 0x54, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4c, 0x52, 0x4c, 0xff, 0x4b, 0x4e, 0x4c, 0xff, + 0x55, 0x55, 0x54, 0xff, 0x4b, 0x4e, 0x4c, 0xff, 0x49, 0x4a, 0x4c, 0xff, + 0x34, 0x32, 0x2c, 0xff, 0x34, 0x32, 0x2c, 0xff, 0x33, 0x2c, 0x2c, 0xff, + 0x44, 0x3a, 0x3c, 0xff, 0x4e, 0x42, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, + 0x34, 0x2e, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3b, 0x3a, 0x34, 0xff, 0x44, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, - 0x3b, 0x3a, 0x3c, 0xff, 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, - 0x44, 0x47, 0x44, 0xff, 0x4c, 0x47, 0x44, 0xff, + 0x3b, 0x3a, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x34, 0xff, + 0x44, 0x3a, 0x3c, 0xff, 0x42, 0x42, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, 0x49, 0x4a, 0x4c, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x3c, 0x35, 0x34, 0xff, 0x3c, 0x35, 0x34, 0xff, 0x3b, 0x3a, 0x3c, 0xff, + 0x40, 0x3f, 0x3c, 0xff, 0x44, 0x47, 0x44, 0xff, 0x44, 0x47, 0x44, 0xff, + 0x4c, 0x47, 0x44, 0xff, }; #endif // WEBP_TESTS_FUZZER_IMG_PEAK_H_ diff --git a/tests/fuzzer/mux_demux_api_fuzzer.cc b/tests/fuzzer/mux_demux_api_fuzzer.cc index 24f0e170..973fd87e 100644 --- a/tests/fuzzer/mux_demux_api_fuzzer.cc +++ b/tests/fuzzer/mux_demux_api_fuzzer.cc @@ -104,7 +104,6 @@ void MuxDemuxApiTest(std::string_view data_in, bool use_mux_api) { } // namespace FUZZ_TEST(MuxDemuxApi, MuxDemuxApiTest) - .WithDomains( - fuzztest::String() - .WithMaxSize(fuzz_utils::kMaxWebPFileSize + 1), - /*mux=*/fuzztest::Arbitrary()); + .WithDomains(fuzztest::String().WithMaxSize(fuzz_utils::kMaxWebPFileSize + + 1), + /*mux=*/fuzztest::Arbitrary()); diff --git a/tests/fuzzer/simple_api_fuzzer.cc b/tests/fuzzer/simple_api_fuzzer.cc index a8e0b491..48d10536 100644 --- a/tests/fuzzer/simple_api_fuzzer.cc +++ b/tests/fuzzer/simple_api_fuzzer.cc @@ -99,6 +99,5 @@ void SimpleApiTest(std::string_view data_in) { } // namespace FUZZ_TEST(SimpleApi, SimpleApiTest) - .WithDomains( - fuzztest::String() - .WithMaxSize(fuzz_utils::kMaxWebPFileSize + 1)); + .WithDomains(fuzztest::String().WithMaxSize(fuzz_utils::kMaxWebPFileSize + + 1)); diff --git a/tests/fuzzer/webp_info_fuzzer.cc b/tests/fuzzer/webp_info_fuzzer.cc index 881fdfa7..cf029193 100644 --- a/tests/fuzzer/webp_info_fuzzer.cc +++ b/tests/fuzzer/webp_info_fuzzer.cc @@ -38,6 +38,5 @@ void WebPInfoTest(std::string_view data) { } FUZZ_TEST(WebPInfo, WebPInfoTest) - .WithDomains( - fuzztest::String() - .WithMaxSize(fuzz_utils::kMaxWebPFileSize + 1)); + .WithDomains(fuzztest::String().WithMaxSize(fuzz_utils::kMaxWebPFileSize + + 1));