annotate sub/sub_cc.c @ 34195:5affa2074131

build: fix compilation on Solaris due to missing alloca.h #include patch by Granville Moore, gvm nemesys com, fixes Bugzilla #1999
author diego
date Mon, 31 Oct 2011 13:18:45 +0000
parents da2dc11d8436
children 5367c50655c4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
1 /*
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
2 * decoder for Closed Captions
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
3 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
4 * This decoder relies on MPlayer's OSD to display subtitles.
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
5 * Be warned that decoding is somewhat preliminary, though it basically works.
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
6 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
7 * Most notably, only the text information is decoded as of now, discarding
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
8 * color, background and position info (see source below).
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
9 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
10 * uses source from the xine closed captions decoder
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
11 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
12 * Copyright (C) 2002 Matteo Giani
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
13 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
14 * This file is part of MPlayer.
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
15 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
16 * MPlayer is free software; you can redistribute it and/or modify
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
17 * it under the terms of the GNU General Public License as published by
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
18 * the Free Software Foundation; either version 2 of the License, or
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
19 * (at your option) any later version.
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
20 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
21 * MPlayer is distributed in the hope that it will be useful,
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
24 * GNU General Public License for more details.
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
25 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
26 * You should have received a copy of the GNU General Public License along
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
27 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
28 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
29 */
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
30
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
31 #include <stdio.h>
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
32 #include <stdlib.h>
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
33 #include <string.h>
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
34
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
35 #include "config.h"
32464
22888a8cb312 Do not use a path for including files in the same directory.
reimar
parents: 32458
diff changeset
36 #include "sub_cc.h"
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
37
32464
22888a8cb312 Do not use a path for including files in the same directory.
reimar
parents: 32458
diff changeset
38 #include "subreader.h"
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
39
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
40 #include "libvo/video_out.h"
32467
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents: 32464
diff changeset
41 #include "sub.h"
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
42
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
43
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
44 #define CC_MAX_LINE_LENGTH 64
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
45
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
46 static char chartbl[128];
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
47
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
48 static subtitle buf1,buf2;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
49 static subtitle *fb,*bb;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
50
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
51 static unsigned int cursor_pos=0;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
52
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
53 static int initialized=0;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
54
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
55 #define CC_ROLLON 1
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
56 #define CC_ROLLUP 2
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
57
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
58 static int cc_mode=CC_ROLLON;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
59 static int cc_lines=4; ///< number of visible rows in CC roll-up mode, not used in CC roll-on mode
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
60
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
61 static void build_char_table(void)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
62 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
63 int i;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
64 /* first the normal ASCII codes */
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
65 for (i = 0; i < 128; i++)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
66 chartbl[i] = (char) i;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
67 /* now the special codes */
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
68 chartbl[0x2a] = 'á';
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
69 chartbl[0x5c] = 'é';
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
70 chartbl[0x5e] = 'í';
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
71 chartbl[0x5f] = 'ó';
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
72 chartbl[0x60] = 'ú';
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
73 chartbl[0x7b] = 'ç';
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
74 chartbl[0x7c] = '÷';
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
75 chartbl[0x7d] = 'Ñ';
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
76 chartbl[0x7e] = 'ñ';
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
77 chartbl[0x7f] = '¤'; /* FIXME: this should be a solid block */
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
78 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
79
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
80 static void clear_buffer(subtitle *buf)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
81 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
82 int i;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
83 buf->lines=0;
32511
b39155e98ac3 Remove some useless NULL pointer checks before invoking free() on the pointer.
diego
parents: 32467
diff changeset
84 for (i = 0; i < SUB_MAX_TEXT; i++) {
b39155e98ac3 Remove some useless NULL pointer checks before invoking free() on the pointer.
diego
parents: 32467
diff changeset
85 free(buf->text[i]);
b39155e98ac3 Remove some useless NULL pointer checks before invoking free() on the pointer.
diego
parents: 32467
diff changeset
86 buf->text[i] = NULL;
b39155e98ac3 Remove some useless NULL pointer checks before invoking free() on the pointer.
diego
parents: 32467
diff changeset
87 }
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
88 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
89
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
90
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
91 /**
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
92 \brief scroll buffer one line up
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
93 \param buf buffer to scroll
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
94 */
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
95 static void scroll_buffer(subtitle* buf)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
96 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
97 int i;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
98
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
99 while(buf->lines > cc_lines)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
100 {
32511
b39155e98ac3 Remove some useless NULL pointer checks before invoking free() on the pointer.
diego
parents: 32467
diff changeset
101 free(buf->text[0]);
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
102
32512
024358659ebd Avoid unnecessary ().
reimar
parents: 32511
diff changeset
103 for(i = 0; i < buf->lines - 1; i++) buf->text[i] = buf->text[i+1];
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
104
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
105 buf->text[buf->lines-1] = NULL;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
106 buf->lines--;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
107 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
108 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
109
32520
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
110 static int channel;
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
111
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
112 void subcc_init(void)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
113 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
114 int i;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
115 //printf("subcc_init(): initing...\n");
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
116 build_char_table();
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
117 for(i=0;i<SUB_MAX_TEXT;i++) {buf1.text[i]=buf2.text[i]=NULL;}
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
118 buf1.lines=buf2.lines=0;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
119 fb=&buf1;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
120 bb=&buf2;
32520
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
121 channel = -1;
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
122
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
123 initialized=1;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
124 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
125
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
126
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
127 static void display_buffer(subtitle *buf)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
128 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
129 vo_sub = buf;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
130 vo_osd_changed(OSDTYPE_SUBTITLE);
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
131 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
132
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
133
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
134 static void append_char(char c)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
135 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
136 if(!bb->lines) {bb->lines++; cursor_pos=0;}
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
137 if(bb->text[bb->lines - 1]==NULL)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
138 {
32513
a150a1bc458d Use calloc instead of malloc+memset.
reimar
parents: 32512
diff changeset
139 bb->text[bb->lines - 1] = calloc(1, CC_MAX_LINE_LENGTH);
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
140 cursor_pos=0;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
141 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
142
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
143 if(c=='\n')
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
144 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
145 if(cursor_pos>0 && bb->lines < SUB_MAX_TEXT)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
146 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
147 bb->lines++;cursor_pos=0;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
148 if(cc_mode==CC_ROLLUP){ //Carriage return - scroll buffer one line up
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
149 bb->text[bb->lines - 1]=calloc(1, CC_MAX_LINE_LENGTH);
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
150 scroll_buffer(bb);
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
151 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
152 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
153 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
154 else
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
155 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
156 if(cursor_pos==CC_MAX_LINE_LENGTH-1)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
157 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
158 fprintf(stderr,"CC: append_char() reached CC_MAX_LINE_LENGTH!\n");
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
159 return;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
160 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
161 bb->text[bb->lines - 1][cursor_pos++]=c;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
162 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
163 //In CC roll-up mode data should be shown immediately
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
164 if(cc_mode==CC_ROLLUP) display_buffer(bb);
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
165 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
166
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
167
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
168 static void swap_buffers(void)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
169 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
170 subtitle *foo;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
171 foo=fb;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
172 fb=bb;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
173 bb=foo;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
174 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
175
32520
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
176 static int selected_channel(void)
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
177 {
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
178 return subcc_enabled - 1;
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
179 }
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
180
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
181 static void cc_decode_EIA608(unsigned short int data)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
182 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
183
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
184 static unsigned short int lastcode=0x0000;
32566
da2dc11d8436 Use uint8_t type instead of unsigned char.
reimar
parents: 32565
diff changeset
185 uint8_t c1 = data & 0x7f;
da2dc11d8436 Use uint8_t type instead of unsigned char.
reimar
parents: 32565
diff changeset
186 uint8_t c2 = (data >> 8) & 0x7f;
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
187
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
188 if (c1 & 0x60) { /* normal character, 0x20 <= c1 <= 0x7f */
32520
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
189 if (channel != (selected_channel() & 1))
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
190 return;
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
191 append_char(chartbl[c1]);
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
192 if(c2 & 0x60) /*c2 might not be a normal char even if c1 is*/
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
193 append_char(chartbl[c2]);
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
194 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
195 else if (c1 & 0x10) // control code / special char
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
196 {
32520
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
197 channel = (c1 & 0x08) >> 3;
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
198 if (channel != (selected_channel() & 1))
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
199 return;
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
200 c1&=~0x08;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
201 if(data!=lastcode)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
202 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
203 if(c2 & 0x40) { /*PAC, Preamble Address Code */
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
204 append_char('\n'); /*FIXME properly interpret PACs*/
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
205 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
206 else
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
207 switch(c1)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
208 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
209 case 0x10: break; // ext attribute
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
210 case 0x11:
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
211 if((c2 & 0x30)==0x30)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
212 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
213 //printf("[debug]:Special char (ignored)\n");
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
214 /*cc_decode_special_char()*/;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
215 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
216 else if (c2 & 0x20)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
217 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
218 //printf("[debug]: midrow_attr (ignored)\n");
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
219 /*cc_decode_midrow_attr()*/;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
220 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
221 break;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
222 case 0x14:
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
223 switch(c2)
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
224 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
225 case 0x00: //CC roll-on mode
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
226 cc_mode=CC_ROLLON;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
227 break;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
228 case 0x25: //CC roll-up, 2 rows
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
229 case 0x26: //CC roll-up, 3 rows
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
230 case 0x27: //CC roll-up, 4 rows
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
231 cc_lines=c2-0x23;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
232 cc_mode=CC_ROLLUP;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
233 break;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
234 case 0x2C: display_buffer(NULL); //EDM
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
235 clear_buffer(fb); break;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
236 case 0x2d: append_char('\n'); //carriage return
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
237 break;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
238 case 0x2e: clear_buffer(bb); //ENM
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
239 break;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
240 case 0x2f: swap_buffers(); //Swap buffers
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
241 display_buffer(fb);
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
242 clear_buffer(bb);
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
243 break;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
244 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
245 break;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
246 case 0x17:
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
247 if( c2>=0x21 && c2<=0x23) //TAB
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
248 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
249 break;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
250 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
251 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
252 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
253 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
254 lastcode=data;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
255 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
256
32566
da2dc11d8436 Use uint8_t type instead of unsigned char.
reimar
parents: 32565
diff changeset
257 static void subcc_decode(const uint8_t *inputbuffer, unsigned int inputlength)
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
258 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
259 /* The first number may denote a channel number. I don't have the
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
260 * EIA-708 standard, so it is hard to say.
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
261 * From what I could figure out so far, the general format seems to be:
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
262 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
263 * repeat
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
264 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
265 * 0xfe starts 2 byte sequence of unknown purpose. It might denote
32522
796cd767b024 Fix one -subcc sample.
reimar
parents: 32520
diff changeset
266 * field #2 in line 21 of the VBI.
796cd767b024 Fix one -subcc sample.
reimar
parents: 32520
diff changeset
267 * Treating it identical of 0xff fixes
796cd767b024 Fix one -subcc sample.
reimar
parents: 32520
diff changeset
268 * http://samples.mplayerhq.hu/MPEG-VOB/ClosedCaptions/Starship_Troopers.vob
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
269 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
270 * 0xff starts 2 byte EIA-608 sequence, field #1 in line 21 of the VBI.
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
271 * Followed by a 3-code triplet that starts either with 0xff or
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
272 * 0xfe. In either case, the following triplet needs to be ignored
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
273 * for line 21, field 1.
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
274 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
275 * 0x00 is padding, followed by 2 more 0x00.
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
276 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
277 * 0x01 always seems to appear at the beginning, always seems to
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
278 * be followed by 0xf8, 8-bit number.
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
279 * The lower 7 bits of this 8-bit number seem to denote the
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
280 * number of code triplets that follow.
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
281 * The most significant bit denotes whether the Line 21 field 1
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
282 * captioning information is at odd or even triplet offsets from this
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
283 * beginning triplet. 1 denotes odd offsets, 0 denotes even offsets.
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
284 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
285 * Most captions are encoded with odd offsets, so this is what we
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
286 * will assume.
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
287 *
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
288 * until end of packet
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
289 */
32566
da2dc11d8436 Use uint8_t type instead of unsigned char.
reimar
parents: 32565
diff changeset
290 const uint8_t *current = inputbuffer;
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
291 unsigned int curbytes = 0;
32566
da2dc11d8436 Use uint8_t type instead of unsigned char.
reimar
parents: 32565
diff changeset
292 uint8_t data1, data2;
da2dc11d8436 Use uint8_t type instead of unsigned char.
reimar
parents: 32565
diff changeset
293 uint8_t cc_code;
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
294 int odd_offset = 1;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
295
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
296 while (curbytes < inputlength) {
32512
024358659ebd Avoid unnecessary ().
reimar
parents: 32511
diff changeset
297 cc_code = current[0];
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
298
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
299 if (inputlength - curbytes < 2) {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
300 #ifdef LOG_DEBUG
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
301 fprintf(stderr, "Not enough data for 2-byte CC encoding\n");
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
302 #endif
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
303 break;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
304 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
305
32512
024358659ebd Avoid unnecessary ().
reimar
parents: 32511
diff changeset
306 data1 = current[1];
024358659ebd Avoid unnecessary ().
reimar
parents: 32511
diff changeset
307 data2 = current[2];
32520
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
308 current += 3; curbytes += 3;
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
309
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
310 switch (cc_code) {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
311 case 0xfe:
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
312 case 0xff:
32520
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
313 odd_offset ^= 1;
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
314 if (odd_offset != selected_channel() >> 1)
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
315 break;
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
316 /* expect EIA-608 CC1/CC2 encoding */
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
317 // FIXME check parity!
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
318 // Parity check omitted assuming we are reading from a DVD and therefore
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
319 // we should encounter no "transmission errors".
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
320 cc_decode_EIA608(data1 | (data2 << 8));
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
321 break;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
322
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
323 case 0x00:
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
324 /* This seems to be just padding */
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
325 break;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
326
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
327 case 0x01:
32520
5e062dc4a04d Add code to allow selecting the Close Captioning channel.
reimar
parents: 32513
diff changeset
328 odd_offset = data2 >> 7;
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
329 break;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
330
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
331 default:
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
332 //#ifdef LOG_DEBUG
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
333 fprintf(stderr, "Unknown CC encoding: %x\n", cc_code);
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
334 //#endif
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
335 break;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
336 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
337 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
338 }
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
339
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
340
32566
da2dc11d8436 Use uint8_t type instead of unsigned char.
reimar
parents: 32565
diff changeset
341 void subcc_process_data(const uint8_t *inputdata, unsigned int len)
32458
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
342 {
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
343 if(!subcc_enabled) return;
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
344 if(!initialized) subcc_init();
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
345
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
346 subcc_decode(inputdata, len);
ab8fb38f28b1 Move sub_cc.[ch] to the sub directory.
cigaes
parents:
diff changeset
347 }