comparison dvbsub.c @ 8516:315b302fcd1d libavcodec

Replace AVSubtitleRect.rgba_palette and bitmap by AVPicture.
author michael
date Sat, 03 Jan 2009 19:17:18 +0000
parents aa45029f5cd7
children 04423b2f6e0b
comparison
equal deleted inserted replaced
8515:45506d633cdc 8516:315b302fcd1d
260 for(i = 0; i < h->rects[clut_id]->nb_colors; i++) { 260 for(i = 0; i < h->rects[clut_id]->nb_colors; i++) {
261 *q++ = i; /* clut_entry_id */ 261 *q++ = i; /* clut_entry_id */
262 *q++ = (1 << (7 - bpp_index)) | (0xf << 1) | 1; /* 2 bits/pixel full range */ 262 *q++ = (1 << (7 - bpp_index)) | (0xf << 1) | 1; /* 2 bits/pixel full range */
263 { 263 {
264 int a, r, g, b; 264 int a, r, g, b;
265 a = (h->rects[clut_id]->rgba_palette[i] >> 24) & 0xff; 265 uint32_t x= ((uint32_t*)h->rects[clut_id]->pict.data[1])[i];
266 r = (h->rects[clut_id]->rgba_palette[i] >> 16) & 0xff; 266 a = (x >> 24) & 0xff;
267 g = (h->rects[clut_id]->rgba_palette[i] >> 8) & 0xff; 267 r = (x >> 16) & 0xff;
268 b = (h->rects[clut_id]->rgba_palette[i] >> 0) & 0xff; 268 g = (x >> 8) & 0xff;
269 b = (x >> 0) & 0xff;
269 270
270 *q++ = RGB_TO_Y_CCIR(r, g, b); 271 *q++ = RGB_TO_Y_CCIR(r, g, b);
271 *q++ = RGB_TO_V_CCIR(r, g, b, 0); 272 *q++ = RGB_TO_V_CCIR(r, g, b, 0);
272 *q++ = RGB_TO_U_CCIR(r, g, b, 0); 273 *q++ = RGB_TO_U_CCIR(r, g, b, 0);
273 *q++ = 255 - a; 274 *q++ = 255 - a;
356 dvb_encode_rle = dvb_encode_rle2; 357 dvb_encode_rle = dvb_encode_rle2;
357 else 358 else
358 dvb_encode_rle = dvb_encode_rle4; 359 dvb_encode_rle = dvb_encode_rle4;
359 360
360 top_ptr = q; 361 top_ptr = q;
361 dvb_encode_rle(&q, h->rects[object_id]->bitmap, h->rects[object_id]->w * 2, 362 dvb_encode_rle(&q, h->rects[object_id]->pict.data[0], h->rects[object_id]->w * 2,
362 h->rects[object_id]->w, h->rects[object_id]->h >> 1); 363 h->rects[object_id]->w, h->rects[object_id]->h >> 1);
363 bottom_ptr = q; 364 bottom_ptr = q;
364 dvb_encode_rle(&q, h->rects[object_id]->bitmap + h->rects[object_id]->w, 365 dvb_encode_rle(&q, h->rects[object_id]->pict.data[0] + h->rects[object_id]->w,
365 h->rects[object_id]->w * 2, h->rects[object_id]->w, 366 h->rects[object_id]->w * 2, h->rects[object_id]->w,
366 h->rects[object_id]->h >> 1); 367 h->rects[object_id]->h >> 1);
367 368
368 bytestream_put_be16(&ptop_field_len, bottom_ptr - top_ptr); 369 bytestream_put_be16(&ptop_field_len, bottom_ptr - top_ptr);
369 bytestream_put_be16(&pbottom_field_len, q - bottom_ptr); 370 bytestream_put_be16(&pbottom_field_len, q - bottom_ptr);