diff --git a/src/lib/sixel.c b/src/lib/sixel.c index 1cd7af128..8d43b9f70 100644 --- a/src/lib/sixel.c +++ b/src/lib/sixel.c @@ -181,26 +181,26 @@ unzip_color(const uint32_t* data, int linesize, int begy, int begx, int didx = ctable_to_dtable(crec); unsigned char* srcsixels = stab->data + stab->sixelcount * didx; unsigned char* dstsixels = stab->data + stab->sixelcount * stab->colors; -fprintf(stderr, "counts: src: %d dst: %d\n", deets->count, targdeets->count); +fprintf(stderr, "counts: src: %d dst: %d src: %p dst: %p\n", deets->count, targdeets->count, srcsixels, dstsixels); int sixel = 0; +int totalcount = 0; memset(deets, 0, sizeof(*deets)); for(int visy = begy ; visy < (begy + leny) ; visy += 6){ for(int visx = begx ; visx < (begx + lenx) ; visx += 1, ++sixel){ if(srcsixels[sixel]){ for(int sy = visy ; sy < (begy + leny) && sy < visy + 6 ; ++sy){ if(srcsixels[sixel] & (1u << (sy - visy))){ + ++totalcount; const uint32_t* rgb = (const uint32_t*)(data + (linesize / 4 * sy) + visx); unsigned char comps[RGBSIZE]; break_sixel_comps(comps, *rgb, 0xff); if(comps[0] > r || comps[1] > g || comps[2] > b){ - ++targdeets->count; dstsixels[sixel] |= (1u << (sy - visy)); srcsixels[sixel] &= ~(1u << (sy - visy)); update_deets(*rgb, targdeets); //fprintf(stderr, "%u/%u/%u comps: [%u/%u/%u]\n", r, g, b, comps[0], comps[1], comps[2]); //fprintf(stderr, "match sixel %d %u %u\n", sixel, srcsixels[sixel], 1u << (sy - visy)); }else{ - ++deets->count; update_deets(*rgb, deets); } } @@ -208,7 +208,7 @@ fprintf(stderr, "counts: src: %d dst: %d\n", deets->count, targdeets->count); } } } -fprintf(stderr, "counts: src: %d dst: %d\n", deets->count, targdeets->count); +fprintf(stderr, "counts: src: %d dst: %d total: %d\n", deets->count, targdeets->count, totalcount); } // relax segment |coloridx|. we must have room for a new color. we find the @@ -423,7 +423,7 @@ int sixel_blit(ncplane* nc, int linesize, const void* data, int begy, int begx, free(stable.deets); return -1; } - refine_color_table(data, linesize, begy, begx, leny, lenx, &stable); + //refine_color_table(data, linesize, begy, begx, leny, lenx, &stable); int r = sixel_blit_inner(nc, leny, lenx, &stable, bargs); free(stable.data); free(stable.deets);