From 3738bfb451c8558ed6f3710a72d418e7c68f7f5b Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 1 Jul 2016 20:29:45 +0200 Subject: [PATCH] bitmap_packer: remove some unused functions --- video/out/bitmap_packer.c | 33 --------------------------------- video/out/bitmap_packer.h | 16 ---------------- 2 files changed, 49 deletions(-) diff --git a/video/out/bitmap_packer.c b/video/out/bitmap_packer.c index 3f75a72bcb..5169357e3a 100644 --- a/video/out/bitmap_packer.c +++ b/video/out/bitmap_packer.c @@ -29,8 +29,6 @@ #include "mpv_talloc.h" #include "bitmap_packer.h" #include "common/common.h" -#include "sub/dec_sub.h" -#include "video/mp_image.h" #define IS_POWER_OF_2(x) (((x) > 0) && !(((x) - 1) & (x))) @@ -199,34 +197,3 @@ void packer_set_size(struct bitmap_packer *packer, int size) packer->scratch = talloc_array_ptrtype(packer, packer->scratch, packer->asize + 16); } - -int packer_pack_from_subbitmaps(struct bitmap_packer *packer, - struct sub_bitmaps *b) -{ - packer->count = 0; - if (b->format == SUBBITMAP_EMPTY) - return 0; - packer_set_size(packer, b->num_parts); - for (int i = 0; i < b->num_parts; i++) - packer->in[i] = (struct pos){b->parts[i].w, b->parts[i].h}; - return packer_pack(packer); -} - -void packer_copy_subbitmaps(struct bitmap_packer *packer, struct sub_bitmaps *b, - void *data, int pixel_stride, int stride) -{ - assert(packer->count == b->num_parts); - if (packer->padding) { - struct pos bb[2]; - packer_get_bb(packer, bb); - memset_pic(data, 0, bb[1].x * pixel_stride, bb[1].y, stride); - } - for (int n = 0; n < packer->count; n++) { - struct sub_bitmap *s = &b->parts[n]; - struct pos p = packer->result[n]; - - void *pdata = (uint8_t *)data + p.y * stride + p.x * pixel_stride; - memcpy_pic(pdata, s->bitmap, s->w * pixel_stride, s->h, - stride, s->stride); - } -} diff --git a/video/out/bitmap_packer.h b/video/out/bitmap_packer.h index 8fd2fce599..97bf88f3e2 100644 --- a/video/out/bitmap_packer.h +++ b/video/out/bitmap_packer.h @@ -48,20 +48,4 @@ void packer_set_size(struct bitmap_packer *packer, int size); */ int packer_pack(struct bitmap_packer *packer); -/* Like above, but packer->count will be automatically set and - * packer->in will be reallocated if needed and filled from the - * given image list. - */ -int packer_pack_from_subbitmaps(struct bitmap_packer *packer, - struct sub_bitmaps *b); - -// Copy the (already packed) sub-bitmaps from b to the image in data. -// data must point to an image that is at least (packer->w, packer->h) big. -// The image has the given stride (bytes between (x, y) to (x, y + 1)), and the -// pixel format used by both the sub-bitmaps and the image uses pixel_stride -// bytes per pixel (bytes between (x, y) to (x + 1, y)). -// If packer->padding is set, the padding borders are cleared with 0. -void packer_copy_subbitmaps(struct bitmap_packer *packer, struct sub_bitmaps *b, - void *data, int pixel_stride, int stride); - #endif