Lines Matching refs:rect
162 static int decode_rle(AVCodecContext *avctx, AVSubtitleRect *rect,
170 rect->data[0] = av_malloc_array(rect->w, rect->h);
172 if (!rect->data[0])
178 while (buf < rle_bitmap_end && line_count < rect->h) {
193 if (run > 0 && pixel_count + run <= rect->w * rect->h) {
194 memset(rect->data[0] + pixel_count, color, run);
201 if (pixel_count % rect->w > 0) {
203 pixel_count % rect->w, rect->w);
212 if (pixel_count < rect->w * rect->h) {
217 ff_dlog(avctx, "Pixel Count = %d, Area = %d\n", pixel_count, rect->w * rect->h);
532 AVSubtitleRect *const rect = av_mallocz(sizeof(*rect));
535 if (!rect)
537 sub->rects[sub->num_rects++] = rect;
538 rect->type = SUBTITLE_BITMAP;
548 // Leaves rect empty with 0 width and height.
552 rect->flags |= AV_SUBTITLE_FLAG_FORCED;
554 rect->x = ctx->presentation.objects[i].x;
555 rect->y = ctx->presentation.objects[i].y;
558 rect->w = object->w;
559 rect->h = object->h;
561 rect->linesize[0] = object->w;
569 ret = decode_rle(avctx, rect, object->rle, object->rle_data_len);
575 rect->w = 0;
576 rect->h = 0;
581 rect->nb_colors = 256;
582 rect->data[1] = av_mallocz(AVPALETTE_SIZE);
583 if (!rect->data[1])
587 memcpy(rect->data[1], palette->clut, rect->nb_colors * sizeof(uint32_t));