36 #define CHARSET_CHARS 256
38 #define CROP_SCREENS 1
41 static const int mc_colors[5]={0x0,0xb,0xc,0xf,0x1};
49 int blockx, blocky, x,
y;
55 for (blocky = 0; blocky <
C64YRES; blocky += 8) {
56 for (blockx = 0; blockx <
C64XRES; blockx += 8) {
57 for (y = blocky; y < blocky + 8 && y <
C64YRES; y++) {
58 for (x = blockx; x < blockx + 8 && x <
C64XRES; x += 2) {
59 if(x < width && y < height) {
61 luma = (src[(x + 0 + y * p->
linesize[0])] +
62 src[(x + 1 + y * p->
linesize[0])]) / 2;
81 int lowdiff, highdiff;
91 for (a=0; a < 256; a++) {
92 if(i < c->mc_pal_size -1 && a == c->
mc_luma_vals[i + 1]) {
108 for (y = 0; y < 8; y++) {
110 for (x = 0; x < 4; x++) {
111 pix = best_cb[y * 4 + x];
114 if (index1[pix] >= 3)
124 row1 |= 3-(index2[pix] & 3);
126 row1 |= 3-(index1[pix] & 3);
129 row2 |= 3-(index2[pix] & 3);
131 row2 |= 3-(index1[pix] & 3);
135 row1 |= 3-(index2[pix] & 3);
137 row1 |= 3-(index1[pix] & 3);
140 charset[y+0x000] = row1;
144 if (highdiff > 0 && lowdiff > 0 && c->
mc_use_5col) {
145 if (lowdiff > highdiff) {
146 for (x = 0; x < 32; x++)
149 for (x = 0; x < 32; x++)
160 colrammap[charpos] = (highdiff > 0);
237 for (a = 0; a < 256; a++) {
238 temp = colram[charmap[a + 0x000]] << 0;
239 temp |= colram[charmap[a + 0x100]] << 1;
240 temp |= colram[charmap[a + 0x200]] << 2;
241 if (a < 0xe8) temp |= colram[charmap[a + 0x300]] << 3;
247 const AVFrame *pict,
int *got_packet)
273 screen_size = b_width * b_height;
311 req_size = charset_size + c->
mc_lifetime*(screen_size + colram_size);
324 memcpy(buf, charset, charset_size);
328 charset += charset_size;
334 for (y = 0; y < b_height; y++) {
335 for (x = 0; x < b_width; x++) {
336 buf[y * b_width + x] = charmap[y * b_width + x];
341 req_size += screen_size;
348 req_size += colram_size;
365 pkt->
size = req_size;
367 *got_packet = !!req_size;
372 #if CONFIG_A64MULTI_ENCODER
373 AVCodec ff_a64multi_encoder = {
386 #if CONFIG_A64MULTI5_ENCODER
387 AVCodec ff_a64multi5_encoder = {
396 .long_name =
NULL_IF_CONFIG_SMALL(
"Multicolor charset for Commodore 64, extended with 5th color (colram)"),