Lines Matching refs:rects
205 if (sub_header->rects) {
207 av_freep(&sub_header->rects[i]->data[0]);
208 av_freep(&sub_header->rects[i]->data[1]);
209 av_freep(&sub_header->rects[i]);
211 av_freep(&sub_header->rects);
372 sub_header->rects = av_mallocz(sizeof(*sub_header->rects));
373 if (!sub_header->rects)
375 sub_header->rects[0] = av_mallocz(sizeof(AVSubtitleRect));
376 if (!sub_header->rects[0])
379 bitmap = sub_header->rects[0]->data[0] = av_malloc(w * h);
388 sub_header->rects[0]->data[1] = av_mallocz(AVPALETTE_SIZE);
389 if (!sub_header->rects[0]->data[1])
394 sub_header->rects[0]->nb_colors = 256;
396 (uint32_t *)sub_header->rects[0]->data[1],
399 sub_header->rects[0]->nb_colors = 4;
400 guess_palette(ctx, (uint32_t*)sub_header->rects[0]->data[1],
403 sub_header->rects[0]->x = x1;
404 sub_header->rects[0]->y = y1;
405 sub_header->rects[0]->w = w;
406 sub_header->rects[0]->h = h;
407 sub_header->rects[0]->type = SUBTITLE_BITMAP;
408 sub_header->rects[0]->linesize[0] = w;
409 sub_header->rects[0]->flags = is_menu ? AV_SUBTITLE_FLAG_FORCED : 0;
447 if (s->num_rects == 0 || !s->rects || s->rects[0]->w <= 0 || s->rects[0]->h <= 0)
450 for(i = 0; i < s->rects[0]->nb_colors; i++) {
451 if ((((uint32_t *)s->rects[0]->data[1])[i] >> 24) == 0) {
459 while (y1 < s->rects[0]->h && is_transp(s->rects[0]->data[0] + y1 * s->rects[0]->linesize[0],
460 1, s->rects[0]->w, transp_color))
462 if (y1 == s->rects[0]->h) {
463 av_freep(&s->rects[0]->data[0]);
464 s->rects[0]->w = s->rects[0]->h = 0;
468 y2 = s->rects[0]->h - 1;
469 while (y2 > 0 && is_transp(s->rects[0]->data[0] + y2 * s->rects[0]->linesize[0], 1,
470 s->rects[0]->w, transp_color))
473 while (x1 < (s->rects[0]->w - 1) && is_transp(s->rects[0]->data[0] + x1, s->rects[0]->linesize[0],
474 s->rects[0]->h, transp_color))
476 x2 = s->rects[0]->w - 1;
477 while (x2 > 0 && is_transp(s->rects[0]->data[0] + x2, s->rects[0]->linesize[0], s->rects[0]->h,
486 memcpy(bitmap + w * y, s->rects[0]->data[0] + x1 + (y1 + y) * s->rects[0]->linesize[0], w);
488 av_freep(&s->rects[0]->data[0]);
489 s->rects[0]->data[0] = bitmap;
490 s->rects[0]->linesize[0] = w;
491 s->rects[0]->w = w;
492 s->rects[0]->h = h;
493 s->rects[0]->x += x1;
494 s->rects[0]->y += y1;
553 if (ctx->forced_subs_only && !(sub->rects[0]->flags & AV_SUBTITLE_FLAG_FORCED))