- I don't think it's a good idea to put a 64 MB lookup table into the static data segment, if it's for a piece of code most people will never use...

This commit is contained in:
Christoph Oelckers 2014-04-03 23:02:43 +02:00
parent e446a8eb30
commit 47406a3406
2 changed files with 3 additions and 2 deletions

View file

@ -38,7 +38,7 @@
#define trV 0x00000006 #define trV 0x00000006
/* RGB to YUV lookup table */ /* RGB to YUV lookup table */
extern uint32_t RGBtoYUV[16777216]; extern uint32_t *RGBtoYUV;
static inline uint32_t rgb_to_yuv(uint32_t c) static inline uint32_t rgb_to_yuv(uint32_t c)
{ {

View file

@ -19,13 +19,14 @@
#include <stdint.h> #include <stdint.h>
#include "hqx.h" #include "hqx.h"
uint32_t RGBtoYUV[16777216]; uint32_t *RGBtoYUV;
uint32_t YUV1, YUV2; uint32_t YUV1, YUV2;
HQX_API void HQX_CALLCONV hqxInit(void) HQX_API void HQX_CALLCONV hqxInit(void)
{ {
/* Initalize RGB to YUV lookup table */ /* Initalize RGB to YUV lookup table */
uint32_t c, r, g, b, y, u, v; uint32_t c, r, g, b, y, u, v;
RGBtoYUV = new uint32_t[16777216];
for (c = 0; c < 16777215; c++) { for (c = 0; c < 16777215; c++) {
r = (c & 0xFF0000) >> 16; r = (c & 0xFF0000) >> 16;
g = (c & 0x00FF00) >> 8; g = (c & 0x00FF00) >> 8;