Lines Matching refs:rects
207 if (sub_header->rects) { in reset_rects()
209 av_freep(&sub_header->rects[i]->data[0]); in reset_rects()
210 av_freep(&sub_header->rects[i]->data[1]); in reset_rects()
211 av_freep(&sub_header->rects[i]); in reset_rects()
213 av_freep(&sub_header->rects); in reset_rects()
374 sub_header->rects = av_mallocz(sizeof(*sub_header->rects)); in decode_dvd_subtitles()
375 if (!sub_header->rects) in decode_dvd_subtitles()
377 sub_header->rects[0] = av_mallocz(sizeof(AVSubtitleRect)); in decode_dvd_subtitles()
378 if (!sub_header->rects[0]) in decode_dvd_subtitles()
381 bitmap = sub_header->rects[0]->data[0] = av_malloc(w * h); in decode_dvd_subtitles()
390 sub_header->rects[0]->data[1] = av_mallocz(AVPALETTE_SIZE); in decode_dvd_subtitles()
391 if (!sub_header->rects[0]->data[1]) in decode_dvd_subtitles()
396 sub_header->rects[0]->nb_colors = 256; in decode_dvd_subtitles()
398 (uint32_t *)sub_header->rects[0]->data[1], in decode_dvd_subtitles()
401 sub_header->rects[0]->nb_colors = 4; in decode_dvd_subtitles()
402 guess_palette(ctx, (uint32_t*)sub_header->rects[0]->data[1], in decode_dvd_subtitles()
405 sub_header->rects[0]->x = x1; in decode_dvd_subtitles()
406 sub_header->rects[0]->y = y1; in decode_dvd_subtitles()
407 sub_header->rects[0]->w = w; in decode_dvd_subtitles()
408 sub_header->rects[0]->h = h; in decode_dvd_subtitles()
409 sub_header->rects[0]->type = SUBTITLE_BITMAP; in decode_dvd_subtitles()
410 sub_header->rects[0]->linesize[0] = w; in decode_dvd_subtitles()
411 sub_header->rects[0]->flags = is_menu ? AV_SUBTITLE_FLAG_FORCED : 0; in decode_dvd_subtitles()
416 sub_header->rects[0]->pict.data[i] = sub_header->rects[0]->data[i]; in decode_dvd_subtitles()
417 sub_header->rects[0]->pict.linesize[i] = sub_header->rects[0]->linesize[i]; in decode_dvd_subtitles()
458 if (s->num_rects == 0 || !s->rects || s->rects[0]->w <= 0 || s->rects[0]->h <= 0) in find_smallest_bounding_rectangle()
461 for(i = 0; i < s->rects[0]->nb_colors; i++) { in find_smallest_bounding_rectangle()
462 if ((((uint32_t *)s->rects[0]->data[1])[i] >> 24) == 0) { in find_smallest_bounding_rectangle()
470 while (y1 < s->rects[0]->h && is_transp(s->rects[0]->data[0] + y1 * s->rects[0]->linesize[0], in find_smallest_bounding_rectangle()
471 1, s->rects[0]->w, transp_color)) in find_smallest_bounding_rectangle()
473 if (y1 == s->rects[0]->h) { in find_smallest_bounding_rectangle()
474 av_freep(&s->rects[0]->data[0]); in find_smallest_bounding_rectangle()
475 s->rects[0]->w = s->rects[0]->h = 0; in find_smallest_bounding_rectangle()
479 y2 = s->rects[0]->h - 1; in find_smallest_bounding_rectangle()
480 while (y2 > 0 && is_transp(s->rects[0]->data[0] + y2 * s->rects[0]->linesize[0], 1, in find_smallest_bounding_rectangle()
481 s->rects[0]->w, transp_color)) in find_smallest_bounding_rectangle()
484 … while (x1 < (s->rects[0]->w - 1) && is_transp(s->rects[0]->data[0] + x1, s->rects[0]->linesize[0], in find_smallest_bounding_rectangle()
485 s->rects[0]->h, transp_color)) in find_smallest_bounding_rectangle()
487 x2 = s->rects[0]->w - 1; in find_smallest_bounding_rectangle()
488 while (x2 > 0 && is_transp(s->rects[0]->data[0] + x2, s->rects[0]->linesize[0], s->rects[0]->h, in find_smallest_bounding_rectangle()
497 memcpy(bitmap + w * y, s->rects[0]->data[0] + x1 + (y1 + y) * s->rects[0]->linesize[0], w); in find_smallest_bounding_rectangle()
499 av_freep(&s->rects[0]->data[0]); in find_smallest_bounding_rectangle()
500 s->rects[0]->data[0] = bitmap; in find_smallest_bounding_rectangle()
501 s->rects[0]->linesize[0] = w; in find_smallest_bounding_rectangle()
502 s->rects[0]->w = w; in find_smallest_bounding_rectangle()
503 s->rects[0]->h = h; in find_smallest_bounding_rectangle()
504 s->rects[0]->x += x1; in find_smallest_bounding_rectangle()
505 s->rects[0]->y += y1; in find_smallest_bounding_rectangle()
510 s->rects[0]->pict.data[i] = s->rects[0]->data[i]; in find_smallest_bounding_rectangle()
511 s->rects[0]->pict.linesize[i] = s->rects[0]->linesize[i]; in find_smallest_bounding_rectangle()
607 if (ctx->forced_subs_only && !(sub->rects[0]->flags & AV_SUBTITLE_FLAG_FORCED)) in dvdsub_decode()
618 ppm_save(ppm_name, sub->rects[0]->data[0], in dvdsub_decode()
619 sub->rects[0]->w, sub->rects[0]->h, (uint32_t*) sub->rects[0]->data[1]); in dvdsub_decode()