]> granicus.if.org Git - libvpx/commit
Avoid heap allocation of firstpass stats
authorJohn Koleszar <jkoleszar@google.com>
Fri, 16 Dec 2011 19:26:53 +0000 (11:26 -0800)
committerJohn Koleszar <jkoleszar@google.com>
Fri, 16 Dec 2011 19:40:23 +0000 (11:40 -0800)
commit26c6a44c66697190e97f2556cd764329cedcc994
tree3258d2431785a0bc837c8ff7fbe8a30e2440684a
parent20573f0640e181e8363fd1efc52f16569715eb97
Avoid heap allocation of firstpass stats

The total_stats, this_frame_stats, and total_left_stats structures
were previously create by a heap allocation, despite being of fixed
size. These structures were allocated and deallocated during
{de,}allocate_compressor_data, which is reinvoked whenever the frame
size changes. Unfortunately, this clobbers the total_stats and
total_left_stats data.

Historically, these were variable size at one time, due to the first
pass motion map, which necessitated their being created by a unique
heap allocation. However, this bug with the total_stats being
clobbered has probably been present since that initial implementation.

These structures are instead moved to be stored within the struct
twopass_rc directly, rather than being heap allocated separately.

Change-Id: I7f9e519e25c58b92969071f0e99fa80307e0682b
vp8/encoder/firstpass.c
vp8/encoder/onyx_if.c
vp8/encoder/onyx_int.h