picture.c: rename picture_alloc_with_edges() to picture_alloc()

The allocated picture has no edges and is not expected to have any
edges, so the _with_edges() suffix was misleading. Fixes #415.
This commit is contained in:
Ronald S. Bultje
2024-02-02 10:57:31 -05:00
parent 18b6ed7008
commit 7f5d3492f6
+19 -20
View File
@@ -111,15 +111,15 @@ void dav1d_picture_free_itut_t35(const uint8_t *const data, void *const user_dat
dav1d_free(itut_t35_ctx);
}
static int picture_alloc_with_edges(Dav1dContext *const c,
Dav1dPicture *const p,
const int w, const int h,
Dav1dSequenceHeader *const seq_hdr, Dav1dRef *const seq_hdr_ref,
Dav1dFrameHeader *const frame_hdr, Dav1dRef *const frame_hdr_ref,
const int bpc,
const Dav1dDataProps *const props,
Dav1dPicAllocator *const p_allocator,
void **const extra_ptr)
static int picture_alloc(Dav1dContext *const c,
Dav1dPicture *const p,
const int w, const int h,
Dav1dSequenceHeader *const seq_hdr, Dav1dRef *const seq_hdr_ref,
Dav1dFrameHeader *const frame_hdr, Dav1dRef *const frame_hdr_ref,
const int bpc,
const Dav1dDataProps *const props,
Dav1dPicAllocator *const p_allocator,
void **const extra_ptr)
{
if (p->data[0]) {
dav1d_log(c, "Picture already allocated!\n");
@@ -194,12 +194,11 @@ int dav1d_thread_picture_alloc(Dav1dContext *const c, Dav1dFrameContext *const f
{
Dav1dThreadPicture *const p = &f->sr_cur;
const int res =
picture_alloc_with_edges(c, &p->p, f->frame_hdr->width[1], f->frame_hdr->height,
f->seq_hdr, f->seq_hdr_ref,
f->frame_hdr, f->frame_hdr_ref,
bpc, &f->tile[0].data.m, &c->allocator,
(void **) &p->progress);
const int res = picture_alloc(c, &p->p, f->frame_hdr->width[1], f->frame_hdr->height,
f->seq_hdr, f->seq_hdr_ref,
f->frame_hdr, f->frame_hdr_ref,
bpc, &f->tile[0].data.m, &c->allocator,
(void **) &p->progress);
if (res) return res;
dav1d_picture_copy_props(&p->p, c->content_light, c->content_light_ref,
@@ -233,11 +232,11 @@ int dav1d_picture_alloc_copy(Dav1dContext *const c, Dav1dPicture *const dst, con
{
Dav1dMemPoolBuffer *const buf = (Dav1dMemPoolBuffer *)src->ref->const_data;
struct pic_ctx_context *const pic_ctx = buf->data;
const int res = picture_alloc_with_edges(c, dst, w, src->p.h,
src->seq_hdr, src->seq_hdr_ref,
src->frame_hdr, src->frame_hdr_ref,
src->p.bpc, &src->m, &pic_ctx->allocator,
NULL);
const int res = picture_alloc(c, dst, w, src->p.h,
src->seq_hdr, src->seq_hdr_ref,
src->frame_hdr, src->frame_hdr_ref,
src->p.bpc, &src->m, &pic_ctx->allocator,
NULL);
if (res) return res;
dav1d_picture_copy_props(dst, src->content_light, src->content_light_ref,