26 #define SCREEN_ROWS 15
27 #define SCREEN_COLUMNS 32
29 #define SET_FLAG(var, val) ( (var) |= ( 1 << (val)) )
30 #define UNSET_FLAG(var, val) ( (var) &= ~( 1 << (val)) )
31 #define CHECK_FLAG(var, val) ( (var) & ( 1 << (val)) )
105 1, 0, 0, 1, 0, 1, 1, 0,
106 1, 0, 0, 1, 0, 1, 1, 0,
107 0, 1, 1, 0, 1, 0, 0, 1,
108 1, 0, 0, 1, 0, 1, 1, 0,
109 0, 1, 1, 0, 1, 0, 0, 1,
110 0, 1, 1, 0, 1, 0, 0, 1,
111 1, 0, 0, 1, 0, 1, 1, 0,
112 1, 0, 0, 1, 0, 1, 1, 0,
113 0, 1, 1, 0, 1, 0, 0, 1,
114 0, 1, 1, 0, 1, 0, 0, 1,
115 1, 0, 0, 1, 0, 1, 1, 0,
116 0, 1, 1, 0, 1, 0, 0, 1,
117 1, 0, 0, 1, 0, 1, 1, 0,
118 1, 0, 0, 1, 0, 1, 1, 0,
119 0, 1, 1, 0, 1, 0, 0, 1,
120 1, 0, 0, 1, 0, 1, 1, 0,
121 0, 1, 1, 0, 1, 0, 0, 1,
122 0, 1, 1, 0, 1, 0, 0, 1,
123 1, 0, 0, 1, 0, 1, 1, 0,
124 0, 1, 1, 0, 1, 0, 0, 1,
125 1, 0, 0, 1, 0, 1, 1, 0,
126 1, 0, 0, 1, 0, 1, 1, 0,
127 0, 1, 1, 0, 1, 0, 0, 1,
128 0, 1, 1, 0, 1, 0, 0, 1,
129 1, 0, 0, 1, 0, 1, 1, 0,
130 1, 0, 0, 1, 0, 1, 1, 0,
131 0, 1, 1, 0, 1, 0, 0, 1,
132 1, 0, 0, 1, 0, 1, 1, 0,
133 0, 1, 1, 0, 1, 0, 0, 1,
134 0, 1, 1, 0, 1, 0, 0, 1,
135 1, 0, 0, 1, 0, 1, 1, 0 };
234 uint8_t cc_valid = (*cc_data_pair & 4) >>2;
235 uint8_t cc_type = *cc_data_pair & 3;
241 if (cc_type==0 || cc_type==1) {
246 cc_data_pair[1]=0x7F;
251 if( (cc_data_pair[0] == 0xFA || cc_data_pair[0] == 0xFC || cc_data_pair[0] == 0xFD )
252 && (cc_data_pair[1] & 0x7F) == 0 && (cc_data_pair[2] & 0x7F) == 0)
256 if(cc_type == 3 || cc_type == 2 )
260 cc_data_pair[1] &= 0x7F;
261 cc_data_pair[2] &= 0x7F;
301 for( i = 0; i < ctx->
cursor_row - keep_lines; i++ )
305 for( i = 0; i < keep_lines && screen->
row_used; i++ ) {
306 const int i_row = ctx->
cursor_row - keep_lines + i + 1;
369 static const int8_t row_map[] = {
370 11, -1, 1, 2, 3, 4, 12, 13, 14, 15, 5, 6, 7, 8, 9, 10
372 const int index = ( (hi<<1) & 0x0e) | ( (lo>>5) & 0x01 );
377 if( row_map[index] <= 0 ) {
390 for(i = 0;i < indent; i++) {
452 av_dlog(ctx,
"(%c,%c)\n",hi,lo);
460 #define COR3(var, with1, with2, with3) ( (var) == (with1) || (var) == (with2) || (var) == (with3) )
463 }
else if ( (hi == 0x10 && (lo >= 0x40 || lo <= 0x5f)) ||
464 ( (hi >= 0x11 && hi <= 0x17) && (lo >= 0x40 && lo <= 0x7f) ) ) {
466 }
else if ( ( hi == 0x11 && lo >= 0x20 && lo <= 0x2f ) ||
467 ( hi == 0x17 && lo >= 0x2e && lo <= 0x2f) ) {
469 }
else if (
COR3(hi, 0x14, 0x15, 0x1C) && lo == 0x20 ) {
472 }
else if (
COR3(hi, 0x14, 0x15, 0x1C) && lo == 0x24 ) {
474 }
else if (
COR3(hi, 0x14, 0x15, 0x1C) && lo == 0x25 ) {
477 }
else if (
COR3(hi, 0x14, 0x15, 0x1C) && lo == 0x26 ) {
480 }
else if (
COR3(hi, 0x14, 0x15, 0x1C) && lo == 0x27 ) {
483 }
else if (
COR3(hi, 0x14, 0x15, 0x1C) && lo == 0x29 ) {
486 }
else if (
COR3(hi, 0x14, 0x15, 0x1C) && lo == 0x2B ) {
489 }
else if (
COR3(hi, 0x14, 0x15, 0x1C) && lo == 0x2C ) {
492 }
else if (
COR3(hi, 0x14, 0x15, 0x1C) && lo == 0x2D ) {
494 av_dlog(ctx,
"carriage return\n");
499 }
else if (
COR3(hi, 0x14, 0x15, 0x1C) && lo == 0x2F ) {
503 }
else if (hi>=0x20) {
508 av_dlog(ctx,
"Unknown command 0x%hhx 0x%hhx\n", hi, lo);
541 for (i = 0; i <
len; i += 3) {
542 uint8_t cc_type = *(bptr + i) & 3;
549 process_cc608(ctx, avpkt->
pts, *(bptr + i + 1) & 0x7f, *(bptr + i + 2) & 0x7f);
564 *got_sub = sub->num_rects > 0;
588 .priv_class = &ccaption_dec_class,