• Yaowu Xu's avatar
    Correct token allocation size for tiles · e39b3b8b
    Yaowu Xu authored
    With --enable-ext-partition, it is possible to have superblock size at
    both 64x64 and 128x128. But MAX_SB_SIZE_LOG2 is defined to be 7, i.e.
    128x128 size. In get_token_alloc(), the token count for a tile or a
    frame is always computed based on "tokens/superblock * number of
    superblocks", so it should use the actual superblock size, instead of
    128x128.
    
    The segfault in #988 is a result when every tile is defined at one
    single superblock of 64x64, the token size computation for each tile
    was assuming it is 128x128, resulting 4x overestimate of the token
    count for every tile. This caused the pointer for many tiles to go
    beyond the allocated token arrary, which is correctly allocated at
    frame level.
    
    BUG=aomedia:988
    
    Change-Id: I2da21f181446ad7117ce3269f01a43950c379028
    e39b3b8b
encodeframe.c 181 KB