Mercurial > libavcodec.hg
comparison dvbsubdec.c @ 5982:1900b70712ab libavcodec
colour --> color in variable names
author | diego |
---|---|
date | Mon, 03 Dec 2007 13:33:48 +0000 |
parents | d457f0c01ec5 |
children | dfdff1ca78a7 |
comparison
equal
deleted
inserted
replaced
5981:b60d7f351e9d | 5982:1900b70712ab |
---|---|
170 int region_id; | 170 int region_id; |
171 | 171 |
172 int x_pos; | 172 int x_pos; |
173 int y_pos; | 173 int y_pos; |
174 | 174 |
175 int fgcolour; | 175 int fgcolor; |
176 int bgcolour; | 176 int bgcolor; |
177 | 177 |
178 struct DVBSubObjectDisplay *region_list_next; | 178 struct DVBSubObjectDisplay *region_list_next; |
179 struct DVBSubObjectDisplay *object_list_next; | 179 struct DVBSubObjectDisplay *object_list_next; |
180 } DVBSubObjectDisplay; | 180 } DVBSubObjectDisplay; |
181 | 181 |
204 int width; | 204 int width; |
205 int height; | 205 int height; |
206 int depth; | 206 int depth; |
207 | 207 |
208 int clut; | 208 int clut; |
209 int bgcolour; | 209 int bgcolor; |
210 | 210 |
211 uint8_t *pbuf; | 211 uint8_t *pbuf; |
212 int buf_size; | 212 int buf_size; |
213 | 213 |
214 DVBSubObjectDisplay *display_list; | 214 DVBSubObjectDisplay *display_list; |
842 int object_id; | 842 int object_id; |
843 DVBSubObject *object; | 843 DVBSubObject *object; |
844 DVBSubObjectDisplay *display; | 844 DVBSubObjectDisplay *display; |
845 int top_field_len, bottom_field_len; | 845 int top_field_len, bottom_field_len; |
846 | 846 |
847 int coding_method, non_modifying_colour; | 847 int coding_method, non_modifying_color; |
848 | 848 |
849 object_id = AV_RB16(buf); | 849 object_id = AV_RB16(buf); |
850 buf += 2; | 850 buf += 2; |
851 | 851 |
852 object = get_object(ctx, object_id); | 852 object = get_object(ctx, object_id); |
853 | 853 |
854 if (!object) | 854 if (!object) |
855 return; | 855 return; |
856 | 856 |
857 coding_method = ((*buf) >> 2) & 3; | 857 coding_method = ((*buf) >> 2) & 3; |
858 non_modifying_colour = ((*buf++) >> 1) & 1; | 858 non_modifying_color = ((*buf++) >> 1) & 1; |
859 | 859 |
860 if (coding_method == 0) { | 860 if (coding_method == 0) { |
861 top_field_len = AV_RB16(buf); | 861 top_field_len = AV_RB16(buf); |
862 buf += 2; | 862 buf += 2; |
863 bottom_field_len = AV_RB16(buf); | 863 bottom_field_len = AV_RB16(buf); |
870 | 870 |
871 for (display = object->display_list; display; display = display->object_list_next) { | 871 for (display = object->display_list; display; display = display->object_list_next) { |
872 block = buf; | 872 block = buf; |
873 | 873 |
874 dvbsub_parse_pixel_data_block(avctx, display, block, top_field_len, 0, | 874 dvbsub_parse_pixel_data_block(avctx, display, block, top_field_len, 0, |
875 non_modifying_colour); | 875 non_modifying_color); |
876 | 876 |
877 if (bottom_field_len > 0) | 877 if (bottom_field_len > 0) |
878 block = buf + top_field_len; | 878 block = buf + top_field_len; |
879 else | 879 else |
880 bottom_field_len = top_field_len; | 880 bottom_field_len = top_field_len; |
881 | 881 |
882 dvbsub_parse_pixel_data_block(avctx, display, block, bottom_field_len, 1, | 882 dvbsub_parse_pixel_data_block(avctx, display, block, bottom_field_len, 1, |
883 non_modifying_colour); | 883 non_modifying_color); |
884 } | 884 } |
885 | 885 |
886 /* } else if (coding_method == 1) {*/ | 886 /* } else if (coding_method == 1) {*/ |
887 | 887 |
888 } else { | 888 } else { |
1033 region->depth= 4; | 1033 region->depth= 4; |
1034 } | 1034 } |
1035 region->clut = *buf++; | 1035 region->clut = *buf++; |
1036 | 1036 |
1037 if (region->depth == 8) | 1037 if (region->depth == 8) |
1038 region->bgcolour = *buf++; | 1038 region->bgcolor = *buf++; |
1039 else { | 1039 else { |
1040 buf += 1; | 1040 buf += 1; |
1041 | 1041 |
1042 if (region->depth == 4) | 1042 if (region->depth == 4) |
1043 region->bgcolour = (((*buf++) >> 4) & 15); | 1043 region->bgcolor = (((*buf++) >> 4) & 15); |
1044 else | 1044 else |
1045 region->bgcolour = (((*buf++) >> 2) & 3); | 1045 region->bgcolor = (((*buf++) >> 2) & 3); |
1046 } | 1046 } |
1047 | 1047 |
1048 #ifdef DEBUG | 1048 #ifdef DEBUG |
1049 av_log(avctx, AV_LOG_INFO, "Region %d, (%dx%d)\n", region_id, region->width, region->height); | 1049 av_log(avctx, AV_LOG_INFO, "Region %d, (%dx%d)\n", region_id, region->width, region->height); |
1050 #endif | 1050 #endif |
1051 | 1051 |
1052 if (fill) { | 1052 if (fill) { |
1053 memset(region->pbuf, region->bgcolour, region->buf_size); | 1053 memset(region->pbuf, region->bgcolor, region->buf_size); |
1054 #ifdef DEBUG | 1054 #ifdef DEBUG |
1055 av_log(avctx, AV_LOG_INFO, "Fill region (%d)\n", region->bgcolour); | 1055 av_log(avctx, AV_LOG_INFO, "Fill region (%d)\n", region->bgcolor); |
1056 #endif | 1056 #endif |
1057 } | 1057 } |
1058 | 1058 |
1059 delete_region_display_list(ctx, region); | 1059 delete_region_display_list(ctx, region); |
1060 | 1060 |
1083 buf += 2; | 1083 buf += 2; |
1084 display->y_pos = AV_RB16(buf) & 0xfff; | 1084 display->y_pos = AV_RB16(buf) & 0xfff; |
1085 buf += 2; | 1085 buf += 2; |
1086 | 1086 |
1087 if ((object->type == 1 || object->type == 2) && buf+1 < buf_end) { | 1087 if ((object->type == 1 || object->type == 2) && buf+1 < buf_end) { |
1088 display->fgcolour = *buf++; | 1088 display->fgcolor = *buf++; |
1089 display->bgcolour = *buf++; | 1089 display->bgcolor = *buf++; |
1090 } | 1090 } |
1091 | 1091 |
1092 display->region_list_next = region->display_list; | 1092 display->region_list_next = region->display_list; |
1093 region->display_list = display; | 1093 region->display_list = display; |
1094 | 1094 |