aom: update libaom to 0ec86ac7ae1e32a7e70410fa4972a655ec3670a4

This commit is contained in:
Roy Tam 2019-02-22 21:52:01 +08:00
commit eb361970c5
438 changed files with 52661 additions and 21905 deletions

View file

@ -50,8 +50,6 @@ typedef void (*cfl_store_inter_block_visitor_fn_t)(AV1_COMMON *const cm,
typedef struct ThreadData {
aom_reader *bit_reader;
DECLARE_ALIGNED(32, MACROBLOCKD, xd);
/* dqcoeff are shared by all the planes. So planes must be decoded serially */
DECLARE_ALIGNED(32, tran_low_t, dqcoeff[MAX_TX_SQUARE]);
CB_BUFFER cb_buffer_base;
uint8_t *mc_buf[2];
int32_t mc_buf_size;
@ -97,9 +95,26 @@ typedef struct AV1DecRowMTInfo {
int tile_cols_end;
int start_tile;
int end_tile;
int mi_rows_parse_done;
int mi_rows_decode_started;
int mi_rows_to_decode;
// Invariant:
// mi_rows_parse_done >= mi_rows_decode_started.
// mi_rows_parse_done and mi_rows_decode_started are both initialized to 0.
// mi_rows_parse_done is incremented freely. mi_rows_decode_started may only
// be incremented to catch up with mi_rows_parse_done but is not allowed to
// surpass mi_rows_parse_done.
//
// When mi_rows_decode_started reaches mi_rows_to_decode, there are no more
// decode jobs.
// Indicates the progress of the bit-stream parsing of superblocks.
// Initialized to 0. Incremented by sb_mi_size when parse sb row is done.
int mi_rows_parse_done;
// Indicates the progress of the decoding of superblocks.
// Initialized to 0. Incremented by sb_mi_size when decode sb row is started.
int mi_rows_decode_started;
// Boolean: Initialized to 0 (false). Set to 1 (true) on error to abort
// decoding.
int row_mt_exit;
} AV1DecRowMTInfo;
@ -146,13 +161,6 @@ typedef struct AV1Decoder {
DECLARE_ALIGNED(32, AV1_COMMON, common);
int refresh_frame_flags;
// TODO(hkuang): Combine this with cur_buf in macroblockd as they are
// the same.
RefCntBuffer *cur_buf; // Current decoding frame buffer.
AVxWorker *frame_worker_owner; // frame_worker that owns this pbi.
AVxWorker lf_worker;
AV1LfSync lf_row_sync;
AV1LrSync lr_row_sync;
@ -178,8 +186,7 @@ typedef struct AV1Decoder {
// Note: The saved buffers are released at the start of the next time the
// application calls aom_codec_decode().
int output_all_layers;
YV12_BUFFER_CONFIG *output_frames[MAX_NUM_SPATIAL_LAYERS];
size_t output_frame_index[MAX_NUM_SPATIAL_LAYERS]; // Buffer pool indices
RefCntBuffer *output_frames[MAX_NUM_SPATIAL_LAYERS];
size_t num_output_frames; // How many frames are queued up so far?
// In order to properly support random-access decoding, we need
@ -191,7 +198,9 @@ typedef struct AV1Decoder {
int max_threads;
int inv_tile_order;
int need_resync; // wait for key/intra-only frame.
int hold_ref_buf; // hold the reference buffer.
int hold_ref_buf; // Boolean: whether we are holding reference buffers in
// common.next_ref_frame_map.
int reset_decoder_state;
int tile_size_bytes;
int tile_col_size_bytes;
@ -225,9 +234,7 @@ typedef struct AV1Decoder {
unsigned int ext_tile_debug; // for ext-tile software debug & testing
unsigned int row_mt;
EXTERNAL_REFERENCES ext_refs;
size_t tile_list_size;
uint8_t *tile_list_output;
size_t buffer_sz;
YV12_BUFFER_CONFIG tile_list_outbuf;
CB_BUFFER *cb_buffer_base;
int cb_buffer_alloc_size;
@ -245,7 +252,7 @@ typedef struct AV1Decoder {
// Returns 0 on success. Sets pbi->common.error.error_code to a nonzero error
// code and returns a nonzero value on failure.
int av1_receive_compressed_data(struct AV1Decoder *pbi, size_t size,
const uint8_t **dest);
const uint8_t **psource);
// Get the frame at a particular index in the output queue
int av1_get_raw_frame(AV1Decoder *pbi, size_t index, YV12_BUFFER_CONFIG **sd,
@ -266,23 +273,28 @@ aom_codec_err_t av1_copy_new_frame_dec(AV1_COMMON *cm,
struct AV1Decoder *av1_decoder_create(BufferPool *const pool);
void av1_decoder_remove(struct AV1Decoder *pbi);
void av1_dealloc_dec_jobs(struct AV1DecTileMTData *tile_jobs_sync);
void av1_dealloc_dec_jobs(struct AV1DecTileMTData *tile_mt_info);
void av1_dec_row_mt_dealloc(AV1DecRowMTSync *dec_row_mt_sync);
void av1_dec_free_cb_buf(AV1Decoder *pbi);
static INLINE void decrease_ref_count(int idx, RefCntBuffer *const frame_bufs,
static INLINE void decrease_ref_count(RefCntBuffer *const buf,
BufferPool *const pool) {
if (idx >= 0) {
--frame_bufs[idx].ref_count;
if (buf != NULL) {
--buf->ref_count;
// Reference counts should never become negative. If this assertion fails,
// there is a bug in our reference count management.
assert(buf->ref_count >= 0);
// A worker may only get a free framebuffer index when calling get_free_fb.
// But the private buffer is not set up until finish decoding header.
// So any error happens during decoding header, the frame_bufs will not
// have valid priv buffer.
if (frame_bufs[idx].ref_count == 0 &&
frame_bufs[idx].raw_frame_buffer.priv) {
pool->release_fb_cb(pool->cb_priv, &frame_bufs[idx].raw_frame_buffer);
// But the raw frame buffer is not set up until we finish decoding header.
// So if any error happens during decoding header, frame_bufs[idx] will not
// have a valid raw frame buffer.
if (buf->ref_count == 0 && buf->raw_frame_buffer.data) {
pool->release_fb_cb(pool->cb_priv, &buf->raw_frame_buffer);
buf->raw_frame_buffer.data = NULL;
buf->raw_frame_buffer.size = 0;
buf->raw_frame_buffer.priv = NULL;
}
}
}