From e18571393db587a1d862798d9e9de28db489ec52 Mon Sep 17 00:00:00 2001 From: James Zern Date: Mon, 24 Nov 2014 21:03:33 -0800 Subject: [PATCH] dsp: initialize VP8PredChroma8 in VP8DspInit() the table becomes non-const to allow for platform-specific optimizations Change-Id: I32d2b51480020dc653ecfafd20b6b0f096af349f --- src/dsp/dec.c | 13 +++++++++---- src/dsp/dsp.h | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/dsp/dec.c b/src/dsp/dec.c index 336a252d..283d0f9e 100644 --- a/src/dsp/dec.c +++ b/src/dsp/dec.c @@ -463,10 +463,7 @@ const VP8PredFunc VP8PredLuma16[NUM_B_DC_MODES] = { DC16NoTop, DC16NoLeft, DC16NoTopLeft }; -const VP8PredFunc VP8PredChroma8[NUM_B_DC_MODES] = { - DC8uv, TM8uv, VE8uv, HE8uv, - DC8uvNoTop, DC8uvNoLeft, DC8uvNoTopLeft -}; +VP8PredFunc VP8PredChroma8[NUM_B_DC_MODES]; //------------------------------------------------------------------------------ // Edge filtering functions @@ -721,6 +718,14 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8DspInit(void) { VP8PredLuma4[8] = HD4; VP8PredLuma4[9] = HU4; + VP8PredChroma8[0] = DC8uv; + VP8PredChroma8[1] = TM8uv; + VP8PredChroma8[2] = VE8uv; + VP8PredChroma8[3] = HE8uv; + VP8PredChroma8[4] = DC8uvNoTop; + VP8PredChroma8[5] = DC8uvNoLeft; + VP8PredChroma8[6] = DC8uvNoTopLeft; + // If defined, use CPUInfo() to overwrite some pointers with faster versions. if (VP8GetCPUInfo != NULL) { #if defined(WEBP_USE_SSE2) diff --git a/src/dsp/dsp.h b/src/dsp/dsp.h index e7389730..f106b410 100644 --- a/src/dsp/dsp.h +++ b/src/dsp/dsp.h @@ -176,7 +176,7 @@ extern VP8WHT VP8TransformWHT; // assumed accessible when needed. typedef void (*VP8PredFunc)(uint8_t* dst); extern const VP8PredFunc VP8PredLuma16[/* NUM_B_DC_MODES */]; -extern const VP8PredFunc VP8PredChroma8[/* NUM_B_DC_MODES */]; +extern VP8PredFunc VP8PredChroma8[/* NUM_B_DC_MODES */]; extern VP8PredFunc VP8PredLuma4[/* NUM_BMODES */]; // clipping tables (for filtering)