Lines Matching refs:rect
663 static void compute_default_clut(DVBSubContext *ctx, uint8_t *clut, AVSubtitleRect *rect, int w, int h)
670 ptrdiff_t stride = rect->linesize[0];
674 #define V(x,y) rect->data[0][(x) + (y)*stride]
735 AVSubtitleRect *rect;
793 rect = sub->rects[i];
794 rect->x = display->x_pos + offset_x;
795 rect->y = display->y_pos + offset_y;
796 rect->w = region->width;
797 rect->h = region->height;
798 rect->nb_colors = (1 << region->depth);
799 rect->type = SUBTITLE_BITMAP;
800 rect->linesize[0] = region->width;
820 rect->data[1] = av_mallocz(AVPALETTE_SIZE);
821 if (!rect->data[1]) {
825 memcpy(rect->data[1], clut_table, (1 << region->depth) * sizeof(*clut_table));
827 rect->data[0] = av_memdup(region->pbuf, region->buf_size);
828 if (!rect->data[0]) {
835 compute_default_clut(ctx, region->computed_clut, rect, rect->w, rect->h);
839 memcpy(rect->data[1], region->computed_clut, sizeof(region->computed_clut));
850 rect = sub->rects[i];
851 if (rect) {
852 av_freep(&rect->data[0]);
853 av_freep(&rect->data[1]);