diff options
author | wm4 <wm4@nowhere> | 2012-12-22 21:46:22 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-01-13 20:04:11 +0100 |
commit | 0c5311f17cb9078f0ddde7c41cad61d00aea4a94 (patch) | |
tree | e8254feab42d21e0c6932ce68a34228529247f66 /sub | |
parent | 15c7f7a33968edebe305e2845b32eb2383457d46 (diff) | |
download | mpv-0c5311f17cb9078f0ddde7c41cad61d00aea4a94.tar.bz2 mpv-0c5311f17cb9078f0ddde7c41cad61d00aea4a94.tar.xz |
video: cleanup: replace old mp_image function names
mp_image_alloc() also changes argument order compared to alloc_mpi().
The format now comes first, then width/height.
Diffstat (limited to 'sub')
-rw-r--r-- | sub/draw_bmp.c | 10 | ||||
-rw-r--r-- | sub/img_convert.c | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/sub/draw_bmp.c b/sub/draw_bmp.c index 245d1edd2b..79b44bfa66 100644 --- a/sub/draw_bmp.c +++ b/sub/draw_bmp.c @@ -274,8 +274,8 @@ static void draw_rgba(struct mp_draw_sub_cache **cache, struct mp_rect bb, part->imgs[i].i = talloc_steal(part, sbi); part->imgs[i].a = talloc_steal(part, sba); } else { - free_mp_image(sbi); - free_mp_image(sba); + talloc_free(sbi); + talloc_free(sba); } } } @@ -520,7 +520,7 @@ void mp_draw_sub_bitmaps(struct mp_draw_sub_cache **cache, struct mp_image *dst, if (dst->imgfmt == format) { temp = &dst_region; } else { - temp = alloc_mpi(bb.x1 - bb.x0, bb.y1 - bb.y0, format); + temp = mp_image_alloc(format, bb.x1 - bb.x0, bb.y1 - bb.y0); // temp is always YUV, dst_region not // reduce amount of conversions in YUV case (upsampling/shifting only) if (dst_region.flags & MP_IMGFLAG_YUV) { @@ -538,7 +538,7 @@ void mp_draw_sub_bitmaps(struct mp_draw_sub_cache **cache, struct mp_image *dst, if (temp != &dst_region) { mp_image_swscale(&dst_region, temp, SWS_AREA); // chroma down - free_mp_image(temp); + talloc_free(temp); } } @@ -581,7 +581,7 @@ static void backup_realloc(struct mp_draw_sub_backup *backup, return; talloc_free_children(backup); - backup->image = alloc_mpi(img->w, img->h, img->imgfmt); + backup->image = mp_image_alloc(img->imgfmt, img->w, img->h); talloc_steal(backup, backup->image); for (int p = 0; p < MP_MAX_PLANES; p++) { backup->lines[p] = talloc_array(backup, struct line_ext, diff --git a/sub/img_convert.c b/sub/img_convert.c index 0560b66aab..5e74ba9e84 100644 --- a/sub/img_convert.c +++ b/sub/img_convert.c @@ -73,7 +73,7 @@ bool osd_conv_idx_to_rgba(struct osd_conv_cache *c, struct sub_bitmaps *imgs) rgba_to_premultiplied_rgba(sb.palette, 256); *d = *s; - struct mp_image *image = alloc_mpi(s->w, s->h, IMGFMT_BGRA); + struct mp_image *image = mp_image_alloc(IMGFMT_BGRA, s->w, s->h); talloc_steal(c->parts, image); d->stride = image->stride[0]; d->bitmap = image->planes[0]; @@ -104,8 +104,8 @@ bool osd_conv_blur_rgba(struct osd_conv_cache *c, struct sub_bitmaps *imgs, // add a transparent padding border to reduce artifacts int pad = 5; - struct mp_image *temp = alloc_mpi(s->w + pad * 2, s->h + pad * 2, - IMGFMT_BGRA); + struct mp_image *temp = mp_image_alloc(IMGFMT_BGRA, s->w + pad * 2, + s->h + pad * 2); memset_pic(temp->planes[0], 0, temp->w * 4, temp->h, temp->stride[0]); uint8_t *p0 = temp->planes[0] + pad * 4 + pad * temp->stride[0]; memcpy_pic(p0, s->bitmap, s->w * 4, s->h, temp->stride[0], s->stride); @@ -117,7 +117,7 @@ bool osd_conv_blur_rgba(struct osd_conv_cache *c, struct sub_bitmaps *imgs, d->y = s->y - pad * sy; d->w = d->dw = s->dw + pad * 2 * sx; d->h = d->dh = s->dh + pad * 2 * sy; - struct mp_image *image = alloc_mpi(d->w, d->h, IMGFMT_BGRA); + struct mp_image *image = mp_image_alloc(IMGFMT_BGRA, d->w, d->h); talloc_steal(c->parts, image); d->stride = image->stride[0]; d->bitmap = image->planes[0]; |