Compare commits
1 Commits
main
...
agent/w092
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aaa624c9cd |
@@ -53,9 +53,9 @@ Progress
|
||||
<!-- progress:start -->
|
||||
| Decompiled | Matched | Linked | Data |
|
||||
|:---:|:---:|:---:|:---:|
|
||||
| 93.64% | 82.24% | 57.94% | 89.35% |
|
||||
| 94.06% | 82.26% | 57.94% | 89.35% |
|
||||
|
||||
units 770/1027 complete, functions 11926/12563 matched.
|
||||
units 770/1027 complete, functions 11927/12563 matched.
|
||||
|
||||
decompiled = code with a C/C++ implementation (objdiff fuzzy), matched = byte-exact code, linked = code actually linked into the DOL, data = byte-exact data
|
||||
<!-- progress:end -->
|
||||
|
||||
@@ -106,7 +106,15 @@ typedef struct {
|
||||
u16 outputHeight; // 0x2A
|
||||
u32 convWidth; // 0x2C
|
||||
u32 convHeight; // 0x30
|
||||
#ifdef TMC_JPEG_PLANAR_OUTPUT
|
||||
u32 chromaWidth;
|
||||
u32 chromaHeight;
|
||||
u8* pLumaBuffer;
|
||||
u8* pCbBuffer;
|
||||
u8* pCrBuffer;
|
||||
#else
|
||||
u8 unk_0x34[0x14]; // 0x34
|
||||
#endif
|
||||
void* pTexBuffer; // 0x48
|
||||
u8 unk_0x4C[0x67C];
|
||||
TMCCJPEGDecWork* pWorkBuf; // 0x6C8
|
||||
|
||||
@@ -1,13 +1,30 @@
|
||||
#include <string.h>
|
||||
#include <tmc_jpeg_internal.h>
|
||||
|
||||
typedef struct {
|
||||
u16 bitLength;
|
||||
u16 symbol;
|
||||
} TMCHuffmanEntry;
|
||||
|
||||
static TMCHuffmanEntry readHuffmanEntry(const TMCHuffmanEntry* entries, u32 index) {
|
||||
return entries[index];
|
||||
}
|
||||
|
||||
static TMCHuffmanEntry readHuffmanLimit(const TMCHuffmanEntry* entries) {
|
||||
TMCHuffmanEntry limit;
|
||||
limit.bitLength = entries->bitLength;
|
||||
limit.symbol = entries->symbol;
|
||||
return limit;
|
||||
}
|
||||
|
||||
s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_ptr, TMCCJPEGDecWork* work) {
|
||||
volatile u32 ac_comb;
|
||||
u16* ac_fast;
|
||||
TMCHuffmanEntry acEntry;
|
||||
const TMCHuffmanEntry* ac_fast;
|
||||
u8* huff_sym;
|
||||
u32* huff_tbl;
|
||||
s32 bit_pos;
|
||||
u32 bit_data;
|
||||
u16* dc_fast;
|
||||
const TMCHuffmanEntry* dc_fast;
|
||||
s32 r;
|
||||
s32 blk0;
|
||||
s32 idx;
|
||||
@@ -19,29 +36,23 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
|
||||
const u8* zztbl;
|
||||
|
||||
bit_pos = work->bitCount;
|
||||
dc_fast = work->pDCFast;
|
||||
dc_fast = (const TMCHuffmanEntry*)work->pDCFast;
|
||||
|
||||
if (bit_pos <= 8) {
|
||||
r = TMCJPEGDEC_load_buff(work);
|
||||
if (r < 0) {
|
||||
return r;
|
||||
}
|
||||
bit_pos = work->bitCount;
|
||||
}
|
||||
|
||||
bit_pos = work->bitCount;
|
||||
bit_data = work->bitBuf;
|
||||
tmp = bit_pos - 8;
|
||||
tmp = ((bit_data >> tmp) & 0xFF) << 2;
|
||||
{
|
||||
u16* dc_entry = (u16*)((u8*)dc_fast + tmp);
|
||||
r = dc_entry[0];
|
||||
extra = dc_entry[1];
|
||||
}
|
||||
|
||||
{
|
||||
volatile u32 dc_comb;
|
||||
*(u16*)&dc_comb = r;
|
||||
*((u16*)&dc_comb + 1) = extra;
|
||||
TMCHuffmanEntry dcEntry = readHuffmanEntry(dc_fast, tmp >> 2);
|
||||
r = dcEntry.bitLength;
|
||||
extra = dcEntry.symbol;
|
||||
}
|
||||
|
||||
if (r != 0) {
|
||||
@@ -51,7 +62,7 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
|
||||
} else {
|
||||
u32 code;
|
||||
unsigned int i;
|
||||
u16* entry;
|
||||
const TMCHuffmanEntry* entry;
|
||||
s32 thresh;
|
||||
s32 offs;
|
||||
|
||||
@@ -71,13 +82,13 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
|
||||
work->bitCount = bit_pos;
|
||||
|
||||
i = 9;
|
||||
entry = (u16*)((u8*)huff_tbl + 0x24);
|
||||
entry = (const TMCHuffmanEntry*)huff_tbl + 9;
|
||||
|
||||
goto dc_entry;
|
||||
|
||||
while (1) {
|
||||
i++;
|
||||
entry += 2;
|
||||
entry++;
|
||||
if (i > 16) {
|
||||
r = TMCC_ERROR_OVERFLOW;
|
||||
goto dc_end;
|
||||
@@ -91,27 +102,17 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
|
||||
code |= (bit_data >> bit_pos) & 1;
|
||||
|
||||
dc_entry:
|
||||
thresh = entry[0];
|
||||
offs = entry[1];
|
||||
|
||||
{
|
||||
volatile u16 p[2];
|
||||
p[0] = thresh;
|
||||
p[1] = offs;
|
||||
tmp = *(u32*)p;
|
||||
}
|
||||
|
||||
{
|
||||
volatile u32 cw;
|
||||
cw = tmp;
|
||||
thresh = *(u16*)&cw;
|
||||
TMCHuffmanEntry decoded = readHuffmanLimit(entry);
|
||||
thresh = decoded.bitLength;
|
||||
offs = decoded.symbol;
|
||||
}
|
||||
|
||||
if (code > (u32)thresh) {
|
||||
continue;
|
||||
}
|
||||
|
||||
code = code - entry[0] + offs;
|
||||
code = code - entry->bitLength + offs;
|
||||
r = huff_sym[code & 0xFF];
|
||||
break;
|
||||
}
|
||||
@@ -138,21 +139,19 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
|
||||
bit_pos -= r;
|
||||
work->bitCount = bit_pos;
|
||||
extra = extra & (bit_data >> bit_pos);
|
||||
if ((s32)tmp >> 1 <= extra) {
|
||||
extra = extra;
|
||||
} else {
|
||||
extra = extra - (tmp - 1);
|
||||
if (extra < (s32)tmp >> 1) {
|
||||
extra -= tmp - 1;
|
||||
}
|
||||
dc_predict_row_ptr[0] += extra;
|
||||
}
|
||||
|
||||
*block = dc_predict_row_ptr[0] * blk0;
|
||||
|
||||
ac_fast = work->pACFast;
|
||||
ac_fast = (const TMCHuffmanEntry*)work->pACFast;
|
||||
huff_tbl = work->pACHuffTbl;
|
||||
huff_sym = work->pACHuffSym;
|
||||
|
||||
memset((u8*)block + 4, 0, 0xFC);
|
||||
memset(block + 1, 0, 0xFC);
|
||||
|
||||
bit_pos = work->bitCount;
|
||||
idx = 1;
|
||||
@@ -166,25 +165,19 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
|
||||
zztbl = TMCJPEGDEC_Zigzag_data;
|
||||
bit_data = work->bitBuf;
|
||||
t = bit_pos - 8;
|
||||
{
|
||||
u32 tbl_idx = ((bit_data >> t) & 0xFF) << 2;
|
||||
s32 thresh_val = ac_fast[tbl_idx >> 1];
|
||||
s32 offs_val = *(u16*)((u8*)ac_fast + tbl_idx + 2);
|
||||
*(u16*)&ac_comb = thresh_val;
|
||||
*((u16*)&ac_comb + 1) = offs_val;
|
||||
}
|
||||
acEntry = readHuffmanEntry(ac_fast, (bit_data >> t) & 0xFF);
|
||||
|
||||
while (idx < 64) {
|
||||
s32 ac_thresh = *(u16*)&ac_comb;
|
||||
s32 ac_thresh = acEntry.bitLength;
|
||||
if (ac_thresh != 0) {
|
||||
bit_pos = work->bitCount;
|
||||
bit_pos -= ac_thresh;
|
||||
work->bitCount = bit_pos;
|
||||
r = *((u16*)&ac_comb + 1);
|
||||
r = acEntry.symbol;
|
||||
} else {
|
||||
u32 code;
|
||||
unsigned int i;
|
||||
u16* entry;
|
||||
const TMCHuffmanEntry* entry;
|
||||
s32 thresh;
|
||||
s32 offs;
|
||||
|
||||
@@ -202,13 +195,13 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
|
||||
work->bitCount = bit_pos;
|
||||
|
||||
i = 9;
|
||||
entry = (u16*)((u8*)work->pACHuffTbl + 0x24);
|
||||
entry = (const TMCHuffmanEntry*)huff_tbl + 9;
|
||||
|
||||
goto ac_entry_huff;
|
||||
|
||||
while (1) {
|
||||
i++;
|
||||
entry += 2;
|
||||
entry++;
|
||||
if (i > 16) {
|
||||
r = TMCC_ERROR_OVERFLOW;
|
||||
goto ac_end;
|
||||
@@ -222,27 +215,17 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
|
||||
code |= (bit_data >> bit_pos) & 1;
|
||||
|
||||
ac_entry_huff:
|
||||
thresh = entry[0];
|
||||
offs = entry[1];
|
||||
|
||||
{
|
||||
volatile u16 p[2];
|
||||
p[0] = thresh;
|
||||
p[1] = offs;
|
||||
tmp = *(u32*)p;
|
||||
}
|
||||
|
||||
{
|
||||
volatile u32 cw;
|
||||
cw = tmp;
|
||||
thresh = *(u16*)&cw;
|
||||
TMCHuffmanEntry decoded = readHuffmanLimit(entry);
|
||||
thresh = decoded.bitLength;
|
||||
offs = decoded.symbol;
|
||||
}
|
||||
|
||||
if (code > (u32)thresh) {
|
||||
continue;
|
||||
}
|
||||
|
||||
code = code - entry[0] + offs;
|
||||
code = code - entry->bitLength + offs;
|
||||
r = huff_sym[code & 0xFF];
|
||||
break;
|
||||
}
|
||||
@@ -278,19 +261,11 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
|
||||
bit_pos -= t;
|
||||
work->bitCount = bit_pos;
|
||||
t = bit_pos - 8;
|
||||
{
|
||||
u32 next_tbl = ((bit_data >> t) & 0xFF) << 2;
|
||||
s32 next_th = ac_fast[next_tbl >> 1];
|
||||
s32 next_of = *(u16*)((u8*)ac_fast + next_tbl + 2);
|
||||
extra = extra & (bit_data >> bit_pos);
|
||||
*(u16*)&ac_comb = next_th;
|
||||
*((u16*)&ac_comb + 1) = next_of;
|
||||
}
|
||||
extra = extra & (bit_data >> bit_pos);
|
||||
acEntry = readHuffmanEntry(ac_fast, (bit_data >> t) & 0xFF);
|
||||
|
||||
if ((s32)tmp >> 1 <= extra) {
|
||||
extra = extra;
|
||||
} else {
|
||||
extra = extra - (tmp - 1);
|
||||
if (extra < (s32)tmp >> 1) {
|
||||
extra -= tmp - 1;
|
||||
}
|
||||
|
||||
q = ((s32*)conv_row_ptr)[zz];
|
||||
@@ -312,12 +287,7 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
|
||||
bit_pos = work->bitCount;
|
||||
t = bit_pos - 8;
|
||||
tmp = ((bit_data >> t) & 0xFF) << 2;
|
||||
{
|
||||
s32 next_thresh = ac_fast[tmp >> 1];
|
||||
s32 next_offs = *(u16*)((u8*)ac_fast + tmp + 2);
|
||||
*(u16*)&ac_comb = next_thresh;
|
||||
*((u16*)&ac_comb + 1) = next_offs;
|
||||
}
|
||||
acEntry = readHuffmanEntry(ac_fast, tmp >> 2);
|
||||
|
||||
idx += 16;
|
||||
}
|
||||
|
||||
@@ -7,17 +7,21 @@ static u8 clampU8(s32 v) {
|
||||
if (v < 256 && v > -1) {
|
||||
ok = 1;
|
||||
}
|
||||
return (ok) ? v : ((v < 0) ? 0 : 255);
|
||||
return ok ? v : 255 & ~(v >> 31);
|
||||
}
|
||||
|
||||
static s8 clampS8(s32 v) {
|
||||
return (v < 128 && v > -129) ? (s8)v : (v > 0) ? 127 : -128;
|
||||
s32 inRange = 0;
|
||||
if (v < 128 && v > -129) {
|
||||
inRange = 1;
|
||||
}
|
||||
return inRange ? (s8)v : (v > 0) ? 127 : -128;
|
||||
}
|
||||
|
||||
static s32 scalingClampU8(s32 val) {
|
||||
s32 result = 0;
|
||||
s32 result;
|
||||
if (val >> 19 != 0)
|
||||
result &= ~(val >> 31) & 0xFF;
|
||||
result = ~(val >> 31) & 0xFF;
|
||||
else
|
||||
result = (val >> 11);
|
||||
return result;
|
||||
@@ -38,8 +42,8 @@ void TMCJPEGDEC_IdctBlock_Lumi(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigz
|
||||
iter = (u32)(r + 7) >> 3;
|
||||
dst = tmp;
|
||||
done = 0;
|
||||
if (r > 0) {
|
||||
for (; iter > 0; iter--) {
|
||||
{
|
||||
for (; done < r; done += 8) {
|
||||
u32 ac;
|
||||
b4 = block[4];
|
||||
b6 = block[6];
|
||||
@@ -49,7 +53,13 @@ void TMCJPEGDEC_IdctBlock_Lumi(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigz
|
||||
b5 = block[5];
|
||||
b3 = block[3];
|
||||
|
||||
ac = (u32)b4 | (u32)b6 | (u32)b2 | (u32)b1 | (u32)b7 | (u32)b5 | (u32)b3;
|
||||
ac = (u32)b4;
|
||||
ac |= (u32)b6;
|
||||
ac |= (u32)b2;
|
||||
ac |= (u32)b1;
|
||||
ac |= (u32)b7;
|
||||
ac |= (u32)b5;
|
||||
ac |= (u32)b3;
|
||||
if (ac == 0) {
|
||||
s32 val = block[0];
|
||||
dst[7] = val;
|
||||
@@ -64,7 +74,7 @@ void TMCJPEGDEC_IdctBlock_Lumi(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigz
|
||||
t = (b2 - b6) * 0xB5 >> 8;
|
||||
a = block[0] - b4;
|
||||
d = block[0] + b4;
|
||||
u = t + b6 + b2;
|
||||
u = t + (b6 + b2);
|
||||
v = a + t;
|
||||
e = a - t;
|
||||
w = d + u;
|
||||
@@ -76,10 +86,13 @@ void TMCJPEGDEC_IdctBlock_Lumi(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigz
|
||||
x = x_factor * 0xB5 >> 8;
|
||||
z = z_factor * 0x62 >> 8;
|
||||
m = m_part - z;
|
||||
n = b1 + b7 + b5 + b3 + m;
|
||||
n = (b1 + b7) + ((b5 + b3) + m);
|
||||
o = x + m;
|
||||
p = z + p_part;
|
||||
q = p + x;
|
||||
dst[0] = w + n;
|
||||
dst[7] = w - n;
|
||||
dst[1] = v + o;
|
||||
dst[6] = v - o;
|
||||
dst[2] = e + q;
|
||||
dst[5] = e - q;
|
||||
@@ -88,12 +101,11 @@ void TMCJPEGDEC_IdctBlock_Lumi(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigz
|
||||
}
|
||||
block += 8;
|
||||
dst += 8;
|
||||
done += 8;
|
||||
}
|
||||
}
|
||||
|
||||
dst = tmp + done;
|
||||
for (; done < 0x38; done += 8) {
|
||||
for (; done <= 0x38; done += 8) {
|
||||
memset(dst, 0, 0x20);
|
||||
dst += 8;
|
||||
}
|
||||
@@ -114,7 +126,13 @@ void TMCJPEGDEC_IdctBlock_Lumi(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigz
|
||||
b5 = dst[0x28];
|
||||
b3 = dst[0x18];
|
||||
|
||||
ac = (u32)b4 | (u32)b6 | (u32)b2 | (u32)b1 | (u32)b7 | (u32)b5 | (u32)b3;
|
||||
ac = (u32)b4;
|
||||
ac |= (u32)b6;
|
||||
ac |= (u32)b2;
|
||||
ac |= (u32)b1;
|
||||
ac |= (u32)b7;
|
||||
ac |= (u32)b5;
|
||||
ac |= (u32)b3;
|
||||
out = conv_row_ptr + i;
|
||||
if (ac == 0) {
|
||||
u8 val = clampU8((*dst >> 11) + 0x80);
|
||||
@@ -128,13 +146,14 @@ void TMCJPEGDEC_IdctBlock_Lumi(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigz
|
||||
out[0] = val;
|
||||
} else {
|
||||
t = (b2 - b6) * 0xB5 >> 8;
|
||||
a = *dst - b4;
|
||||
d = *dst + b4;
|
||||
u = t + b6 + b2;
|
||||
a = (*dst + 0x40000) - b4;
|
||||
d = (*dst + 0x40000) + b4;
|
||||
u = t + (b6 + b2);
|
||||
v = a + t;
|
||||
e = a - t;
|
||||
w = d + u;
|
||||
x = ((b1 + b7) - (b5 + b3)) * 0xB5 >> 8;
|
||||
x_factor = (b1 + b7) - (b5 + b3);
|
||||
x = x_factor * 0xB5 >> 8;
|
||||
y = d - u;
|
||||
|
||||
z_factor = ((b5 - b3) + (b1 - b7)) * 0x62 >> 8;
|
||||
@@ -296,7 +315,7 @@ mode_gt_2:
|
||||
t = (b2 - b6) * 0xB5 >> 8;
|
||||
a = block[0] - b4;
|
||||
d = block[0] + b4;
|
||||
u = t + b6 + b2;
|
||||
u = t + (b6 + b2);
|
||||
v = a + t;
|
||||
e = a - t;
|
||||
w = d + u;
|
||||
@@ -308,10 +327,13 @@ mode_gt_2:
|
||||
x = x_factor * 0xB5 >> 8;
|
||||
z = z_factor * 0x62 >> 8;
|
||||
m = m_part - z;
|
||||
n = b1 + b7 + b5 + b3 + m;
|
||||
n = (b1 + b7) + ((b5 + b3) + m);
|
||||
o = x + m;
|
||||
p = z + p_part;
|
||||
q = p + x;
|
||||
dst[0] = w + n;
|
||||
dst[7] = w - n;
|
||||
dst[1] = v + o;
|
||||
dst[6] = v - o;
|
||||
dst[2] = e + q;
|
||||
dst[5] = e - q;
|
||||
@@ -365,15 +387,17 @@ epilogue:
|
||||
t = (b2 - b6) * 0xB5 >> 8;
|
||||
a = *dst - b4;
|
||||
d = *dst + b4;
|
||||
u = t + b6 + b2;
|
||||
u = t + (b6 + b2);
|
||||
v = a + t;
|
||||
e = a - t;
|
||||
w = d + u;
|
||||
x = ((b1 + b7) - (b5 + b3)) * 0xB5 >> 8;
|
||||
x_factor = (b1 + b7) - (b5 + b3);
|
||||
x = x_factor * 0xB5 >> 8;
|
||||
y = d - u;
|
||||
z = ((b5 - b3) + (b1 - b7)) * 0x62 >> 8;
|
||||
z_factor = (b5 - b3) + (b1 - b7);
|
||||
z = z_factor * 0x62 >> 8;
|
||||
m = ((b1 - b7) * 0x14E >> 8) - z;
|
||||
n = b1 + b7 + b5 + b3 + m;
|
||||
n = (b1 + b7) + ((b5 + b3) + m);
|
||||
o = x + m;
|
||||
|
||||
p = z + ((b5 - b3) * 0x8B >> 8);
|
||||
|
||||
@@ -15,9 +15,16 @@ static u16 readU16(const u8* p, u16 byteOrder) {
|
||||
return (u16)(raw >> 8 & 0xFF | (raw & 0xFF) << 8);
|
||||
}
|
||||
|
||||
static u16 readExifU16(const u8* data, u16 byteOrder) {
|
||||
u32 value = data[0] | data[1] << 8;
|
||||
if (byteOrder == 0x4949) {
|
||||
return (u16)value;
|
||||
}
|
||||
return (u16)(value >> 8 & 255 | (value & 255) << 8);
|
||||
}
|
||||
|
||||
static u32 readU32(const u8* p, u16 byteOrder) {
|
||||
u32 raw = p[0] | p[1] << 8;
|
||||
raw = raw | p[3] << 24 | p[2] << 16;
|
||||
u32 raw = p[1] << 8 | p[0] | p[2] << 16 | p[3] << 24;
|
||||
if (byteOrder == 0x4949) {
|
||||
return raw;
|
||||
}
|
||||
@@ -26,9 +33,9 @@ static u32 readU32(const u8* p, u16 byteOrder) {
|
||||
|
||||
s32 TMCCJPEGDecGetOffsetEXIF(u32* pOffset, u32* pSize, TMCCJPEGDecInitParam* pParam) {
|
||||
TMCCJPEGDecWork* work;
|
||||
u16 marker;
|
||||
u32 dataSize;
|
||||
u16 segSize;
|
||||
u32 dataSize;
|
||||
u16 marker;
|
||||
s32 result;
|
||||
u8 sig[4];
|
||||
|
||||
@@ -108,62 +115,26 @@ s32 TMCCJPEGDecGetOffsetEXIF(u32* pOffset, u32* pSize, TMCCJPEGDecInitParam* pPa
|
||||
continue;
|
||||
}
|
||||
|
||||
if (marker >= 0xFFD9) {
|
||||
if (marker == 0xFFD9) {
|
||||
switch (marker) {
|
||||
case 0xFFC0:
|
||||
case 0xFFC2:
|
||||
case 0xFFC4:
|
||||
case 0xFFDB:
|
||||
case 0xFFDC:
|
||||
case 0xFFDD:
|
||||
case 0xFFFE:
|
||||
result = TMCJPEGDEC_move_ptr(segSize, work);
|
||||
if (result < 0) {
|
||||
return result;
|
||||
}
|
||||
break;
|
||||
case 0xFFDA:
|
||||
return -2;
|
||||
}
|
||||
|
||||
if (marker == 0xFFFE) {
|
||||
result = TMCJPEGDEC_move_ptr(segSize, work);
|
||||
if (result < 0) {
|
||||
return result;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (marker >= 0xFFDE)
|
||||
case 0xFFD9:
|
||||
return -2;
|
||||
default:
|
||||
return -0x2F;
|
||||
|
||||
if (marker >= 0xFFDB) {
|
||||
result = TMCJPEGDEC_move_ptr(segSize, work);
|
||||
if (result < 0) {
|
||||
return result;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
return -2;
|
||||
}
|
||||
|
||||
if (marker >= 0xFFC2) {
|
||||
if (marker == 0xFFC2) {
|
||||
result = TMCJPEGDEC_move_ptr(segSize, work);
|
||||
if (result < 0) {
|
||||
return result;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (marker == 0xFFC4) {
|
||||
result = TMCJPEGDEC_move_ptr(segSize, work);
|
||||
if (result < 0) {
|
||||
return result;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
return -0x2F;
|
||||
}
|
||||
|
||||
if (marker == 0xFFC0) {
|
||||
result = TMCJPEGDEC_move_ptr(segSize, work);
|
||||
if (result < 0) {
|
||||
return result;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
return -0x2F;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,114 +242,103 @@ _error:
|
||||
}
|
||||
|
||||
static s32 TMCJPEGDEC_exif_parse(const u8* data, u32 size, TMCCJPEGDecExifData* pInfo) {
|
||||
u32 ifd0Offset;
|
||||
u32 ifd1Offset;
|
||||
u32 exifIfdOffset;
|
||||
u16 count;
|
||||
u32 entriesSize;
|
||||
u32 i;
|
||||
const u8* p;
|
||||
s32 sval;
|
||||
u16 byteOrder;
|
||||
u32 raw;
|
||||
|
||||
u32 ifdOffset;
|
||||
pInfo->thumbnailData = (u8*)data;
|
||||
pInfo->dataEnd = (u8*)data + size;
|
||||
pInfo->nextIfdOffset = 0;
|
||||
|
||||
if (size < 8) {
|
||||
return -161;
|
||||
}
|
||||
|
||||
raw = data[0] | data[1] << 8;
|
||||
byteOrder = raw;
|
||||
byteOrder = data[0] | data[1] << 8;
|
||||
if (byteOrder != 0x4D4D && byteOrder != 0x4949) {
|
||||
return -161;
|
||||
}
|
||||
|
||||
if (readU16(data + 2, byteOrder) != 0x002A) {
|
||||
if (readExifU16(data + 2, byteOrder) != 42) {
|
||||
return -161;
|
||||
}
|
||||
|
||||
ifd0Offset = readU32(data + 4, byteOrder);
|
||||
if (ifd0Offset > size) {
|
||||
ifdOffset = readU32(data + 4, byteOrder);
|
||||
if (size < ifdOffset) {
|
||||
return -161;
|
||||
}
|
||||
|
||||
sval = size - (u16)ifd0Offset;
|
||||
if (sval < 2) {
|
||||
return -161;
|
||||
}
|
||||
|
||||
p = data + (u16)ifd0Offset;
|
||||
count = readU16(p, byteOrder);
|
||||
entriesSize = count * 12;
|
||||
sval = (u32)(sval - 2);
|
||||
if (sval < entriesSize) {
|
||||
return -161;
|
||||
}
|
||||
|
||||
p += 2;
|
||||
for (i = 0; i < count; i++) {
|
||||
TMCJPEGDEC_IFD0_tag_parse(pInfo, byteOrder, p);
|
||||
p += 12;
|
||||
}
|
||||
|
||||
sval -= entriesSize;
|
||||
if (sval < 4) {
|
||||
return -161;
|
||||
}
|
||||
|
||||
ifd1Offset = readU32(p, byteOrder);
|
||||
if (ifd1Offset != 0) {
|
||||
if (ifd1Offset > size) {
|
||||
{
|
||||
const u8* entries = data + ifdOffset;
|
||||
u16 remaining = size - (u16)ifdOffset;
|
||||
u16 count;
|
||||
s32 entriesSize;
|
||||
u16 index;
|
||||
if (remaining < 2) {
|
||||
return -161;
|
||||
}
|
||||
|
||||
sval = size - (u16)ifd1Offset;
|
||||
if (sval < 2) {
|
||||
return -161;
|
||||
}
|
||||
|
||||
p = data + (u16)ifd1Offset;
|
||||
count = readU16(p, byteOrder);
|
||||
count = readExifU16(entries, byteOrder);
|
||||
entriesSize = count * 12;
|
||||
sval = (u32)(sval - 2);
|
||||
if (sval < entriesSize) {
|
||||
entries += 2;
|
||||
remaining -= 2;
|
||||
if (remaining < entriesSize) {
|
||||
return -161;
|
||||
}
|
||||
|
||||
p += 2;
|
||||
for (i = 0; i < count; i++) {
|
||||
TMCJPEGDEC_IFD1_tag_parse(pInfo, byteOrder, p);
|
||||
p += 12;
|
||||
for (index = 0; index < count; index++) {
|
||||
TMCJPEGDEC_IFD0_tag_parse(pInfo, byteOrder, entries);
|
||||
entries += 12;
|
||||
}
|
||||
remaining -= entriesSize;
|
||||
if (remaining < 4) {
|
||||
return -161;
|
||||
}
|
||||
ifdOffset = readU32(entries, byteOrder);
|
||||
}
|
||||
if (ifdOffset == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (size < ifdOffset) {
|
||||
return -161;
|
||||
}
|
||||
{
|
||||
const u8* entries = data + ifdOffset;
|
||||
u16 remaining = size - (u16)ifdOffset;
|
||||
u16 count;
|
||||
s32 entriesSize;
|
||||
u16 index;
|
||||
if (remaining < 2) {
|
||||
return -161;
|
||||
}
|
||||
count = readExifU16(entries, byteOrder);
|
||||
entriesSize = count * 12;
|
||||
entries += 2;
|
||||
remaining -= 2;
|
||||
if (remaining < entriesSize) {
|
||||
return -161;
|
||||
}
|
||||
for (index = 0; index < count; index++) {
|
||||
TMCJPEGDEC_IFD1_tag_parse(pInfo, byteOrder, entries);
|
||||
entries += 12;
|
||||
}
|
||||
}
|
||||
|
||||
exifIfdOffset = pInfo->nextIfdOffset;
|
||||
if (exifIfdOffset == 0 || exifIfdOffset > size) {
|
||||
ifdOffset = pInfo->nextIfdOffset;
|
||||
if (size < ifdOffset) {
|
||||
return -161;
|
||||
}
|
||||
|
||||
sval = size - (u16)exifIfdOffset;
|
||||
if (sval < 2) {
|
||||
return -161;
|
||||
{
|
||||
const u8* entries = data + ifdOffset;
|
||||
u16 remaining = size - (u16)ifdOffset;
|
||||
u16 count;
|
||||
s32 entriesSize;
|
||||
u16 index;
|
||||
if (remaining < 2) {
|
||||
return -161;
|
||||
}
|
||||
count = readExifU16(entries, byteOrder);
|
||||
entriesSize = count * 12;
|
||||
entries += 2;
|
||||
remaining -= 2;
|
||||
if (remaining < entriesSize) {
|
||||
return -161;
|
||||
}
|
||||
for (index = 0; index < count; index++) {
|
||||
TMCJPEGDEC_IFD0_tag_parse(pInfo, byteOrder, entries);
|
||||
entries += 12;
|
||||
}
|
||||
}
|
||||
|
||||
p = data + (u16)exifIfdOffset;
|
||||
count = readU16(p, byteOrder);
|
||||
entriesSize = count * 12;
|
||||
sval = (u32)(sval - 2);
|
||||
if (sval < entriesSize) {
|
||||
return -161;
|
||||
}
|
||||
|
||||
p += 2;
|
||||
for (i = 0; i < count; i++) {
|
||||
TMCJPEGDEC_IFD0_tag_parse(pInfo, byteOrder, p);
|
||||
p += 12;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -391,7 +351,9 @@ static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
|
||||
|
||||
switch (tag) {
|
||||
case 0x0103:
|
||||
case 0x0111: {
|
||||
case 0x0111:
|
||||
case 0x0201:
|
||||
case 0x0202: {
|
||||
return;
|
||||
}
|
||||
case 0x0112: {
|
||||
@@ -401,18 +363,18 @@ static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
|
||||
case 0x011A: {
|
||||
u32 offset = readU32(entry + 8, byteOrder);
|
||||
const u8* p = pInfo->thumbnailData + offset;
|
||||
if (p < pInfo->thumbnailData) {
|
||||
if (pInfo->thumbnailData > p) {
|
||||
return;
|
||||
}
|
||||
if (p + 4 > pInfo->dataEnd) {
|
||||
if (p > pInfo->dataEnd - 4) {
|
||||
return;
|
||||
}
|
||||
pInfo->xResNum = readU32(p, byteOrder);
|
||||
p = (const u8*)(pInfo->thumbnailData + offset + 4);
|
||||
if (p < pInfo->thumbnailData) {
|
||||
if (pInfo->thumbnailData > p) {
|
||||
return;
|
||||
}
|
||||
if (p + 4 > pInfo->dataEnd) {
|
||||
if (p > pInfo->dataEnd - 4) {
|
||||
return;
|
||||
}
|
||||
pInfo->xResDen = readU32(p, byteOrder);
|
||||
@@ -421,18 +383,18 @@ static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
|
||||
case 0x011B: {
|
||||
u32 offset = readU32(entry + 8, byteOrder);
|
||||
const u8* p = pInfo->thumbnailData + offset;
|
||||
if (p < pInfo->thumbnailData) {
|
||||
if (pInfo->thumbnailData > p) {
|
||||
return;
|
||||
}
|
||||
if (p + 4 > pInfo->dataEnd) {
|
||||
if (p > pInfo->dataEnd - 4) {
|
||||
return;
|
||||
}
|
||||
pInfo->yResNum = readU32(p, byteOrder);
|
||||
p = (const u8*)(pInfo->thumbnailData + offset + 4);
|
||||
if (p < pInfo->thumbnailData) {
|
||||
if (pInfo->thumbnailData > p) {
|
||||
return;
|
||||
}
|
||||
if (p + 4 > pInfo->dataEnd) {
|
||||
if (p > pInfo->dataEnd - 4) {
|
||||
return;
|
||||
}
|
||||
pInfo->yResDen = readU32(p, byteOrder);
|
||||
@@ -444,19 +406,19 @@ static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
|
||||
}
|
||||
case 0x012D: {
|
||||
u32 offset = readU32(entry + 8, byteOrder);
|
||||
const u8* p = pInfo->thumbnailData + offset;
|
||||
u32 j;
|
||||
u32 i;
|
||||
for (j = 0; j < 3; j++) {
|
||||
for (i = 0; i < 256; i++) {
|
||||
if (p < pInfo->thumbnailData) {
|
||||
return;
|
||||
u32 channel;
|
||||
u32 index;
|
||||
for (channel = 0; channel < 3; channel++) {
|
||||
for (index = 0; index < 256; index++) {
|
||||
const u8* p = pInfo->thumbnailData + offset;
|
||||
if (pInfo->thumbnailData > p) {
|
||||
break;
|
||||
}
|
||||
if (p + 2 > pInfo->dataEnd) {
|
||||
return;
|
||||
if (p > pInfo->dataEnd - 2) {
|
||||
break;
|
||||
}
|
||||
pInfo->transferFunc[j][i] = readU16(p, byteOrder);
|
||||
p += 2;
|
||||
pInfo->transferFunc[channel][index] = readU16(p, byteOrder);
|
||||
offset += 2;
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -464,17 +426,18 @@ static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
|
||||
case 0x0132: {
|
||||
u32 offset = readU32(entry + 8, byteOrder);
|
||||
const u8* p = pInfo->thumbnailData + offset;
|
||||
if (p < pInfo->thumbnailData) {
|
||||
if (pInfo->thumbnailData > p) {
|
||||
return;
|
||||
}
|
||||
if (p + 20 > pInfo->dataEnd) {
|
||||
if (p > pInfo->dataEnd - 20) {
|
||||
return;
|
||||
}
|
||||
*(u32*)(pInfo->dateTime + 0) = *(u32*)(p + 0);
|
||||
*(u32*)(pInfo->dateTime + 4) = *(u32*)(p + 4);
|
||||
*(u32*)(pInfo->dateTime + 8) = *(u32*)(p + 8);
|
||||
*(u32*)(pInfo->dateTime + 12) = *(u32*)(p + 12);
|
||||
*(u32*)(pInfo->dateTime + 16) = *(u32*)(p + 16);
|
||||
{
|
||||
u32 index;
|
||||
for (index = 0; index < 20; index++) {
|
||||
pInfo->dateTime[index] = p[index];
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
case 0x0213: {
|
||||
@@ -538,52 +501,54 @@ static void TMCJPEGDEC_IFD1_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
|
||||
switch (tag) {
|
||||
case 0x0132:
|
||||
case 0x0111:
|
||||
case 0x0112:
|
||||
case 0x012D:
|
||||
case 0x0213:
|
||||
case 0x8769:
|
||||
case 0x9000:
|
||||
case 0x9101: {
|
||||
return;
|
||||
}
|
||||
case 0x0103: {
|
||||
pInfo->compressionIfd1 = readU16(entry + 8, byteOrder);
|
||||
case 0x9101:
|
||||
case 0xA003: {
|
||||
return;
|
||||
}
|
||||
case 0x011A: {
|
||||
u32 offset = readU32(entry + 8, byteOrder);
|
||||
const u8* p = pInfo->thumbnailData + offset;
|
||||
if (p < pInfo->thumbnailData) {
|
||||
u32 offset;
|
||||
const u8* p;
|
||||
offset = readU32(entry + 8, byteOrder);
|
||||
p = pInfo->thumbnailData + offset;
|
||||
if (pInfo->thumbnailData > p) {
|
||||
return;
|
||||
}
|
||||
if (p + 4 > pInfo->dataEnd) {
|
||||
if (p > pInfo->dataEnd - 4) {
|
||||
return;
|
||||
}
|
||||
pInfo->xResNumIfd1 = readU32(p, byteOrder);
|
||||
p = (const u8*)(pInfo->thumbnailData + offset + 4);
|
||||
if (p < pInfo->thumbnailData) {
|
||||
if (pInfo->thumbnailData > p) {
|
||||
return;
|
||||
}
|
||||
if (p + 4 > pInfo->dataEnd) {
|
||||
if (p > pInfo->dataEnd - 4) {
|
||||
return;
|
||||
}
|
||||
pInfo->xResDenIfd1 = readU32(p, byteOrder);
|
||||
return;
|
||||
}
|
||||
case 0x011B: {
|
||||
u32 offset = readU32(entry + 8, byteOrder);
|
||||
const u8* p = pInfo->thumbnailData + offset;
|
||||
if (p < pInfo->thumbnailData) {
|
||||
u32 offset;
|
||||
const u8* p;
|
||||
offset = readU32(entry + 8, byteOrder);
|
||||
p = pInfo->thumbnailData + offset;
|
||||
if (pInfo->thumbnailData > p) {
|
||||
return;
|
||||
}
|
||||
if (p + 4 > pInfo->dataEnd) {
|
||||
if (p > pInfo->dataEnd - 4) {
|
||||
return;
|
||||
}
|
||||
pInfo->planarConfigIfd1 = readU32(p, byteOrder);
|
||||
p = (const u8*)(pInfo->thumbnailData + offset + 4);
|
||||
if (p < pInfo->thumbnailData) {
|
||||
if (pInfo->thumbnailData > p) {
|
||||
return;
|
||||
}
|
||||
if (p + 4 > pInfo->dataEnd) {
|
||||
if (p > pInfo->dataEnd - 4) {
|
||||
return;
|
||||
}
|
||||
pInfo->yResDenIfd1 = readU32(p, byteOrder);
|
||||
@@ -593,6 +558,10 @@ static void TMCJPEGDEC_IFD1_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
|
||||
pInfo->resUnitIfd1 = readU16(entry + 8, byteOrder);
|
||||
return;
|
||||
}
|
||||
case 0x0103: {
|
||||
pInfo->compressionIfd1 = readU16(entry + 8, byteOrder);
|
||||
return;
|
||||
}
|
||||
case 0x0201: {
|
||||
pInfo->thumbnailOffset = readU32(entry + 8, byteOrder);
|
||||
return;
|
||||
|
||||
@@ -50,7 +50,7 @@ s32 TMCJPEGDEC_set_converterRGB565(TMCCJPEGDecWork* work) {
|
||||
work->pConvRowPtrs[0] = (void*)ptr;
|
||||
work->pConvRowPtrs[1] = (void*)(ptr + mode);
|
||||
work->pConvRowPtrs[5] = (void*)(ob + 0x84);
|
||||
work->pConvRowPtrs[6] = (void*)(ob + 0xC4);
|
||||
work->pConvRowPtrs[6] = (void*)(ob + 0xc4);
|
||||
work->pitch = 0x10;
|
||||
work->converterFlags = 0;
|
||||
break;
|
||||
@@ -58,12 +58,15 @@ s32 TMCJPEGDEC_set_converterRGB565(TMCCJPEGDecWork* work) {
|
||||
case 2: {
|
||||
u8 mode = work->idctMode;
|
||||
u8* ptr = ob + 4;
|
||||
u8* p1 = ptr + mode;
|
||||
u8* p2 = ptr + mode * 16;
|
||||
u8* p3 = p2 + mode;
|
||||
work->pConverterFunc = TMCJPEGDEC_converterYUV420toRGB565;
|
||||
work->pConverterFuncEdge = TMCJPEGDEC_converterYUV420toRGB565edge;
|
||||
work->pConvRowPtrs[0] = (void*)ptr;
|
||||
work->pConvRowPtrs[1] = (void*)(ptr + mode);
|
||||
work->pConvRowPtrs[2] = (void*)(ptr + mode * 16);
|
||||
work->pConvRowPtrs[3] = (void*)(ptr + mode * 16 + mode);
|
||||
work->pConvRowPtrs[1] = (void*)p1;
|
||||
work->pConvRowPtrs[2] = (void*)p2;
|
||||
work->pConvRowPtrs[3] = (void*)p3;
|
||||
work->pConvRowPtrs[5] = (void*)(ob + 0x104);
|
||||
work->pConvRowPtrs[6] = (void*)(ob + 0x144);
|
||||
work->pitch = 0x10;
|
||||
@@ -77,26 +80,26 @@ s32 TMCJPEGDEC_set_converterRGB565(TMCCJPEGDecWork* work) {
|
||||
work->pConverterFuncEdge = TMCJPEGDEC_converterYUV211toRGB565edge;
|
||||
work->pConvRowPtrs[0] = (void*)ptr;
|
||||
work->pConvRowPtrs[1] = (void*)(ptr + mode * 8);
|
||||
work->pConvRowPtrs[5] = (void*)(ptr + 0x84);
|
||||
work->pConvRowPtrs[6] = (void*)(ptr + 0xC4);
|
||||
work->pConvRowPtrs[5] = (void*)(ob + 0x84);
|
||||
work->pConvRowPtrs[6] = (void*)(ob + 0xc4);
|
||||
work->pitch = 0x08;
|
||||
work->converterFlags = 0;
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
work->pConverterFunc = TMCJPEGDEC_converterYUV400toRGB565;
|
||||
work->pConverterFuncEdge = TMCJPEGDEC_converterYUV400toRGB565edge;
|
||||
work->pConvRowPtrs[0] = (void*)(ob + 4);
|
||||
work->pConverterFunc = TMCJPEGDEC_converterYUV444toRGB565;
|
||||
work->pConverterFuncEdge = TMCJPEGDEC_converterYUV444toRGB565edge;
|
||||
work->pConvRowPtrs[0] = (void*)(ob + 0x4);
|
||||
work->pConvRowPtrs[5] = (void*)(ob + 0x44);
|
||||
work->pConvRowPtrs[6] = (void*)(ob + 0x84);
|
||||
work->pitch = 0x08;
|
||||
work->converterFlags = 0;
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
work->pConverterFunc = TMCJPEGDEC_converterYUV444toRGB565;
|
||||
work->pConverterFuncEdge = TMCJPEGDEC_converterYUV444toRGB565edge;
|
||||
work->pConvRowPtrs[0] = (void*)(ob + 4);
|
||||
work->pConvRowPtrs[5] = (void*)(ob + 0x44);
|
||||
work->pConvRowPtrs[6] = (void*)(ob + 0x84);
|
||||
work->pConverterFunc = TMCJPEGDEC_converterYUV400toRGB565;
|
||||
work->pConverterFuncEdge = TMCJPEGDEC_converterYUV400toRGB565edge;
|
||||
work->pConvRowPtrs[0] = (void*)(ob + 0x4);
|
||||
work->pitch = 0x08;
|
||||
work->converterFlags = 0;
|
||||
break;
|
||||
@@ -107,18 +110,723 @@ s32 TMCJPEGDEC_set_converterRGB565(TMCCJPEGDecWork* work) {
|
||||
}
|
||||
|
||||
{
|
||||
u32 fw = st->jpegWidth;
|
||||
u32 fh = st->jpegHeight;
|
||||
s32 bw = (s32)(((fw << 30) - (fw >> 31)) * 4 + (fw >> 31));
|
||||
s32 bh = (s32)(((fh << 30) - (fh >> 31)) * 4 + (fh >> 31));
|
||||
{
|
||||
s32 nb = -bw;
|
||||
s32 nb2 = -bh;
|
||||
bw = ((nb | bw) >> 31) + (fw >> 2);
|
||||
bh = ((nb2 | bh) >> 31) + (fh >> 2);
|
||||
}
|
||||
st->convWidth = bw << 2;
|
||||
st->convHeight = bh << 2;
|
||||
s32 width = st->jpegWidth;
|
||||
s32 height = st->jpegHeight;
|
||||
st->convWidth = ((u32)width / 4 + (width % 4 != 0)) * 4;
|
||||
st->convHeight = ((u32)height / 4 + (height % 4 != 0)) * 4;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_converterYUV411toRGB565(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
u8* cb = work->convBuf + 260;
|
||||
u8* cr = work->convBuf + 324;
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 2;
|
||||
u8* texture = state->pTexBuffer;
|
||||
s32 width;
|
||||
s32 height;
|
||||
width = 32 / state->scaleFactor;
|
||||
height = 8 / state->scaleFactor;
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 lumaSkip = 32 - width;
|
||||
s32 chromaSkip = lumaSkip >> 2;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u16* output = (u16*)(texture + ((y & 3) << 3));
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 4) {
|
||||
s32 redOffset, greenOffset, blueOffset;
|
||||
{
|
||||
s32 cbValue = (s8)*cb++;
|
||||
s32 crValue = (s8)*cr++;
|
||||
redOffset = (crValue * 359) >> 8;
|
||||
greenOffset = -(cbValue * 88 + crValue * 183) >> 8;
|
||||
blueOffset = (cbValue * 454) >> 8;
|
||||
}
|
||||
{
|
||||
s32 value = luminance[0];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column & 3) + ((((column) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
{
|
||||
s32 value = luminance[1];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column + 1 & 3) + ((((column + 1) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
{
|
||||
s32 value = luminance[2];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column + 2 & 3) + ((((column + 2) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
{
|
||||
s32 value = luminance[3];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column + 3 & 3) + ((((column + 3) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
luminance += 4;
|
||||
}
|
||||
luminance += lumaSkip;
|
||||
cb += chromaSkip;
|
||||
cr += chromaSkip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_converterYUV411toRGB565edge(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
u8* cb = work->convBuf + 260;
|
||||
u8* cr = work->convBuf + 324;
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 2;
|
||||
u8* texture = state->pTexBuffer;
|
||||
s32 width;
|
||||
s32 height;
|
||||
if (state->dataSizeX == (u32)x) {
|
||||
width = state->stepXExt;
|
||||
} else {
|
||||
width = 32 / state->scaleFactor;
|
||||
}
|
||||
if (state->dataSizeY == (u32)y) {
|
||||
height = state->stepYExt;
|
||||
} else {
|
||||
height = 8 / state->scaleFactor;
|
||||
}
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 lumaSkip = 32 - width;
|
||||
s32 chromaSkip = lumaSkip >> 2;
|
||||
s32 redOffset = 0, greenOffset = 0, blueOffset = 0;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u16* output = (u16*)(texture + ((y & 3) << 3));
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
if ((column & 3) == 0) {
|
||||
s32 cbValue = (s8)*cb++;
|
||||
s32 crValue = (s8)*cr++;
|
||||
redOffset = (crValue * 359) >> 8;
|
||||
greenOffset = -(cbValue * 88 + crValue * 183) >> 8;
|
||||
blueOffset = (cbValue * 454) >> 8;
|
||||
}
|
||||
{
|
||||
s32 value = luminance[0];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column & 3) + ((((column) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += lumaSkip;
|
||||
cb += chromaSkip;
|
||||
cr += chromaSkip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_converterYUV422toRGB565(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
u8* cb = work->convBuf + 132;
|
||||
u8* cr = work->convBuf + 196;
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 2;
|
||||
u8* texture = state->pTexBuffer;
|
||||
s32 width;
|
||||
s32 height;
|
||||
width = 16 / state->scaleFactor;
|
||||
height = 8 / state->scaleFactor;
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 lumaSkip = 16 - width;
|
||||
s32 chromaSkip = lumaSkip >> 1;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u16* output = (u16*)(texture + ((y & 3) << 3));
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 2) {
|
||||
s32 redOffset, greenOffset, blueOffset;
|
||||
{
|
||||
s32 cbValue = (s8)*cb++;
|
||||
s32 crValue = (s8)*cr++;
|
||||
redOffset = (crValue * 359) >> 8;
|
||||
greenOffset = -(cbValue * 88 + crValue * 183) >> 8;
|
||||
blueOffset = (cbValue * 454) >> 8;
|
||||
}
|
||||
{
|
||||
s32 value = luminance[0];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column & 3) + ((((column) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
{
|
||||
s32 value = luminance[1];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column + 1 & 3) + ((((column + 1) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
luminance += 2;
|
||||
}
|
||||
luminance += lumaSkip;
|
||||
cb += chromaSkip;
|
||||
cr += chromaSkip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_converterYUV422toRGB565edge(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
u8* cb = work->convBuf + 132;
|
||||
u8* cr = work->convBuf + 196;
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 2;
|
||||
u8* texture = state->pTexBuffer;
|
||||
s32 width;
|
||||
s32 height;
|
||||
if (state->dataSizeX == (u32)x) {
|
||||
width = state->stepXExt;
|
||||
} else {
|
||||
width = 16 / state->scaleFactor;
|
||||
}
|
||||
if (state->dataSizeY == (u32)y) {
|
||||
height = state->stepYExt;
|
||||
} else {
|
||||
height = 8 / state->scaleFactor;
|
||||
}
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 lumaSkip = 16 - width;
|
||||
s32 chromaSkip = lumaSkip >> 1;
|
||||
s32 redOffset = 0, greenOffset = 0, blueOffset = 0;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u16* output = (u16*)(texture + ((y & 3) << 3));
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
if ((column & 1) == 0) {
|
||||
s32 cbValue = (s8)*cb++;
|
||||
s32 crValue = (s8)*cr++;
|
||||
redOffset = (crValue * 359) >> 8;
|
||||
greenOffset = -(cbValue * 88 + crValue * 183) >> 8;
|
||||
blueOffset = (cbValue * 454) >> 8;
|
||||
}
|
||||
{
|
||||
s32 value = luminance[0];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column & 3) + ((((column) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += lumaSkip;
|
||||
cb += chromaSkip;
|
||||
cr += chromaSkip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_converterYUV420toRGB565(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
u8* cb = work->convBuf + 260;
|
||||
u8* cr = work->convBuf + 324;
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 2;
|
||||
u8* texture = state->pTexBuffer;
|
||||
s32 width;
|
||||
s32 height;
|
||||
width = 16 / state->scaleFactor;
|
||||
height = 16 / state->scaleFactor;
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 lumaSkip = 16 - width;
|
||||
s32 chromaSkip = lumaSkip >> 1;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u16* output = (u16*)(texture + ((y & 3) << 3));
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 2) {
|
||||
s32 redOffset, greenOffset, blueOffset;
|
||||
{
|
||||
s32 cbValue = (s8)*cb++;
|
||||
s32 crValue = (s8)*cr++;
|
||||
redOffset = (crValue * 359) >> 8;
|
||||
greenOffset = -(cbValue * 88 + crValue * 183) >> 8;
|
||||
blueOffset = (cbValue * 454) >> 8;
|
||||
}
|
||||
{
|
||||
s32 value = luminance[0];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column & 3) + ((((column) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
{
|
||||
s32 value = luminance[1];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column + 1 & 3) + ((((column + 1) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
luminance += 2;
|
||||
}
|
||||
luminance += lumaSkip;
|
||||
if (y & 1) {
|
||||
cb += chromaSkip;
|
||||
cr += chromaSkip;
|
||||
} else {
|
||||
cb -= (width + 1) >> 1;
|
||||
cr -= (width + 1) >> 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_converterYUV420toRGB565edge(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
u8* cb = work->convBuf + 260;
|
||||
u8* cr = work->convBuf + 324;
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 2;
|
||||
u8* texture = state->pTexBuffer;
|
||||
s32 width;
|
||||
s32 height;
|
||||
if (state->dataSizeX == (u32)x) {
|
||||
width = state->stepXExt;
|
||||
} else {
|
||||
width = 16 / state->scaleFactor;
|
||||
}
|
||||
if (state->dataSizeY == (u32)y) {
|
||||
height = state->stepYExt;
|
||||
} else {
|
||||
height = 16 / state->scaleFactor;
|
||||
}
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 lumaSkip = 16 - width;
|
||||
s32 chromaSkip = lumaSkip >> 1;
|
||||
s32 redOffset = 0, greenOffset = 0, blueOffset = 0;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u16* output = (u16*)(texture + ((y & 3) << 3));
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
if ((column & 1) == 0) {
|
||||
s32 cbValue = (s8)*cb++;
|
||||
s32 crValue = (s8)*cr++;
|
||||
redOffset = (crValue * 359) >> 8;
|
||||
greenOffset = -(cbValue * 88 + crValue * 183) >> 8;
|
||||
blueOffset = (cbValue * 454) >> 8;
|
||||
}
|
||||
{
|
||||
s32 value = luminance[0];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column & 3) + ((((column) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += lumaSkip;
|
||||
if (y & 1) {
|
||||
cb += chromaSkip;
|
||||
cr += chromaSkip;
|
||||
} else {
|
||||
cb -= (width + 1) >> 1;
|
||||
cr -= (width + 1) >> 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_converterYUV211toRGB565(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
u8* cb = work->convBuf + 132;
|
||||
u8* cr = work->convBuf + 196;
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 2;
|
||||
u8* texture = state->pTexBuffer;
|
||||
s32 width;
|
||||
s32 height;
|
||||
width = 8 / state->scaleFactor;
|
||||
height = 16 / state->scaleFactor;
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 lumaSkip = 8 - width;
|
||||
s32 chromaSkip = lumaSkip >> 0;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u16* output = (u16*)(texture + ((y & 3) << 3));
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
s32 redOffset, greenOffset, blueOffset;
|
||||
{
|
||||
s32 cbValue = (s8)*cb++;
|
||||
s32 crValue = (s8)*cr++;
|
||||
redOffset = (crValue * 359) >> 8;
|
||||
greenOffset = -(cbValue * 88 + crValue * 183) >> 8;
|
||||
blueOffset = (cbValue * 454) >> 8;
|
||||
}
|
||||
{
|
||||
s32 value = luminance[0];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column & 3) + ((((column) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += lumaSkip;
|
||||
if (y & 1) {
|
||||
cb += chromaSkip;
|
||||
cr += chromaSkip;
|
||||
} else {
|
||||
cb -= (width + 0) >> 0;
|
||||
cr -= (width + 0) >> 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_converterYUV211toRGB565edge(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
u8* cb = work->convBuf + 132;
|
||||
u8* cr = work->convBuf + 196;
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 2;
|
||||
u8* texture = state->pTexBuffer;
|
||||
s32 width;
|
||||
s32 height;
|
||||
if (state->dataSizeX == (u32)x) {
|
||||
width = state->stepXExt;
|
||||
} else {
|
||||
width = 8 / state->scaleFactor;
|
||||
}
|
||||
if (state->dataSizeY == (u32)y) {
|
||||
height = state->stepYExt;
|
||||
} else {
|
||||
height = 16 / state->scaleFactor;
|
||||
}
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 lumaSkip = 8 - width;
|
||||
s32 chromaSkip = lumaSkip >> 0;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u16* output = (u16*)(texture + ((y & 3) << 3));
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
s32 redOffset, greenOffset, blueOffset;
|
||||
{
|
||||
s32 cbValue = (s8)*cb++;
|
||||
s32 crValue = (s8)*cr++;
|
||||
redOffset = (crValue * 359) >> 8;
|
||||
greenOffset = -(cbValue * 88 + crValue * 183) >> 8;
|
||||
blueOffset = (cbValue * 454) >> 8;
|
||||
}
|
||||
{
|
||||
s32 value = luminance[0];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column & 3) + ((((column) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += lumaSkip;
|
||||
if (y & 1) {
|
||||
cb += chromaSkip;
|
||||
cr += chromaSkip;
|
||||
} else {
|
||||
cb -= (width + 0) >> 0;
|
||||
cr -= (width + 0) >> 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_converterYUV444toRGB565(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
u8* cb = work->convBuf + 68;
|
||||
u8* cr = work->convBuf + 132;
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 2;
|
||||
u8* texture = state->pTexBuffer;
|
||||
s32 width;
|
||||
s32 height;
|
||||
width = 8 / state->scaleFactor;
|
||||
height = 8 / state->scaleFactor;
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 lumaSkip = 8 - width;
|
||||
s32 chromaSkip = lumaSkip >> 0;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u16* output = (u16*)(texture + ((y & 3) << 3));
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
s32 redOffset, greenOffset, blueOffset;
|
||||
{
|
||||
s32 cbValue = (s8)*cb++;
|
||||
s32 crValue = (s8)*cr++;
|
||||
redOffset = (crValue * 359) >> 8;
|
||||
greenOffset = -(cbValue * 88 + crValue * 183) >> 8;
|
||||
blueOffset = (cbValue * 454) >> 8;
|
||||
}
|
||||
{
|
||||
s32 value = luminance[0];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column & 3) + ((((column) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += lumaSkip;
|
||||
cb += chromaSkip;
|
||||
cr += chromaSkip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_converterYUV444toRGB565edge(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
u8* cb = work->convBuf + 68;
|
||||
u8* cr = work->convBuf + 132;
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 2;
|
||||
u8* texture = state->pTexBuffer;
|
||||
s32 width;
|
||||
s32 height;
|
||||
if (state->dataSizeX == (u32)x) {
|
||||
width = state->stepXExt;
|
||||
} else {
|
||||
width = 8 / state->scaleFactor;
|
||||
}
|
||||
if (state->dataSizeY == (u32)y) {
|
||||
height = state->stepYExt;
|
||||
} else {
|
||||
height = 8 / state->scaleFactor;
|
||||
}
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 lumaSkip = 8 - width;
|
||||
s32 chromaSkip = lumaSkip >> 0;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u16* output = (u16*)(texture + ((y & 3) << 3));
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
s32 redOffset, greenOffset, blueOffset;
|
||||
{
|
||||
s32 cbValue = (s8)*cb++;
|
||||
s32 crValue = (s8)*cr++;
|
||||
redOffset = (crValue * 359) >> 8;
|
||||
greenOffset = -(cbValue * 88 + crValue * 183) >> 8;
|
||||
blueOffset = (cbValue * 454) >> 8;
|
||||
}
|
||||
{
|
||||
s32 value = luminance[0];
|
||||
s32 red = value + redOffset;
|
||||
s32 green = value + greenOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = (blue > 255) ? 255 : blue & ~(blue >> 31);
|
||||
green = (green > 255) ? 255 : green & ~(green >> 31);
|
||||
red = (red > 255) ? 255 : red & ~(red >> 31);
|
||||
}
|
||||
output[(column & 3) + ((((column) >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += lumaSkip;
|
||||
cb += chromaSkip;
|
||||
cr += chromaSkip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_converterYUV400toRGB565(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 2;
|
||||
u8* texture = state->pTexBuffer;
|
||||
s32 width;
|
||||
s32 height;
|
||||
width = 8 / state->scaleFactor;
|
||||
height = 8 / state->scaleFactor;
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 lumaSkip = 8 - width;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u16* output = (u16*)(texture + ((y & 3) << 3));
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
s32 value = *luminance++;
|
||||
s32 red, green, blue;
|
||||
if (value >> 8) {
|
||||
blue = (value > 255) ? 255 : value & ~(value >> 31);
|
||||
green = (value > 255) ? 255 : value & ~(value >> 31);
|
||||
red = (value > 255) ? 255 : value & ~(value >> 31);
|
||||
} else {
|
||||
red = green = blue = value;
|
||||
}
|
||||
output[(column & 3) + (((column >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
luminance += lumaSkip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_converterYUV400toRGB565edge(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 2;
|
||||
u8* texture = state->pTexBuffer;
|
||||
s32 width;
|
||||
s32 height;
|
||||
if (state->dataSizeX == (u32)x) {
|
||||
width = state->stepXExt;
|
||||
} else {
|
||||
width = 8 / state->scaleFactor;
|
||||
}
|
||||
if (state->dataSizeY == (u32)y) {
|
||||
height = state->stepYExt;
|
||||
} else {
|
||||
height = 8 / state->scaleFactor;
|
||||
}
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 lumaSkip = 8 - width;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u16* output = (u16*)(texture + ((y & 3) << 3));
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
s32 value = *luminance++;
|
||||
s32 red, green, blue;
|
||||
if (value >> 8) {
|
||||
blue = (value > 255) ? 255 : value & ~(value >> 31);
|
||||
green = (value > 255) ? 255 : value & ~(value >> 31);
|
||||
red = (value > 255) ? 255 : value & ~(value >> 31);
|
||||
} else {
|
||||
red = green = blue = value;
|
||||
}
|
||||
output[(column & 3) + (((column >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
luminance += lumaSkip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,672 @@
|
||||
#define TMC_JPEG_PLANAR_OUTPUT
|
||||
#include <tmc_jpeg_internal.h>
|
||||
|
||||
static void TMCJPEG_814EFEAC(TMCCJPEGDecWork*, s32, s32);
|
||||
static void TMCJPEG_814F043C(TMCCJPEGDecWork*, s32, s32);
|
||||
static void TMCJPEG_814F0A58(TMCCJPEGDecWork*, s32, s32);
|
||||
static void TMCJPEG_814F11C4(TMCCJPEGDecWork*, s32, s32);
|
||||
static void TMCJPEG_814F17E0(TMCCJPEGDecWork*, s32, s32);
|
||||
static void TMCJPEG_814F1F48(TMCCJPEGDecWork*, s32, s32);
|
||||
static void TMCJPEG_814F2570(TMCCJPEGDecWork*, s32, s32);
|
||||
static void TMCJPEG_814F2B50(TMCCJPEGDecWork*, s32, s32);
|
||||
static void TMCJPEG_814F3158(TMCCJPEGDecWork*, s32, s32);
|
||||
static void TMCJPEG_814F32E4(TMCCJPEGDecWork*, s32, s32);
|
||||
static void TMCJPEG_814F34A4(TMCCJPEGDecWork*, s32, s32);
|
||||
static void TMCJPEG_814F372C(TMCCJPEGDecWork*, s32, s32);
|
||||
|
||||
s32 TMCJPEGDEC_set_converterY8U8V8(TMCCJPEGDecWork* work) {
|
||||
u8* ob;
|
||||
s32 cc;
|
||||
TMCCJPEGDecState* st;
|
||||
|
||||
ob = (u8*)&work->convBuf;
|
||||
cc = work->componentCount;
|
||||
st = work->pState;
|
||||
|
||||
switch (cc) {
|
||||
case 0: {
|
||||
u8 mode = work->idctMode;
|
||||
u8* ptr = ob + 4;
|
||||
u8* p1 = ptr + mode;
|
||||
u8* p2 = p1 + mode;
|
||||
u8* p3 = p2 + mode;
|
||||
|
||||
work->pConverterFunc = TMCJPEG_814EFEAC;
|
||||
work->pConverterFuncEdge = TMCJPEG_814F043C;
|
||||
work->pConvRowPtrs[0] = (void*)ptr;
|
||||
work->pConvRowPtrs[1] = (void*)p1;
|
||||
work->pConvRowPtrs[2] = (void*)p2;
|
||||
work->pConvRowPtrs[3] = (void*)p3;
|
||||
work->pConvRowPtrs[5] = (void*)(ob + 0x104);
|
||||
work->pConvRowPtrs[6] = (void*)(ob + 0x144);
|
||||
work->pitch = 0x20;
|
||||
work->converterFlags = 0;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
u8 mode = work->idctMode;
|
||||
u8* ptr = ob + 4;
|
||||
work->pConverterFunc = TMCJPEG_814F0A58;
|
||||
work->pConverterFuncEdge = TMCJPEG_814F11C4;
|
||||
work->pConvRowPtrs[0] = (void*)ptr;
|
||||
work->pConvRowPtrs[1] = (void*)(ptr + mode);
|
||||
work->pConvRowPtrs[5] = (void*)(ob + 0x84);
|
||||
work->pConvRowPtrs[6] = (void*)(ob + 0xC4);
|
||||
work->pitch = 0x10;
|
||||
work->converterFlags = 0;
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
u8 mode = work->idctMode;
|
||||
u8* ptr = ob + 4;
|
||||
u8* p1 = ptr + mode;
|
||||
u8* p2 = ptr + mode * 16;
|
||||
u8* p3 = p2 + mode;
|
||||
work->pConverterFunc = TMCJPEG_814F17E0;
|
||||
work->pConverterFuncEdge = TMCJPEG_814F1F48;
|
||||
work->pConvRowPtrs[0] = (void*)ptr;
|
||||
work->pConvRowPtrs[1] = (void*)p1;
|
||||
work->pConvRowPtrs[2] = (void*)p2;
|
||||
work->pConvRowPtrs[3] = (void*)p3;
|
||||
work->pConvRowPtrs[5] = (void*)(ob + 0x104);
|
||||
work->pConvRowPtrs[6] = (void*)(ob + 0x144);
|
||||
work->pitch = 0x10;
|
||||
work->converterFlags = 0;
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
u8 mode = work->idctMode;
|
||||
u8* ptr = ob + 4;
|
||||
work->pConverterFunc = TMCJPEG_814F2570;
|
||||
work->pConverterFuncEdge = TMCJPEG_814F2B50;
|
||||
work->pConvRowPtrs[0] = (void*)ptr;
|
||||
work->pConvRowPtrs[1] = (void*)(ptr + mode * 8);
|
||||
work->pConvRowPtrs[5] = (void*)(ob + 0x84);
|
||||
work->pConvRowPtrs[6] = (void*)(ob + 0xC4);
|
||||
work->pitch = 0x08;
|
||||
work->converterFlags = 0;
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
work->pConverterFunc = TMCJPEG_814F3158;
|
||||
work->pConverterFuncEdge = TMCJPEG_814F32E4;
|
||||
work->pConvRowPtrs[0] = (void*)(ob + 4);
|
||||
work->pConvRowPtrs[5] = (void*)(ob + 0x44);
|
||||
work->pConvRowPtrs[6] = (void*)(ob + 0x84);
|
||||
work->pitch = 0x08;
|
||||
work->converterFlags = 0;
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
work->pConverterFunc = TMCJPEG_814F34A4;
|
||||
work->pConverterFuncEdge = TMCJPEG_814F372C;
|
||||
work->pConvRowPtrs[0] = (void*)(ob + 4);
|
||||
work->pitch = 0x08;
|
||||
work->converterFlags = 0;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
return TMCC_ERROR_FORMAT;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
s32 width = st->jpegWidth;
|
||||
s32 height = st->jpegHeight;
|
||||
st->convWidth = ((u32)width / 8 + (width % 8 != 0)) * 8;
|
||||
st->convHeight = ((u32)height / 4 + (height % 4 != 0)) * 4;
|
||||
width = st->outputWidth;
|
||||
height = st->outputHeight;
|
||||
st->chromaWidth = ((u32)width / 8 + (width % 8 != 0)) * 8;
|
||||
st->chromaHeight = ((u32)height / 4 + (height % 4 != 0)) * 4;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void TMCJPEG_814EFEAC(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
s8* cb = (s8*)&work->convBuf[260];
|
||||
s8* cr = (s8*)&work->convBuf[324];
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 3;
|
||||
u8* lumaTexture = state->pLumaBuffer;
|
||||
u8* cbTexture = state->pCbBuffer;
|
||||
u8* crTexture = state->pCrBuffer;
|
||||
s32 width, height;
|
||||
width = 32 / state->scaleFactor;
|
||||
height = 8 / state->scaleFactor;
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 row;
|
||||
for (row = y; row < yEnd; row++) {
|
||||
s32 tileRow = (row >> 2) * tileWidth;
|
||||
u8* output = lumaTexture + ((row & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 4) {
|
||||
output[((column) & 7) + ((((column) >> 3) + tileRow) << 5)] = luminance[0];
|
||||
output[((column + 1) & 7) + ((((column + 1) >> 3) + tileRow) << 5)] = luminance[1];
|
||||
output[((column + 2) & 7) + ((((column + 2) >> 3) + tileRow) << 5)] = luminance[2];
|
||||
output[((column + 3) & 7) + ((((column + 3) >> 3) + tileRow) << 5)] = luminance[3];
|
||||
luminance += 4;
|
||||
}
|
||||
luminance += 32 - width;
|
||||
}
|
||||
x = (u32)x >> 2;
|
||||
width = 8 / state->scaleFactor;
|
||||
height = 8 / state->scaleFactor;
|
||||
xEnd = x + width;
|
||||
yEnd = y + height;
|
||||
tileWidth = state->chromaWidth >> 3;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u8* cbOutput = cbTexture + ((y & 3) << 3);
|
||||
u8* crOutput = crTexture + ((y & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column++) {
|
||||
cbOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cb++ + 128;
|
||||
crOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cr++ + 128;
|
||||
}
|
||||
cb += 8 - width;
|
||||
cr += 8 - width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEG_814F043C(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
s8* cb = (s8*)&work->convBuf[260];
|
||||
s8* cr = (s8*)&work->convBuf[324];
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 3;
|
||||
u8* lumaTexture = state->pLumaBuffer;
|
||||
u8* cbTexture = state->pCbBuffer;
|
||||
u8* crTexture = state->pCrBuffer;
|
||||
s32 width, height;
|
||||
if (state->dataSizeX == (u32)x) {
|
||||
width = state->stepXExt;
|
||||
} else {
|
||||
width = 32 / state->scaleFactor;
|
||||
}
|
||||
if (state->dataSizeY == (u32)y) {
|
||||
height = state->stepYExt;
|
||||
} else {
|
||||
height = 8 / state->scaleFactor;
|
||||
}
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 row;
|
||||
for (row = y; row < yEnd; row++) {
|
||||
s32 tileRow = (row >> 2) * tileWidth;
|
||||
u8* output = lumaTexture + ((row & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
output[((column) & 7) + ((((column) >> 3) + tileRow) << 5)] = luminance[0];
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += 32 - width;
|
||||
}
|
||||
x = (u32)x >> 2;
|
||||
width = (width + 3) >> 2;
|
||||
xEnd = x + width;
|
||||
yEnd = y + height;
|
||||
tileWidth = state->chromaWidth >> 3;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u8* cbOutput = cbTexture + ((y & 3) << 3);
|
||||
u8* crOutput = crTexture + ((y & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column++) {
|
||||
cbOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cb++ + 128;
|
||||
crOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cr++ + 128;
|
||||
}
|
||||
cb += 8 - width;
|
||||
cr += 8 - width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEG_814F0A58(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
s8* cb = (s8*)&work->convBuf[132];
|
||||
s8* cr = (s8*)&work->convBuf[196];
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 3;
|
||||
u8* lumaTexture = state->pLumaBuffer;
|
||||
u8* cbTexture = state->pCbBuffer;
|
||||
u8* crTexture = state->pCrBuffer;
|
||||
s32 width, height;
|
||||
width = 16 / state->scaleFactor;
|
||||
height = 8 / state->scaleFactor;
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 row;
|
||||
for (row = y; row < yEnd; row++) {
|
||||
s32 tileRow = (row >> 2) * tileWidth;
|
||||
u8* output = lumaTexture + ((row & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 2) {
|
||||
output[((column) & 7) + ((((column) >> 3) + tileRow) << 5)] = luminance[0];
|
||||
output[((column + 1) & 7) + ((((column + 1) >> 3) + tileRow) << 5)] = luminance[1];
|
||||
luminance += 2;
|
||||
}
|
||||
luminance += 16 - width;
|
||||
}
|
||||
x = (u32)x >> 1;
|
||||
width = 8 / state->scaleFactor;
|
||||
height = 8 / state->scaleFactor;
|
||||
xEnd = x + width;
|
||||
yEnd = y + height;
|
||||
tileWidth = state->chromaWidth >> 3;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u8* cbOutput = cbTexture + ((y & 3) << 3);
|
||||
u8* crOutput = crTexture + ((y & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column++) {
|
||||
cbOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cb++ + 128;
|
||||
crOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cr++ + 128;
|
||||
}
|
||||
cb += 8 - width;
|
||||
cr += 8 - width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEG_814F11C4(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
s8* cb = (s8*)&work->convBuf[132];
|
||||
s8* cr = (s8*)&work->convBuf[196];
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 3;
|
||||
u8* lumaTexture = state->pLumaBuffer;
|
||||
u8* cbTexture = state->pCbBuffer;
|
||||
u8* crTexture = state->pCrBuffer;
|
||||
s32 width, height;
|
||||
if (state->dataSizeX == (u32)x) {
|
||||
width = state->stepXExt;
|
||||
} else {
|
||||
width = 16 / state->scaleFactor;
|
||||
}
|
||||
if (state->dataSizeY == (u32)y) {
|
||||
height = state->stepYExt;
|
||||
} else {
|
||||
height = 8 / state->scaleFactor;
|
||||
}
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 row;
|
||||
for (row = y; row < yEnd; row++) {
|
||||
s32 tileRow = (row >> 2) * tileWidth;
|
||||
u8* output = lumaTexture + ((row & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
output[((column) & 7) + ((((column) >> 3) + tileRow) << 5)] = luminance[0];
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += 16 - width;
|
||||
}
|
||||
x = (u32)x >> 1;
|
||||
width = (width + 1) >> 1;
|
||||
xEnd = x + width;
|
||||
yEnd = y + height;
|
||||
tileWidth = state->chromaWidth >> 3;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u8* cbOutput = cbTexture + ((y & 3) << 3);
|
||||
u8* crOutput = crTexture + ((y & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column++) {
|
||||
cbOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cb++ + 128;
|
||||
crOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cr++ + 128;
|
||||
}
|
||||
cb += 8 - width;
|
||||
cr += 8 - width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEG_814F17E0(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
s8* cb = (s8*)&work->convBuf[260];
|
||||
s8* cr = (s8*)&work->convBuf[324];
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 3;
|
||||
u8* lumaTexture = state->pLumaBuffer;
|
||||
u8* cbTexture = state->pCbBuffer;
|
||||
u8* crTexture = state->pCrBuffer;
|
||||
s32 width, height;
|
||||
width = 16 / state->scaleFactor;
|
||||
height = 16 / state->scaleFactor;
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 row;
|
||||
for (row = y; row < yEnd; row++) {
|
||||
s32 tileRow = (row >> 2) * tileWidth;
|
||||
u8* output = lumaTexture + ((row & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 2) {
|
||||
output[((column) & 7) + ((((column) >> 3) + tileRow) << 5)] = luminance[0];
|
||||
output[((column + 1) & 7) + ((((column + 1) >> 3) + tileRow) << 5)] = luminance[1];
|
||||
luminance += 2;
|
||||
}
|
||||
luminance += 16 - width;
|
||||
}
|
||||
x = (u32)x >> 1;
|
||||
y = (u32)y >> 1;
|
||||
width = 8 / state->scaleFactor;
|
||||
height = 8 / state->scaleFactor;
|
||||
xEnd = x + width;
|
||||
yEnd = y + height;
|
||||
tileWidth = state->chromaWidth >> 3;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u8* cbOutput = cbTexture + ((y & 3) << 3);
|
||||
u8* crOutput = crTexture + ((y & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column++) {
|
||||
cbOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cb++ + 128;
|
||||
crOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cr++ + 128;
|
||||
}
|
||||
cb += 8 - width;
|
||||
cr += 8 - width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEG_814F1F48(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
s8* cb = (s8*)&work->convBuf[260];
|
||||
s8* cr = (s8*)&work->convBuf[324];
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 3;
|
||||
u8* lumaTexture = state->pLumaBuffer;
|
||||
u8* cbTexture = state->pCbBuffer;
|
||||
u8* crTexture = state->pCrBuffer;
|
||||
s32 width, height;
|
||||
if (state->dataSizeX == (u32)x) {
|
||||
width = state->stepXExt;
|
||||
} else {
|
||||
width = 16 / state->scaleFactor;
|
||||
}
|
||||
if (state->dataSizeY == (u32)y) {
|
||||
height = state->stepYExt;
|
||||
} else {
|
||||
height = 16 / state->scaleFactor;
|
||||
}
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 row;
|
||||
for (row = y; row < yEnd; row++) {
|
||||
s32 tileRow = (row >> 2) * tileWidth;
|
||||
u8* output = lumaTexture + ((row & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
output[((column) & 7) + ((((column) >> 3) + tileRow) << 5)] = luminance[0];
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += 16 - width;
|
||||
}
|
||||
x = (u32)x >> 1;
|
||||
y = (u32)y >> 1;
|
||||
width = (width + 1) >> 1;
|
||||
height = (height + 1) >> 1;
|
||||
xEnd = x + width;
|
||||
yEnd = y + height;
|
||||
tileWidth = state->chromaWidth >> 3;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u8* cbOutput = cbTexture + ((y & 3) << 3);
|
||||
u8* crOutput = crTexture + ((y & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column++) {
|
||||
cbOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cb++ + 128;
|
||||
crOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cr++ + 128;
|
||||
}
|
||||
cb += 8 - width;
|
||||
cr += 8 - width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEG_814F2570(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
s8* cb = (s8*)&work->convBuf[132];
|
||||
s8* cr = (s8*)&work->convBuf[196];
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 3;
|
||||
u8* lumaTexture = state->pLumaBuffer;
|
||||
u8* cbTexture = state->pCbBuffer;
|
||||
u8* crTexture = state->pCrBuffer;
|
||||
s32 width, height;
|
||||
width = 8 / state->scaleFactor;
|
||||
height = 16 / state->scaleFactor;
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 row;
|
||||
for (row = y; row < yEnd; row++) {
|
||||
s32 tileRow = (row >> 2) * tileWidth;
|
||||
u8* output = lumaTexture + ((row & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
output[((column) & 7) + ((((column) >> 3) + tileRow) << 5)] = luminance[0];
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += 8 - width;
|
||||
}
|
||||
y = (u32)y >> 1;
|
||||
width = 8 / state->scaleFactor;
|
||||
height = 8 / state->scaleFactor;
|
||||
xEnd = x + width;
|
||||
yEnd = y + height;
|
||||
tileWidth = state->chromaWidth >> 3;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u8* cbOutput = cbTexture + ((y & 3) << 3);
|
||||
u8* crOutput = crTexture + ((y & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column++) {
|
||||
cbOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cb++ + 128;
|
||||
crOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cr++ + 128;
|
||||
}
|
||||
cb += 8 - width;
|
||||
cr += 8 - width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEG_814F2B50(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
s8* cb = (s8*)&work->convBuf[132];
|
||||
s8* cr = (s8*)&work->convBuf[196];
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 3;
|
||||
u8* lumaTexture = state->pLumaBuffer;
|
||||
u8* cbTexture = state->pCbBuffer;
|
||||
u8* crTexture = state->pCrBuffer;
|
||||
s32 width, height;
|
||||
if (state->dataSizeX == (u32)x) {
|
||||
width = state->stepXExt;
|
||||
} else {
|
||||
width = 8 / state->scaleFactor;
|
||||
}
|
||||
if (state->dataSizeY == (u32)y) {
|
||||
height = state->stepYExt;
|
||||
} else {
|
||||
height = 16 / state->scaleFactor;
|
||||
}
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 row;
|
||||
for (row = y; row < yEnd; row++) {
|
||||
s32 tileRow = (row >> 2) * tileWidth;
|
||||
u8* output = lumaTexture + ((row & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
output[((column) & 7) + ((((column) >> 3) + tileRow) << 5)] = luminance[0];
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += 8 - width;
|
||||
}
|
||||
y = (u32)y >> 1;
|
||||
height = (height + 1) >> 1;
|
||||
xEnd = x + width;
|
||||
yEnd = y + height;
|
||||
tileWidth = state->chromaWidth >> 3;
|
||||
for (; y < yEnd; y++) {
|
||||
s32 tileRow = (y >> 2) * tileWidth;
|
||||
u8* cbOutput = cbTexture + ((y & 3) << 3);
|
||||
u8* crOutput = crTexture + ((y & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column++) {
|
||||
cbOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cb++ + 128;
|
||||
crOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cr++ + 128;
|
||||
}
|
||||
cb += 8 - width;
|
||||
cr += 8 - width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEG_814F3158(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
s8* cb = (s8*)&work->convBuf[68];
|
||||
s8* cr = (s8*)&work->convBuf[132];
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 3;
|
||||
u8* lumaTexture = state->pLumaBuffer;
|
||||
u8* cbTexture = state->pCbBuffer;
|
||||
u8* crTexture = state->pCrBuffer;
|
||||
s32 width, height;
|
||||
width = 8 / state->scaleFactor;
|
||||
height = 8 / state->scaleFactor;
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 row;
|
||||
for (row = y; row < yEnd; row++) {
|
||||
s32 tileRow = (row >> 2) * tileWidth;
|
||||
u8* output = lumaTexture + ((row & 3) << 3);
|
||||
s32 column;
|
||||
u8* cbOutput = cbTexture + ((row & 3) << 3);
|
||||
u8* crOutput = crTexture + ((row & 3) << 3);
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
output[((column) & 7) + ((((column) >> 3) + tileRow) << 5)] = luminance[0];
|
||||
cbOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cb++ + 128;
|
||||
crOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cr++ + 128;
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += 8 - width;
|
||||
cb += 8 - width;
|
||||
cr += 8 - width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEG_814F32E4(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
s8* cb = (s8*)&work->convBuf[68];
|
||||
s8* cr = (s8*)&work->convBuf[132];
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 3;
|
||||
u8* lumaTexture = state->pLumaBuffer;
|
||||
u8* cbTexture = state->pCbBuffer;
|
||||
u8* crTexture = state->pCrBuffer;
|
||||
s32 width, height;
|
||||
if (state->dataSizeX == (u32)x) {
|
||||
width = state->stepXExt;
|
||||
} else {
|
||||
width = 8 / state->scaleFactor;
|
||||
}
|
||||
if (state->dataSizeY == (u32)y) {
|
||||
height = state->stepYExt;
|
||||
} else {
|
||||
height = 8 / state->scaleFactor;
|
||||
}
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 row;
|
||||
for (row = y; row < yEnd; row++) {
|
||||
s32 tileRow = (row >> 2) * tileWidth;
|
||||
u8* output = lumaTexture + ((row & 3) << 3);
|
||||
s32 column;
|
||||
u8* cbOutput = cbTexture + ((row & 3) << 3);
|
||||
u8* crOutput = crTexture + ((row & 3) << 3);
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
output[((column) & 7) + ((((column) >> 3) + tileRow) << 5)] = luminance[0];
|
||||
cbOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cb++ + 128;
|
||||
crOutput[(column & 7) + (((column >> 3) + tileRow) << 5)] = *cr++ + 128;
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += 8 - width;
|
||||
cb += 8 - width;
|
||||
cr += 8 - width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEG_814F34A4(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 3;
|
||||
u8* lumaTexture = state->pLumaBuffer;
|
||||
s32 width, height;
|
||||
width = 8 / state->scaleFactor;
|
||||
height = 8 / state->scaleFactor;
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 row;
|
||||
for (row = y; row < yEnd; row++) {
|
||||
s32 tileRow = (row >> 2) * tileWidth;
|
||||
u8* output = lumaTexture + ((row & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
output[((column) & 7) + ((((column) >> 3) + tileRow) << 5)] = luminance[0];
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += 8 - width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TMCJPEG_814F372C(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
u8* luminance = work->convBuf + 4;
|
||||
TMCCJPEGDecState* state = work->pState;
|
||||
u32 tileWidth = state->convWidth >> 3;
|
||||
u8* lumaTexture = state->pLumaBuffer;
|
||||
s32 width, height;
|
||||
if (state->dataSizeX == (u32)x) {
|
||||
width = state->stepXExt;
|
||||
} else {
|
||||
width = 8 / state->scaleFactor;
|
||||
}
|
||||
if (state->dataSizeY == (u32)y) {
|
||||
height = state->stepYExt;
|
||||
} else {
|
||||
height = 8 / state->scaleFactor;
|
||||
}
|
||||
{
|
||||
s32 xEnd = x + width;
|
||||
s32 yEnd = y + height;
|
||||
s32 row;
|
||||
for (row = y; row < yEnd; row++) {
|
||||
s32 tileRow = (row >> 2) * tileWidth;
|
||||
u8* output = lumaTexture + ((row & 3) << 3);
|
||||
s32 column;
|
||||
for (column = x; column < xEnd; column += 1) {
|
||||
output[((column) & 7) + ((((column) >> 3) + tileRow) << 5)] = luminance[0];
|
||||
luminance += 1;
|
||||
}
|
||||
luminance += 8 - width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
510
tools/decomp-assist/tmc-jpeg.attempts.md
Normal file
510
tools/decomp-assist/tmc-jpeg.attempts.md
Normal file
@@ -0,0 +1,510 @@
|
||||
# TMC JPEG matching attempts
|
||||
|
||||
All work stayed in this worktree. No units were changed to Matching. Only the EXIF marker scan gained an exact function. The other five units are uncommitted partial implementations or cleanup experiments.
|
||||
|
||||
The quick gate accepts non-regressing partial code. A GATE PASS alone does not establish a new exact function or a complete unit.
|
||||
|
||||
All six units have no data bytes or string pools. pool_diff.py cannot read absent .data sections; the gate independently reported identical empty pools.
|
||||
|
||||
## texturecvtr/Texture_MCUtoRGB565
|
||||
|
||||
- rgb-inline-store: Reordered 444/400 switch cases and named the four 420 row pointers before assigning them.
|
||||
- rgb-explicit-pixels: Expanded the pixel-store helper into scoped RGB channel calculations at each pixel.
|
||||
- rgb-byte-samples: Changed signed sample pointers to byte pointers with signed sample casts; expressed texture rows through byte pointers.
|
||||
- rgb-final-byte-setup: Final setup uses byte offsets into the actual conversion buffer; no address-pinning symbols or objects.
|
||||
- rgb-initial-layouts: Literal MCU loops, signed chroma pointers, inlined pixel-store helper; corrected buffer layout and rounded texture bounds.
|
||||
- rgb-self-saturation: Used explicit channel saturation statements and copied grayscale channels before saturation.
|
||||
- rgb-ternary-saturation: Expressed channel saturation with ternaries and kept grayscale copies in their branch.
|
||||
|
||||
| Function | Attempt | Objdiff % | Instructions mine/target | Instruction differences |
|
||||
| --- | --- | ---: | ---: | ---: |
|
||||
| TMCJPEGDEC_set_converterRGB565 | rgb-inline-store | 93.635290 | 169/170 | different counts |
|
||||
| TMCJPEGDEC_set_converterRGB565 | rgb-explicit-pixels | 93.635290 | 169/170 | different counts |
|
||||
| TMCJPEGDEC_set_converterRGB565 | rgb-byte-samples | 93.635290 | 169/170 | different counts |
|
||||
| TMCJPEGDEC_set_converterRGB565 | rgb-final-byte-setup | 93.635290 | 169/170 | different counts |
|
||||
| TMCJPEGDEC_set_converterRGB565 | rgb-initial-layouts | 88.511765 | 169/170 | different counts |
|
||||
| TMCJPEGDEC_set_converterRGB565 | rgb-self-saturation | 93.635290 | 169/170 | different counts |
|
||||
| TMCJPEGDEC_set_converterRGB565 | rgb-ternary-saturation | 93.635290 | 169/170 | different counts |
|
||||
| TMCJPEGDEC_converterYUV411toRGB565 | rgb-inline-store | 74.502304 | 217/217 | 199 |
|
||||
| TMCJPEGDEC_converterYUV411toRGB565 | rgb-explicit-pixels | 72.820274 | 217/217 | 200 |
|
||||
| TMCJPEGDEC_converterYUV411toRGB565 | rgb-byte-samples | 72.797230 | 217/217 | 201 |
|
||||
| TMCJPEGDEC_converterYUV411toRGB565 | rgb-final-byte-setup | 72.797230 | 217/217 | 201 |
|
||||
| TMCJPEGDEC_converterYUV411toRGB565 | rgb-initial-layouts | 74.502304 | 217/217 | 199 |
|
||||
| TMCJPEGDEC_converterYUV411toRGB565 | rgb-self-saturation | 72.797230 | 217/217 | 201 |
|
||||
| TMCJPEGDEC_converterYUV411toRGB565 | rgb-ternary-saturation | 72.797230 | 217/217 | 201 |
|
||||
| TMCJPEGDEC_converterYUV411toRGB565edge | rgb-inline-store | 75.311320 | 109/106 | different counts |
|
||||
| TMCJPEGDEC_converterYUV411toRGB565edge | rgb-explicit-pixels | 80.783020 | 109/106 | different counts |
|
||||
| TMCJPEGDEC_converterYUV411toRGB565edge | rgb-byte-samples | 80.924530 | 109/106 | different counts |
|
||||
| TMCJPEGDEC_converterYUV411toRGB565edge | rgb-final-byte-setup | 80.924530 | 109/106 | different counts |
|
||||
| TMCJPEGDEC_converterYUV411toRGB565edge | rgb-initial-layouts | 75.311320 | 109/106 | different counts |
|
||||
| TMCJPEGDEC_converterYUV411toRGB565edge | rgb-self-saturation | 80.924530 | 109/106 | different counts |
|
||||
| TMCJPEGDEC_converterYUV411toRGB565edge | rgb-ternary-saturation | 80.924530 | 109/106 | different counts |
|
||||
| TMCJPEGDEC_converterYUV422toRGB565 | rgb-inline-store | 76.058820 | 136/136 | 121 |
|
||||
| TMCJPEGDEC_converterYUV422toRGB565 | rgb-explicit-pixels | 76.544120 | 136/136 | 122 |
|
||||
| TMCJPEGDEC_converterYUV422toRGB565 | rgb-byte-samples | 76.580880 | 136/136 | 122 |
|
||||
| TMCJPEGDEC_converterYUV422toRGB565 | rgb-final-byte-setup | 76.580880 | 136/136 | 122 |
|
||||
| TMCJPEGDEC_converterYUV422toRGB565 | rgb-initial-layouts | 76.058820 | 136/136 | 121 |
|
||||
| TMCJPEGDEC_converterYUV422toRGB565 | rgb-self-saturation | 76.580880 | 136/136 | 122 |
|
||||
| TMCJPEGDEC_converterYUV422toRGB565 | rgb-ternary-saturation | 76.580880 | 136/136 | 122 |
|
||||
| TMCJPEGDEC_converterYUV422toRGB565edge | rgb-inline-store | 83.037384 | 110/107 | different counts |
|
||||
| TMCJPEGDEC_converterYUV422toRGB565edge | rgb-explicit-pixels | 80.934580 | 110/107 | different counts |
|
||||
| TMCJPEGDEC_converterYUV422toRGB565edge | rgb-byte-samples | 80.794395 | 110/107 | different counts |
|
||||
| TMCJPEGDEC_converterYUV422toRGB565edge | rgb-final-byte-setup | 80.794395 | 110/107 | different counts |
|
||||
| TMCJPEGDEC_converterYUV422toRGB565edge | rgb-initial-layouts | 83.037384 | 110/107 | different counts |
|
||||
| TMCJPEGDEC_converterYUV422toRGB565edge | rgb-self-saturation | 80.794395 | 110/107 | different counts |
|
||||
| TMCJPEGDEC_converterYUV422toRGB565edge | rgb-ternary-saturation | 80.794395 | 110/107 | different counts |
|
||||
| TMCJPEGDEC_converterYUV420toRGB565 | rgb-inline-store | 75.531910 | 141/141 | 127 |
|
||||
| TMCJPEGDEC_converterYUV420toRGB565 | rgb-explicit-pixels | 77.340420 | 141/141 | 125 |
|
||||
| TMCJPEGDEC_converterYUV420toRGB565 | rgb-byte-samples | 77.375885 | 141/141 | 125 |
|
||||
| TMCJPEGDEC_converterYUV420toRGB565 | rgb-final-byte-setup | 77.375885 | 141/141 | 125 |
|
||||
| TMCJPEGDEC_converterYUV420toRGB565 | rgb-initial-layouts | 75.531910 | 141/141 | 127 |
|
||||
| TMCJPEGDEC_converterYUV420toRGB565 | rgb-self-saturation | 77.375885 | 141/141 | 125 |
|
||||
| TMCJPEGDEC_converterYUV420toRGB565 | rgb-ternary-saturation | 77.375885 | 141/141 | 125 |
|
||||
| TMCJPEGDEC_converterYUV420toRGB565edge | rgb-inline-store | 81.842100 | 117/114 | different counts |
|
||||
| TMCJPEGDEC_converterYUV420toRGB565edge | rgb-explicit-pixels | 83.552635 | 117/114 | different counts |
|
||||
| TMCJPEGDEC_converterYUV420toRGB565edge | rgb-byte-samples | 83.289474 | 117/114 | different counts |
|
||||
| TMCJPEGDEC_converterYUV420toRGB565edge | rgb-final-byte-setup | 83.289474 | 117/114 | different counts |
|
||||
| TMCJPEGDEC_converterYUV420toRGB565edge | rgb-initial-layouts | 81.842100 | 117/114 | different counts |
|
||||
| TMCJPEGDEC_converterYUV420toRGB565edge | rgb-self-saturation | 83.289474 | 117/114 | different counts |
|
||||
| TMCJPEGDEC_converterYUV420toRGB565edge | rgb-ternary-saturation | 83.289474 | 117/114 | different counts |
|
||||
| TMCJPEGDEC_converterYUV211toRGB565 | rgb-inline-store | 76.816330 | 98/98 | 80 |
|
||||
| TMCJPEGDEC_converterYUV211toRGB565 | rgb-explicit-pixels | 73.000000 | 98/98 | 85 |
|
||||
| TMCJPEGDEC_converterYUV211toRGB565 | rgb-byte-samples | 73.051020 | 98/98 | 85 |
|
||||
| TMCJPEGDEC_converterYUV211toRGB565 | rgb-final-byte-setup | 73.051020 | 98/98 | 85 |
|
||||
| TMCJPEGDEC_converterYUV211toRGB565 | rgb-initial-layouts | 76.816330 | 98/98 | 80 |
|
||||
| TMCJPEGDEC_converterYUV211toRGB565 | rgb-self-saturation | 73.051020 | 98/98 | 85 |
|
||||
| TMCJPEGDEC_converterYUV211toRGB565 | rgb-ternary-saturation | 73.051020 | 98/98 | 85 |
|
||||
| TMCJPEGDEC_converterYUV211toRGB565edge | rgb-inline-store | 80.862390 | 109/109 | 82 |
|
||||
| TMCJPEGDEC_converterYUV211toRGB565edge | rgb-explicit-pixels | 77.192660 | 109/109 | 91 |
|
||||
| TMCJPEGDEC_converterYUV211toRGB565edge | rgb-byte-samples | 77.238530 | 109/109 | 91 |
|
||||
| TMCJPEGDEC_converterYUV211toRGB565edge | rgb-final-byte-setup | 77.238530 | 109/109 | 91 |
|
||||
| TMCJPEGDEC_converterYUV211toRGB565edge | rgb-initial-layouts | 80.862390 | 109/109 | 82 |
|
||||
| TMCJPEGDEC_converterYUV211toRGB565edge | rgb-self-saturation | 77.238530 | 109/109 | 91 |
|
||||
| TMCJPEGDEC_converterYUV211toRGB565edge | rgb-ternary-saturation | 77.238530 | 109/109 | 91 |
|
||||
| TMCJPEGDEC_converterYUV444toRGB565 | rgb-inline-store | 75.373630 | 91/91 | 75 |
|
||||
| TMCJPEGDEC_converterYUV444toRGB565 | rgb-explicit-pixels | 73.450550 | 91/91 | 80 |
|
||||
| TMCJPEGDEC_converterYUV444toRGB565 | rgb-byte-samples | 73.505490 | 91/91 | 80 |
|
||||
| TMCJPEGDEC_converterYUV444toRGB565 | rgb-final-byte-setup | 73.505490 | 91/91 | 80 |
|
||||
| TMCJPEGDEC_converterYUV444toRGB565 | rgb-initial-layouts | 75.373630 | 91/91 | 75 |
|
||||
| TMCJPEGDEC_converterYUV444toRGB565 | rgb-self-saturation | 73.505490 | 91/91 | 80 |
|
||||
| TMCJPEGDEC_converterYUV444toRGB565 | rgb-ternary-saturation | 73.505490 | 91/91 | 80 |
|
||||
| TMCJPEGDEC_converterYUV444toRGB565edge | rgb-inline-store | 80.182690 | 104/104 | 79 |
|
||||
| TMCJPEGDEC_converterYUV444toRGB565edge | rgb-explicit-pixels | 76.432690 | 104/104 | 88 |
|
||||
| TMCJPEGDEC_converterYUV444toRGB565edge | rgb-byte-samples | 76.480770 | 104/104 | 88 |
|
||||
| TMCJPEGDEC_converterYUV444toRGB565edge | rgb-final-byte-setup | 76.480770 | 104/104 | 88 |
|
||||
| TMCJPEGDEC_converterYUV444toRGB565edge | rgb-initial-layouts | 80.182690 | 104/104 | 79 |
|
||||
| TMCJPEGDEC_converterYUV444toRGB565edge | rgb-self-saturation | 76.480770 | 104/104 | 88 |
|
||||
| TMCJPEGDEC_converterYUV444toRGB565edge | rgb-ternary-saturation | 76.480770 | 104/104 | 88 |
|
||||
| TMCJPEGDEC_converterYUV400toRGB565 | rgb-inline-store | 82.571430 | 68/70 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGB565 | rgb-explicit-pixels | 82.571430 | 68/70 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGB565 | rgb-byte-samples | 82.571430 | 68/70 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGB565 | rgb-final-byte-setup | 82.571430 | 68/70 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGB565 | rgb-initial-layouts | 82.571430 | 68/70 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGB565 | rgb-self-saturation | 79.571430 | 67/70 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGB565 | rgb-ternary-saturation | 82.571430 | 68/70 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGB565edge | rgb-inline-store | 84.216866 | 81/83 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGB565edge | rgb-explicit-pixels | 84.216866 | 81/83 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGB565edge | rgb-byte-samples | 84.216866 | 81/83 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGB565edge | rgb-final-byte-setup | 84.216866 | 81/83 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGB565edge | rgb-initial-layouts | 84.216866 | 81/83 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGB565edge | rgb-self-saturation | 81.686745 | 80/83 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGB565edge | rgb-ternary-saturation | 84.216866 | 81/83 | different counts |
|
||||
|
||||
## texturecvtr/Texture_MCUtoRGBA8
|
||||
|
||||
- rgba-inline-pixels: Ported the RGB MCU loops to split AR/GB texture tiles; corrected chroma signs and tile offsets.
|
||||
- rgba-green-first: Computed green before red and changed the order of the channel range expression.
|
||||
- rgba-signed-stride-and-bounds: Used a signed tile stride, computed vertical bounds first, and made grayscale copies before saturation.
|
||||
- rgba-final: Reviewed the final readable source and rebuilt it.
|
||||
|
||||
| Function | Attempt | Objdiff % | Instructions mine/target | Instruction differences |
|
||||
| --- | --- | ---: | ---: | ---: |
|
||||
| TMCJPEGDEC_set_converterRGBA8 | rgba-inline-pixels | 93.635290 | 169/170 | different counts |
|
||||
| TMCJPEGDEC_set_converterRGBA8 | rgba-green-first | 93.635290 | 169/170 | different counts |
|
||||
| TMCJPEGDEC_set_converterRGBA8 | rgba-signed-stride-and-bounds | 93.635290 | 169/170 | different counts |
|
||||
| TMCJPEGDEC_set_converterRGBA8 | rgba-final | 93.635290 | 169/170 | different counts |
|
||||
| TMCJPEGDEC_converterYUV411toRGBA8 | rgba-inline-pixels | 63.995870 | 242/242 | 220 |
|
||||
| TMCJPEGDEC_converterYUV411toRGBA8 | rgba-green-first | 65.190090 | 242/242 | 218 |
|
||||
| TMCJPEGDEC_converterYUV411toRGBA8 | rgba-signed-stride-and-bounds | 65.871900 | 242/242 | 221 |
|
||||
| TMCJPEGDEC_converterYUV411toRGBA8 | rgba-final | 65.871900 | 242/242 | 221 |
|
||||
| TMCJPEGDEC_converterYUV411toRGBA8edge | rgba-inline-pixels | 75.294640 | 115/112 | different counts |
|
||||
| TMCJPEGDEC_converterYUV411toRGBA8edge | rgba-green-first | 71.544640 | 115/112 | different counts |
|
||||
| TMCJPEGDEC_converterYUV411toRGBA8edge | rgba-signed-stride-and-bounds | 71.544640 | 115/112 | different counts |
|
||||
| TMCJPEGDEC_converterYUV411toRGBA8edge | rgba-final | 71.544640 | 115/112 | different counts |
|
||||
| TMCJPEGDEC_converterYUV422toRGBA8 | rgba-inline-pixels | 68.743240 | 148/148 | 132 |
|
||||
| TMCJPEGDEC_converterYUV422toRGBA8 | rgba-green-first | 67.770270 | 148/148 | 137 |
|
||||
| TMCJPEGDEC_converterYUV422toRGBA8 | rgba-signed-stride-and-bounds | 66.486490 | 148/148 | 137 |
|
||||
| TMCJPEGDEC_converterYUV422toRGBA8 | rgba-final | 66.486490 | 148/148 | 137 |
|
||||
| TMCJPEGDEC_converterYUV422toRGBA8edge | rgba-inline-pixels | 71.725660 | 116/113 | different counts |
|
||||
| TMCJPEGDEC_converterYUV422toRGBA8edge | rgba-green-first | 68.610620 | 116/113 | different counts |
|
||||
| TMCJPEGDEC_converterYUV422toRGBA8edge | rgba-signed-stride-and-bounds | 68.610620 | 116/113 | different counts |
|
||||
| TMCJPEGDEC_converterYUV422toRGBA8edge | rgba-final | 68.610620 | 116/113 | different counts |
|
||||
| TMCJPEGDEC_converterYUV420toRGBA8 | rgba-inline-pixels | 68.424835 | 153/153 | 132 |
|
||||
| TMCJPEGDEC_converterYUV420toRGBA8 | rgba-green-first | 69.810455 | 153/153 | 136 |
|
||||
| TMCJPEGDEC_converterYUV420toRGBA8 | rgba-signed-stride-and-bounds | 69.745094 | 153/153 | 136 |
|
||||
| TMCJPEGDEC_converterYUV420toRGBA8 | rgba-final | 69.745094 | 153/153 | 136 |
|
||||
| TMCJPEGDEC_converterYUV420toRGBA8edge | rgba-inline-pixels | 74.166664 | 123/120 | different counts |
|
||||
| TMCJPEGDEC_converterYUV420toRGBA8edge | rgba-green-first | 74.191666 | 123/120 | different counts |
|
||||
| TMCJPEGDEC_converterYUV420toRGBA8edge | rgba-signed-stride-and-bounds | 74.191666 | 123/120 | different counts |
|
||||
| TMCJPEGDEC_converterYUV420toRGBA8edge | rgba-final | 74.191666 | 123/120 | different counts |
|
||||
| TMCJPEGDEC_converterYUV211toRGBA8 | rgba-inline-pixels | 69.846150 | 104/104 | 89 |
|
||||
| TMCJPEGDEC_converterYUV211toRGBA8 | rgba-green-first | 69.480770 | 104/104 | 93 |
|
||||
| TMCJPEGDEC_converterYUV211toRGBA8 | rgba-signed-stride-and-bounds | 69.480770 | 104/104 | 93 |
|
||||
| TMCJPEGDEC_converterYUV211toRGBA8 | rgba-final | 69.480770 | 104/104 | 93 |
|
||||
| TMCJPEGDEC_converterYUV211toRGBA8edge | rgba-inline-pixels | 74.295654 | 115/115 | 96 |
|
||||
| TMCJPEGDEC_converterYUV211toRGBA8edge | rgba-green-first | 73.965220 | 115/115 | 99 |
|
||||
| TMCJPEGDEC_converterYUV211toRGBA8edge | rgba-signed-stride-and-bounds | 73.965220 | 115/115 | 99 |
|
||||
| TMCJPEGDEC_converterYUV211toRGBA8edge | rgba-final | 73.965220 | 115/115 | 99 |
|
||||
| TMCJPEGDEC_converterYUV444toRGBA8 | rgba-inline-pixels | 70.453606 | 97/97 | 85 |
|
||||
| TMCJPEGDEC_converterYUV444toRGBA8 | rgba-green-first | 70.082470 | 97/97 | 87 |
|
||||
| TMCJPEGDEC_converterYUV444toRGBA8 | rgba-signed-stride-and-bounds | 70.082470 | 97/97 | 87 |
|
||||
| TMCJPEGDEC_converterYUV444toRGBA8 | rgba-final | 70.082470 | 97/97 | 87 |
|
||||
| TMCJPEGDEC_converterYUV444toRGBA8edge | rgba-inline-pixels | 73.445460 | 110/110 | 93 |
|
||||
| TMCJPEGDEC_converterYUV444toRGBA8edge | rgba-green-first | 73.118180 | 110/110 | 94 |
|
||||
| TMCJPEGDEC_converterYUV444toRGBA8edge | rgba-signed-stride-and-bounds | 73.118180 | 110/110 | 94 |
|
||||
| TMCJPEGDEC_converterYUV444toRGBA8edge | rgba-final | 73.118180 | 110/110 | 94 |
|
||||
| TMCJPEGDEC_converterYUV400toRGBA8 | rgba-inline-pixels | 84.276310 | 74/76 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGBA8 | rgba-green-first | 84.276310 | 74/76 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGBA8 | rgba-signed-stride-and-bounds | 84.276310 | 74/76 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGBA8 | rgba-final | 84.276310 | 74/76 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGBA8edge | rgba-inline-pixels | 85.561800 | 87/89 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGBA8edge | rgba-green-first | 85.561800 | 87/89 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGBA8edge | rgba-signed-stride-and-bounds | 85.561800 | 87/89 | different counts |
|
||||
| TMCJPEGDEC_converterYUV400toRGBA8edge | rgba-final | 85.561800 | 87/89 | different counts |
|
||||
|
||||
## texturecvtr/Texture_MCUtoY8U8V8
|
||||
|
||||
- planar-indexed-tiles: Implemented each original symbol using tiled luma and chroma output loops; width and height fields are guarded for this TU only.
|
||||
- planar-tile-index-and-count: Expressed tile addresses with multiplication, tested a bounded decrementing 444 loop, and used border-selection ternaries.
|
||||
- planar-shared-chroma-offset: Used signed tile strides, vertical bounds first, shared chroma offsets, and explicit sample temporaries.
|
||||
- planar-final: Returned to direct indexed tile loops after the weaker shared-offset experiment.
|
||||
- planar-guarded-counted-444: Tested a guarded do-loop for the combined 444 planes. It removed automatic unrolling but was still smaller than the target.
|
||||
- planar-signed-chroma-pointers: Changed chroma pointers to signed bytes. The compiler eliminated sign extension before byte stores; measurements stayed unchanged.
|
||||
|
||||
| Function | Attempt | Objdiff % | Instructions mine/target | Instruction differences |
|
||||
| --- | --- | ---: | ---: | ---: |
|
||||
| TMCJPEGDEC_set_converterY8U8V8 | planar-indexed-tiles | 92.540820 | 195/196 | different counts |
|
||||
| TMCJPEGDEC_set_converterY8U8V8 | planar-tile-index-and-count | 89.760200 | 195/196 | different counts |
|
||||
| TMCJPEGDEC_set_converterY8U8V8 | planar-shared-chroma-offset | 84.530610 | 193/196 | different counts |
|
||||
| TMCJPEGDEC_set_converterY8U8V8 | planar-final | 92.540820 | 195/196 | different counts |
|
||||
| TMCJPEGDEC_set_converterY8U8V8 | planar-guarded-counted-444 | 92.540820 | 195/196 | different counts |
|
||||
| TMCJPEGDEC_set_converterY8U8V8 | planar-signed-chroma-pointers | 92.540820 | 195/196 | different counts |
|
||||
| TMCJPEG_814EFEAC | planar-indexed-tiles | 52.233147 | 338/356 | different counts |
|
||||
| TMCJPEG_814EFEAC | planar-tile-index-and-count | 52.233147 | 338/356 | different counts |
|
||||
| TMCJPEG_814EFEAC | planar-shared-chroma-offset | 45.828650 | 317/356 | different counts |
|
||||
| TMCJPEG_814EFEAC | planar-final | 52.233147 | 338/356 | different counts |
|
||||
| TMCJPEG_814EFEAC | planar-guarded-counted-444 | 52.233147 | 338/356 | different counts |
|
||||
| TMCJPEG_814EFEAC | planar-signed-chroma-pointers | 52.233147 | 338/356 | different counts |
|
||||
| TMCJPEG_814F043C | planar-indexed-tiles | 51.355500 | 391/391 | 387 |
|
||||
| TMCJPEG_814F043C | planar-tile-index-and-count | 51.355500 | 391/391 | 387 |
|
||||
| TMCJPEG_814F043C | planar-shared-chroma-offset | 44.304348 | 371/391 | different counts |
|
||||
| TMCJPEG_814F043C | planar-final | 51.355500 | 391/391 | 387 |
|
||||
| TMCJPEG_814F043C | planar-guarded-counted-444 | 51.355500 | 391/391 | 387 |
|
||||
| TMCJPEG_814F043C | planar-signed-chroma-pointers | 51.355500 | 391/391 | 387 |
|
||||
| TMCJPEG_814F0A58 | planar-indexed-tiles | 43.534737 | 477/475 | different counts |
|
||||
| TMCJPEG_814F0A58 | planar-tile-index-and-count | 43.534737 | 477/475 | different counts |
|
||||
| TMCJPEG_814F0A58 | planar-shared-chroma-offset | 41.677895 | 456/475 | different counts |
|
||||
| TMCJPEG_814F0A58 | planar-final | 43.534737 | 477/475 | different counts |
|
||||
| TMCJPEG_814F0A58 | planar-guarded-counted-444 | 43.534737 | 477/475 | different counts |
|
||||
| TMCJPEG_814F0A58 | planar-signed-chroma-pointers | 43.534737 | 477/475 | different counts |
|
||||
| TMCJPEG_814F11C4 | planar-indexed-tiles | 51.355500 | 391/391 | 387 |
|
||||
| TMCJPEG_814F11C4 | planar-tile-index-and-count | 51.355500 | 391/391 | 387 |
|
||||
| TMCJPEG_814F11C4 | planar-shared-chroma-offset | 44.304348 | 371/391 | different counts |
|
||||
| TMCJPEG_814F11C4 | planar-final | 51.355500 | 391/391 | 387 |
|
||||
| TMCJPEG_814F11C4 | planar-guarded-counted-444 | 51.355500 | 391/391 | 387 |
|
||||
| TMCJPEG_814F11C4 | planar-signed-chroma-pointers | 51.355500 | 391/391 | 387 |
|
||||
| TMCJPEG_814F17E0 | planar-indexed-tiles | 41.890297 | 475/474 | different counts |
|
||||
| TMCJPEG_814F17E0 | planar-tile-index-and-count | 41.890297 | 475/474 | different counts |
|
||||
| TMCJPEG_814F17E0 | planar-shared-chroma-offset | 39.810127 | 454/474 | different counts |
|
||||
| TMCJPEG_814F17E0 | planar-final | 41.890297 | 475/474 | different counts |
|
||||
| TMCJPEG_814F17E0 | planar-guarded-counted-444 | 41.890297 | 475/474 | different counts |
|
||||
| TMCJPEG_814F17E0 | planar-signed-chroma-pointers | 41.890297 | 475/474 | different counts |
|
||||
| TMCJPEG_814F1F48 | planar-indexed-tiles | 46.809643 | 400/394 | different counts |
|
||||
| TMCJPEG_814F1F48 | planar-tile-index-and-count | 46.809643 | 400/394 | different counts |
|
||||
| TMCJPEG_814F1F48 | planar-shared-chroma-offset | 41.375633 | 379/394 | different counts |
|
||||
| TMCJPEG_814F1F48 | planar-final | 46.809643 | 400/394 | different counts |
|
||||
| TMCJPEG_814F1F48 | planar-guarded-counted-444 | 46.809643 | 400/394 | different counts |
|
||||
| TMCJPEG_814F1F48 | planar-signed-chroma-pointers | 46.809643 | 400/394 | different counts |
|
||||
| TMCJPEG_814F2570 | planar-indexed-tiles | 47.063830 | 376/376 | 370 |
|
||||
| TMCJPEG_814F2570 | planar-tile-index-and-count | 47.063830 | 376/376 | 370 |
|
||||
| TMCJPEG_814F2570 | planar-shared-chroma-offset | 42.981384 | 356/376 | different counts |
|
||||
| TMCJPEG_814F2570 | planar-final | 47.063830 | 376/376 | 370 |
|
||||
| TMCJPEG_814F2570 | planar-guarded-counted-444 | 47.063830 | 376/376 | 370 |
|
||||
| TMCJPEG_814F2570 | planar-signed-chroma-pointers | 47.063830 | 376/376 | 370 |
|
||||
| TMCJPEG_814F2B50 | planar-indexed-tiles | 52.950780 | 385/386 | different counts |
|
||||
| TMCJPEG_814F2B50 | planar-tile-index-and-count | 52.950780 | 385/386 | different counts |
|
||||
| TMCJPEG_814F2B50 | planar-shared-chroma-offset | 46.113990 | 365/386 | different counts |
|
||||
| TMCJPEG_814F2B50 | planar-final | 52.950780 | 385/386 | different counts |
|
||||
| TMCJPEG_814F2B50 | planar-guarded-counted-444 | 52.950780 | 385/386 | different counts |
|
||||
| TMCJPEG_814F2B50 | planar-signed-chroma-pointers | 52.950780 | 385/386 | different counts |
|
||||
| TMCJPEG_814F3158 | planar-indexed-tiles | unscored | 275/99 | different counts |
|
||||
| TMCJPEG_814F3158 | planar-tile-index-and-count | unscored | 230/99 | different counts |
|
||||
| TMCJPEG_814F3158 | planar-shared-chroma-offset | unscored | 215/99 | different counts |
|
||||
| TMCJPEG_814F3158 | planar-final | unscored | 275/99 | different counts |
|
||||
| TMCJPEG_814F3158 | planar-guarded-counted-444 | 37.404040 | 63/99 | different counts |
|
||||
| TMCJPEG_814F3158 | planar-signed-chroma-pointers | unscored | 275/99 | different counts |
|
||||
| TMCJPEG_814F32E4 | planar-indexed-tiles | unscored | 288/112 | different counts |
|
||||
| TMCJPEG_814F32E4 | planar-tile-index-and-count | unscored | 243/112 | different counts |
|
||||
| TMCJPEG_814F32E4 | planar-shared-chroma-offset | unscored | 228/112 | different counts |
|
||||
| TMCJPEG_814F32E4 | planar-final | unscored | 288/112 | different counts |
|
||||
| TMCJPEG_814F32E4 | planar-guarded-counted-444 | 45.651787 | 76/112 | different counts |
|
||||
| TMCJPEG_814F32E4 | planar-signed-chroma-pointers | unscored | 288/112 | different counts |
|
||||
| TMCJPEG_814F34A4 | planar-indexed-tiles | 60.037037 | 147/162 | different counts |
|
||||
| TMCJPEG_814F34A4 | planar-tile-index-and-count | 60.037037 | 147/162 | different counts |
|
||||
| TMCJPEG_814F34A4 | planar-shared-chroma-offset | 59.728394 | 147/162 | different counts |
|
||||
| TMCJPEG_814F34A4 | planar-final | 60.037037 | 147/162 | different counts |
|
||||
| TMCJPEG_814F34A4 | planar-guarded-counted-444 | 60.037037 | 147/162 | different counts |
|
||||
| TMCJPEG_814F34A4 | planar-signed-chroma-pointers | 60.037037 | 147/162 | different counts |
|
||||
| TMCJPEG_814F372C | planar-indexed-tiles | 62.891430 | 160/175 | different counts |
|
||||
| TMCJPEG_814F372C | planar-tile-index-and-count | 62.891430 | 160/175 | different counts |
|
||||
| TMCJPEG_814F372C | planar-shared-chroma-offset | 62.605713 | 160/175 | different counts |
|
||||
| TMCJPEG_814F372C | planar-final | 62.891430 | 160/175 | different counts |
|
||||
| TMCJPEG_814F372C | planar-guarded-counted-444 | 62.891430 | 160/175 | different counts |
|
||||
| TMCJPEG_814F372C | planar-signed-chroma-pointers | 62.891430 | 160/175 | different counts |
|
||||
|
||||
## buffer/idct_block_var
|
||||
|
||||
- idct-output-and-saturation: Restored missing Lumi butterfly outputs, completed zero filling, fixed unsigned saturation, and restored the second-pass luma bias.
|
||||
- idct-row-loop-and-butterfly-sums: Tested a row-count loop, sequential AC accumulation, and grouped butterfly sums in both functions.
|
||||
- idct-butterfly-temporaries: Separated odd butterfly factors into temporaries and used a sign-mask clamp.
|
||||
- idct-final-complete-butterfly-output: Also restored the three missing Col butterfly stores so no temporary output is left uninitialized.
|
||||
|
||||
| Function | Attempt | Objdiff % | Instructions mine/target | Instruction differences |
|
||||
| --- | --- | ---: | ---: | ---: |
|
||||
| TMCJPEGDEC_IdctBlock_Lumi | idct-output-and-saturation | 64.821014 | 259/257 | different counts |
|
||||
| TMCJPEGDEC_IdctBlock_Lumi | idct-row-loop-and-butterfly-sums | 64.712060 | 258/257 | different counts |
|
||||
| TMCJPEGDEC_IdctBlock_Lumi | idct-butterfly-temporaries | 63.077820 | 257/257 | 217 |
|
||||
| TMCJPEGDEC_IdctBlock_Lumi | idct-final-complete-butterfly-output | 63.077820 | 257/257 | 217 |
|
||||
| TMCJPEGDEC_IdctBlock_Col | idct-output-and-saturation | 70.601320 | 471/454 | different counts |
|
||||
| TMCJPEGDEC_IdctBlock_Col | idct-row-loop-and-butterfly-sums | 70.055070 | 471/454 | different counts |
|
||||
| TMCJPEGDEC_IdctBlock_Col | idct-butterfly-temporaries | 70.055070 | 471/454 | different counts |
|
||||
| TMCJPEGDEC_IdctBlock_Col | idct-final-complete-butterfly-output | 69.085900 | 480/454 | different counts |
|
||||
|
||||
## b65/iqdec_b65_frv32
|
||||
|
||||
- iq-struct-return-helper: Removed all volatile coercions; represented fast Huffman entries with named fields and ordinary struct-value returns.
|
||||
- iq-value-limit-helper: Used a local limit struct returned by value and reloaded the bit position after buffer loading.
|
||||
- iq-shared-long-code-decoder: Factored long Huffman decoding into a shared C helper. The compiler did not inline it.
|
||||
- iq-inline-long-code-decoder: Requested ordinary C inline expansion of the shared helper; branch layout and register allocation still differed.
|
||||
- iq-final: Retained the value-copy experiment rather than the weaker shared-decoder experiment.
|
||||
- iq-typed-limit-iteration: Removed redundant reads and byte-offset casts; iterated typed entries and reused the cached AC table.
|
||||
|
||||
| Function | Attempt | Objdiff % | Instructions mine/target | Instruction differences |
|
||||
| --- | --- | ---: | ---: | ---: |
|
||||
| TMCJPEGDEC_decode_iquant | iq-struct-return-helper | 83.829710 | 271/276 | different counts |
|
||||
| TMCJPEGDEC_decode_iquant | iq-value-limit-helper | 85.333336 | 281/276 | different counts |
|
||||
| TMCJPEGDEC_decode_iquant | iq-shared-long-code-decoder | 61.442028 | 196/276 | different counts |
|
||||
| TMCJPEGDEC_decode_iquant | iq-inline-long-code-decoder | 71.557970 | 280/276 | different counts |
|
||||
| TMCJPEGDEC_decode_iquant | iq-final | 85.333336 | 281/276 | different counts |
|
||||
| TMCJPEGDEC_decode_iquant | iq-typed-limit-iteration | 84.641304 | 280/276 | different counts |
|
||||
|
||||
## exif/exif_parse
|
||||
|
||||
- exif-bounds-widths-and-entry-order: Corrected directory offset checks and remaining-byte widths; changed byte assembly order and bounded pointers against end minus field size.
|
||||
- exif-pointer-lifetimes-and-switch-tags: Computed entry pointers before remaining counts, advanced pointers before checking entry space, and tested ignored EXIF tag cases.
|
||||
- exif-switch-breaks-and-declarations: Tested break-based switch bodies and separate declarations for tag offsets and pointers.
|
||||
- exif-scoped-directory-entries: Gave each directory its own pointer, remaining count, entry count, and loop index.
|
||||
- exif-marker-switch-and-byte-copy: Used a marker switch, copied the 20 date-time bytes individually, and recomputed transfer-function pointers from offsets.
|
||||
- exif-marker-local-order: Ordered marker and segment locals to match the target stack slots and swapped the two terminal-marker case bodies. GetOffsetEXIF reached exact.
|
||||
- exif-separate-ignored-tag-blocks: Tested separate ignored-tag bodies. The dispatch grew and did not improve matching; discarded.
|
||||
- exif-final: Restored the independently gated, committed EXIF result.
|
||||
|
||||
| Function | Attempt | Objdiff % | Instructions mine/target | Instruction differences |
|
||||
| --- | --- | ---: | ---: | ---: |
|
||||
| TMCCJPEGDecGetOffsetEXIF | exif-bounds-widths-and-entry-order | 77.129036 | 171/155 | different counts |
|
||||
| TMCCJPEGDecGetOffsetEXIF | exif-pointer-lifetimes-and-switch-tags | 77.129036 | 171/155 | different counts |
|
||||
| TMCCJPEGDecGetOffsetEXIF | exif-switch-breaks-and-declarations | 77.129036 | 171/155 | different counts |
|
||||
| TMCCJPEGDecGetOffsetEXIF | exif-scoped-directory-entries | 77.129036 | 171/155 | different counts |
|
||||
| TMCCJPEGDecGetOffsetEXIF | exif-marker-switch-and-byte-copy | 99.877420 | 155/155 | 11 |
|
||||
| TMCCJPEGDecGetOffsetEXIF | exif-marker-local-order | 100.000000 | 155/155 | 0 |
|
||||
| TMCCJPEGDecGetOffsetEXIF | exif-separate-ignored-tag-blocks | 100.000000 | 155/155 | 0 |
|
||||
| TMCCJPEGDecGetOffsetEXIF | exif-final | 100.000000 | 155/155 | 0 |
|
||||
| TMCCJPEGDecGetInfoEXIF | exif-bounds-widths-and-entry-order | 100.000000 | 132/132 | 0 |
|
||||
| TMCCJPEGDecGetInfoEXIF | exif-pointer-lifetimes-and-switch-tags | 100.000000 | 132/132 | 0 |
|
||||
| TMCCJPEGDecGetInfoEXIF | exif-switch-breaks-and-declarations | 100.000000 | 132/132 | 0 |
|
||||
| TMCCJPEGDecGetInfoEXIF | exif-scoped-directory-entries | 100.000000 | 132/132 | 0 |
|
||||
| TMCCJPEGDecGetInfoEXIF | exif-marker-switch-and-byte-copy | 100.000000 | 132/132 | 0 |
|
||||
| TMCCJPEGDecGetInfoEXIF | exif-marker-local-order | 100.000000 | 132/132 | 0 |
|
||||
| TMCCJPEGDecGetInfoEXIF | exif-separate-ignored-tag-blocks | 100.000000 | 132/132 | 0 |
|
||||
| TMCCJPEGDecGetInfoEXIF | exif-final | 100.000000 | 132/132 | 0 |
|
||||
| TMCJPEGDEC_exif_parse | exif-bounds-widths-and-entry-order | 85.528305 | 212/212 | 118 |
|
||||
| TMCJPEGDEC_exif_parse | exif-pointer-lifetimes-and-switch-tags | 98.514150 | 212/212 | 52 |
|
||||
| TMCJPEGDEC_exif_parse | exif-switch-breaks-and-declarations | 98.514150 | 212/212 | 52 |
|
||||
| TMCJPEGDEC_exif_parse | exif-scoped-directory-entries | 98.113205 | 212/212 | 58 |
|
||||
| TMCJPEGDEC_exif_parse | exif-marker-switch-and-byte-copy | 98.113205 | 212/212 | 58 |
|
||||
| TMCJPEGDEC_exif_parse | exif-marker-local-order | 98.113205 | 212/212 | 58 |
|
||||
| TMCJPEGDEC_exif_parse | exif-separate-ignored-tag-blocks | 98.113205 | 212/212 | 58 |
|
||||
| TMCJPEGDEC_exif_parse | exif-final | 98.113205 | 212/212 | 58 |
|
||||
| TMCJPEGDEC_IFD0_tag_parse | exif-bounds-widths-and-entry-order | 70.449066 | 446/481 | different counts |
|
||||
| TMCJPEGDEC_IFD0_tag_parse | exif-pointer-lifetimes-and-switch-tags | 75.883575 | 446/481 | different counts |
|
||||
| TMCJPEGDEC_IFD0_tag_parse | exif-switch-breaks-and-declarations | 75.883575 | 446/481 | different counts |
|
||||
| TMCJPEGDEC_IFD0_tag_parse | exif-scoped-directory-entries | 75.883575 | 446/481 | different counts |
|
||||
| TMCJPEGDEC_IFD0_tag_parse | exif-marker-switch-and-byte-copy | 85.507280 | 480/481 | different counts |
|
||||
| TMCJPEGDEC_IFD0_tag_parse | exif-marker-local-order | 85.507280 | 480/481 | different counts |
|
||||
| TMCJPEGDEC_IFD0_tag_parse | exif-separate-ignored-tag-blocks | 85.507280 | 480/481 | different counts |
|
||||
| TMCJPEGDEC_IFD0_tag_parse | exif-final | 85.507280 | 480/481 | different counts |
|
||||
| TMCJPEGDEC_IFD1_tag_parse | exif-bounds-widths-and-entry-order | 82.797520 | 243/242 | different counts |
|
||||
| TMCJPEGDEC_IFD1_tag_parse | exif-pointer-lifetimes-and-switch-tags | 97.570250 | 244/242 | different counts |
|
||||
| TMCJPEGDEC_IFD1_tag_parse | exif-switch-breaks-and-declarations | 91.566120 | 240/242 | different counts |
|
||||
| TMCJPEGDEC_IFD1_tag_parse | exif-scoped-directory-entries | 91.566120 | 240/242 | different counts |
|
||||
| TMCJPEGDEC_IFD1_tag_parse | exif-marker-switch-and-byte-copy | 92.107440 | 242/242 | 79 |
|
||||
| TMCJPEGDEC_IFD1_tag_parse | exif-marker-local-order | 92.107440 | 242/242 | 79 |
|
||||
| TMCJPEGDEC_IFD1_tag_parse | exif-separate-ignored-tag-blocks | 85.975204 | 260/242 | different counts |
|
||||
| TMCJPEGDEC_IFD1_tag_parse | exif-final | 92.107440 | 242/242 | 79 |
|
||||
| TMCJPEGDEC_ThumbnailCheck | exif-bounds-widths-and-entry-order | 100.000000 | 50/50 | 0 |
|
||||
| TMCJPEGDEC_ThumbnailCheck | exif-pointer-lifetimes-and-switch-tags | 100.000000 | 50/50 | 0 |
|
||||
| TMCJPEGDEC_ThumbnailCheck | exif-switch-breaks-and-declarations | 100.000000 | 50/50 | 0 |
|
||||
| TMCJPEGDEC_ThumbnailCheck | exif-scoped-directory-entries | 100.000000 | 50/50 | 0 |
|
||||
| TMCJPEGDEC_ThumbnailCheck | exif-marker-switch-and-byte-copy | 100.000000 | 50/50 | 0 |
|
||||
| TMCJPEGDEC_ThumbnailCheck | exif-marker-local-order | 100.000000 | 50/50 | 0 |
|
||||
| TMCJPEGDEC_ThumbnailCheck | exif-separate-ignored-tag-blocks | 100.000000 | 50/50 | 0 |
|
||||
| TMCJPEGDEC_ThumbnailCheck | exif-final | 100.000000 | 50/50 | 0 |
|
||||
|
||||
## Remaining differences
|
||||
|
||||
The last full gate is the final authority. Each unmatched function is listed here with its final score and instruction evidence. Equal instruction counts do not establish a pure register tie-break; branch offsets and operand scheduling also remain.
|
||||
|
||||
- TMCJPEGDEC_set_converterRGB565: 93.635290%, 169/170 instructions, conversion-buffer address folding and scheduling.
|
||||
- TMCJPEGDEC_converterYUV411toRGB565: 72.797230%, 217/217 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_converterYUV411toRGB565edge: 80.924530%, 109/106 instructions, three initialized chroma offsets remain; no uninitialized-value shortcut used.
|
||||
- TMCJPEGDEC_converterYUV422toRGB565: 76.580880%, 136/136 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_converterYUV422toRGB565edge: 80.794395%, 110/107 instructions, three initialized chroma offsets remain; no uninitialized-value shortcut used.
|
||||
- TMCJPEGDEC_converterYUV420toRGB565: 77.375885%, 141/141 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_converterYUV420toRGB565edge: 83.289474%, 117/114 instructions, three initialized chroma offsets remain; no uninitialized-value shortcut used.
|
||||
- TMCJPEGDEC_converterYUV211toRGB565: 73.051020%, 98/98 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_converterYUV211toRGB565edge: 77.238530%, 109/109 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_converterYUV444toRGB565: 73.505490%, 91/91 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_converterYUV444toRGB565edge: 76.480770%, 104/104 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_converterYUV400toRGB565: 82.571430%, 68/70 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEGDEC_converterYUV400toRGB565edge: 84.216866%, 81/83 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEGDEC_set_converterRGBA8: 93.635290%, 169/170 instructions, conversion-buffer address folding and scheduling.
|
||||
- TMCJPEGDEC_converterYUV411toRGBA8: 65.871900%, 242/242 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_converterYUV411toRGBA8edge: 71.544640%, 115/112 instructions, three initialized chroma offsets remain; no uninitialized-value shortcut used.
|
||||
- TMCJPEGDEC_converterYUV422toRGBA8: 66.486490%, 148/148 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_converterYUV422toRGBA8edge: 68.610620%, 116/113 instructions, three initialized chroma offsets remain; no uninitialized-value shortcut used.
|
||||
- TMCJPEGDEC_converterYUV420toRGBA8: 69.745094%, 153/153 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_converterYUV420toRGBA8edge: 74.191666%, 123/120 instructions, three initialized chroma offsets remain; no uninitialized-value shortcut used.
|
||||
- TMCJPEGDEC_converterYUV211toRGBA8: 69.480770%, 104/104 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_converterYUV211toRGBA8edge: 73.965220%, 115/115 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_converterYUV444toRGBA8: 70.082470%, 97/97 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_converterYUV444toRGBA8edge: 73.118180%, 110/110 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_converterYUV400toRGBA8: 84.276310%, 74/76 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEGDEC_converterYUV400toRGBA8edge: 85.561800%, 87/89 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEGDEC_set_converterY8U8V8: 92.540820%, 195/196 instructions, conversion-buffer address folding and scheduling.
|
||||
- TMCJPEG_814EFEAC: 52.233147%, 338/356 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEG_814F043C: 51.355500%, 391/391 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEG_814F0A58: 43.534737%, 477/475 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEG_814F11C4: 51.355500%, 391/391 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEG_814F17E0: 41.890297%, 475/474 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEG_814F1F48: 46.809643%, 400/394 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEG_814F2570: 47.063830%, 376/376 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEG_814F2B50: 52.950780%, 385/386 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEG_814F3158: unscored, 275/99 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEG_814F32E4: unscored, 288/112 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEG_814F34A4: 60.037037%, 147/162 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEG_814F372C: 62.891430%, 160/175 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEGDEC_IdctBlock_Lumi: 63.077820%, 257/257 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_IdctBlock_Col: 69.085900%, 480/454 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEGDEC_decode_iquant: 84.641304%, 280/276 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEGDEC_exif_parse: 98.113205%, 212/212 instructions, operand/register allocation and scheduling.
|
||||
- TMCJPEGDEC_IFD0_tag_parse: 85.507280%, 480/481 instructions, instruction count and control-flow/code-generation structure.
|
||||
- TMCJPEGDEC_IFD1_tag_parse: 92.107440%, 242/242 instructions, switch dispatch tree and operand/register allocation.
|
||||
|
||||
## Review limits
|
||||
|
||||
The planar 444 loops remain much larger than the targets and are unscored by objdiff. No converter unit reached exact. MCU converter behavior was reconstructed from the target assembly but has not been tested on decoded images. The instruction-level differences remain open.
|
||||
|
||||
Changed sources: the three texture converters, buffer/idct_block_var.c, b65/iqdec_b65_frv32.c, exif/exif_parse.c. The planar output fields in include/tmc_jpeg.h are guarded by TMC_JPEG_PLANAR_OUTPUT and enabled only by Texture_MCUtoY8U8V8.c.
|
||||
|
||||
## Final full gate
|
||||
|
||||
```text
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] pool: IDENTICAL
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] objdiff: code None/6184 data None/None functions 0/13 fuzzy 79.3978 linked code 0
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] instruction-exact functions: 0/13
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] section .text size 6184 match 79.397804
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] below 100: TMCJPEGDEC_set_converterRGB565 93.63529
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] below 100: TMCJPEGDEC_converterYUV411toRGB565 72.79723
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] below 100: TMCJPEGDEC_converterYUV411toRGB565edge 80.92453
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] below 100: TMCJPEGDEC_converterYUV422toRGB565 76.58088
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] below 100: TMCJPEGDEC_converterYUV422toRGB565edge 80.794395
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] below 100: TMCJPEGDEC_converterYUV420toRGB565 77.375885
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] below 100: TMCJPEGDEC_converterYUV420toRGB565edge 83.289474
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] below 100: TMCJPEGDEC_converterYUV211toRGB565 73.05102
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] below 100: TMCJPEGDEC_converterYUV211toRGB565edge 77.23853
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] below 100: TMCJPEGDEC_converterYUV444toRGB565 73.50549
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] below 100: TMCJPEGDEC_converterYUV444toRGB565edge 76.48077
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] below 100: TMCJPEGDEC_converterYUV400toRGB565 82.57143
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] below 100: TMCJPEGDEC_converterYUV400toRGB565edge 84.216866
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565] baseline: code None/6184 data None functions 0 fuzzy 9.2756
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] pool: IDENTICAL
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] objdiff: code None/6596 data None/None functions 0/13 fuzzy 73.7611 linked code 0
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] instruction-exact functions: 0/13
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] section .text size 6596 match 73.76107
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] below 100: TMCJPEGDEC_set_converterRGBA8 93.63529
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] below 100: TMCJPEGDEC_converterYUV411toRGBA8 65.8719
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] below 100: TMCJPEGDEC_converterYUV411toRGBA8edge 71.54464
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] below 100: TMCJPEGDEC_converterYUV422toRGBA8 66.48649
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] below 100: TMCJPEGDEC_converterYUV422toRGBA8edge 68.61062
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] below 100: TMCJPEGDEC_converterYUV420toRGBA8 69.745094
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] below 100: TMCJPEGDEC_converterYUV420toRGBA8edge 74.191666
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] below 100: TMCJPEGDEC_converterYUV211toRGBA8 69.48077
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] below 100: TMCJPEGDEC_converterYUV211toRGBA8edge 73.96522
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] below 100: TMCJPEGDEC_converterYUV444toRGBA8 70.08247
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] below 100: TMCJPEGDEC_converterYUV444toRGBA8edge 73.11818
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] below 100: TMCJPEGDEC_converterYUV400toRGBA8 84.27631
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] below 100: TMCJPEGDEC_converterYUV400toRGBA8edge 85.5618
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8] baseline: code None/6596 data None functions 0 fuzzy 76.5585
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] pool: IDENTICAL
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] objdiff: code None/15948 data None/None functions 0/13 fuzzy 48.8432 linked code 0
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] instruction-exact functions: 0/13
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] section .text size 15948 match 48.84324
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] below 100: TMCJPEGDEC_set_converterY8U8V8 92.54082
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] below 100: TMCJPEG_814EFEAC 52.233147
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] below 100: TMCJPEG_814F043C 51.3555
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] below 100: TMCJPEG_814F0A58 43.534737
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] below 100: TMCJPEG_814F11C4 51.3555
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] below 100: TMCJPEG_814F17E0 41.890297
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] below 100: TMCJPEG_814F1F48 46.809643
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] below 100: TMCJPEG_814F2570 47.06383
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] below 100: TMCJPEG_814F2B50 52.95078
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] below 100: TMCJPEG_814F3158 None
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] below 100: TMCJPEG_814F32E4 None
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] below 100: TMCJPEG_814F34A4 60.037037
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] below 100: TMCJPEG_814F372C 62.89143
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8] baseline: code None/15948 data None functions 0 fuzzy 0.0351
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/buffer/idct_block_var] pool: IDENTICAL
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/buffer/idct_block_var] objdiff: code None/2844 data None/None functions 0/2 fuzzy 66.9142 linked code 0
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/buffer/idct_block_var] instruction-exact functions: 0/2
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/buffer/idct_block_var] section .text size 2844 match 66.91421
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/buffer/idct_block_var] below 100: TMCJPEGDEC_IdctBlock_Lumi 63.07782
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/buffer/idct_block_var] below 100: TMCJPEGDEC_IdctBlock_Col 69.0859
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/buffer/idct_block_var] baseline: code None/2844 data None functions 0 fuzzy 69.6357
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/b65/iqdec_b65_frv32] pool: IDENTICAL
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/b65/iqdec_b65_frv32] objdiff: code None/1104 data None/None functions 0/1 fuzzy 84.6413 linked code 0
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/b65/iqdec_b65_frv32] instruction-exact functions: 0/1
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/b65/iqdec_b65_frv32] section .text size 1104 match 84.641304
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/b65/iqdec_b65_frv32] below 100: TMCJPEGDEC_decode_iquant 84.641304
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/b65/iqdec_b65_frv32] baseline: code None/1104 data None functions 0 fuzzy 85.7101
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] pool: IDENTICAL
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] objdiff: code 1348/5088 data None/None functions 3/6 fuzzy 92.7036 linked code 0
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] instruction-exact functions: 3/6
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] section .text size 5088 match 92.70361
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] below 100: TMCJPEGDEC_exif_parse 98.113205
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] below 100: TMCJPEGDEC_IFD0_tag_parse 85.50728
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] below 100: TMCJPEGDEC_IFD1_tag_parse 92.10744
|
||||
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] baseline: code 728/5088 data None functions 2 fuzzy 77.1800
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 82.03095 -> 82.05164
|
||||
global fuzzy_match_percent: 93.26352 -> 93.68542
|
||||
global complete_code_percent: 57.20994 -> 57.20994
|
||||
global matched_data_percent: 89.09599 -> 89.09599
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
review note: libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565.c: possible pointer+offset into a blob (orchestrator reviews) (+2 net), e.g. work->pConvRowPtrs[6] = (void*)(ob + 0xc4);
|
||||
review note: libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8.c: possible pointer+offset into a blob (orchestrator reviews) (+10 net), e.g. work->pConvRowPtrs[5] = (void*)(ob + 0x104);
|
||||
review note: libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoY8U8V8.c: possible pointer+offset into a blob (orchestrator reviews) (+10 net), e.g. work->pConvRowPtrs[5] = (void*)(ob + 0x104);
|
||||
GATE PASS
|
||||
```
|
||||
Reference in New Issue
Block a user